## 5 Simulation Results  
The simulation work was performed using MATLAB/SIMULINK in order to investigate the performance of the proposed and conventional PI controllers. A Y-connected RL load with R = 120 \(\rm\Omega\) and L = 69 mH was connected to the inverter. \(\rm V_{in}\) was fixed at 200 V; thus, the reference voltage was 50 V (i.e., \(\rm V_{in}/4\)), the inductors were set as \(\rm L_{1}=L_{2}=12\) mH, the capacitors were 2200 \(\rm\mu F\) each, the modulation index used was 0.9 and the switching frequency was 5 kHz. The conventional PI controller is designed to have a constant \(\rm K_{PU}\) and \(\rm K_{PL}\) of 2, and a constant \(\rm K_{IU}\) and \(\rm K_{IL}\) of 0.001. The proposed PI controller has varying \(\rm K_{PU}\) and \(\rm K_{PL}\) that is tuned using the online tuning algorithm, while \(\rm K_{IU}\) and \(\rm K_{IL}\) are kept at 0.001. Step responses were investigated as a result of a change in \(\rm V_{in}\). This is to verify the effectiveness of the online tuning mechanism. \(\rm V_{in}\) changes between 60 V and 200 V with a step response were set to occur at t = 0.03 s. The time duration for the simulation was 0.1 s. The simulation results are presented in Figures 8 and 9 for without and with tuning, respectively. It can be seen that all capacitor voltages are able to be balanced even after a change in \(\rm V_{in}\). The inverter's output shows satisfactory results as the line-to-line voltage, \(\rm V_{AB}\), is able to produce nine voltage levels in the waveform. The output phase voltage, \(\rm V_{AN}\), and output current, \(\rm I_{A}\), indicate good results as well. It is observed that the capacitor voltage ripples with the application of the online tuning mechanism is estimated at 2 V, whereas the capacitor voltage ripples without online tuning is around 4 V. In addition, after \(\rm V_{in}\) change, the output current THD is recorded to be lower when there is online tuning employed. The results show that only 3.09% THD when there is online tuning as compared to 3.42% for without online tuning. This verifies that the online tuning algorithm  
Figure 7: Online tuning mechanism for the lower part of buck-boost converter.  
contributes to the improvement made in the capacitor voltages ripples and the output current THD.  
Figure 8: Simulation results without online tuning for a step response with V\({}_{\text{in}}\) changes from 60 V to 200 V. (**a**) Capacitor voltages (V\({}_{1}\), V\({}_{2}\), V\({}_{3}\), V\({}_{4}\)) for step-up response. (**b**) Capacitor voltages (V\({}_{1}\), V\({}_{2}\), V\({}_{3}\), V\({}_{4}\)) for step-down response. (**c**) Line-to-line output voltage (V\({}_{\text{AB}}\)), phase voltage (V\({}_{\text{AN}}\)) and output current (I\({}_{\text{A}}\)). (**d**) Output current harmonics.  
Figure 9: Simulation results with online tuning for a step response with \(\mathrm{V_{in}}\) changes from 60 V to 200 V. **(a)** Capacitor voltages (\(\mathrm{V_{1}}\), \(\mathrm{V_{2}}\), \(\mathrm{V_{3}}\), \(\mathrm{V_{4}}\)) for step-up response. **(b)** Capacitor voltages (\(\mathrm{V_{1}}\), \(\mathrm{V_{2}}\), \(\mathrm{V_{3}}\), \(\mathrm{V_{4}}\)) for step-down response. **(c)** Line-to-line output voltage (\(\mathrm{V_{AB}}\)), phase voltage (\(\mathrm{V_{AN}}\)) and output current (\(\mathrm{I_{A}}\)). **(d)** Output current harmonic.