How diodes protect H-bridge DC motor driver?

The diodes in this application are not there to block current, but to allow a low-impedance path for the coils to discharge themselves through. If such a path is not provided, then when the coil's supply is stopped at each cycle, the stored magnetic energy must find a path for discharge. This results in the coil expressing an arbitrarily high reverse voltage across its ends till the energy finds a way to get out.

Result: This high voltage shows up across the MOSFETs, which die a miserable death.

The diodes thus provide a short-circuit discharge path, dissipating this energy as heat within the diode.

The capacitor's function is to act as a local energy store, to provide some of the energy required by the motor during the initial spike of each turn-on, and storing back some of the energy that kicks back onto the power rail at each turn-off. Without the capacitor, the current spikes at each edge would completely need to be served by the supply rail. As any supply connection will have some resistance, these current spikes thus result in voltage dips on the supply rail.

In simple terms, the capacitor smooths out the spikes due to temporary power demand and temporary power surplus, as the coils are energized and de-energized.


To supplement Anindo's fine answer, specifically, the voltage across the inductor (i.e., in this case the motor) is $$ L \frac{di}{dt} $$

Thus, when current is cut off suddenly (exactly what an h-bridge wants to do, especially when controlled as a PWM), \$\frac{di}{dt}\$ gets extremely large and there is an associated very large spike in voltage. The diodes protect the MOSFETs from these spikes.


The capacitor is there to absorb noise coming from the motor, which otherwise would mess with your power supply. 100nF is a very low value, however. Depending on the motor's power I would use 10uF to 100uF, but also leave the 100nF in.