🤖 Week 7, Day 5: Motor Drivers and Power Electronics

Theme: Actuators & Drive Systems
Topic: Motor Drivers and Power Electronics
Learning Goal: Understand the circuits and control strategies that convert digital commands into motor current.


Introduction

A motor driver is the bridge between a robot’s brain (microcontroller/CPU) and its muscles (motor). It must:

  1. Accept low-power digital commands (3.3V, mA)
  2. Deliver high-power analog current (12-48V, 1-100A)
  3. Protect against faults (overcurrent, overtemperature, stall)
  4. Provide feedback (current, temperature, fault status)

Today we’ll explore the circuits that make this possible.


The H-Bridge: Fundamental Building Block

What Is an H-Bridge?

An H-bridge is a circuit with four switches (transistors) arranged in an “H” configuration, allowing bidirectional current through a motor:

        V_supply
           |
     Q1 ----+---- Q3
      |     |     |
    --+-- Motor --+--
      |     |     |
     Q2 ----+---- Q4
           |
         GND

Operating Modes

Q1Q2Q3Q4Motor
ONOFFOFFONForward
OFFONONOFFReverse
ONOFFONOFFBrake (short circuit)
OFFONOFFONBrake (short circuit)
OFFOFFOFFOFFCoast (freewheel)

Critical: Q1+Q2 or Q3+Q4 must NEVER be ON simultaneously — this creates a shoot-through (direct short across power supply).

PWM Speed Control

Rather than simply switching ON/OFF, motor drivers use Pulse Width Modulation (PWM):

Duty Cycle = T_on / (T_on + T_off)

PWM frequency considerations:

Regeneration

When a motor decelerates, it acts as a generator. The H-bridge must handle this energy:

Options:
1. Dissipate in resistors (simple, wasteful)
2. Return to battery (efficient, requires bidirectional converter)
3. Dump to capacitor (brief energy storage)

Transistor Technologies

MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor)

The dominant switch for motor drivers:

Advantages:

Key parameters:

Losses:

P_conduction = I² × R_ds(on)
P_switching = 0.5 × V × I × (t_rise + t_fall) × f_pwm

IGBT (Insulated Gate Bipolar Transistor)

Used for very high power (>1 kW):

Advantages:

Disadvantages:

GaN (Gallium Nitride) and SiC (Silicon Carbide)

Emerging wide-bandgap semiconductors:

ParameterSilicon MOSFETGaNSiC MOSFET
Switching speed~100 ns~10 ns~50 ns
R_ds(on)10 mΩ5 mΩ8 mΩ
Voltage<200V<650V<1700V
CostLowModerateHigh
Temperature150°C200°C200°C

Applications:


Motor Driver Architectures

1. DC Motor Driver (Single H-Bridge)

Components:

Example ICs:

2. Stepper Motor Driver

Requirements:

Current Chopping Principle:

1. Apply voltage to winding
2. Current rises: di/dt = (V - I×R) / L
3. When I > I_target: switch OFF, current decays through diodes
4. When I < I_target: switch ON again
5. Repeat at 20-50 kHz chop frequency

Example ICs:

3. BLDC Motor Controller (ESC)

Requirements:

Phases of Operation:

Step 1: Energize A+B-, measure C back-EMF
Step 2: Energize A+C-, measure B back-EMF
Step 3: Energize B+C-, measure A back-EMF
... (6-step commutation)

Example controllers:

4. Servo Drive (Industrial)

Requirements:

Example products:


Control Strategies

Open-Loop PWM

Simplest approach: PWM duty cycle maps directly to speed:

# Pseudo-code
pwm_duty = speed_command / max_speed  # 0.0 to 1.0
set_pwm(pwm_duty)

Problems:

Use for: Simple fans, pumps, toys — not robotics.

Closed-Loop Velocity Control

Add encoder feedback to regulate speed:

# Velocity PI control loop (1 kHz)
velocity_error = target_velocity - measured_velocity
integral += velocity_error * dt
command_current = Kp * velocity_error + Ki * integral
pwm_duty = command_current / max_current

Advantages:

Closed-Loop Position Control

Add position feedback for precise positioning:

# Cascaded position-velocity loops
# Position loop (100 Hz)
position_error = target_position - measured_position
velocity_command = Kp_pos * position_error

# Velocity loop (1 kHz)
velocity_error = velocity_command - measured_velocity
integral += velocity_error * dt
current_command = Kp_vel * velocity_error + Ki_vel * integral

# Current loop (10 kHz)
current_error = current_command - measured_current
voltage_command = Kp_cur * current_error
pwm_duty = voltage_command / battery_voltage

Advantages:


Protection and Safety

Overcurrent Protection

if measured_current > I_max:
    disable_pwm()
    set_fault_flag(OVERCURRENT)
    require_reset()

Implementation:

Thermal Protection

T_estimated = T_ambient + I² × R × R_th

if T_estimated > T_max:
    reduce_current_limit()
    log_warning()
    
if T_estimated > T_critical:
    disable_drive()
    set_fault_flag(OVERTEMP)

Stall Detection

A stalled motor draws maximum current but produces no motion:

if current > stall_threshold and velocity == 0 for > stall_time:
    disable_pwm()
    set_fault_flag(STALL)

Safe Torque Off (STO)

Industrial safety standard (IEC 61800-5-2):


Power Supply Considerations

Battery Selection

ChemistryNominal VEnergy DensityDischarge RateCyclesCost
LiPo3.7V/cell150-200 Wh/kg20-100C300-500Medium
LiFePO43.2V/cell90-120 Wh/kg5-30C2000+Medium
Li-Ion 186503.6V/cell250 Wh/kg3-10C500-1000Low
NiMH1.2V/cell60 Wh/kg5-10C500Low

For mobile robots: LiPo or LiFePO4 (lightweight, high discharge) For stationary robots: Li-Ion 18650 or AC power (cost, longevity)

Voltage Regulation

Motors need direct battery voltage, but logic needs 3.3V/5V:

Battery (12V-48V)
    |
    +--> DC-DC Buck --> 5V (motor driver logic)
    |       |
    |       +--> LDO --> 3.3V (microcontroller, sensors)
    |
    +--> Direct to H-bridge (motor power)

Important: Keep motor power and logic grounds separate (star grounding) to prevent noise coupling.


Practical Design Example

Application: 6-DOF robot arm joint

Driver Selection:

Selected: Elmo Gold Solo Twitter (compact servo drive)

Power Budget:

6 joints × 24V × 5A × 0.8 (efficiency) = 576W mechanical
Battery: 24V × 25Ah LiFePO4 = 600Wh
Runtime at full load: 600Wh / 576W = ~1 hour
Actual runtime (partial load): 3-4 hours

Summary

Key PointTakeaway
H-bridgeFundamental circuit for bidirectional DC motor control
PWMDuty cycle controls effective voltage and speed
MOSFETsDominant switch technology; GaN/SiC emerging for high performance
Driver typesDC H-bridge, stepper chopper, BLDC ESC, servo FOC
ProtectionOvercurrent, thermal, stall detection — mandatory for reliability
SafetySTO (Safe Torque Off) for collaborative robots
PowerBattery selection and grounding critical for noise immunity

Further Reading


Tomorrow (Day 6): Python Practice — Building a Motor Control Simulator.