Lite / Textbooks / Robotics From First Principles / Chapter 2
2. Actuators and drives
Introduction
A DC motor spins fast and weakly, a servo holds an angle, and a stepper moves in exact clicks. Choosing between them is choosing what you need to control: speed, position or count. Small motors almost never drive a joint directly; a gearbox trades their speed for turning force. And because a microcontroller pin can supply only a trickle of current, every real motor needs a driver in between.
Figure 2.1. Trade speed for torque (described in words)
A motor producing 0.05 N·m at 6000 rpm drives a 30:1 gearbox. Ideally the joint gets 0.05 × 30 = 1.5 N·m at 200 rpm; with 80% efficiency it gets 1.2 N·m.
Explanation
Built from 3 School lessons. Each part is the lesson's own explanation.
2.1 DC motors, servos and steppers
A fan, a robot's elbow and a 3D printer's nozzle all move with motors. Why do they use three different kinds?
DC motor: speed from voltage
A DC motor spins when current flows: more voltage, more speed; reverse the voltage, reverse direction. It is cheap, fast and powerful for its size, which is why fans, drills and wheels use it. But it does not know its position. To control position it needs a sensor such as an encoder and a feedback loop.
Servo: an angle on command
A hobby servo packs a small DC motor, a gearbox, a position sensor and a control circuit into one box. You send it a pulse that means an angle (next lesson), and its built-in feedback turns to that angle and holds it. Great for robot joints, steering and flaps; most hobby servos only cover about 180°.
Stepper: counted steps
A stepper motor moves in fixed steps each time its coils are switched in order. A common type has 200 steps per revolution: 360° ÷ 200 = 1.8° per step. Count steps and you know the angle without a sensor, as long as it never skips (too much load or acceleration makes it skip silently). Printers and CNC machines use steppers.
Common mix-ups
A servo is a special kind of motor that spins.
✓ A hobby servo is a motor plus gears plus a position sensor plus control electronics, built to reach and hold angles.Steppers always know where they are.
✓ They know how many steps they were told to take. If they skip, nothing tells them.
Open the Lite lesson: DC motors, servos and steppers
2.2 Talking to a servo in milliseconds
A servo has just one signal wire. How do you tell it 'turn to 135°' with a single wire that is only ever on or off?
A pulse every 20 ms
A hobby servo expects a pulse about every 20 ms (50 times a second). The width of each pulse carries the command. A common mapping is 1.0 ms → 0°, 1.5 ms → 90°, 2.0 ms → 180°. The voltage of the pulse is just 'high'; the information is in the time.
A straight-line mapping
Between the ends, angle and pulse width are linked by a straight line: angle = (pulse − 1.0 ms) × 180° per ms, and pulse = 1.0 ms + angle ÷ 180° × 1 ms. So each 0.1 ms is worth 18°. In Python:
def pulse_ms(angle):
return 1.0 + angle / 180Duty cycle of a servo signal
The duty cycle is the fraction of each period spent high. A 1.5 ms pulse every 20 ms is 1.5 ÷ 20 = 7.5%. The whole servo range lives between 5% and 10% duty. Microcontrollers make this signal with a timer-driven PWM peripheral, which you meet in week 25.
Common mix-ups
A servo's angle is set by the voltage on its signal wire.
✓ It is set by the pulse width. The signal is always either high or low.All servos use exactly 1–2 ms.
✓ That is a common convention; real models vary, so check the datasheet and test the ends carefully.
Open the Lite lesson: Talking to a servo in milliseconds
2.3 Choosing an actuator, and why pins need help
Your microcontroller pin can light an LED. Can it run a 6 W motor on its own?
Power, voltage, current
Electrical power is P = V × I. Rearranged, I = P ÷ V. A 12 V, 18 W pump draws 1.5 A; a 5 V, 1.5 W fan draws 0.3 A. Small motors often draw several times their running current for a moment when starting or stalled, so drivers and supplies need extra headroom.
Pins command, drivers deliver
A pin can safely supply only milliamps. Motors need amps, and they make electrical noise and voltage spikes. So the pin sends a small logic signal to a driver (a transistor or a motor-driver chip), which switches a separate supply through the motor. A diode or the driver's built-in protection catches the spike when the motor is switched off. Servos and stepper drivers follow the same idea.
A fair comparison
List what the task needs (angle or speed? holding force? cost? power?) and score each actuator against it, as in the trade-offs lab. Write down the must-haves first: a vent that must hold 45° in wind rules out a plain DC motor without a sensor, however cheap it is.
Common mix-ups
If a motor is small, a pin can power it.
✓ Even small motors draw hundreds of milliamps and spike when switched. Always use a driver.The cheapest actuator is the best choice.
✓ Must-haves come first. A cheap actuator that cannot hold an angle fails the task.
Open the Lite lesson: Choosing an actuator, and why pins need help
Worked examples
DC motors, servos and steppers: example 1
A 200-step stepper drives a dial. How many steps turn it through 54°?
Solution
Step angle = 360 ÷ 200 = 1.8°. Steps = 54 ÷ 1.8 = 30 steps.
Talking to a servo in milliseconds: example 1
What pulse width sets 45°, and what duty cycle is that at 50 Hz?
Solution
Pulse = 1.0 + 45 ÷ 180 = 1.25 ms. Period = 1 ÷ 50 = 20 ms. Duty = 1.25 ÷ 20 = 6.25%.
Choosing an actuator, and why pins need help: example 1
A 12 V greenhouse fan is rated 3 W. Its current, and how long can it run on a 12 V, 7 Ah battery?
Solution
I = 3 ÷ 12 = 0.25 A. 7 Ah ÷ 0.25 A = 28 hours (ideal; real batteries give less).
Interactive figures, in words
Figure 2.2 from Talking to a servo in milliseconds
Set the PWM frequency to 50 Hz. Find the duty cycles that give a high time of 1.0 ms, 1.5 ms and 2.0 ms per period. (Ignore the motor readout here: a servo listens to pulse width, not average voltage.)
The PWM visualiser shows a square wave whose high time is the duty cycle times the period. At 50 Hz the period is 20 ms, so 5% duty gives a 1.0 ms pulse, 7.5% gives 1.5 ms and 10% gives 2.0 ms: the pulse widths a hobby servo reads as 0°, 90° and 180° in the common mapping.
Laboratory
These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.
- Simulation OS: One robot joint (Simulation OS experiment)
Lower the torque limit until the joint can no longer reach its target in time, and note the limit.
Open on the full site - Robotics Workbench (Studio)
Choose an actuator for a gripper finger and justify the choice in one sentence.
Open on the full site
Practice
Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.
- Which actuator suits a desk fan best?
Answer it in “DC motors, servos and steppers” - A stepper with 48 steps per revolution must turn 90°. How many full steps is that?
Answer it in “DC motors, servos and steppers” - A stepper-driven printer head is pushed too hard and skips 10 steps. What does the firmware believe?
Answer it in “DC motors, servos and steppers” - A hobby servo is told 1.0 ms means 0° and 2.0 ms means 180°, in a straight line between. How long a pulse sets it to 0°, in milliseconds?
Answer it in “Talking to a servo in milliseconds” - A servo signal has a 20 ms period and a 1.8 ms pulse. What is the duty cycle, in percent?
Answer it in “Talking to a servo in milliseconds” - A 9 V DC motor uses 1.5 W when running. How much current does it draw, in amps?
Answer it in “Choosing an actuator, and why pins need help” - Why does a motor connect through a driver with its own supply?
Answer it in “Choosing an actuator, and why pins need help”
Engineering applications
3D printers
Printers use stepper motors because counting steps gives position without a sensor. If a nozzle snags and steps are skipped, the printer does not know, and every later layer is shifted: the classic layer-shift fault.
Robot arms
Arm joints usually pair a fast motor with a high-ratio gearbox and an encoder. The gearbox multiplies torque, the encoder closes the loop on position, and the motor driver supplies the current the logic cannot.
Watch (optional)
Streaming video uses a lot of data. Everything you need is in the text.
- “How Motors Work For Beginners (Episode 1): The DC Motor: 032” by Jeremy Fielding
- “Servo Motors, how do they work?” by The Engineering Mindset
- “Modern Robotics, Chapter 8.9: Actuation, Gearing, and Friction” by Northwestern Robotics
Summary
- DC motors suit speed, servos suit angle, steppers suit counted steps.
- A gearbox multiplies torque by its ratio and divides speed by it, minus losses.
- A servo reads its target angle from the width of a repeating pulse.
- Motors draw far more current than a logic pin can give, so a driver switches the real power.
Glossary
- Hobby servo motor
- A hobby servo is a motor, gearbox, position sensor and controller in one case. It moves to an angle set by the width of a pulse repeated about every 20 ms. Field Guide
- Stepper motor step angle
- A stepper motor turns in fixed increments called steps. A common motor has a 1.8° step, which is 200 full steps per revolution; microstepping divides each step further. Field Guide
- Stall torque and no-load speed
- For a DC motor, stall torque is the torque at zero speed and no-load speed is the speed with zero torque; between them torque falls roughly linearly as speed rises. Field Guide
- Gear ratio
- A gear ratio is the driven gear's teeth divided by the driver's teeth. It divides speed and, ignoring losses, multiplies torque by the same factor. Field Guide
- PWM average voltage
- Pulse-width modulation switches a signal fully on and off quickly; the fraction of time it is on, the duty cycle, sets the average voltage delivered. Field Guide
Project: Pick the motor
A camera turret must turn 180° in one second and hold its angle against a light wind. Compare a DC motor with an encoder, a hobby servo and a stepper for the job. Estimate the torque needed, choose a gear ratio if one is required, and explain how the motor will be driven.
Deliverables
- A comparison table of the three actuators
- A torque estimate and gear ratio
- A sketch of the driver between microcontroller and motor
Write it up on paper or in your own notes. Lite never stores what you write.
References
- Kevin M. Lynch and Frank C. Park (2017). Modern Robotics: Mechanics, Planning, and Control. Cambridge University Press.
- Mark W. Spong et al. (2006). Robot Modeling and Control. Wiley.