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

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

 Réponse acceptée

Benjamin Hoepfner
Benjamin Hoepfner le 27 Mar 2023
Modifié(e) : Benjamin Hoepfner le 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 commentaires

tcagdas
tcagdas le 27 Mar 2023
Modifié(e) : tcagdas le 27 Mar 2023
hi, how can you set an input port for TZSEL. can you share an example? I want to disable epwm modules after a certain of time.
First of all - you could be a bit more gratefull to my comment by saying thank you or smth like that.
As i wrote, you can use a boolean number (0 or 1) to switch on or switch off the working of the ePWM. How to create this input is your task.
Either you create a boolean constant which you can set to zero or one and which you can manipulate in the "tuning mode" of simulink or you can build some kind of counter which counts up to a specific level and this level can be compared with a "compare to constant" block how's output is a boolean number.
With the latter method you have a continous switching of the epwm.
Besides this two fast options there are hundrets of methods, like using communication port, using a GPIO as an input switch or using if and else conditions. I will not share an example with you.
I apologize for the confusion in my language. I wrote in this way because I was excited that someone finally got back to me regarding an issue that I have been trying to reach out for weeks. Sorry for any inconvenience.
Hi, Thank you for the suggestion, but the value of 1 I entered for the TZSEL input does not activate the trip zone. Am I doing something wrong because I entered the value directly as 1
This works verry well.
tcagdas
tcagdas le 28 Mar 2023
Modifié(e) : tcagdas le 28 Mar 2023
I really appreciate your quick response and patience. Thank you for taking your time also. However, even though I am trying to set up the same things, the system is not responding and I can't figure out why. Is there a place in the model settings where I need to set the trip zone? I have shared all the epwm and trip zone activation blocks in the pictures. I really don't understand where I went wrong. I hope you can help me. Thank you in advance.
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 le 29 Mar 2023
Modifié(e) : tcagdas le 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by