AC/DC bidirectional battery charger/discharger Firmware/Hardware simulation


My project diagram is similar to this idea,

Lets  say input is 3p 380VAC, 60Hz, Main Transformer MTR runs at 20kHz, DC output should be 50-147 v, charging current 100A. Should have CC and CV mode of operation.

I need to implement FW with following facilities,

1. Shunt/ Temperature sensing 

2. 3v AC to 16 bit ADC having channel current and voltage 

3. CAN/SPI/SCI protocol 

4. PF correction, PI or PID control 

5. PWM for high frequency switching.

KIndly suggest any simulation model/ EVM board/tools to understand the system.