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.

TMS320F280049C: TZ for PWMA or B

Part Number: TMS320F280049C

Tool/software:

Hello,

I am working on modifying one of the Totem Pole PFC EVMs. In order to prevent inductor current from going negative during the positive AC cycle and vice versa, I am attempting to stop the sync FET gate drive pulses when inductor current nears 0. I use CMPSS and the PWM DC submodule to trigger DCAEVT2. The TZ action is changed during the zero cross dead band to determine which switch is the sync FET.

The issue I am having is that I can only seem to disable both PWM outputs (PWM2A/PWM2B). My intention is to only disable PWM2A during the positive half cycle, and PWM2B during the negative half cycle. I am using the default PWM setup from the TTPLPFC code bases.

Thank you,

  • By using DCAEVT2.force/DCBEVT2.force directly, I was able to get closer to my expected behavior.

    DCAEVT2 is shutting off only EPWMxA and DVBEVT2 shuts off only EPWMxB. The problem is that the DCxEVTs are asynchronous and cannot provide CBC behavior. They instead restore the original PWM state as soon as DCxEVT is cleared. This causes brief, or rapid PWM pulses.

    Any time I enable a bit on the TZSEL register, the DCxEVTs go back to disabling both EPWMxA and EPWMxB, even when TZA and TZB are set to "do nothing"

    The TRM mentions many times that TZA can control EPWMxA and TZB can control EPWMxB. What am I missing?

  • Hi Stephen,

    Anytime you enable the TZSEL for either one shot or cbc using the DCA/BEVT1/2 path as input, this is an ORed signal path that goes directly to both outputs ePWMxA/B.

    If you would like totally independent control on each of the outputs such as DCAEVT1/2.force for ePWMxA or DCBEVT1/2.force for ePWMxB then do not use the TZSEL path via One-shot or CBC.

    Only configure for the TZCTL.DCA/BEVT1/2 events. You can configure TZCTL.TZA/B to do nothing.

    Another alternative is you can use the T1/T2 events from the Action Qualifier submodule for outputs A and B independently.

    Best regards,

    Ryan Ma

  • Ryan,

    Before switching to DCxEVTy, for the positive and negative cycles, I was swapping the TZA/TZB config such that one should force low, while the other is disabled. I swap between these during the deadtime around zero cross so nothing is switching during this time. 

    EPWM_setTripZoneAction(TTPLPFC_HIGH_FREQ_PWM1_BASE, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_DISABLE);
    EPWM_setTripZoneAction(TTPLPFC_HIGH_FREQ_PWM1_BASE, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_LOW);

    In this case, shouldn't EPWMA stay in whatever state it was and EPWMB go low?

    The TRM (Figure 18-42) only shows "EPWM Logic Block" for all of this trip logic, so it is fairly unclear.  

    Thank you

  • Hi Stephen,

    If you are switching these conditions. EPWMA should stay in whatever state it was in, unless the TZCLR was written to, to clear the one shot or cycle by cycle condition. You can read from the TZFLG register to see the status after swapping the TZA/B outputs.

    Best,

    Ryan Ma

  • Ryan,

    I think I have a working solution. I found this thread: TMS320F28379D: Trip Zone action priority questions - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

    Following Marlyn's suggestions there:

    I set up the PWM channel EPWMxSYNCPER output to go high when CTR=PRD.

    Changed CMPSS (which triggers the DCxEVTy) config to use the latched output and then used the EPWMxSYNCPER to clear the latch.

    Since I am using up-down count and the power switch on time is always centered around PRD, this has the effect of keeping the sync switch off until the next pulse. 

    Thank you

  • Hi Stephen,

    Glad you found a working solution!

    Will go ahead and mark this as resolved then.

    Best regards,

    Ryan Ma