Based on my understanding, it seems that the issue you're encountering is that the ("Id") and ("Iq") are not following their reference values.
After reviewing the model you provided, I have reached the following conclusions:
- The voltage source inverter model appears to be good.
- The controllers are well designed.
- It seems the issue arises due to the use of “Goto” and “From” tags, which may be causing the signal to not properly transmit between blocks.
To address this, I have modified the sub-systems so that their “Goto” tag is positioned outside the block, as illustrated in the figure below. I have also shared the updated Simulink file with you (NOTE: I have saved the model in different simulink version. download the one according to the version you are using.).
Validating the Controller:
CASE-1: Change "Iqref" , keeping "Idref" = 0.
I applied a step increment to “Iqref” at various time intervals while maintaining “Idref = 0.” The results, shown below, indicate that the reference is being tracked accurately. ]
CASE 2: Change "Idref" by keeping "Iqref" = 10
Now, I set “Iqref = 10A” and incremented “Idref” in steps at different intervals. The results, also displayed below, confirm that the reference is tracked perfectly.
Further Steps:
You can now generate any “Idref” or “Iqref” by solving the Virtual Synchronous Machine model. The inverter's actual currents should track these references accurately.
I hope this information proves helpful !
NOTE: I have saved the model in different simulink version. download the one according to version you are using.