In situations where you want to drive current through a load in 2 directions, f.e. to control
a DC motor
a bipolar stepper motor
a bidirectional actuator
the polarity of the voltage over the load terminals has to be reversed.
In the figure below, 3 methods are shown to accomplish this:
In figure 1, a half bridge is shown, that uses a symmetrical power supply. The grounded load is connected either to the positive rail or to the negative rail by either switch1 or switch2.
Disadvantage is the fact that you need a symmetrical power supply.
In figure 2, a half bridge is shown, that uses an asymmetrical power supply in combination with 2 electrolytic capacitors.
This configuration can only be used when the switches are opened and closed shorter than the time-constant formed by the load and the capacitor and when the time that switch1 is closed is equal to the time that switch2 is closed. Only then, the voltage at the node that connects both capacitors will be at Vdc/2.
Disadvantage is the fact that the voltage over the load is half the power supply voltage.
In figure 3, a full H-bridge is shown that allows to switch the polarity of the voltage over the load using 4 switches and an asymmetrical power supply.
Below is shown how the switches in a H-bridge are set to control the direction of f.e. a DC motor or to brake by short-circuiting the motor terminals via the positive rail or via ground :
Below is shown how the 4 H-bridge switches can be controlled using 2 inputs, A and B :
In the left figure above, the top and bottom switches at each side of the H-bridge are paired using an inverter. The inverter causes the top and bottom switch to have opposite states.
In this configuration, it is important that the inverter is fast enough, so there is no overlap in the switching of switch1 and switch2. When there is any overlap, so that switch1 and switch2 are temporarily switched on simultaneous, this will cause a short circuit between the positive rail and ground, called "shoot-through". So care should be taken in the design of the H-bridge to avoid any shoot-through/overlap.
When using transistors as switches in the H-bridge, care should be taken to the fact that transistors, while driven into saturation, need more time to switch off than to switch on. This can easily cause overlap/shoot-through issues.
Especially when using PWM (f.e. with a frequency of 40KHz) on the inputs to control the speed of the motor, this "shoot-through"issue will become problematic, because the current-spikes will increase the power dissipation in the H-bridge and drive it hot.
In the right figure above, the shoot-through issues are eliminated by cross-coupling the switches in the H-bridge, so that switch1 and switch4 or switch2 and switch3 are switched simultaneous,
If you don't need the braking possibility and only need a forward or backward mode, you can put an inverter between input A and input B and use only input A to control the direction of the motor.