Sub topic 4
Shoot-through: the one switch combination to avoid
This chapter assumes you know how the four switches of an H-bridge steer current through a motor, and that you can read a basic schematic. It also assumes you have used digitalWrite and analogWrite on an Arduino. Here you will learn what shoot-through is, why it damages hardware, how driver ICs prevent it, and how to avoid it when you build a bridge from discrete parts.
What shoot-through is
An H-bridge has a high-side switch and a low-side switch on each of its two legs. Call them S1 (high-side, left), S2 (low-side, left), S3 (high-side, right) and S4 (low-side, right). Each leg connects the motor supply to ground through its two switches in series, and the motor terminal sits at the midpoint between them.
Shoot-through happens when both switches on the same leg are on at the same time. S1 and S2 together, or S3 and S4 together, form a direct path from the supply to ground. The motor is not in that path, so nothing limits the current except the small on-resistance of the switches, the supply's own resistance, and the wiring.
The current can be far above the motor's stall current. Take a 12 V supply and two MOSFETs with 50 mΩ on-resistance each. The path resistance is about 0.1 Ω, so the current tries to reach 120 A. In practice the supply sags or its protection trips, but the switches can still be destroyed in microseconds.
The switch combinations
Each leg has four possible states. Only one is dangerous.
| High-side | Low-side | Midpoint | Safe? |
|---|---|---|---|
| off | off | floating (high impedance) | Yes |
| on | off | supply voltage | Yes |
| off | on | ground | Yes |
| on | on | shorted supply to ground | No |
With two legs there are 16 combinations of the four switches. Four of them contain a shorted leg on at least one side. The valid ones either drive the motor forward or reverse, brake it by connecting both terminals to the same rail, or let it coast with all switches off. Later chapters cover brake and coast in detail.
Why the damage is so fast
Three effects combine.
- Current limited only by resistance. The motor's winding resistance and back-EMF normally limit current. A shorted leg has neither.
- Heat in tiny silicon. Power dissipated in a switch is I²R. At 100 A and 50 mΩ that is 500 W in each device, and a power MOSFET die cannot spread that heat quickly enough.
- Supply collapse. The sudden current draw pulls the supply voltage down. On a shared supply this can reset the Arduino, which then leaves its pins in an unknown state while the bridge is still in the faulty state.
A brief overlap of a few tens of nanoseconds does not always destroy a device, but it still wastes energy and heats the switches. At high PWM frequencies these overlaps repeat thousands of times per second, so a small overlap can cause steady overheating without any visible failure.
Where shoot-through comes from
Shoot-through is almost never intended. It comes from a few sources.
- Software that sets both inputs on a leg high. This is a risk with discrete bridges where each switch has its own input.
- Slow turn-off. A MOSFET does not stop conducting the instant its gate signal drops. The gate has capacitance and takes time to discharge. If the opposite switch is told to turn on right away, both can conduct briefly.
- Floating inputs at start-up. Before the microcontroller finishes booting, its pins are inputs and may float. A gate driver reading a floating input can turn a switch on at random.
- Noise. Switching spikes coupling onto a gate line can turn on a switch that should be off.
Dead time
Dead time is a short delay inserted between turning one switch off and turning the opposite switch on. During dead time both switches on the leg are off, so no shoot-through path exists. Typical values range from tens of nanoseconds for small MOSFET drivers to a few microseconds for slower devices such as IGBTs or bipolar parts.
Dead time must be longer than the slowest turn-off time of the device, including temperature and tolerance effects. It also has a cost. During dead time the motor current has to flow through the body diodes of the switches, which drop about 0.7 V or more, so the bridge dissipates extra heat. It also slightly distorts the relationship between duty cycle and average voltage. Engineers pick the shortest dead time that is still safe.
How driver ICs prevent shoot-through
Most hobby drivers give you protection at one of three levels.
Single direction input
Some drivers, such as many MOSFET half-bridge ICs, have one input per leg. The chip turns on exactly one switch in the leg, or neither. Because the input is a single signal, the "both on" state cannot be requested.
Two inputs per leg, with built-in interlock
Gate driver ICs with separate high and low inputs often include a shoot-through lock-out circuit. If both inputs are high, the chip keeps both outputs off. Many also add a fixed or adjustable dead time.
Direction pins on a full bridge
Modules based on the L298N or L293D use two direction inputs (IN1, IN2) and an enable (EN). Inside the chip, the logic maps each input combination to a safe set of switches. Setting IN1 high and IN2 low closes one diagonal pair. Setting both low or both high puts the bridge into a brake or off state, depending on the part. Because the inputs are decoded into pairs, you cannot select the shorted-leg state from the pins.
The setMotor function from the earlier example relies on this protection:
const uint8_t IN1 = 7;
const uint8_t IN2 = 8;
const uint8_t EN = 9; // must be a PWM-capable pin
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(EN, OUTPUT);
}
// speed: -255 (full reverse) to 255 (full forward), 0 = stopped
void setMotor(int speed) {
speed = constrain(speed, -255, 255);
if (speed > 0) {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
} else if (speed < 0) {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
} else {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
}
analogWrite(EN, abs(speed));
}
void loop() {
setMotor(200);
delay(2000);
setMotor(0);
delay(500);
setMotor(-200);
delay(2000);
setMotor(0);
delay(500);
}Nothing in this code can create shoot-through, because the driver chip decodes IN1 and IN2 and never exposes the individual switches. This is a main reason to start with an integrated driver.
Discrete bridges: your responsibility
With four separate MOSFETs or transistors, nothing stops you from setting both switches on a leg. Use these practices.
- Use a gate driver IC with lock-out and dead time rather than driving gates directly from Arduino pins. High-side N-channel MOSFETs also need a gate voltage above the supply, which a gate driver provides through a bootstrap circuit.
- Add pull-down resistors on every gate so a switch is off while the microcontroller pins float during reset. Values of 10 kΩ to 100 kΩ are common.
- Change one switch at a time. Turn the active switch off first, wait longer than the turn-off time, then turn the other on. In software, a delay of a few microseconds with
delayMicrosecondscan serve as dead time for slow devices, but it is not a substitute for hardware lock-out, because an interrupt or a bug can stretch or skip it. - Keep gate wiring short and place decoupling capacitors close to the bridge, so switching noise does not turn on the wrong switch.
If you must write direct switch control, make the invalid state unrepresentable. This sketch defines only the legal states and applies the turn-off step before the turn-on step:
// Discrete bridge: one pin per switch (use a gate driver in real hardware).
const uint8_t S1 = 2; // left high-side
const uint8_t S2 = 3; // left low-side
const uint8_t S3 = 4; // right high-side
const uint8_t S4 = 5; // right low-side
const unsigned int DEAD_TIME_US = 5; // must exceed the slowest turn-off time
void setup() {
// Set pins low before making them outputs so no switch turns on at start-up.
digitalWrite(S1, LOW);
digitalWrite(S2, LOW);
digitalWrite(S3, LOW);
digitalWrite(S4, LOW);
pinMode(S1, OUTPUT);
pinMode(S2, OUTPUT);
pinMode(S3, OUTPUT);
pinMode(S4, OUTPUT);
}
void allOff() {
digitalWrite(S1, LOW);
digitalWrite(S2, LOW);
digitalWrite(S3, LOW);
digitalWrite(S4, LOW);
delayMicroseconds(DEAD_TIME_US);
}
void forward() {
allOff(); // turn everything off first
digitalWrite(S1, HIGH); // left high-side on
digitalWrite(S4, HIGH); // right low-side on
}
void reverse() {
allOff();
digitalWrite(S3, HIGH); // right high-side on
digitalWrite(S2, HIGH); // left low-side on
}
void loop() {
forward();
delay(2000);
allOff();
delay(500);
reverse();
delay(2000);
allOff();
delay(500);
}Every transition goes through allOff(), so a forward-to-reverse change never has S1 and S2 on together. The digitalWrite before pinMode on an AVR board sets the output latch first, so the pin does not briefly drive a stale level when it becomes an output. The code also has no function that sets both switches of one leg.
Signs of shoot-through
Shoot-through often shows up as a pattern of faults and not as one clear failure.
- A bridge or driver that gets hot with the motor disconnected or lightly loaded.
- A supply that current-limits or a fuse that blows when the bridge switches.
- The Arduino resetting at the moment the motor starts or changes direction.
- Switches that fail short, which then causes continuous shoot-through and further damage.
A useful test is to power the bridge through a current-limited bench supply with the motor disconnected. If the supply current rises well above the idle level while you switch, you have overlap. If you do not have a bench supply, put a power resistor of a few ohms in series with the supply for the first test. The resistor limits the fault current, so a mistake costs a hot resistor and not a destroyed MOSFET.
Common mistakes
- Assuming the chip protects you in every mode. Some drivers have a lock-out, others do not. Read the datasheet section on input logic.
- Setting dead time by guesswork. Check the MOSFET datasheet for turn-off delay and fall time, then add a margin.
- Forgetting start-up states. Pins float during reset and when uploading a sketch.
- Powering the logic from the motor supply without decoupling, so supply dips corrupt the control signals.
Exercise
A driver IC has separate high and low inputs for one leg, and its datasheet says it has no shoot-through lock-out. Your sketch sets both inputs high by mistake. What happens, what limits the current, and what two changes would make the design safe?
Show answer
Both switches on that leg turn on, which connects the motor supply directly to ground. Only the switch on-resistances, the supply resistance and the wiring limit the current, so it can be tens of amps or more and may destroy the switches or collapse the supply. Two safe changes: add a gate driver or driver IC that has lock-out and dead time, and change the software so every transition first turns all switches off, waits longer than the turn-off time, and then turns on the next switch. Pull-down resistors on the inputs also keep switches off while the microcontroller resets.
Exercise
A MOSFET has a turn-off delay of 60 ns and a fall time of 40 ns. A designer sets dead time to 50 ns. Is this safe, and what is the trade-off of making dead time much longer?
Show answer
It is not safe. The switch needs about 100 ns (60 ns delay plus 40 ns fall) to stop conducting, and the dead time is only 50 ns, so the opposite switch can turn on while the first is still conducting. A margin above 100 ns is needed. Making dead time much longer costs efficiency and control: motor current flows through the body diodes during the gap, which wastes power as heat, and the effective average voltage no longer matches the duty cycle exactly.