Arduino and stepper motors?

Joined
22 Jul 2016
Messages
5,876
Reaction score
1,081
Country
United Kingdom
I have a need at work to look into controlling stepper motors and I know sod all.

Anybody able to guide me to an idiot’s guide ? or ideally a YouTube channel that is easy to understand?

Thankfully I can get away with buying odds and sods on Amazon etc through work and spending time to get a basic knowledge.

cheers
 
Sponsored Links
There are plenty of tutorials out there, you can even start with some info from Arduino, themselves:

The Arduino, doesn't directly drive the steppers. There is normally a stepper motor driver inbetween - this can be an IC, if you are breadboarding, individual modules, or an Arduino motor shield.

What would you like to achieve?
There could be ready made solutions already out there. For example, my 3D printer has a controller that is basically an Arduino and four stepper motor drivers!
Many robotics kits are similar.
 
Driving a stepper motor is a black art. There is far more to it than creating a stream of pulses to a driver module

One of the common things overlooked in designing a controller / driver for a stepper motor is the need to ramp the motor's speed when a speed change is necessary. A sudden step change in the stepping pulse frequency applied to a rotating motor will cause the motor's speed and even direction to become unstable and unpredictable.

I have designed several motion control systems using stepper motors and I relied heavily on advice and guidance from Stebon the motor manufacturers.

https://www.automation.com/en-us/suppliers/aps20/total-motion-systems-ltd may be a good source of advice as they seem to have taken over the Stebon name.
 
Driving a stepper motor is a black art. There is far more to it than creating a stream of pulses to a driver module
Some really great advice, but don't put him off!

Arduinos, a bit of breadboard and some driver IC's are a really simple way to experiment with small steppers.

I've taken a few groups of students through the process and they picked it up really quickly. Although we were using RPi's and Python, instead of Arduinos - moving a hall probe in X, Y & Z, to create a 3D visualisation of a magnetic field.

If the end result has to be something polished, some considerations have to be made, but if you're just playing, have some fun! :)

...and if you want some more practice with Arduino, there are some decent simulators to run from a PC.
I've used UnoArduSim which is free, but quite simplistic. Others allow full modelling of a breadboard and components.
 
Last edited:
Sponsored Links
A few years ago I couldn't find a good enough stepper motor driver for what I wanted - long story short I designed my own.
Things improved a lot and I lost touch. I can't remember the best ones, which are still a pickle to use, but Pololu drivers are ok and good for the price..
Don't do it from an Arduino with simple transistor drivers, it'll make a racket, mis steps, not run fast, microsteps will mess up etc.
You may want PID control - they recently released a book programming it. Or just start slow and ramp up slower than you think you need.

I used an arduino then but I'd use a Pi now.
 
Thanks
I sometimes get asked to make weird things and my electronics knowledge is basic.

One thing I want to do is use 3 steppers to interface with Dragonframe software.
It’s a piece of software for animation - the software can controls xyz motion control but you kind of have to build your own unless spending mega bucks.

I also get asked to make some props like folding wings so just want to play with bits and bobs.
 
One thing I want to do is use 3 steppers to interface with Dragonframe software.
It’s a piece of software for animation - the software can controls xyz motion control but you kind of have to build your own unless spending mega bucks.
As I mentioned before,
There could be ready made solutions already out there. For example, my 3D printer has a controller that is basically an Arduino and four stepper motor drivers!
Many robotics kits are similar.
You don't always have to start from scratch and reinvent the wheel! :)

There's a link here, talking about a sketch for use with Dragonframe to control a CNC shield:

And here is an advanced project for moving a camera around:


At a very basic level, this is not far off from being a 3D printer mechanism.
It may be, that a bit of modification to a DIY printer, could get you all the bits you want, for a reasonable cost!
 
Last edited:
Thanks.
I have seen that - it's what got me started thinking about Arduinos in the first place.
I get asked to do various "odd jobs" and thought that stepper motors and Arduinos would be a good tool to have in my pocket
 
Just a tip, have a look at ChatGPT, it's excellent at writing arduino code, I've actually managed to finish some projects using it.
 
Sponsored Links
Back
Top