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: Tripping PWMxA and PWMxB signals when using active high complimentary mode

Part Number: TMS320F28377D

Hello!

I am programming the digital compare sub-module of my DSP and want to trip both the PWMA and PWMB signals according to some CMPSS signals I have generated.

Is it important to program both the DCAHTRIPSEL and DCBHTRIPSEL registers, or can you assume that, if using AHC mode, that when PWMA is tripped, PWMB will be tripped as well automatically?

Is it good practice to trip PWMA and PWMB even in AHC mode just to be safe? Will the dead-band submodule always ensure no cross-over exists when PWMA and PWMB trip/recover?

Regards,
Joel

  • Is it the case that DCAH is only for tripping the PWMA output, whereas DCBH is for tripping the PWMB output, and one would use a one-shot if they wish to trip both at the same time? What is the best way to do the following:

    Have cycle-by-cycle current limiting on two CMPSS signals, and a one-shot limiting action for a third CMPSS signal? 

  • Hi Joel,

    Have cycle-by-cycle current limiting on two CMPSS signals, and a one-shot limiting action for a third CMPSS signal? 

    There are four possible digital compare output events that can cause a trip: DCAEVT1/2 and  DCBEVT1/2. These are generated based on a combination of the DCAH/DCAL and DCBH/DCBL signals as selected by the TZDCSEL register. You can have the analog comparator CMPSSx signals source the DCAH/DCAL and DCBH/DCBL signals (selected via the DCTRIPSEL register).

    Only DCAEVT2/DCBEVT2 can cause a cycle by cycle trip, and DCAEVT1/DCBEVT1 can cause a one-shot event. Therefore, you can configure your DCAH/DCAL and DCBH/DCBL signals based on the CMPSSx signals you desire and then utilize the corresponding CBC and OST events.

    Is it the case that DCAH is only for tripping the PWMA output, whereas DCBH is for tripping the PWMB output

    DCAEVT1/2 comes from DCAH/DCAL signals. DCBEVT1/2 comes from DCBH/DCBL signals. However, if you take a look at the Trip-Zone Submodule Mode Control Logic figure within the TRM you will notice that the CBC and OST signal is ORed and fed into both EPWMxA and EPWMxB. 

    Is it good practice to trip PWMA and PWMB even in AHC mode just to be safe? Will the dead-band submodule always ensure no cross-over exists when PWMA and PWMB trip/recover?

    Yes, it is good practice to still define the trip output state of EPWMxA and EPWMxB even if AHC mode is used. When the trip is cleared then the EPWMxA/B outputs will go back to their normal states.

    Best Regards,

    Marlyn

  • Thank you very much Marlyn for this very helpful response.

  • Just to clarify;

    Although DCAEVT1/2 comes from DCAH/DCAL signals. DCBEVT1/2 comes from DCBH/DCBL signals, because they are ORed together and sent to both the A and B outputs of the PWM module, both the DCBEVT1/2 and DCAEVT1/2 signals act on both the outputs of the PWM module?

    If we trip decide to trip both A and B outputs of the PWM module according to any combination of digital compare trip signal, again what is the point in defining trips for both A and B outputs? It would make sense to just have any error signals trip PWMA, since those signals also trip PWMB anyway, unless I am mistaken. 

  • Can you confirm that the code below is correct, to trigger both PWMxA and PWMxB according to the trip signals? 

    EALLOW;

    // Digital Compare (DC) Submodule
    // Generate DCAH signal from Trip Combination Input
    EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 15; // OR together all Trip combinations selected by DCALTRIPSEL Registers -> DCAH
    EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 15; // OR together all Trip combinations selected by DCALTRIPSEL Registers -> DCBH

    // DCAH/DCAEVT1/2 are used for one-shot trip faults
    // DCBH/DCBEVT1/2 are used for cycle-by-cycle faults
    // Individually select which trip signals are passed into the block to be ORed together
    EPwm1Regs.DCAHTRIPSEL.bit.TRIPINPUT5 = 1; // Input Over Voltage Trip One-Shot Fault
    EPwm1Regs.DCAHTRIPSEL.bit.TRIPINPUT7 = 1; // Output Voltage 1 Over Voltage Trip One-Shot Fault
    EPwm1Regs.DCBHTRIPSEL.bit.TRIPINPUT4 = 1; //  Over Current Trip Cycle-by-Cycle Fault

    // Event A Action Qualifier block
    // Generate DCAEVT1/DCBEVT1 trip events according to DCAH and DCBH
    // Only EVT1 can be used for OST, and EVT2 for CBC
    // Need to enable both A and B of these registers to trigger both the PWMx outputs
    EPwm1Regs.TZDCSEL.bit.DCAEVT1 = 2; // DCAEVT1: DCAH = high, DCAL = don't care
    EPwm1Regs.TZDCSEL.bit.DCAEVT2 = 2; // DCAEVT2: DCAH = high, DCAL = don't care
    EPwm1Regs.TZDCSEL.bit.DCBEVT1 = 2; // DCBEVT1: DCBH = high, DCBL = don't care
    EPwm1Regs.TZDCSEL.bit.DCBEVT2 = 2; // DCBEVT2: DCBH = high, DCBL = don't care

    // Event Triggering block - Generate DCAEVT1.force and DCBEVT1.force signals (One Shot Source)
    EPwm1Regs.DCACTL.bit.EVT1SRCSEL = 0; // Select DCAEVT1 as input signal
    EPwm1Regs.DCACTL.bit.EVT1FRCSYNCSEL = 1; // Select Asynchronous
    EPwm1Regs.TZFRC.bit.DCAEVT1 = 0; // Enable DCAEVT1.force output signal
    EPwm1Regs.DCBCTL.bit.EVT1SRCSEL = 0; // Select DCBEVT1 as input signal
    EPwm1Regs.DCBCTL.bit.EVT1FRCSYNCSEL = 1; // Select Asynchronous
    EPwm1Regs.TZFRC.bit.DCBEVT1 = 0; // Enable DCBEVT1.force output signal

    // Event Triggering block - Generated DCAEVT2.force and DCBEVT2.force signals (Cycle-by-Cycle Source)
    EPwm1Regs.DCACTL.bit.EVT2SRCSEL = 0; // Select DCAEVT2 as input signal
    EPwm1Regs.DCACTL.bit.EVT2FRCSYNCSEL = 1; // Select Asynchronous
    EPwm1Regs.TZFRC.bit.DCAEVT2 = 0; // Enable DCAEVT2.force output signal
    EPwm1Regs.DCBCTL.bit.EVT2SRCSEL = 0; // Select DCBEVT2 as input signal
    EPwm1Regs.DCBCTL.bit.EVT2FRCSYNCSEL = 1; // Select Asynchronous
    EPwm1Regs.TZFRC.bit.DCBEVT2 = 0; // Enable DCBEVT2.force output signal

    // Trip Zone Submodule - Trip Logic block
    // Using only TZCTL and EVT1
    EPwm1Regs.TZCTL2.bit.ETZE = 0; // Use only TZCTL register, disable TSCTL2

    EPwm1Regs.TZCTL.bit.DCAEVT1 = 0x10; // On trip, force EPWM1A to a LOW state
    EPwm1Regs.TZCTL.bit.DCBEVT1 = 0x10; // On trip, force EPWM1B to a LOW state
    EPwm1Regs.TZCTL.bit.DCAEVT2 = 0x10; // On trip, force EPWM1A to a LOW state
    EPwm1Regs.TZCTL.bit.DCBEVT2 = 0x10; // On trip, force EPWM1B to a LOW state
    EPwm1Regs.TZCTL.bit.TZA = 0x10; // On trip, force EPWM1A to a LOW state
    EPwm1Regs.TZCTL.bit.TZB = 0x10; // On trip, force EPWM1B to a LOW state

    // Trip-Zone Submodule - select OSHT and CBC sources
    EPwm1Regs.TZSEL.bit.DCAEVT1 = 1; // Enable DCAEVT1 as one-shot-trip source for this ePWM module
    EPwm1Regs.TZSEL.bit.DCBEVT1 = 1; // Enable DCBEVT1 as one-shot trip source for this ePWM module
    EPwm1Regs.TZSEL.bit.DCAEVT2 = 1; // Enable DCAEVT2 as a CBC trip source for this ePWM module
    EPwm1Regs.TZSEL.bit.DCBEVT2 = 1; // Enable DCBEVT2 as a CBC trip source for this ePWM module

  • Hi Joel,

    Can you confirm that the code below is correct, to trigger both PWMxA and PWMxB according to the trip signals?

    I don't see an errors in the code you have provided, have you tested it?

    Although DCAEVT1/2 comes from DCAH/DCAL signals. DCBEVT1/2 comes from DCBH/DCBL signals, because they are ORed together and sent to both the A and B outputs of the PWM module, both the DCBEVT1/2 and DCAEVT1/2 signals act on both the outputs of the PWM module?

    If we trip decide to trip both A and B outputs of the PWM module according to any combination of digital compare trip signal, again what is the point in defining trips for both A and B outputs? It would make sense to just have any error signals trip PWMA, since those signals also trip PWMB anyway, unless I am mistaken.

    Yes, since you would like to configure a one-shot and cycle-by-cycle event. 

    This is done for configuration purposes. Some applications require a different change in each of the outputs, and not all configurations have output B dependent on output A.

    Best Regards,

    Marlyn