EN

DC motors with an H-bridge

Direction, speed with PWM, starting current and choosing the driver

Calculator

Motor
V
rpm
Ω
A
Driver and PWM
V
%
kHz
V

Simple motor model: the back EMF is proportional to speed and the no-load current is neglected. Driver data are indicative, from their datasheets; the real continuous current depends on cooling.

What an H-bridge is

A DC motor turns one way or the other depending on the polarity of its voltage. The H-bridge is four switches (transistors) arranged in an H with the motor on the crossbar. Closing Q1 and Q4, current flows through the motor from left to right; closing Q2 and Q3, the other way. The two switches on the same side must never be closed together, because they would short the supply: integrated drivers prevent it and add a short dead time between changes.

IN1IN2SwitchesMotor
10Q1 and Q4Forward
01Q2 and Q3Reverse
11Q3 and Q4 (or Q1 and Q2)Brake: shorting the terminals brakes the motor
00NoneCoast: the motor stops by inertia

The exact input combination for brake and coast varies between drivers; check their truth table.

Speed with PWM

Speed is controlled with PWM: the motor receives pulses at the supply voltage and, because of its inductance and inertia, responds to the average voltage. Speed is roughly proportional to the voltage minus the armature drop:

\[ V_{avg} = D\,(V_s - V_{driver}) \]
\[ n \approx \frac{V_{avg} - I\,R}{k_e} \]
\[ k_e = \frac{V_{nom}}{n_0} \]

With a PWM frequency below about 15 kHz the motor gives an audible whine; above 20 kHz it is inaudible, but the driver's switching losses increase. Many cheap drivers have trouble above 20 to 30 kHz.

Starting current

At standstill the motor generates no back EMF and only the armature resistance limits it: the starting (or stall) current is V/R, often five to ten times the rated current. The driver must withstand that peak for a moment or limit it; many modern drivers limit current by themselves. A soft start, raising the duty cycle gradually, reduces the peak and protects the mechanics.

Choosing the driver

Related: PWM calculator, transistor as a switch, current sensing with a shunt, stepper motors and servo motors.