Servos & Steppers
Two ways to command position: a feedback loop in a $3 can, or a motor that moves in countable clicks.
Builds on: 19.1 DC Motors & the H-Bridge14.1 Closing the Loop8.1 Build the PWM Dimmer
The hobby servo: Unit 14 in a can
Crack open a hobby servo and grin: a small DC motor, gears, a potentiometer on the output shaft (2.2 — the shaft literally turns a voltage divider that reports its own angle), and a little board running a proportional controller (14.1). You command it with a pulse width — 1.0 to 2.0 ms, repeated every 20 ms, decoded exactly like Unit 8’s PWM (the common convention; the exact angle range varies by servo) — and the internal loop drives the motor until pot-voltage matches command. Closed-loop position control, three dollars, no assembly required. Robot arms, RC steering, camera gimbals: fleets of these.
The stepper: position by counting
A stepper motor takes the opposite philosophy: no feedback at all. Its rotor snaps to whichever coil is energised; pulse the coils in sequence (A, B, A’, B’ — a circular counter, hello 7.3) and it advances in precise, identical steps — typically 200 per revolution. Position is simply the number of steps you have sent: open-loop, deterministic, perfectly repeatable… until you overload it and it silently skips, which is why 3D printers sometimes shift layers mid-print. Speed and smoothness come from stepping fast and from microstepping — driving two coils with PWM-shaped currents to park the rotor between poles.
Holding a position against unpredictable forces → servo (or motor + encoder, next lesson). Repeating exact moves in a controlled machine → stepper. Your 3D printer uses steppers because its loads are known; a robot arm in the messy world wants feedback.
⚡ Lab — Command & Obey
A servo chasing your pulse width, and a stepper you can click around its dial.
- Sweep the pulse slider slowly — the horn tracks with that faint controlled lag (the internal P-loop).
- Single-step the stepper and watch the rotor snap coil to coil. Count your way to a full turn.
- Auto-run the stepper backwards — the coil sequence simply reverses. It’s a counter you can hold.