Skip to content
Tactiverge

Textbooks/Robotics From First Principles/Chapter 2Lite (plain text) version

2Actuators and drives

Version 1 · Technically checked (automated checks only) · 3 source lessons · 7 practice items

Text
All chapters and search
  1. 1. Sense, think, act
  2. 2. Actuators and drives
  3. 3. Vectors and frames
  4. 4. Rotations and transforms
  5. 5. Forward kinematics
  6. 6. Inverse kinematics
  7. 7. Motion and trajectories
  8. 8. Where am I? Drift, uncertainty and fusion

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.

Trade speed for torqueMotor0.05 N·m30:1gearboxJoint1.2 N·m6000 rpm200 rpmideal: 0.05 × 30 = 1.5 N·mat 80%: 1.2 N·m
Figure 2.1. Trade speed for torque. 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

This chapter is built from 3 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.

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 full 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 / 180

Duty 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 full 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 full 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

Figure 2.2 from Talking to a servo in millisecondsSet 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.)
Can't use the interactive? Read a description instead

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.

Interactive figure (online). Description: 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

Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.

Guided practice

Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.

Practice 1

Which actuator suits a desk fan best?

Practice 2 · a fresh version every time

A stepper with 48 steps per revolution must turn 90°. How many full steps is that?

steps

Practice 3

A stepper-driven printer head is pushed too hard and skips 10 steps. What does the firmware believe?

Practice 4 · a fresh version every time

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?

ms

Practice 5

A servo signal has a 20 ms period and a 1.8 ms pulse. What is the duty cycle, in percent?

%

Practice 6 · a fresh version every time

A 9 V DC motor uses 1.5 W when running. How much current does it draw, in amps?

A

Practice 7

Why does a motor connect through a driver with its own supply?

  1. Which actuator suits a desk fan best?
    • A DC motor
    • A hobby servo
    • A stepper motor
  2. A stepper with 48 steps per revolution must turn 90°. How many full steps is that? (steps)
  3. A stepper-driven printer head is pushed too hard and skips 10 steps. What does the firmware believe?
    • It notices and corrects
    • It still thinks the head is where it counted, so every later move is offset
    • The motor stops forever
  4. 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? (ms)
  5. A servo signal has a 20 ms period and a 1.8 ms pulse. What is the duty cycle, in percent? (%)
  6. A 9 V DC motor uses 1.5 W when running. How much current does it draw, in amps? (A)
  7. Why does a motor connect through a driver with its own supply?
    • Drivers make motors quieter
    • Pins supply only milliamps, and motors need amps and produce voltage spikes
    • Microcontrollers cannot make 0 and 1

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 verified videos. Nothing loads from YouTube until you press play.

A hands-on engineer explains DC motors with real hardware, which helps when you pick a motor for a project.

11 min 46 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

An animated explainer of what is inside a hobby servo and how it turns to, and holds, the angle it is told.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

Why real robot joints have gearboxes, and what gearing does to torque, speed, inertia and friction.

6 min 6 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

  • How Motors Work For Beginners (Episode 1): The DC Motor: 032 (Jeremy Fielding)
  • Servo Motors, how do they work? (The Engineering Mindset)
  • Modern Robotics, Chapter 8.9: Actuation, Gearing, and Friction (Northwestern Robotics)

Chapter 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.
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.
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.
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.
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.

Definitions from the 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

Keep your work in your Engineering Journal; it stays private unless you choose to share it.

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.

Publication record

Version
1
Status
Technically checked (automated checks only)
Technical review
Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
Written by
Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
Licence
All rights reserved by the founders unless a licence is approved.
Corrections
None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.