## 2 Two-Bidirectional Buck-Boost Converter for Capacitor Voltage Balancing
### Operation of the Buck-Boost Converter in Different Modes  
In Figure 3, the circuit configuration of a two-bidirectional buck-boost converter proposed for capacitor voltage balancing in a five-level switch-sharing-based multilevel inverter is presented [24]. In general, the buck-boost converter circuit is the simplest topology, which requires four power switches (S\({}_{1}\), S\({}_{2}\), S\({}_{3}\) and S\({}_{4}\)), and two inductors (L\({}_{1}\) and L\({}_{2}\)) for connection to four DC-link capacitors (C\({}_{1}\), C\({}_{2}\), C\({}_{3}\) and C\({}_{4}\)).  
Figure 3: Different operating modes of the buck-boost converter. (**a**) Mode 1: (S\({}_{2}\) and S\({}_{3}\) ON, S\({}_{1}\) and S\({}_{4}\) OFF); (**b**) Mode 2: (S\({}_{1}\) and S\({}_{4}\) ON, S\({}_{2}\) and S\({}_{3}\) OFF); (**c**) Mode 3: (S\({}_{2}\) and S\({}_{4}\) ON, S\({}_{1}\) and S\({}_{3}\) OFF) and (**d**) Mode 4: (S\({}_{1}\) and S\({}_{3}\) ON, S\({}_{2}\) and S\({}_{4}\) OFF).  
The circuit operates by transferring energy between the capacitors through the switches, inductors and diodes. In this work, the buck-boost converter circuit is divided into two separate parts which are the upper and the lower parts. The power switches in each part are switched ON or OFF in a complementary manner. This is to avoid a short circuit if all switches S\({}_{1}\), S\({}_{2}\), S\({}_{3}\) and S\({}_{4}\) are turned ON simultaneously. In the upper part of the circuit, S\({}_{1}\) and S\({}_{2}\) are complementary switches to allow energy transfer between capacitors C\({}_{1}\) and C\({}_{2}\) through diodes D\({}_{1}\) and D\({}_{2}\) and inductor L\({}_{1}\). In the lower part of the circuit, S\({}_{3}\) and S\({}_{4}\) are also complementary switches. They are used to control the energy transfer between capacitors C\({}_{3}\) and C\({}_{4}\) through inductor L\({}_{2}\) and diodes D\({}_{3}\) and D\({}_{4}\).  
Figure 3 also presents different operating modes of the converter for charging and discharging the capacitors in both parts of the circuit. The paths of the current flow in all modes are shown in the figure. A controller controls switches S\({}_{1}\), S\({}_{2}\), S\({}_{3}\), and S\({}_{4}\) accordingly so that four capacitor voltages can be equally balanced. Figure 3a shows that S\({}_{2}\) is turned ON to allow the charging of capacitor C\({}_{1}\) and the discharging of capacitor C\({}_{2}\) while S\({}_{1}\) is turned OFF. In the lower part of the circuit, S\({}_{3}\) is turned ON and S\({}_{4}\) is turned OFF so that capacitor C\({}_{4}\) is charging while capacitor C\({}_{3}\) is discharging.  
As S\({}_{2}\) and S\({}_{3}\) are ON during mode 1, they will be OFF during mode 2. Capacitors C\({}_{2}\) and C\({}_{3}\) are starting to charge, while capacitors C\({}_{1}\) and C\({}_{4}\) automatically start to discharge. For mode 3, S\({}_{2}\) and S\({}_{4}\) are turned ON to allow the charging of capacitors C\({}_{1}\) and C\({}_{3}\), and S\({}_{1}\) and S\({}_{3}\) are turned OFF as they are complementary to S\({}_{2}\) and S\({}_{4}\). As a result, capacitor C\({}_{2}\) and C\({}_{4}\) are discharged. During mode 4, capacitors C\({}_{2}\) and C\({}_{4}\) will start charging when S\({}_{1}\) and S\({}_{3}\) are turned ON. Opposite to that, S\({}_{2}\) and S\({}_{4}\) are turned OFF to allow capacitors C\({}_{3}\) and C\({}_{1}\) to discharge. The processes of charging and discharging continue until the capacitors are fully charged and all the capacitor voltages are at their reference values.