I am new to the simcode generation of the PSIM. To start with, I have taken a simple example of Dual Active Bridge (DAB) converter.
It has 8 switches (4 switches in each bridge) as shown in the attached PSIM file.
I am simply using a square wave generator and giving a dead band in the top and bottom switches with the help of an AND circuit.
The above square wave generator is sampled using a ZOH block and then given to the Digital Output
Everything is working fine in the simulation, but when I am generating the code I am getting a continuous high (always 1) on the output pins of GPIO.
Note: The code is successfully burnt on DSP using cc studio.
Kindly see the model and let me know what mistakes I am doing and how to get a PWM at the GPIO pins of DSP using the above control logic..?
I think the main issue with your simulation is that you have asked for an interrupt routine to run at 1MHz please try with slower frequencies to start ~10KHz. The TI MCUs likely cannot handle such a fast interrupt, please check with TI what the limits are.
that being said you have made life much more complicated for yourself. Please use the phase shift pwm elements, they are designed specifically for this application. An example simulation is attached, for more examples check examples\simcoder
Many thanks for the reply.
Yes, you are correct as 1 MHz signal was too much for the MCU. I tried with 100kHz and now getting the PWM signals on the GPIO pins. Thanks for your suggestions.
The reason that I am not using PWM blocks of PSIM (Shared by you in the example) is that I am using my own logic for generation of the signal (or you can say that I may be using hysteresis control).
As I can see in the PWM block, the carrier signal can be either triangle or sawtooth, whereas in my simulation I don’t require carrier signal as I am comparing the current in the hysteresis loop for generation of signal.