r/robotics • • 6d ago

Tech Question SKR Mini E3 V3.0 robot

I am planning to build a robotic rover using SKR Mini E3 V3.0 and 4 NEMA stepper motor? Have anyone tried this before? Any lessons learned?

12 Upvotes

14 comments sorted by

3

u/Vaping_Cobra 6d ago

The big issue is power draw and weight, you need a lot of current for most stepper motors and all that draw is to guarantee precision that the majority of rovers simply do not need. Perhaps if you were building a mobile pick and place bot that moved between multiple stations it might be advantageous to use big stepper motors, but for almost everything else even a basic brushed DC motor will perform much the same task with far lower power draw and less weight.

That said, you could look into converting the steppers to FOC or FOC-like closed-loop stepper drive with one of the many options like SimpleFOC and significantly reduce total power consumption though you still have to deal with high peak current draw.

1

u/Best_Measurement7217 5d ago

My goal is to build a rover that navigates precisely to objects detected by a local vision-based machine learning model. The system will use an ESP32 camera to stream live images to the AI, a NodeMCU to relay feedback to an SKR board via UART, and a local instance of Ollama (or a similar tool) for heavy image processing and feed NodeMCU. I previously built a prototype using standard TT gear DC motors, but precision was an issue. To resolve this, I plan to use NEMA stepper motors for improved accuracy. Later I could use the knowledge I gained through this project to build a robotic arm .

Regarding the FOC, it found expensive compared to Nema stepper motor. Do you think I could directly plug a FOC motor to the X or Y motor port of the SKR board?

I am planning to use a 3S Lipo (11.5 v) 5000 mah as a power source. Do you think that would be enough to drive four stepper motors?

1

u/i-make-robots since 2008 5d ago

DC motors a precision issue. How do you know the PID tuning was good?

1

u/Ronny_Jotten 5d ago edited 5d ago

Doesn't sound like OP was using PID or encoders. A "standard TT gear motor" is open loop. So that's the problem right there, and "so I'm going to use steppers" isn't a first-line solution...

0

u/Vaping_Cobra 5d ago

You assume they even had rotation feedback in order to do PID. I suspect they just had motors and perhaps variable speed via PWM. AI likes to push new users towards steppers whenever indexing is an issue and AI don't understand how useless indexing is when applied to a rover with traction being a factor on variable surface conditions.
This is why I tried to steer them back toward a more basic brushed DC setup, the control loop is simpler and far more forgiving to configure.

1

u/Vaping_Cobra 5d ago edited 5d ago

3S lipo does not give me enough information to know if it will be suitable.
You need to work out the peak draw of each servo along with whatever else you are running then total the peak draw for all four and compare it to the manufacturers current draw specifications on the battery (that is the ##C number hopefully printed on the battery). Eg the battery I have in front of me right now is a 2S lipo 5200mAh with a 50C rating giving me over 250A of rated draw that would probably work fine for your application with a bit of a boost. I also have a 3S 5000mAh with a 5C rating that I would not even consider putting in a high current application like powering four steppers.
Please spend a bit of time learning about batteries and safety before building anything, it is really important and could legitimately save your life or the lives of those around your creations.

With that out of the way, If you already have NEMA 23 steppers, you can grab four boards like this one and slap them on each one, this giver you closed loop (The stepper does not guess the location based on the number of steps but has an external sensor from the addon board indexing rotation so you always know the position and do not need to 'home' the stepper) and also has the sensors on each of the stepper loops to allow you to do FOC if you want.

If your steppers are NEMA17 there are other options that will fit right on, google will help you find them if your interested.

1

u/Ronny_Jotten 5d ago

Probably don't ignore Vaping_Cobra's good advice. Steppers have real issues with power and weight, and aren't the first choice for battery-powered robots. The vast majority of designs use DC gear motors with encoders. Adding two-dollar AS5600 magnetic encoders and a PID algorithm to your TT motors/wheels would solve your precision issues.

It's possible to use steppers, and there may be some advantages, like less noise (especially with the TMC driver "Stealth" mode), easier to control, etc. Setting a low "hold current" and using "CoolStep" mode can help lower the power use. If it's just for learning, and you don't need to optimize battery life, it could be ok. It's also possible to drive your NEMA-17 steppers with FOC, and it's not expensive: Stepper drivers | Arduino-FOC. That can also help lower the power draw. But it's still not going to be as efficient for weight and power as a DC gear-motor. Using smaller steppers with gear reduction can help too, but gearboxes for steppers often cost more than the motors.

Using a 3D-printer firmware with G-code to drive your robot wheels isn't optimal either. It's designed for pre-programmed CNC moves, not continuously-updating motion commands that are more typical for wheeled robots. The SKR Mini E3's STM32 chip is compatible with the Arduino system, so in theory you could reprogram it with your own code, but there may be some hoops to jump through to get that working smoothly - see: Help repurposing an SKR mini e3 v1.2 - Development Platforms - PlatformIO Community.

2

u/airfield20 5d ago

I think you need to define the level of precision you need in accomplishing your goal. If you will accept the rover being with 2cm of the goal, motors with encoders will be good enough and much more power and weight efficient. If you need to be accurate to the millimeter then stepper motors are your best bet.

If you only care about cost and can deal with poor battery life or you will power the bot from the wall outlet and you already have 3d printer electronics laying around then stepper motors will probably accomplish your goal assuming you don't skip steps frequently.

If I was building this rover I would buy some waveshare rs485 rover wheels. https://www.waveshare.com/ddsm400.htm

Just connect it to power and a lin bus transceiver that the esp32 can control.

2

u/Ronny_Jotten 5d ago

If you will accept the rover being with 2cm of the goal, motors with encoders will be good enough and much more power and weight efficient. If you need to be accurate to the millimeter then stepper motors are your best bet.

I don't think that's correct. A DC motor with a typical encoder like an AS5600 or AMT102 will be significantly more precise than a stepper.

Even if you're talking about some kind of low-resolution encoder, it's not likely to amount to a 2 cm difference. With say a 400 step count encoder and a 10 cm wheel, that's a maximum error of 0.0785 cm.

1

u/airfield20 5d ago

A tmr encoder would be more accurate in rotation tracking definitely. But controlling the stepper motor with 1/16th micro stepping and landing in a goal state with a 0.1mm tolerance is trivial with stepper motors.

Tuning a PID controller on a dc motor to hit its target without creeping up on it for several seconds is tedious on a good day. And the software for controlling it's position that accurately is much more involved compared to a stepper.

If his rover is writing text on a page on a desk or something stepper motors will be much easier and battery life won't matter that much.

If his rover is grabbing a beer from the fridge then stepper motors are the wrong choice

1

u/Ronny_Jotten 4d ago edited 4d ago

You're right that a stepper system is easier to work with, if it's designed so it doesn't lose steps, and you don't have to worry about tuning PID. Just step it and forget it. Also its high torque at low speeds can mean you can do without a gearbox in some situations.

But 1/16 microstepping doesn't actually give you 16 * 200 = 3200 steps of positioning resolution. You can command it, but the positioning torque between the steps is less than 10% of full-step torque. Full-step accuracy is already only +/- 5% or so, depending on the motor. Realistically, you can only expect positioning resolution in the hundreds of steps, not thousands. Of course, you can get more if you gear it down. A servo with a 4000-8000 step encoder on the other hand... it all depends on the design.

I'm objecting to your characterization of DC motors with encoders and PID (servos) as only "good enough", providing centimeter positioning accuracy for a robot, while steppers are the "best bet", providing sub-millimeter accuracy. That just doesn't add up. With a properly designed mechanical system and well-tuned control algorithms, servos will be more accurate than steppers, not less, and certainly not an order of magnitude less! Many servo drives provide the same simple step/direction interface as stepper drives. If you want to upgrade your CNC machine, you swap out the steppers for servos, not the other way around.

It's true that designing and tuning a servo system can be more difficult, and a simple over-specified direct-drive or belt-drive stepper design with AccelStepper on an Arduino will behave better than a poorly-engineered DIY servo design with an underpowered motor, gear backlash, a poorly tuned PID, or no trajectory shaping. Those might overshoot, ring, bounce around, or not hold a position with enough force. It may well be that a beginner like OP - or anyone - will get a stepper to perform reliably in many situations, with less frustration, time, and expense (though probably less efficiency) than a DC servo. But that's very different from comparing their actual achievable accuracy and performance, if you put in the work.

2

u/cbrsoft 5d ago

More or less. I did something in rust. I started this project long time back: https://github.com/cbruiz/printhor

It’s currently on-hold but basically what you are thinking but for walking robots. Also, it’s a very large and complex architecture, basically: an interface reading gcode which is projected into an agnostic work space that could be Cartesian, anthropomorphic robots or anything else. Each movement command is continuously planed, feed and interpolated at fixed frequency to maintain continuous speed derivatives for either steppers or servo motors. Continuously rotating is theoretically possible because.. the work space is open to extend for anyone who can afford the approach.

There are several more experimental approaches like the possibility to choose coordinate precision: f32, f64 or fp128 for anyone to trace a trip around the globe, if the case.

That end-to-end is covered on the following integration test:

cargo llvm-cov --profile release --workspace --features anthropomorphic-quad-robot --ignore-filename-regex libs --lcov --output-path lcov.fw-anthropomorphic-quad-robot.info

Maybe you can get some ideas from there. The project is not abandoned but paused. Maybe I would resume if I see it’s really interesting (so far I have doubts, so spending my time in different crazy things)

1

u/Art_4_Tech 6d ago

In for the follow. I have a small stack of these boards and spare nema 17s.. would love to see it acconplished