Hello
I am currently designing a closed-loop Grid-Forming (GFM) inverter in islanded mode using an HIL RT Box, where the plant is modeled on the RT Box and the closed-loop controller is implemented on an STM32G474RE. The closed-loop controller consists of a voltage control loop and a current control loop. The voltage control loop regulates the voltage at the PCC bus according to the desired reference voltage, which then generates a current reference used by the current controller to regulate the current injected into the PCC bus. However, in this model, I have not implemented a power synchronization control (PSC) such as droop control or a virtual synchronous generator (VSG). Instead, I simplified the model by removing the PSC and directly setting Vd_ref and θ (theta). The offline simulation results shown in Fig. 3 indicate that the PCC bus voltage can be properly regulated using the proposed closed-loop controller. In addition, I performed an HIL-to-HIL simulation, the results of the HIL-to-HIL simulation are shown in Fig. 4. However, when I implemented the controller on the STM32G474RE connected to the RT Box, the results became unusual compared to the offline and HIL-to-HIL simulations.
What could be the possible reasons for this discrepancy? Should I make adjustments to my closed-loop controller implementation, for example by applying a multitasking strategy or modifying the discretization step size configuration on the STM32?
Fig 1. Plant
Fig 2. Controller
Fig 3. Offline Simulation Result Fig 4. HIL2HIL Simulation Result
Fig 5. RT Box and STM32 Result:
Here model that i am using for RT Box-STM32 :
Closed_Loop_GFM.plecs (224.0 KB)




