This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: Set trip zone CBC action on EPWM on different event

Part Number: TMS320F28377D

Hello all,

In my application, I have EPWM1A and EPWM1B working with complementary configuration. I also monitor one analog input signal. Once it is higher the upper threshold, force EPWM1A low and force EPWM1B high; Once it is lower than the lower threshold, force EPWM1A high and force EPWM1B low. Both EPWMs shall be working in CBC mode.

Right now, I can use digital compare sub-module to give me DCAEVT2 and DCBEVT2 (I can only use EVT2 because only EVT2 can work with CBC). DCAEVT2 can be configured as trip zone CBC source and trip zone action can be set as "force EPWM low" or "force EPWM high". I can do the same thing for DCBEVT2.

The only problem with this approach is that I can not set trip zone on EPWM on different events.

For example, I can set DCAEVT2 when exceeding upper threshold and set DCABEVT2 when exceeding upper threshold. Then configure TZA = force EPWM low and configure TZB = force EPWM high. By doing this, only half of what I want is done.

Can someone help me on this? (Also, TZCTL2 doesn't work for my case because EPWM is working as counting up and down mode).

Thank you!

  • Hi Fei,

    Are the outputs of your PWM changing ONLY based on the analog input? Or are you using CMPA/CMPB events to set the PWM, and want to override those settings based on the analog events?

    With the DC/TZ modules we can accomplish an event on the upper and lower analog events, but the difficulty is that you want the PWM channels in different states on each events. If you wanted Channel A and Channel B in the same states on an upper and lower event, we could that with the DC/TZ subdmodules.

    If you don't really need a CBC event and just need the output of the PWM channel to change, we may be able to accomplish this with the T1/T2 events in the AQ submodule. Take a look at the AQTSRCSEL register and see if this may be an option for your application.

    Regards,
    Kris
  • Hi Kris,

    First of all, my EPWM are set by CMPA and CMPB events and I want to override those setting based on analog events.

    Here is what I think might be a solution (keep both CBC feature and TZ by different events). Please take a look at it.

    In DC module, do the following setting:
    DCAH active high: analog input exceeds upper limit
    DCAL active high: analog input exceeds lower limit
    DCBH active high: analog input exceeds lower limit
    DCBL active high: analog input exceeds upper limit

    In TZDCSEL, do the following setting:
    DCAEVT1: DCAH = high, DCAL = don't care
    DCAEVT2: DCAL = high, DCAH = don't care
    DCBEVT1: DCBH = high, DCBL = don't care
    DCBEVT2: DCBL = high, DCBH = don't care

    In TZCTL, do the following setting:
    DCAEVT1: force 1A output low
    DCAEVT2: force 1A output high
    DCBEVT1: force 1B output low
    DCBEVT2: force 1B output high

    In TZSEL, do the following setting:
    DCAEVT2: source for CBC
    DCBEVT2: source for CBC

    In TZCTL, disable TZA and TZB forcing (force EPWM1A and 1B do noting)

    Thank you

    Fei