How Servos Work: From Pulse to Motion
The little motor that knows exactly where it is
The little motor that knows exactly where it is
Every hobby servo has just three wires: red (power, usually 5V), black or brown (ground), and yellow or white (signal). The signal wire carries the pulses that tell the servo what angle to hold. Drag the slider to send a different angle command.
The yellow signal wire delivers angle commands. Power and ground complete the circuit.
The trick is Pulse Width Modulation. A pulse 1.0 ms wide means 0°. 1.5 ms means 90°. 2.0 ms means 180°. The pulse repeats every 20 ms (50 times per second). Move the slider to see the pulse width change.
Each pulse is a tiny voltage spike. The servo only cares about how wide the spike is, not how often it arrives.
Open up a servo and you'll find four parts: a small DC motor, a stack of gears to slow it down and increase torque, a potentiometer to measure the actual shaft angle, and a tiny control circuit. The circuit compares the commanded angle to the measured angle and runs the motor until they match. Try disturbing the shaft.
The control circuit runs the motor until the measured angle matches the command.
Servos are great, but they aren't the only way to make a motor turn precisely. Here's the family tree of motors used in robotics, drones, and 3D printers.
Cheap, small, and accurate to a degree or two. Limited to about 180° of rotation and modest speed. The control circuit is built in, so you only need a PWM signal.
No feedback sensor. Instead, it moves in fixed "steps" (often 200 per revolution). Send 50 step pulses and it turns 90°. Precise, but it can lose steps under heavy load.
No brushes wearing out, very high efficiency, very high speed. Needs an electronic speed controller to fire the right coils at the right time. With an encoder, can match servo precision.
The pot is replaced or fixed in place. The PWM now controls speed and direction instead of angle. Useful when you want servo-like simplicity but full rotation, like a wheel.
A typical hobby servo can hold its position against several kilograms of force — far more than its motor alone could produce. The trick is the gear train, which trades speed for torque. A 250:1 reduction means the motor spins 250 times for every 1 revolution of the output shaft, multiplying the torque by 250.
You've met the workhorse of every robot, RC plane, and animatronic. A servo turns a tiny pulse signal into precise angle control by combining a motor, gears, a potentiometer, and a feedback loop. Three wires in. Exact angle out.
A servo has just three wires: power (red), ground (black), and signal (yellow or white). The signal wire carries pulses that tell the servo what angle to hold.
Pulse Width Modulation. A pulse 1.0 ms wide means 0 degrees. 1.5 ms means 90 degrees. 2.0 ms means 180 degrees. The pulse repeats every 20 ms (50 times per second).
Inside the servo, a potentiometer measures the actual shaft angle. A control circuit compares it to the commanded angle and runs the motor until they match. This is why a servo "holds" its position.
Servos: cheap, precise, hold position, but limited speed and rotation. Steppers: precise rotation by counting steps, no feedback. Brushless DC: high speed and torque, used in drones and EVs.
Put your new knowledge into practice!