PMSM control issue

Dear all,
I am making the simulation model for PMSM control using PLECS in Simulink.
When I am running a simulation I have a issue.
The id and iq current can not be controlled with weird behavior.
And I found a thing which is from the Triangular Wave block.
It is okay with single operation however, when I added it in the whole system, it look weird as you can see the ficture.
It should operates from -200 to 200 but it operated -6*1e8.
If you have any idea about it, please let me know.

IPMSM_MODEL_250226_Torque_control.slx (87.6 KB)
IPMSMParmeterSelection.m (562 Bytes)

The main driver for the odd behavior from the triangular wave generator is that you have disabled zero crossing detection in the Simulink solver settings and the related warning in PLECS that raises an error if you do this. See the relevant excerpt from the PLECS Manual below.

If you enable zero crossing detection in the Simulink solver settings then you get an excessive zero crossing warning error. In your model if I set tdead=0 then the simulation proceeds. This will allow you to work through the underlying control issues that I believe are not resolved.

I’ll also note that the Delay blocks in your current controller have a sample time of 1 which is probably not what you intend.