As shown in the following circuit: Each MOSFET has an internal MOSFET diode connected across their drain-source pins. The anode of the MOSFET diode is connected to the source, while the cathode pin is connected to the source pin of the device.
Because the MOSFETs are configured in a bridge network, the MOSFET diode are also configured in a basic full-bridge rectifier network format. With a few relays, fast switching is achieved to enable grid AC to charge the off grid solar batteries through the MOSFET diode.
In fact, the MOSFET diode with this bridge rectifier network structure, and the process of using a single transformer as the inverter transformer and charger transformer are relatively simple.
As shown in the figure, if START is positive, the orange arrow indicates the current mode in which the current passes through D1, battery, D3 and flows back to FINISH or the negative terminal of the transformer. On the next AC cycle, the polarity is reversed and the current flows as indicated by the blue arrow through body MOSFET diode D4, battery D2 and back to the FINISH or negative terminal of the transformer winding.
This repeats continuously, converting both AC cycles to DC and charging the battery, such as 12v battery. Because MOSFET diode is included in the system, extreme care must be taken when handling them to ensure that these devices are not damaged during the process.
I added a Triac/Microcontroller circuit to the High voltage side to control the charging current .