H-Bridge Motor Driver Design Guide
Half/Full Bridge, Shoot-Through, Dead Time, Freewheeling & Current Sensing
1. Introduction — Four Switches That Must Never Fight
The H-bridge is the standard circuit for driving a brushed DC motor in both directions (or any two-terminal load that needs bipolar drive): four switches arranged so that opposite diagonals conduct to spin the motor one way or the other, and both low-side (or both high-side) switches conduct for braking or freewheeling. It is deceptively simple to draw and full of traps for the unwary: shoot-through (both switches of one leg on at once, a dead short across the supply), dead-time distortion, freewheeling recirculation through the body diodes, inductive-load demagnetization, and current-sense placement. This guide covers the half/full-bridge topologies, the switching sequence, dead-time and shoot-through protection, gate drive, the freewheeling current paths and snubbering, PWM control strategies (synchronous rectification, braking, coasting), current sensing for torque control, and the failure modes. It complements the motor control guide and stepper/BLDC guides on this site.
2. Topology and Switching States
An H-bridge has two legs; each leg (high-side + low-side) is an independent half-bridge. With a battery or bus voltage VBUS across the top and ground (or a −V rail) at the bottom, the motor (an inductor with resistance, Lm, Rm) connects between the two leg midpoints. The useful states:
- Forward: Q1 and Q4 on, Q2/Q3 off — current flows VBUS → Q1 → motor → Q4 → GND.
- Reverse: Q2 and Q3 on — the opposite polarity across the motor.
- Coast: all low-side (or all high-side) off — the motor’s inductive current freewheels through Q2/Q4’s body diodes (or through both low-side MOSFETs with synchronous rectification) and the motor coasts down.
- Brake (dynamic): Q2 and Q4 (both low-side, or both high-side) on — the motor terminals are shorted, the back-EMF drives a large current that brakes quickly. This is the principle of short-circuit braking.
Reversing direction must always go through a coast period to avoid an instant current reversal that can exceed the switch ratings and stress the gears.
3. Shoot-Through and Dead Time
Every switch commutation is a race between turning one switch off and its complement on. Because real MOSFETs have finite (and asymmetric) turn-off/turn-on delays, gating both switches of a leg simultaneously — even for 100 ns — shorts VBUS to GND through a nearly zero impedance: shoot-through. The current spikes to the melt point of the package; the classic symptom is a smoked low-side MOSFET on the very first power-on. The fix is dead time: delay the turn-on of the complement until the other has demonstrably turned off. Dead time is set in the gate driver (e.g. via a programmable delay or an RC), and the cost of dead time is duty-cycle distortion — at PWM carrier frequencies above ~100 kHz and low duty cycles the distortion eats the average output and heats the motor. For a DC motor the distortion is usually tolerable, but for high-frequency synchronous PWM (BLDC) the dead-time compensation becomes a real design problem.
Gate-driver ICs with internal cross-conduction prevention are strongly recommended; a bootstrap high-side driver (e.g. IR2104 class) generates the high-side gate supply from the low switching node.
4. Freewheeling and Demagnetization
The motor is an inductor; when a switch turns off, the inductive current cannot stop instantly and must find a path. In the forward state, turning off Q1 makes the motor current continue through Q2’s body diode and Q4 (rise to VBUS). Without that recirculation the voltage across the switch collapses (flyback) far beyond the rating — the reason every H-bridge has the four body diodes as an inherent freewheeling path and often additional Schottky diodes or snubbers. The consequences of poor demagnetization: the switch avalanche-rings, EMI spikes appear, and at best the efficiency drops. Synchronous rectification — turning on the freewheeling MOSFET instead of letting its body diode conduct — cuts the voltage drop from ~0.6 V to I·RDS(on), recovering several percent of efficiency at low speeds. The snubber calculator sizes the RC snubber (or RCD clamp) for the ringing frequency measured at the leg midpoint, damping the overshoot to an acceptable level without burning power at the PWM repetition rate.
5. Gate Drive and Bootstrap
High-side switches need a gate voltage above VBUS; the bootstrap capacitor (C_boot) charged from the low-side supply through a diode provides it, replenished whenever the low side conducts. The bootstrap cap is sized by the gate charge: C_boot >> Q_g_total / ΔV_allowed. If the load allows no body-diode conduction (e.g. a fully balanced PWM that never lets the leg go low), the bootstrap caps drain and the high-side dies — a known trap with “locked-rotor” and certain PWM patterns. Solutions: keep a minimum on/off duty that exercises the low side, use a charge-pump or a regulated isolated supply for the high side, or use low-side-only freewheeling so the leg still dips low.
For low-side gate charge math and the gate-driver current sizing, the motor control calculator helps cross-check PWM frequency, duty and current before committing to the driver part.
6. Current Sensing for Torque Control
Torque in a DC motor is proportional to the armature current, so torque regulation needs a current measurement. The standard placements: (a) a low-side shunt in the ground return, sampled during the low-side conduction, or (b) a high-side or leg shunt sampled during the active phase, or (c) a sense resistor in series with the supply rail measured as the average. Each placement has a different sampling window relative to the PWM — the classic mistake is sampling during the dead time or the freewheel interval when the current is flowing through a different path and the sense voltage is not the motor current. For the shunt value: R_sense = V_fullscale / (I_peak · gain) where the peak includes the PWM ripple and any startup current (typically 2–3× the rated current); choose the power rating with the average: P = I_rms² · R_sense. The low-side shunt drops the effective bus voltage; a 10 mΩ shunt at 5 A drops 50 mV, fine for a 12 V rail, meaningful for a 5 V one. Inverters with four-quadrant operation need the shunt the low side conducts.
7. Worked Example — 12 V, 5 A Brushed DC Motor Driver with Current Control
Target: drive the motor bidirectionally at 20 kHz PWM from a 12 V rail, current regulated to 5 A with a 0.1 Ω low-side shunt and a 100× amplifier into the MCU ADC.
- Dead time: set the driver to 500 ns; verify with a scope that no cross-conduction exists at 20 kHz (the two transitions × 20k = 40k/day of distrust if wrong).
- Gate drive: bootstrap cap for the high side with Q_g ≈ 30 nC → C_boot = 30 nC/0.5 V = 60 nF → 100 nF + ceramic, with a 1N5819 diode.
- Shunt: 0.1 Ω; full-scale 10 A → 1 V; amplifier ×50 into a 2.048 V ADC → ±4 A range; sample synchronized to the PWM center to avoid commutating glitches.
- Synchronous rectification: enable the low-side MOSFET during freewheel to cut diode loss; verify the body-diode dead-time window remains below the switch rating.
- Add an RC snubber across each leg if the ringing at turn-off exceeds ~24 V (2× VBUS); size from the measured ringing frequency with the snubber calculator.
- Verify thermally: at 5 A, RDS(on)=25 mΩ each gives ~0.6 W per switch; with a suitable heatsink the junction stays within limits — the thermal calculator cross-checks the heatsink size.
8. Common Mistakes
- No dead time / shoot-through: the number-one H-bridge killer; the first power-on test without drive should not toast the low-side FETs.
- Dead time too long at high frequency: eats output duty and creates distortion/audible noise on the motor.
- Sampling current during the wrong phase: reads the freewheel or dead-time current instead of the motor current, breaking the torque loop.
- Ignoring the body-diode reverse recovery: at high di/dt the diode’s reverse-recovery spikes the stress; a parallel Schottky or a soft-switching pattern helps.
- Locked rotor without current limit: the motor draws just the DC-resistance-limited current, hundreds of percent of rated — thermal destruction within seconds.
- Using the wrong ground scheme: a shared noisy ground for the gate driver and the ADC contaminates the torque measurement.
9. FAQ
Q: Why did my low-side MOSFET burn on the first power-up? A: The classic shoot-through — both switches on for a microscopic time shorts the bus; always start with large dead time and verify with a scope.
Q: Do I really need dead time if the MCU sets the PWM? A: Yes — the MCU outputs are simultaneous; the dead time must come from the gate driver’s logic, not from the firmware timing, to be safe under all conditions.
Q: What does synchronous rectification buy me? A: One diode drop (~0.6 V) replaced by I×RDS(on) (~tens of mV) during freewheel — several percent efficiency, lower temperature and better braking smoothness.
Q: How do I reverse a motor safely? A: Coast (all off) briefly to let the current decay, then apply the reverse state; instant reversal can exceed the switch/gear rating.
10. Conclusion
The H-bridge is the workhorse of bidirectional motor control, and its reliability hinges on three numbers: enough dead time, a controlled freewheel path, and a correct current-sense window. Add the snubber for ringing, the thermal budget for the MOSFETs, and an explicit sequence for direction changes, and the four switches will drive the motor for years instead of smoking on the first day.