Hello
I am currently developing a Grid-Forming (GFM) inverter that will be implemented in a Hardware-in-the-Loop (HIL) environment. The HIL platform consists of an RT Box and a TI microcontroller. The plant model is executed on the RT Box, while the control algorithm is implemented on the TI microcontroller. The plant model consists of an average-model VSI (Voltage Source Inverter) with an LC filter connected to the grid through a grid impedance. The control system consists of a Virtual Synchronous Generator (VSG) controller, virtual impedance, voltage control, and current control loops. The modulation signals generated by the controller are transmitted from the TI microcontroller to the plant model via SPI communication. This approach is used due to the limited number of DAC channels available on the TI microcontroller. The inverter parameters (Kp, Ki, Rf, Lf, etc) are taken from a published journal reference. During offline simulation, the GFM model operates as expected. The inverter output power is able to track the reference power accurately, and the generated Uref signal is stable and behaves as expected.
Issue:
However, when the model is implemented in the HIL environment, the system becomes unstable. As shown in the attached file, there is video that the Uref signal exhibits unstable behavior. Initially, the Uref waveform follows the transient response observed in the offline simulation. However, after some time, the signal becomes unstable, then returns to its initial condition, and this behavior repeats periodically.
What could be the possible causes of this instability when the model is implemented in the HIL setup? Are there any specific aspects of the controller implementation, SPI communication, sampling rates, execution timing, or real-time constraints that I should investigate further?
Here I attached the plecs blockset model included with .m files simulations parameters below.
RT Box 2-TI F280049C configuration hardware:
Parameter_Average_GFM.m (4.7 KB) (PLECS version 5.0.2)
Average_Model_SPI.slx (111.4 KB) (MATLAB version 2024b)
