How to program an epwm interrupt in Simulink for a TI-F28379D Controller?

21 views (last 30 days)
Hi,
I would like to program a Controller and for that I need to interrupt or suppress the epwm generation. I use Simulink to program the Controller and I use the epwm blocks to define all specifications (pwm with A/B Mode - one output is switched on when the other is switched off and vice versa).
The aim is to switch switch off all epwm outups with a specified signal.
Thanks a lot. Benjamin

Accepted Answer

Benjamin Hoepfner
Benjamin Hoepfner on 27 Mar 2023
Edited: Benjamin Hoepfner on 27 Mar 2023
Hi, here the answer to my request and to the comment below:
It is solved and its verry simple but hard to find..
In the epwm setup you can find the tab Trip Zone unit .
In this Tab you can select Trip zone source: Input port
(or specify via dialog). In my case i need the input port selction. If you choose the input port, the epwm block apears with an additional port called "TZSEL".
Below you can set the epwm to what ever you want to do. In my case i set the
ePWM1A forced (TZ) to: Low
ePWM1B forced (TZ) to: High .
If i use a boolean number at the input TZSEL i can switch on or off the epwm firing with the settings above.
Maybe someone can explain what the other four setting parameters are ? [ ePWMx forced (DCxEVTy) ] ?
What is the difference between TZ and DCxEVTy ?
Best regards,
Benjamin
  8 Comments
Benjamin Hoepfner
Benjamin Hoepfner on 28 Mar 2023
The ePWM is firing in the desired way without the Trip Zone? If yes, these settings should be fine.
What is the sample time for the delay block? In your settings you have "-1" which means that the delay would follow the models sampling time.
If the shown model is not a part of an interrupted submodel, the delay adopt the sampling time of the constant which is set to "inf". This could be a reason for your problems.
Set the delay's sampling time to 0.01 for example. Try to unselect the OST value in the Trip Zone settings.
tcagdas
tcagdas on 29 Mar 2023
Edited: tcagdas on 29 Mar 2023
Thank you very much for the all suggestions. After changing delays sampling time, system still produced PWMs. The newly generated PWMs are different from the ones before I activated my trip zone. It is not performing any of the forced operations. When I run the system in the simulink, the output of the boolean block produces values for different sampling times as in the figure. Could the system still be generating PWM because it produces a continuous stream of 1s and 0s? Also, when I tried using 0 instead of a constant 1, I still saw the same PWM patterns. Even, if I choose the "no action" option, it still produces the same PWMs.
Best regards.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!