Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 38 ยท Actuators and Control

Motors and Actuators

Learn how DC, servo, stepper and brushless motors work, what torque, speed and gear ratio mean, how PWM controls speed, and simulate a DC motor in Python.

Sensors tell a robot what is happening; actuators make things happen. Most robots use electric motors, and picking the right one is mostly about two quantities: torque (how hard it can turn) and speed. This lesson compares the common motor types, explains gearboxes and PWM, and simulates a DC motor so you can watch how voltage, load and inertia shape its motion before you control it in PID control.

Motor types

Type How it is controlled Strengths Weaknesses
Brushed DC voltage (via PWM) cheap, simple, strong at low speed brushes wear, noisy, needs an encoder for position
Brushless DC (BLDC) electronic commutation (ESC or driver) efficient, long life, high power needs a driver and rotor sensing
Servo (hobby) pulse width sets the angle position control built in limited range, modest torque, coarse
Stepper pulses move fixed steps open-loop positioning, holds position can lose steps, vibrates, poor at speed
Linear actuator motor plus lead screw straight-line force slow

Hydraulic and pneumatic actuators exist too (see Robot Components), but electric motors dominate small and medium robots.

Torque, speed and power

A motor delivers power P = ฯ„ ยท ฯ‰ (torque in Nยทm times angular speed in rad/s). A DC motor has a simple, nearly linear speed-torque curve: speed is highest with no load (no-load speed), and torque is highest when stopped (stall torque). Between them,

ฯ‰ = ฯ‰_noload ยท (1 - ฯ„ / ฯ„_stall)

so the best power is about halfway, at half the stall torque and half the no-load speed. Running at stall draws huge current and overheats the winding, which is why robots must avoid stalling motors for long.

Python The speed-torque curve and power of a DC motor

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Gearboxes

Small motors spin fast with little torque; robots need the opposite. A gearbox with ratio N (for example 50:1) divides speed by N and multiplies torque by N (times efficiency ฮท, typically 60-90 percent):

ฯ„_out = N ยท ฮท ยท ฯ„_motor, ฯ‰_out = ฯ‰_motor / N

Gearing also makes the motor's inertia look Nยฒ times larger from the load side, which helps stability but makes quick reversals slower. Real gearboxes have backlash (play between teeth), a problem for precise arms; harmonic drives and planetary gearboxes reduce it. High ratios cannot be back-driven, so the arm holds its position with the power off (a plus for safety, a minus for compliance).

Python Pick a gear ratio for a wheel

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The sweet spot is a ratio that meets both requirements. Real designs also keep a margin (2x) for friction, acceleration and surprises.

Controlling speed with PWM

A microcontroller pin is either on or off, so it cannot output "half voltage". Pulse-width modulation (PWM) switches the motor supply on and off thousands of times per second; the duty cycle (fraction of time on) sets the average voltage: 40% duty on 12 V acts like about 4.8 V. The motor's inductance smooths the current. The switching sits between 1 kHz and 20+ kHz; above 20 kHz it is inaudible. An H-bridge driver, four switches arranged in an H shape, lets the PWM signal drive the motor in both directions, and the driver, not the pin, supplies the current. Never connect a motor directly to a microcontroller pin.

A DC motor model

A brushed DC motor has an electrical side (resistance R, back-EMF Ke ฯ‰) and a mechanical side (inertia J, friction b). Ignoring the small inductance:

Text
V = R i + Ke ฯ‰
ฯ„ = Kt i
J dฯ‰/dt = ฯ„ - b ฯ‰ - ฯ„_load

The back-EMF means a spinning motor "pushes back": the faster it turns the less current flows, so the speed settles where torque balances friction and load. The time to settle (the time constant) depends on J: a heavy flywheel takes longer to reach speed. Simulating these equations is the standard way to design a controller before touching hardware.

Python Simulating a DC motor's step response

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the start current: 12 V across 1.2 ohm is 10 A at first, before back-EMF builds. That is the power-supply surge from Robot Components. Drivers therefore limit the current.

Servos and steppers

A hobby servo contains a motor, gearbox, potentiometer and a tiny controller. You send a pulse every 20 ms whose width, 1 to 2 ms, sets the angle (about 1.5 ms is the center). A stepper moves one fixed angle per pulse (commonly 1.8 degrees, so 200 steps per turn; microstepping divides further). It holds position with no sensor as long as the load stays below its torque; if it is overloaded it silently skips steps and the position is lost, which is why 3D printers use them carefully.

Python Servo pulse width and stepper steps

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Encoders: closing the loop

To control a motor you need to know where it is. An encoder on the motor shaft produces pulses as it turns. Quadrature encoders have two channels shifted by 90 degrees so the direction is known too, and the controller counts edges. The resolution is counts per revolution (CPR); after a 50:1 gearbox the output shaft sees 50 times as many counts. Speed is the change in count per time; that division is noisy at low speed, which is why speed estimates are filtered (see Sensors and Noise).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a 30:1 gearbox do to a motor's output?

    A reduction gearbox trades speed for torque; efficiency losses mean slightly less than 30x torque.
  2. 2. What does PWM duty cycle control?

    Switching fast with different on-time fractions emulates a lower average voltage.
  3. 3. Why is stalling a DC motor dangerous?

    With no back-EMF the current is V/R, which is large.
  4. 4. What can happen to a stepper motor that is overloaded?

    Open-loop steppers do not sense position, so lost steps go unnoticed unless an encoder is added.

Summary

  • Choose a motor type by control method, torque, speed, efficiency and cost; servos and steppers have built-in or open-loop positioning.
  • Gearboxes trade speed for torque and add backlash; size the ratio from the load's torque and speed needs.
  • PWM sets average voltage; an H-bridge supplies current and direction.
  • A DC motor has a first-order speed response and large start-up current; encoders close the loop.

Next: PID Control