30% off your first 3 months

Get the deal

Stepper motors: moving in exact steps

by DuckyHelperNov 12, 20265 min read
Robotics

TL;DR:

  • A common stepper takes 200 full steps per revolution, which is 360° ÷ 200 = 1.8° per step.

  • A driver can split each step into microsteps, which makes motion smoother but does not make positioning proportionally more exact.

  • If the load or speed is too high the motor skips steps and nothing tells the controller, so leave torque margin.

A desktop 3D printer moves its print head to a spot, dozens of times a second, without a camera or a position sensor checking where it ended up. It just counts. The motors behind that trick are stepper motors, and the counting works because the motor can only rest at certain exact angles.

How a stepper works

A DC motor spins as long as it has power. A stepper is built to rotate by a small fixed angle each time you move its magnetic field. The rotor is a toothed or magnetized wheel, and the stator has coils arranged around it. When you energize one coil the rotor snaps to line up with it, like a compass needle. Energize the next coil and the rotor turns to line up with that one. Switch coils in order and the rotor walks around, one step at a time.

A common stepper has two windings and a rotor with 50 teeth. The driver changes the current through the two windings in a repeating four-phase pattern. Four phases per tooth gives 50 × 4 = 200 positions per revolution. You do not need to remember the construction. You need the number the datasheet gives you: steps per revolution.

Worked example: 200 steps per revolution is 1.8° per step

One revolution is 360°. With 200 full steps per revolution:

  1. Angle per step. 360° / 200 = 1.8°.

  2. Turn 90°. 90 / 1.8 = 50 steps.

  3. Speed. If you send 2000 steps per second, that is 2000 / 200 = 10 revolutions per second, or 10 × 60 = 600 rpm.

Now attach a lead screw, a threaded rod where one turn moves the nut 8 mm (the lead). One step moves 8 / 200 = 0.04 mm. To move 50 mm you need 50 / 8 = 6.25 turns, which is 6.25 × 200 = 1250 steps. Check: 1250 × 0.04 mm = 50 mm.

The controller never measures the position. It trusts that every step it commanded actually happened. This is called open-loop control, and it is why steppers are cheap and simple.

Steps and microsteps

A driver can set the current in the two windings to values between the extremes, which parks the rotor between the full-step positions. This is microstepping. At 1/16 microstepping a revolution takes 200 × 16 = 3200 microsteps, and each is 1.8° / 16 = 0.1125°.

Microstepping makes the motion much smoother and quieter, because the rotor no longer jumps 1.8° at a time. But be careful about claiming extra accuracy. The torque that pulls the rotor to a microstep position gets smaller the closer you are to the neighbouring full step, so friction and load can leave the shaft a little away from where you asked. Microsteps give smoothness more reliably than precision.

Holding torque and torque at speed

A stepper's holding torque is the torque it resists when it is energized and standing still. It is printed on the datasheet in N·m (or sometimes kg·cm). A stepper standing still with the coils powered holds its position without moving, but it also draws current the whole time and gets warm.

The torque you get while spinning is much lower than the holding torque and falls as speed rises. Why: each coil has inductance, so the current needs time to build up in each step. The faster you step, the less current gets in, and the less torque you get. So the real limit on a stepper is not the holding torque but the torque at the speed you need.

Where it goes wrong: missed steps

Because nothing checks the shaft position, any step that does not happen goes unnoticed. This is a missed step (or lost step). It happens when:

  • the load needs more torque than the motor produces at that speed;

  • you accelerate too quickly, so the rotor cannot keep up with the rotating field;

  • the driver's current setting is too low;

  • the machine hits an obstacle and the motor stalls.

After a missed step, the controller thinks the head is at 50 mm but it is really at 49.96 mm. Errors do not correct themselves, they pile up. Printers and plotters address this with a homing routine, where the axis moves until it presses a limit switch to find a known zero. Some systems add an encoder to close the loop.

Three habits prevent missed steps: choose a motor with generous torque headroom over your worst-case load, accelerate and decelerate gradually rather than starting at full speed, and set the driver current to the motor's rated figure.

Safety: Stepper motors and their drivers get hot. Motors rated for several amps can reach temperatures that burn skin, so do not touch one that has been running or holding. Never unplug a motor from the driver while the power is on, because the voltage spike can destroy the driver. Keep fingers away from lead screws, belts and moving carriages, which can pinch hard.

How real robots use steppers

Steppers drive 3D printers, laser and CNC machines, camera sliders, small robot arms and the pan axis of many telescope mounts. They are favoured where you want a known motion without feedback hardware and where the load is predictable. Where the load varies a lot or you need full torque at high speed, designers prefer a servo or a brushless motor, such as in brushless motors and why drones use them.

Try it yourself

Take a stepper with a driver board and a safe low-voltage supply. Move it 200 steps at a slow speed with a mark on the shaft and check that it returns to the same mark after one revolution. Then raise the speed in small increments until it stalls or loses the mark, and write down the speed where that happens. That is your torque-at-speed limit for that load. Then count the steps you need to move something by a distance, as in the lead screw example.

Frequently asked questions

Does a stepper need a feedback sensor?

Not to run. It counts commanded steps and assumes they happened. If the load can exceed the motor's torque, add a home switch or an encoder so that a missed step is detected.

Why does a stepper get hot when it is standing still?

The coils stay energized to hold position, so current flows continuously and heats the windings. Many drivers can lower the current when idle to reduce this.

Get started

DuckyHelper can
do more

It sees your screen and works in any app you use. Try it for 10 minutes, no card.

Get it for Mac, Windows or Linux

Share

Questions and jobs

Do anything

Ask it a question or hand it a job, in any app.

Doing jobs for you is in early access on Mac. Asking works on Mac, Windows and Linux.