Stepper Motor Driver Design Guide
Microstepping, Current Control & Decay Modes
1. Introduction — Position Without Feedback
A stepper motor is an open-loop positioning machine: it moves in discrete angular steps determined by the number of stator poles and the sequence of coil energization. The motor’s torque comes from the magnetic alignment between stator and rotor; the driver’s job is to create precise, timed current in the two (or more) phase windings. Get the current waveform right and you get smooth, accurate motion; get it wrong and you get resonance, vibration, missed steps, and burned drivers. This guide covers stepper types, the H-bridge drive topology, constant-current chopping, microstepping and the sine/cosine lookup, decay modes (fast/slow/mixed), stall detection, resonance suppression, and how to pick a driver IC.
2. Stepper Motor Types
| Type | Rotor | Characteristics | Typical use |
|---|---|---|---|
| PM (Permanent Magnet) | PM disc, 2-phase | Cheap, low resolution (~48 steps/rev), low torque | Clocks, small dials, toys |
| VR (Variable Reluctance) | Soft iron, no magnet | High step rate, low torque, no detent | High-speed/low-load |
| Hybrid (HB) | PM + toothed soft-iron | Best torque/resolution, 200 steps/rev (1.8°), detent torque | 3D printers, CNC, robotics |
Hybrid steppers dominate engineering: 200 full steps/rev (1.8°/step) with half-step (0.9°) and microstepping to fractions of a degree. Torque falls off with speed because the winding inductance limits how fast current can build in each phase — a key constraint for the driver.
3. Drive Topology — H-Bridges
Why not a unipolar driver? Unipolar (center-tapped) drives only half the winding at a time, wasting the copper and producing half the torque for the same current; bipolar double-ended drive energizes the full winding. Modern drivers are bipolar.
Voltage source problem: a stepper winding is highly inductive (L = 1–50 mH). Driving it from a fixed voltage rail means current rises slowly (τ = L/R), limiting high-speed torque. The standard fix is a higher bus voltage (24–48 V) and constant-current chopping that regulates winding current, not voltage.
4. Constant-Current Chopping Control
Constant-current (chopper) control maintains the commanded phase current despite back-EMF, resistance changes, and speed:
- Current sense: a small sense resistor (or integrated sense FET) in series with each phase measures winding current; the driver compares it to a DAC reference.
- Chopping: when current exceeds the reference, the driver switches the H-bridge into a decay state (current recirculates and falls); when below, it reapplies bus voltage (t_on). The result is a sawtooth current around the setpoint.
- Fixed-off-time vs. current-mode: fixed off-time is simple; current-mode (peak current controlled, or with adaptive decay) is more efficient and smoother at low currents.
- Back-EMF and speed: as speed rises, back-EMF steals headroom; the bus voltage must be high enough that (Vbus − EMF)/L still builds current fast enough within the step time. Rule: Vbus ≈ 8–12 × Vrated for a good high-speed torque curve.
5. Microstepping — Sine/Cosine Currents
5.1 Principle
In full-step mode, both phases are either fully on or off in one of 4 combinations. The rotor aligns to the resultant vector — 1.8° increments with strong detent. In microstepping, the two phase currents are commanded as sine and cosine of the electrical angle, so the resultant magnetic vector rotates smoothly through many intermediate positions per full step (e.g., 1/8, 1/16, 1/32, 1/256 microsteps).
Phase A current: IA(k) = Ipk · sin(θ(k)), θ(k) = (π/2) · (k / N), k = 0…N−1
Phase B current: IB(k) = Ipk · cos(θ(k))
Example (1/4 microstep, N=4):
k=0: A=0, B=Ipk
k=1: A=0.707·Ipk, B=0.707·Ipk
k=2: A=Ipk, B=0
k=3: A=0.707·Ipk, B=−0.707·Ipk
The table is implemented in the driver IC as a current DAC; the MCU just steps the position counter and the IC produces the sine/cosine currents.
5.2 What microstepping does and doesn’t do
- Smoothness/noise: microstepping dramatically reduces low-speed vibration, resonance, and audible noise (the “cogging” at full step).
- Position resolution: 1/16 microstepping on a 200-step motor gives 3200 steps/rev (0.1125°) — useful for fine positioning; beyond ~1/16–1/32 the incremental improvement is limited by friction and holding torque, and step accuracy is not improved (the rotor still snaps to the nearest tooth detent when stationary).
- Torque: microstepping does not increase torque; holding torque is set by Ipk and motor sizing. It can slightly reduce the torque ripple at the cost of reduced peak alignment torque at the microstep positions.
- Not a substitute for a servo: microstepping improves resolution but doesn’t correct missed steps — the system remains open-loop for position error accumulation.
6. Decay Modes — Fast, Slow, Mixed
When the chopper switches off to reduce winding current, the energy stored in the inductance must go somewhere. The H-bridge decay mode defines the path:
| Mode | Path | Current decay rate | Pros/Cons |
|---|---|---|---|
| Fast decay | Both low-side (or both high-side) on, current reverses through winding | Fast (L dI/dt, energy returned to bus) | Handles rapid current reduction; inefficient at low load, can cause audible whine |
| Slow decay | Recirculate through one FET + body diode (or both low-side for a “low recirculation”) | Slow (falls via winding R) | Efficient, smooth at low speeds; too slow to reduce current quickly near zero crossing |
| Mixed decay | Combination — fast to drop current, slow to hold it | Adaptive | Best overall; modern ICs (e.g., with “mixed” or “smart” decay) blend modes by current level |
Why decay matters: at the sine zero crossing, current must reverse rapidly — slow decay alone can’t, causing distortion and “kickback” that loses microstep accuracy; at the sine peak, fast decay wastes energy. Mixed/smart decay keeps the current waveform clean across the whole sine, reducing torque ripple, noise, and power loss.
7. Stall Detection & Position Integrity
- Stall = missed steps: open-loop steppers lose steps when torque demand exceeds available torque (too fast acceleration, overload, wrong current). Position is silently wrong afterward.
- Back-EMF sensing: some drivers (e.g., Trinamic stallGuard) measure the back-EMF voltage across the un-driven winding; a drop indicates the rotor is decoupled or stalling. This gives stall detection without an encoder.
- Current signature: stall detection via winding current anomaly is less reliable; back-EMF is the standard approach.
- Protective response: on stall, stop motion, flag an error, optionally re-home (drive to a limit switch) to recover position.
- Thermal stall risk: a stalled motor with full current burns — that’s why a current-limit safety timeout and temperature monitoring matter (see below).
8. Resonance & Noise Suppression
At low speeds, full-step and coarse stepping excite the motor’s mechanical resonance (the spring-mass system of rotor + load inertia vs. detent stiffness) — audible hum and position oscillation. Mitigations:
- Microstepping: the primary fix — smooths the current vector and avoids the step-step impulse that excites resonance.
- SpreadCycle / current shaping: advanced drivers add high-frequency current modulation (e.g., SpreadCycle, StealthChop) that reduces audible noise by randomizing or spreading the chopper frequency above the audible band.
- Acceleration profiles: ramp acceleration (S-curve rather than constant) avoids exciting resonance bands and reduces missed steps at start/stop.
- Damping: add mechanical damping (elastomer mounts) or electrical damping (proper decay mode).
- Run above resonance: for continuous rotation, accelerate quickly through the resonance band and cruise at a speed where resonance is damped.
9. Driver IC Selection
| Feature | Why it matters |
|---|---|
| Bus voltage rating | Must exceed motor back-EMF + headroom for speed/torque |
| Output current (per phase) | ≥ motor RMS current × √2 (peak); with margin |
| Microstepping resolution | 1/16–1/256 typical; match required resolution/noise target |
| Decay mode control | Mixed/smart decay gives best smoothness/efficiency |
| Integrated sense FETs | Removes external sense resistors, less BOM |
| Protection | OCP, OTP, under-voltage, stall detection, SPI fault reporting |
| Interface | STEP/DIR (hardware) vs. SPI/UART (register config + diagnostics) |
10. Worked Example — Current Setting & Microstep Selection
1. Driver peak current: Ipeak = √2 × 1.5 = 2.12 A. Set Vref so the sense resistor sees ~2.12 A peak. For a sense resistor Rsense = 0.1 Ω and a driver with Vref = Ipeak × Rsense × gain: Vref ≈ 2.12 × 0.1 × 1.33 ≈ 0.28 V (check the specific IC formula).
2. Bus voltage for speed: rule of thumb Vbus ≈ 12 × Vrated = 12 × (1.5 × 1.2) = 21.6 V → pick 24 V. Higher bus (48 V) gives better high-speed torque but needs a beefier chopper and more EMI care.
3. Microstep choice: printing at 100 mm/s on a belt with 1.8°/step and 80 teeth/rev… compute steps per mm = (200 × microstep)/(belt pitch × teeth). For microstep 16, 2 mm belt pitch, 20-tooth pulley: steps/mm = (200×16)/(2×20) = 3200/40 = 80 steps/mm — plenty. For fine positioning use 1/16 or 1/32; beyond that noise/accuracy gain is marginal.
4. Resonance band: if the system resonates near 50–80 steps/s, either accelerate through quickly or use 1/16 microstepping to damp it.
11. Common Mistakes
- Setting current to RMS instead of peak — under-drives the motor, losing torque and microstep definition.
- Too low a bus voltage — current can’t build fast enough at speed; high-speed torque collapses, missed steps.
- Wrong decay mode for the speed range — slow decay at high speed causes distortion; fast decay everywhere wastes power and adds noise.
- Full-step / half-step at low speed — resonance and audible hum; microstep or accelerate through.
- No stall detection or current timeout — a stalled motor at full current overheats the driver and winding; add detection or a hard time limit.
- Ignoring microstep accuracy limits — microstepping doesn’t increase absolute position accuracy; don’t rely on 1/256 for precision positioning without feedback.
- Ignoring driver thermal management — a 24–48 V chopper on a small board needs the same thermal design discipline as a power stage.
12. Frequently Asked Questions
Q1. Does microstepping increase torque?
No. It improves smoothness and position resolution but not peak torque. Holding torque is set by Ipk and the motor’s torque constant. At the exact microstep detents, torque can be slightly reduced vs. full-step alignment.
Q2. My motor buzzes loudly at low speed — what now?
That’s mechanical resonance excited by step impulses. Use microstepping (1/16), enable a noise-reduction/current-shaping mode (SpreadCycle/StealthChop), and ramp acceleration through the resonance band instead of constant-speed.
Q3. Why is high bus voltage better?
The winding inductance limits current slew: dI/dt = (Vbus − EMF − I·R)/L. Higher bus voltage builds current faster, so the phase current reaches its commanded value within the (shorter) step time at high speed — more high-speed torque. The chopper then regulates the current down to the setpoint.
Q4. How do I know if I’m losing steps?
Use stall detection (back-EMF based) or verify with an encoder/limit switch during homing. If steps are lost intermittently, the usual causes are too aggressive acceleration, overload torque, or under-set current.
Q5. Fast, slow, or mixed decay?
Modern drivers do it automatically (mixed/smart decay). If you’re setting it manually: slow decay for smooth low-speed running and efficiency; fast decay when you must rapidly reduce current near the sine zero crossing. Mixed gives the best overall waveform.
Q6. Is a stepper with microstepping a servo replacement?
Not for true position feedback or when loads change unpredictably — a servo closes the loop and corrects errors; a microstepping stepper still silently accumulates position error after a stall. Use closed-loop steppers (encoder feedback) where accuracy under load is critical.