Sub topic 5
Inductive kickback and flyback paths
This chapter assumes you know Ohm's law, understand a transistor as a switch, and have seen the four-switch H-bridge layout from the previous chapters. It explains what happens to a motor's current when you open a switch, and how a driver gives that current a safe place to go.
Why a motor resists changes in current
A brushed DC motor contains wire windings. A winding is an inductor, which means it stores energy in a magnetic field while current flows. The stored energy is E = ½ × L × I², where L is the inductance in henries and I is the current in amperes.
An inductor opposes any change in its current. The relationship is:
V = L × (dI/dt)
Here dI/dt is how fast the current changes. When a switch opens, the current path is broken and dI/dt becomes very large and negative. The inductor does not let the current stop instantly. Instead it produces whatever voltage it needs to keep the current flowing. This voltage is called inductive kickback, or a flyback spike. Its polarity is the opposite of the voltage that was driving the current.
A rough example: a small motor with 2 mH of winding inductance carries 1 A. The stored energy is 0.5 × 0.002 × 1² = 1 mJ. That is small, but if the switch opens in 1 µs and nothing gives the current a path, the winding tries to produce 2 mH × 1 A / 1 µs = 2000 V. The voltage keeps rising until something conducts: an arc across the switch contacts, or a transistor breaking down.
The motor also has a second effect that matters here. A spinning rotor is a generator. After you cut power, the spinning rotor keeps producing back-EMF, so the motor can push current back into the circuit for a while. The chapter on motor basics covered back-EMF while the motor is driven. Here the point is that it can also act as a source when the drive stops.
What kickback does to a driver
Switching a transistor off while the winding carries current produces a voltage spike at the transistor's output terminal. The spike can exceed the transistor's maximum rating. The failure modes are:
- Avalanche or breakdown of the transistor junction, which can destroy it immediately.
- Repeated smaller overvoltage stress, which shortens the part's life.
- A spike that couples into the supply rails and resets the microcontroller.
- Electrical noise that disturbs sensors and radio modules nearby.
The fix is to provide a path with a low voltage drop for the current to continue flowing until the stored energy is spent. That path is the flyback path.
The flyback path in an H-bridge
An H-bridge has four switches. Each switch is a transistor, and each transistor needs a diode connected across it, with the diode pointing from the motor terminal toward the supply (for the high-side switches) or from ground toward the motor terminal (for the low-side switches). These diodes are called flyback diodes, freewheeling diodes, or clamp diodes.
In a MOSFET, the silicon structure already contains a parasitic diode between source and drain. It is called the body diode. Most MOSFET H-bridges rely on body diodes, sometimes with an external Schottky diode added in parallel because the body diode is slow or has a higher forward voltage.
Consider the bridge driving the motor forward: the top-left (A high) and bottom-right (B low) switches are closed. Current flows from the supply, through A high, through the motor, and through B low to ground.
Now open both switches at once. The motor current cannot stop. The inductance drives the motor's A terminal below ground and its B terminal above the supply. Two diodes become forward biased:
- The diode across the low-side switch on the A side, which pulls A up to about one diode drop below ground.
- The diode across the high-side switch on the B side, which clamps B to about one diode drop above the supply.
The current continues in the same direction through the motor, but now it flows from ground, through the A-side low diode, through the motor, and through the B-side high diode back into the supply. The motor's stored energy returns to the supply rail and dissipates in the motor resistance, the diodes, and the supply's capacitance. The current decays over a time set by the inductance and the voltage across the winding.
The voltage across the transistors in this state is limited to the supply voltage plus one diode drop. This is the whole purpose of the flyback path: the spike is clamped to a level the transistors can survive.
Why the supply must absorb the returned energy
In the flyback state the current flows into the supply rail. A battery can accept this current. A bench power supply or a simple regulated adapter often cannot sink current, so the rail voltage rises. A small decoupling capacitor on the motor supply helps, because it absorbs the returned charge, but a large kickback into a lightly loaded supply can still push the rail above the driver's maximum voltage.
This is common when a motor is spinning fast and the driver is switched to coast. The rail rises by a few volts, and drivers with a tight margin between operating voltage and absolute maximum can fail. The practical rules are:
- Put a bulk electrolytic capacitor across the motor supply near the driver. A starting value is 100 µF to 470 µF, rated at least twice the supply voltage.
- Add a 100 nF ceramic capacitor close to the driver's supply pins for high-frequency spikes.
- Leave margin between the supply voltage and the driver's maximum rating.
- Do not disconnect a battery while the motor runs, because the rail loses its energy sink.
Diodes on your driver: what is already there
Whether you must add diodes depends on the driver.
| Driver type | Built-in flyback protection | What to do |
|---|---|---|
| L293D | Internal clamp diodes | Nothing extra for small motors |
| L293 (no D) | None | Add four external diodes |
| L298N | None internal | Add four fast diodes, such as 1N4007 for slow use or Schottky for PWM. Most modules include them |
| MOSFET driver IC | Body diodes | Check the datasheet. Add Schottky diodes if the current is high |
| Discrete MOSFET bridge | Body diodes | Consider external Schottky diodes in parallel |
On a module board, look for four diodes near the output terminals. If you buy a bare L298 chip you must add them yourself. Diodes should be fast, since the clamp must turn on within nanoseconds. A Schottky diode has a lower forward drop of 0.3 V to 0.5 V and no reverse recovery delay. The 1N4007 is rated for mains frequency and recovers slowly, so at PWM frequencies of several kilohertz it heats and can pass shoot-through-like current during recovery. Prefer 1N5819 or similar Schottky parts, rated above the motor's stall current.
Sizing the diode
The diode must carry the motor's full running current at the moment of switching. Use the stall current of the motor as the upper bound. With PWM, the diode conducts during every off period, so its average power is:
P ≈ V_f × I × (1 − duty)
For a 1 A motor, a 0.4 V Schottky drop, and 50 percent duty, the diode dissipates about 0.2 W. A 1N4007 at 1 V forward drop would dissipate 0.5 W in the same situation. Choose a package that can dissipate that without a heat sink.
Kickback in PWM operation
When you control speed with PWM, the switches open and close thousands of times per second, and every opening creates a flyback event. The flyback path is therefore active during the off part of every cycle. The diodes are not an emergency device; they carry current for a large share of the operating time. This is why their forward voltage and speed affect efficiency and heat.
It also explains why the choice of which switch to turn off matters, which is the subject of the next chapter on brake, coast, and decay modes. Opening both switches sends the current through the diodes back to the supply. Opening only one and leaving the other closed lets the current recirculate through the motor and a single switch with a smaller voltage drop.
Common mistakes
- Using a bare L298 or L293 chip with no external diodes. The chip may work briefly and then fail.
- Using slow rectifier diodes in a PWM circuit.
- Using diodes rated below the motor's stall current.
- Omitting the bulk capacitor, so spikes reset the Arduino.
- Powering the motor from a supply that cannot sink current and has no capacitor.
- Placing the capacitor far from the driver on long wires. Wire inductance cancels the benefit.
Summary of the key ideas
- A motor winding stores energy and keeps current flowing when a switch opens.
- Without a path, the voltage across the opening switch rises until something breaks down.
- Diodes across each switch provide the path, clamping the voltage to the supply plus a diode drop.
- The returned energy goes into the supply, so the supply and capacitors must be able to absorb it.
- Use fast diodes, Schottky where possible, rated for the motor's stall current.
Exercise
A motor with 5 mH winding inductance carries 2 A and runs from a 12 V supply. (a) How much energy is stored in the winding? (b) The driver opens both active switches, and the clamp diodes have a forward drop of 0.5 V. What is the largest voltage that appears across an open transistor? (c) Why is a 1N4007 a poor choice for this diode at 20 kHz PWM?
Show answer
(a) E = ½ × L × I² = 0.5 × 0.005 × 4 = 0.01 J, which is 10 mJ. (b) The diode on the opposite side clamps the terminal to the supply plus one diode drop, so the transistor sees about 12 V + 0.5 V = 12.5 V. (c) The 1N4007 is a slow rectifier diode with a large forward drop and a long reverse recovery time. At 20 kHz it spends significant time recovering, wastes power as heat, and can conduct a brief reverse current that stresses the switches. A Schottky diode such as the 1N5819 has a lower drop and no meaningful recovery delay.