According to output frequency, ON time and OFF time of MOSFET is decided and gate pulses are generated. We need 50Hz AC power, so the time period of one cycle (0 < t < 2π) is 20msec. As shown in the diagram, MOSFET-1 is triggered for first half cycle (0 < t < π) and during this time period MOSFET-2 is not triggered. In this time period, current will flow in the direction of arrow as shown in below figure and half cycle of AC output is completed. The current from the load is right to left and load voltage is equal to +Vdc/2.
In second half cycle (π < t < 2π), the MOSFET-2 is triggered and lower voltage source is connected with the load. The current from the load is left to right direction and load voltage is equal to -Vdc/2. In this time period, current will flow as shown in figure and the other half cycle of AC output is completed.
GADDALA JAYA RAJU (2020). Half Bridge Inverter withd THD CALCULATION (https://www.mathworks.com/matlabcentral/fileexchange/73379-half-bridge-inverter-withd-thd-calculation), MATLAB Central File Exchange. Retrieved .