According to the guide of plecs documents, I try to transfer some code to plecs, but there are some questions confusing me for several days, so could you help me solve the questions, thank you
the matlab code and plecs simulation are as follows;
Firstly, this model uses the Transport Delay for a phase shifted modulator. This is not recommended. See the excerpt from the Transport Delay’s help below. The modulator by itself will not work (e.g. setting the input to the gain block to 0.001 results in an error). This must be resolved first. In additional to the Dual Active Bridge demo model, there’s some useful forum posts on PLECS: Using the C-Script Block tutorial? The discrete PI implementation referenced in the tutorial should give you a good starting place for your controller.
> “The modulator by itself will not work (e.g. setting the input to the gain block to 0.001 results in an error).” ?
Removing the C-Script and testing the model with just the modulator at a fixed duty cycle fails due shorting the output capacitor. This is because of the modulator implementation. See below. You should resolve this first before looking into the C-Script.
> I’m confused the that what’s the majorstep and minorstep?
The “Model Execution” section of the “How PLECS Works” section of the help describes major and minor time steps in detail. The C-Script documentation also provides this helpful guidance: "In general, output signals should be continuous and smooth during minor time steps; discontinuities or sharp bends should only occur during major time steps. Whether or not the call is made for a major time step can be inquired with the IsMajorStep macro. "