Stepper motors
An ordinary motor turns as long as voltage is applied. A stepper motor advances an exact angle for each pulse and stays there. That makes it possible to position without sensors, and it is what sits inside a 3D printer, a homemade CNC machine or a dosing machine.
01Positioning without feedback
The stator has several coils and the rotor is a toothed permanent magnet. By energizing the coils in a certain order, the rotor jumps from one stable position to the next. By counting pulses you know where it is, with no encoder.
| Stepper | Servo motor | |
|---|---|---|
| Feedback | None | Encoder or resolver |
| Position | Counting pulses, in open loop | Measured and corrected |
| If overloaded | Loses steps silently: nobody notices | Detects the error and reports it |
| Torque at zero speed | High, with the coils energized | High, controlled |
| Torque at high speed | Drops sharply | Holds up |
| Cost | Low | High |
| Chosen for | 3D printers, small CNC machines, dosing machines, light axes | Production machines, demanding axes, high speed |
The most common is 1.8°, which is 200 steps per revolution. There are also 0.9° motors (400 steps) and, in small permanent-magnet motors, 7.5° (48 steps). With 1/16 microstepping the same 200-step motor gives 3200 positions per revolution.
02Unipolar and bipolar
Each coil has a center tap. Current always flows in the same direction through each half-coil, so four simple transistors are enough (a ULN2003).
Easier to drive, but only half a coil is used at a time: it delivers about 30% less torque than the same motor in bipolar mode.
It is recognized by having 5 or 6 wires.
Two coils with no tap. To reverse the field you have to reverse the current, which requires an H-bridge per coil: four transistors per phase.
It uses the whole coil: more torque for its size. It is what all modern drivers are built for.
It is recognized by having 4 wires (8-wire motors can be connected either way).
- Look for pairs with continuity: wires with no continuity between them belong to different coils.
- In a 6-wire motor, within each group of three the common wire measures half the resistance against the other two.
- A 4-wire bipolar motor gives two pairs, with no continuity between them.
- Practical trick: join two wires and turn the shaft by hand; if it feels stiffer, those two belong to the same coil.
03Sequences
| Mode | Active coils | Torque | Resolution |
|---|---|---|---|
| Full step, one phase | One at a time | Lower | 200 steps |
| Full step, two phases | Two at a time | Higher (≈ 40% more) | 200 steps |
| Half step | Alternates one and two | Uneven | 400 steps |
| Microstepping | Graded currents in both coils | Smooth and even | 1600 to 51,200 |
With 1/16 steps the motion is much smoother and quieter, and resonance is avoided. But position accuracy is still limited by the motor's mechanics —the tooth tolerance is around 5% of a full step— and the holding torque of each microstep is a fraction of the total. At a very fine microstep, a light load can shift the rotor without the driver noticing. Microstepping is for smoothness; the real resolution comes from the mechanics: belt, lead screw or gear reduction.
04Drivers
A simple H-bridge (L298) or Darlington transistors (ULN2003). Voltage is applied to the coil and the current rises according to its inductance.
Cheap and simple. At high speed, the current does not have time to build up before the next step and the torque collapses.
A4988, DRV8825, TMC2209 and similar. They feed the coil with a voltage much higher than the rated one and chop the current to the programmed value, measuring it with a sense resistor.
The current builds up much faster: torque is retained at high speed. It is the current standard and has built-in microstepping.
An A4988 with 0.1 Ω sense resistors, for a motor rated 1.2 A per phase:
- The manufacturer's formula is Vref = Imax × 8 × Rsense.
- Vref = 1.2 × 8 × 0.1 = 0.96 V, measured between the module's potentiometer and ground.
- With the current too low the motor loses steps; with the current too high it overheats and the driver enters thermal protection and cuts out at the wrong moment.
It is the adjustment that causes the most trouble in 3D printers, and it is done with the motor connected and at rest.
05Torque, speed and lost steps
- Holding torque: the torque it resists with the coils energized and the motor stationary. It is the big number listed in the catalog.
- Pull-in torque: up to what frequency it can start without a ramp.
- Pull-out torque: how far it can keep turning if it is accelerated gradually. If it is exceeded, the motor loses steps.
Hence the golden rule: always accelerate and decelerate with a ramp. Demanding the final speed all at once is the number one cause of lost steps.
A 1.8° motor (200 steps) on a lead screw of 8 mm per revolution, with 1/16 microstepping:
- Steps per revolution = 200 × 16 = 3200.
- Theoretical resolution = 8/3200 = 0.0025 mm per microstep.
- To advance at 20 mm/s: 20/8 = 2.5 rev/s → 2.5 × 3200 = 8000 pulses per second.
- At 2.5 revolutions per second the motor turns at 150 rpm, where the torque is already well below the holding torque: it must be checked on the curve.
Around a certain frequency —typically between 100 and 300 steps per second— the motor enters mechanical resonance: it vibrates, makes noise and can lose steps even with no load. It is solved with microstepping, with damping in the coupling or simply by passing quickly through that speed range.
06Typical faults and troubleshooting
| Symptom | Probable cause | How to check |
|---|---|---|
| Vibrates in place and does not turn | A wire of one coil reversed or broken | Measure continuity of each coil and check the connection order |
| Turns the wrong way | One coil reversed | Swap the two wires of just one coil |
| Loses steps under load | Current set incorrectly, excessive speed or no ramp | Measure Vref, lower the speed and add acceleration |
| Gets very hot while stationary | Normal up to a point: the coils are energized. If it burns, the current is too high | Measure the current and the case temperature |
| The driver cuts out every so often | Thermal protection: missing heat sink or ventilation | Touch the driver, measure its temperature |
| Noise and vibration at a certain speed | Resonance | Change the speed and see if it disappears |
| The motor “loses” position over time | Accumulated lost steps: it is open loop and nobody corrects it | Re-home against a limit switch every so often |
Interrupting the current in a coil generates an overvoltage that destroys the driver immediately. Power is cut before touching the motor wires. It is the mistake that burns the most drivers in the workshop and in 3D printers.
07In the lab
With scrap motors from printers and scanners, use the ohmmeter to determine whether they are unipolar or bipolar, how many coils they have and which wire is which. Note the phase resistance. Then turn them by hand and feel the detent torque.
With four switches or four outputs of a microcontroller at a very low frequency (2 steps per second), run through the full-step sequence and observe how the shaft advances. Mark the shaft and count 200 steps: it must make exactly one revolution. Reverse the sequence and check the change of direction.
With a simple friction brake, measure at what load the motor starts to lose steps for three different speeds. Plot the results. Repeat with the driver current halved and compare the two curves.
Compare the same movement in full step and in 1/16: listen to the noise and observe the vibration. Then demand the final speed all at once and with an acceleration ramp, checking in both cases whether the final position matches the starting one on returning.
08Common mistakes
| Mistake | Consequence |
|---|---|
| Demanding the final speed with no ramp | The motor does not start or loses steps from the very first moment. |
| Setting the current “by eye” | Too low, it loses steps; too high, motor and driver overheat. |
| Expecting microsteps to be accurate | The real resolution is limited by the motor's mechanics, not by the driver. |
| Disconnecting the motor with the driver on | Destroyed driver. |
| Using a unipolar motor as bipolar without checking | It may work, but with half the winding and less torque if wired incorrectly. |
| Trusting the position after hours of operation | It is open loop: lost steps accumulate. The reference must be redone. |
| Choosing a stepper for a very demanding axis | Torque is lost at speed and there is no error warning: that is where a servo belongs. |
09Self-assessment
How many steps per revolution does a 1.8° motor have, and how many with 1/8 microstepping?
360/1.8 = 200 steps per revolution; with 1/8 microstepping, 200 × 8 = 1600.
How do you tell a unipolar motor from a bipolar one?
By the number of wires and the continuity: the unipolar has 5 or 6 and includes a center tap; the bipolar has 4, in two pairs with no continuity between them.
Why does a bipolar motor give more torque than the same motor in unipolar mode?
Because it uses the whole coil, whereas the unipolar mode energizes only half at a time. The difference is about 30%.
What advantage does a current driver have over a voltage driver?
It feeds the coil with much more voltage and chops the current to the desired value: the current builds up much faster and the motor retains torque at high speed.
An A4988 with Rsense = 0.1 Ω for 1.5 A: what Vref must be set?
Vref = 1.5 × 8 × 0.1 = 1.2 V.
What does it mean that a stepper works in open loop?
That nobody checks that the rotor moved: the controller counts pulses and assumes the motor followed them. If it loses steps from overload, the real position is shifted and the system does not find out.
Why does torque fall as speed increases?
Because the coils' inductance prevents the current from building up in the short time each step lasts. With less current there is less torque.
What is the difference between pull-in torque and pull-out torque?
The pull-in torque determines up to what frequency the motor can start abruptly; the pull-out torque determines how far it can keep turning if accelerated with a ramp. Between the two curves, motion is only possible by accelerating gradually.
8 mm lead screw, 200-step motor, 1/16: how many pulses per second to advance at 15 mm/s?
3200 microsteps per revolution; 15/8 = 1.875 rev/s → 1.875 × 3200 = 6000 pulses per second.
Why must you not disconnect the motor while the driver is powered?
Because interrupting the current in a coil generates an overvoltage that destroys the driver's output stage.