Hello, Today I try to do real time simulation with RT Box (Plant) for Grid connected inverter and STM32 (Controller) for Grid Forming Inverter Voltage, Current, and Power Control. When I build the model into HIL simulation there is an issue with step input value is not equal as I expected in offline simulation on 0 Watt. Please, help me to find the wrong aspect of my simulation. Is it happen that caused by wrong scale or offset?. Here I also attached my simulation topology.
Fig.1 Plant and controller topology
Fig. 2 Step input (P) on HIL simulation
Fig. 3 Step input on Offline simulation
You will need to post a model for further guidance. I’m not quite certain how your model will work since I can see an analog input into the (presumably) average inverter model, but the STM32 targets only have two external DACs. It’s unclear why you have added a delay.
I would recommend reviewing the From Offline to Real-Time RT Box Tutorial which covers how to modify models for the RT Box. Many of the lessons regarding controller implementation in that tutorial are applicable to the embedded targets. There also are embedded tutorials for the STM32 target covering modulation and sampling.
There also could be a whole host of underlying control issues. However, you can debug this extensively in regular PLECS simulations on your PC.