🔍
57 lessons

Servos & Steppers

Two ways to command position: a feedback loop in a $3 can, or a motor that moves in countable clicks.

lesson 2 of 4 in this unit

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.

servo: command → compare → correct (closed loop) · stepper: count clicks (open loop)the same open/closed distinction as Lesson 14.1’s toaster vs thermostat — now in hardware
Choosing between them

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.
1.50 ms
stopped
Two philosophies
servo: analog feedback loop chasing a commanded angle · stepper: open-loop digital clicks you can count
Where each lives
servos steer RC cars and robot arms; steppers move 3D printers — position by counting, no encoder (usually…)

Check your understanding

1. Inside a hobby servo you find a motor, gears, a controller and…

2. A servo's commanded angle is encoded in…

3. A stepper motor knows its position because…

4. A 3D print with all layers shifted 2 mm sideways after hour three most likely suffered…