🤖 Week 7, Day 2: DC Motors and Servo Motors
Theme: Actuators & Drive Systems
Topic: DC Motors and Servo Motors
Learning Goal: Understand DC motor physics, servo control loops, and how feedback systems enable precise positioning.
Introduction
DC motors and servo motors power the majority of robotic joints — from 3D printer extruders to humanoid hip actuators. Today we’ll explore the physics that makes them work, the control systems that make them precise, and the practical considerations that make them reliable.
DC Motor Fundamentals
The Physics: Lorentz Force
A DC motor converts electrical energy to mechanical rotation through the Lorentz force:
F = I × L × B
Where:
- I = current through conductor (Amps)
- L = length of conductor in magnetic field (meters)
- B = magnetic field strength (Tesla)
The torque produced is:
τ = K_t × I
Where K_t is the torque constant (Nm/A), a motor-specific parameter determined by magnet strength and coil geometry.
The Back-EMF Effect
As the motor spins, it acts as a generator, producing a voltage that opposes the applied voltage:
V_back = K_e × ω
Where:
- K_e = back-EMF constant (V·s/rad)
- ω = angular velocity (rad/s)
Key insight: K_t ≈ K_e (same physical constant, different units). This is why high-torque motors (large K_t) also have high back-EMF — they require higher voltage to reach high speeds.
The Complete DC Motor Equation
V_applied = R × I + L × (dI/dt) + K_e × ω
Where:
- R = armature resistance (Ω)
- L = armature inductance (H)
- The electrical time constant: τ_e = L/R (typically ms)
Mechanical Dynamics
τ = J × (dω/dt) + b × ω + τ_load
Where:
- J = rotor inertia (kg·m²)
- b = viscous friction coefficient
- τ_load = external load torque
The mechanical time constant: τ_m = J/b (typically 10-100 ms)
Motor Characteristics
Speed-Torque Curve
The fundamental operating characteristic of a DC motor:
ω = (V_applied / K_e) - (R / K_t × K_e) × τ
At stall (ω = 0): Maximum torque, maximum current
τ_stall = K_t × V / R
I_stall = V / R
At no-load (τ = 0): Maximum speed
ω_no_load = V / K_e
Efficiency
η = (Mechanical Power Out) / (Electrical Power In)
= (τ × ω) / (V × I)
Maximum efficiency typically occurs at ~80-90% of no-load speed and ~10-20% of stall torque.
From DC Motor to Servo Motor
A servo motor is not a different motor type — it’s a DC motor (usually brushless) with three critical additions:
1. Gearbox 🔧
Purpose: Trade speed for torque
τ_output = τ_motor × N × η_gearbox
ω_output = ω_motor / N
Where:
- N = gear ratio (e.g., 50:1, 100:1)
- η_gearbox = efficiency (0.7-0.95 depending on type)
Types:
- Spur gears: Simple, cheap, noisy, backlash
- Planetary gears: Compact, high ratio, low backlash
- Harmonic drives: Zero backlash, high ratio, expensive (we’ll cover Day 4)
- Cycloidal drives: High torque, compact (we’ll cover Day 4)
2. Position Encoder 📏
Purpose: Measure actual joint position for closed-loop control
Types:
- Incremental encoder: Quadrature A/B channels, counts relative position
- Resolution: 500-10,000 counts per revolution (CPR)
- Cost: $5-50
- Absolute encoder: Unique position at every angle
- Resolution: 12-20 bits (4096-1,048,576 positions/rev)
- Cost: $50-500
- Advantage: No homing required at startup
Key specification: Encoder resolution directly determines minimum detectable movement:
θ_min = 360° / CPR (for incremental)
θ_min = 360° / 2^bits (for absolute)
3. Motor Controller 🎛️
Purpose: Close the loop between commanded and actual position
The servo control loop runs at 1-10 kHz and implements:
The Servo Control Loop
Three Nested Loops
Modern servo drives implement three nested control loops:
Position Loop (outer, 1-2 kHz)
↓ outputs velocity command
Velocity Loop (middle, 5-10 kHz)
↓ outputs current/torque command
Current Loop (inner, 10-20 kHz)
↓ outputs PWM to motor
Position Loop (P or PID)
e = θ_commanded - θ_actual
τ_command = K_p × e + K_i × ∫e dt + K_d × (de/dt)
Tuning considerations:
- K_p (proportional): Higher = faster response, more overshoot
- K_i (integral): Eliminates steady-state error, can cause windup
- K_d (derivative): Damping, reduces overshoot, sensitive to noise
Velocity Loop (PI)
e_v = ω_commanded - ω_actual
I_command = K_pv × e_v + K_iv × ∫e_v dt
The velocity loop is critical for smooth motion — the position loop commands desired velocity, and the velocity loop ensures the motor tracks it.
Current Loop (PI)
e_i = I_commanded - I_actual
V_motor = K_pi × e_i + K_ii × ∫e_i dt
The current loop protects the motor from overcurrent and implements torque control (since τ ∝ I).
Control Performance Metrics
1. Step Response
When commanding a sudden position change, measure:
- Rise time (10% → 90%): How fast the system responds
- Settling time (within 2% of target): When motion truly completes
- Overshoot: Maximum excursion past target (typically < 5% for robots)
- Steady-state error: Final position error (should be < 1 encoder count)
2. Frequency Response
- Bandwidth: Frequency where output amplitude drops to 70.7% (-3dB) of input
- Industrial robots: 5-20 Hz
- High-performance humanoids: 50-100 Hz
- Phase margin: Stability indicator (should be > 30°)
3. Tracking Error
For trajectory following, the servo should maintain:
|θ_commanded(t) - θ_actual(t)| < ε_max
Where ε_max depends on application (0.1mm for CNC, 1mm for pick-and-place).
Practical Considerations
Thermal Management
Motor windings heat up according to:
P_heat = I² × R
T_winding = T_ambient + P_heat × R_th
Where R_th is thermal resistance (°C/W). Exceeding the maximum winding temperature (typically 120-155°C) permanently damages insulation.
Solutions:
- Current limiting in software
- Thermal modeling (estimate temperature without sensor)
- Forced air or liquid cooling for high-performance applications
Gearbox Backlash
Backlash (lost motion when reversing direction) causes:
- Position error at direction changes
- Vibration and noise
- Reduced effective encoder resolution
Mitigation:
- Preload mechanisms (spring-loaded gears)
- Software compensation (map backlash per joint)
- Use low-backlash gear types (harmonic, cycloidal)
Cogging Torque
Permanent magnet motors exhibit cogging — periodic torque ripple at low speeds caused by attraction between rotor magnets and stator teeth:
τ_cogging = Σ A_n × sin(n × N_pp × θ)
Where N_pp is the number of pole pairs.
Impact: Causes velocity ripple, audible noise, and positioning errors at low speeds.
Mitigation:
- Skewed rotor magnets
- Distributed windings
- High-resolution encoders + velocity loop compensation
- Direct drive (no gearbox) for ultra-smooth applications
Motor Selection Example
Application: 6-DOF robot arm, elbow joint
- Load: 5 kg payload at 0.5m arm length → τ_load = 24.5 Nm (worst case)
- Speed: 180°/s peak → ω = π rad/s
- Precision: ±0.1° accuracy
Selection process:
-
Torque: With 2× safety margin, need τ_motor × N × η > 49 Nm
- Choose motor: τ_stall = 0.8 Nm, K_t = 0.16 Nm/A
- Gear ratio: N = 100:1, η = 0.8
- Output torque: 0.8 × 100 × 0.8 = 64 Nm ✓
-
Speed: ω_motor = ω_output × N = π × 100 = 314 rad/s ≈ 3000 RPM
- Motor V = 24V, K_e = 0.016 V·s/rad
- Required V: V = I×R + K_e×ω = 2×1.5 + 0.016×314 = 3 + 5 = 8V
- 24V supply provides margin ✓
-
Precision: θ_min = 360° / (100 × 1000 CPR) = 0.0036°
- Well within ±0.1° requirement ✓
Summary
| Key Point | Takeaway |
|---|---|
| DC motor physics | τ = K_t × I; back-EMF limits speed at given voltage |
| Servo = DC motor + gearbox + encoder + controller | The combination enables precise closed-loop positioning |
| Three nested loops | Position → Velocity → Current, each with specific bandwidth |
| Thermal and mechanical limits | I²R heating, backlash, cogging — practical constraints on performance |
| Selection process | Torque, speed, precision — verify all three with safety margins |
Further Reading
- Chapter 6: Siciliano & Khatib, Springer Handbook of Robotics — motor dynamics and control
- Maxon Motor Handbook: Comprehensive guide to DC motor selection and servo tuning
- MIT 2.12: Lecture 9 — “Actuator Dynamics and Control”
Tomorrow (Day 3): Stepper Motors and Brushless DC Motors — open-loop precision and high-efficiency drives.