Catto / Topic Map · Industrial Electronics I Year 6
Industrial Electronics I · 144 h · Topic 9 of 10

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.

Electrical machines Sensors Microstepping Drivers

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.

StepperServo motor
FeedbackNoneEncoder or resolver
PositionCounting pulses, in open loopMeasured and corrected
If overloadedLoses steps silently: nobody noticesDetects the error and reports it
Torque at zero speedHigh, with the coils energizedHigh, controlled
Torque at high speedDrops sharplyHolds up
CostLowHigh
Chosen for3D printers, small CNC machines, dosing machines, light axesProduction machines, demanding axes, high speed
Step angle

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

Unipolar

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.

Bipolar

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).

Identifying the wires with an ohmmeter
  1. Look for pairs with continuity: wires with no continuity between them belong to different coils.
  2. In a 6-wire motor, within each group of three the common wire measures half the resistance against the other two.
  3. A 4-wire bipolar motor gives two pairs, with no continuity between them.
  4. Practical trick: join two wires and turn the shaft by hand; if it feels stiffer, those two belong to the same coil.

03Sequences

A B A' B' rotor Half-step sequence step 1 A 0° step 2 A + B 45° step 3 B 90° step 4 B + A' 135° step 5 A' 180° step 6 A' + B' 225° step 7 B' 270° step 8 B' + A 315° Reversing the order of the sequence makes the motor turn the other way. Nothing else is needed to change direction.
Figure 1. Energization sequence, animated. As the coils are activated in order, the rotor chases the field and advances one step at a time. Reversing the order makes it turn the other way: that is all there is to direction control.
ModeActive coilsTorqueResolution
Full step, one phaseOne at a timeLower200 steps
Full step, two phasesTwo at a timeHigher (≈ 40% more)200 steps
Half stepAlternates one and twoUneven400 steps
MicrosteppingGraded currents in both coilsSmooth and even1600 to 51,200
Microstepping gives smoothness, not accuracy

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

Voltage drive

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.

Current drive (chopper)

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.

Example · Setting the driver current

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

maximum torque · with ramp only start torque · no ramp torque speed (steps per second) 500 1000 1500 2000 200 steps/s 60 rpm torque 91% starts 50% 600 steps/s 180 rpm torque 57% starts 31% 1100 steps/s 330 rpm torque 31% starts 17% 1700 steps/s 510 rpm torque 17% starts 9% Between the two curves the motor can only work if it is accelerated with a ramp. Above the green one, it loses steps. Values are for a typical 200-step-per-revolution motor; each model has its own curve in the datasheet.
Figure 2. Torque-speed curve, animated. Torque falls with speed because the coil's inductance prevents the current from building up. Below the start curve the motor can start abruptly; between the two curves, only if it accelerates with a ramp.
Three datasheet concepts
  • 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.

Example · Speed and pulse frequency

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.
Resonance

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

SymptomProbable causeHow to check
Vibrates in place and does not turnA wire of one coil reversed or brokenMeasure continuity of each coil and check the connection order
Turns the wrong wayOne coil reversedSwap the two wires of just one coil
Loses steps under loadCurrent set incorrectly, excessive speed or no rampMeasure Vref, lower the speed and add acceleration
Gets very hot while stationaryNormal up to a point: the coils are energized. If it burns, the current is too highMeasure the current and the case temperature
The driver cuts out every so oftenThermal protection: missing heat sink or ventilationTouch the driver, measure its temperature
Noise and vibration at a certain speedResonanceChange the speed and see if it disappears
The motor “loses” position over timeAccumulated lost steps: it is open loop and nobody corrects itRe-home against a limit switch every so often
Never disconnect the motor while the driver is powered

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

Lab 1 · Identifying the motor

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.

Lab 2 · Hand-driven sequence

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.

Lab 3 · Torque-speed curve

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.

Lab 4 · Microstepping and ramps

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

MistakeConsequence
Demanding the final speed with no rampThe 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 accurateThe real resolution is limited by the motor's mechanics, not by the driver.
Disconnecting the motor with the driver onDestroyed driver.
Using a unipolar motor as bipolar without checkingIt may work, but with half the winding and less torque if wired incorrectly.
Trusting the position after hours of operationIt is open loop: lost steps accumulate. The reference must be redone.
Choosing a stepper for a very demanding axisTorque 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.

Development of the topic “Stepper motors” of Industrial Electronics I (Year 6), following the “Curriculum Proposal – Second Cycle of the Technical-Vocational Modality, Secondary Education – Electronics”, Ministry of Education of the Province of Córdoba, DGETyFP. Back to the Topic Map · catto.ar