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.

TMS320F28377S: PCMC using CMPSS module for PSFB

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

Hi 

I referred this TI-02000 design document for generating peak current waveform for PSFB, 

The Purple waveform is the ramp signal to CMPINP and it is at twice the switching frequency, and based on DAC value, Trip events are generated.

In the first case i have used Only action qualifier T1U and T1D to generate actions SET/CLEAR. as mentioned in the reference document.

Yellow waveform is EPWM A register and Blue Waveform is EPWM B register

Observations: 1. Trip during upcount (T1U) on EPWM A  using action qualifier occurred,

                        but trip event actionT1D (down count) didn't happen and pwm was Cleared at Zero instead.

                       2. For EPWM B , T1U didn't occur and it was set at PRD and Cleared at T1D. 

In the second case I used Tripzone registers TZAD, TZAU, TZBU and TZBD to override the action qualifier events.

Here i Observed PWMs are SET/Reset based on the CMPSS trip inputs

My question is ::

why in action qualifier T1U and T1D are not generating actions as expected based on CMPSS trip events?

Any specific configuration need to be done so that trip actions occurs on both up and down counts?

NOTE: I have configured the AQTSRCSEL register to select the source for T1 as DCEAVT2.

  • ATTACHING SOURCE CODE for reference

    void initEPWM(void)
    {
    // // Disable EPWM11_INT
    //EPwm8Regs.ETSEL.bit.INTEN = PER_mDISABLE_INT;
    EPwm8Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
    EPwm8Regs.TBCTL.bit.CLKDIV = TB_DIV1;
    EPwm8Regs.TBCTL.bit.PRDLD = TB_SHADOW;
    EPwm8Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Enable phase loading
    EPwm8Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN;
    EPwm8Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;


    EPwm8Regs.TBPHS.bit.TBPHS = 0x0000; 


    EPwm8Regs.TBCTR = 0x0000;


    EPwm8Regs.TBPRD = 1250;

    // Setup shadow register load on ZERO
    EPwm8Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW ;
    EPwm8Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
    EPwm8Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW ;
    EPwm8Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;


    // 1.667us Clock pulse width
    EPwm8Regs.CMPA.bit.CMPA = 0;
    EPwm8Regs.CMPB.bit.CMPB = 0;

    EPwm8Regs.AQTSRCSEL.bit.T1SEL = 1; 

    //ACTION FOR A REGISTERS
    EPwm8Regs.AQCTLA.bit.PRD = AQ_SET;
    EPwm8Regs.AQCTLA.bit.ZRO = AQ_CLEAR;
    EPwm8Regs.AQCTLA2.bit.T1U = AQ_SET;
    EPwm8Regs.AQCTLA2.bit.T1D = AQ_CLEAR;

    // Active low configuration
    EPwm8Regs.AQCTLB.bit.PRD = AQ_SET; 
    EPwm8Regs.AQCTLB.bit.ZRO = AQ_CLEAR;
    EPwm8Regs.AQCTLB2.bit.T1U = AQ_SET; 
    EPwm8Regs.AQCTLB2.bit.T1D = AQ_CLEAR; 


    //Configure DCB as CBC
    EPwm8Regs.TZSEL.bit.DCAEVT2 = 1;

    //Configure DCB to be TRIP4
    EPwm8Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCAH_HI;

    EPwm8Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 3;

    EPwm8Regs.DCAHTRIPSEL.bit.TRIPINPUT4 = 1;

    //Configure DCB path to be unfiltered & async
    EPwm8Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2;
    EPwm8Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC;


    // EPwm8Regs.DCFCTL.bit.BLANKE = 1;
    // EPwm8Regs.DCFCTL.bit.PULSESEL = 2;
    // EPwm8Regs.DCFCTL.bit.SRCSEL = 3;
    // EPwm8Regs.DCFOFFSET = 0;
    // EPwm8Regs.DCFWINDOW = 100;

    //Configure TRIP4 to be CTRIP1H
    EPwmXbarRegs.TRIP4MUX0TO15CFG.bit.MUX0 = 0;

    //Enable TRIP4 Mux for Output
    EPwmXbarRegs.TRIP4MUXENABLE.bit.MUX0 = 1;


    EPwm8Regs.TZCTL2.bit.ETZE = 1;
    //EPwm8Regs.TZCTL2.bit.TZBU = TZ_FORCE_HI;//for test 2
    // EPwm8Regs.TZCTL2.bit.TZBU = TZ_FORCE_HI;
    // EPwm8Regs.TZCTL2.bit.TZBD = TZ_FORCE_LO;
    // EPwm8Regs.TZCTL2.bit.TZAD = TZ_FORCE_LO;
    // EPwm8Regs.TZCTL2.bit.TZAU = TZ_FORCE_HI;

    //
    // CBC will clear at CTR=0 OR CTR = PRD
    //
    EPwm8Regs.TZCLR.bit.CBCPULSE = 2;
    //
    // Clear trip flags
    //
    EPwm8Regs.TZCLR.bit.CBC = 1;
    EPwm8Regs.TZCLR.bit.INT = 1;

    EPwm8Regs.TZCBCCLR.bit.DCAEVT2 = 1;

    //
    //Enable DCB interrupt
    //
    EPwm8Regs.TZEINT.bit.CBC = 1


    }

    void initCMPSS(void)
    {

    //
    // Enable CMPSS and configure the negative input signal to come from
    // the DAC
    //
    CMPSS_enableModule(CMPSS1_BASE);
    CMPSS_configHighComparator(CMPSS1_BASE, CMPSS_INSRC_DAC);

    //
    // Use VDDA as the reference for the DAC and set DAC value to midpoint for
    // arbitrary reference.
    //
    CMPSS_configDAC(CMPSS1_BASE, CMPSS_DACREF_VDDA | CMPSS_DACVAL_SYSCLK |
    CMPSS_DACSRC_SHDW);
    CMPSS_setDACValueHigh(CMPSS1_BASE, 1000);

    //
    // Configure the output signals. Both CTRIPH and CTRIPOUTH will be fed by
    // the asynchronous comparator output.
    //
    CMPSS_configOutputsHigh(CMPSS1_BASE, CMPSS_TRIP_ASYNC_COMP |
    CMPSS_TRIPOUT_ASYNC_COMP);
    //CMPSS_configOutputsHigh(CMPSS1_BASE, CMPSS_TRIP_SYNC_COMP |
    // CMPSS_TRIPOUT_SYNC_COMP);

    }

  • Hi,

    I will try to get back to you about this tomorrow.

    Best Regards,

    Ben Collier

  • Hi Benjamin,

    Thankyou for you reply.

    Any updates on this.

    Regards,

    Rupa

  • Rups,

    I apologize, I have not had time to get to this yet. Will be discussing this with some coworkers tomorrow. 

  • No worries, I have one more question here, if CMPSS is configured to generate trip signal, but in action qualifier T1U and T1D are not used instead PRD and ZRO events are used. Will the action qualifier consider the trip inputs?

  • Rupa,

    Would you be willing to use driverlib instead of bitfield for your ePWM setup? If you look at the epwm_ex2_updown_aq example in C2000WARE, it will show you how to set up your action qualifier.

    Best Regards,

    Ben Collier

  • Hi,

    Yes I am okay with using driverlib for my epwm setup. I will Implement configuration with driverlib and check the pwm generation.
    But i have the doubt here whether this action qualifier configurations in bitfield is missing something. 

    Regards,
    Rupa 

  • Hi Rupa,

    Were you able to get any C2000Ware examples working for your application?

    Best Regards,

    Allison

  • Hi Allison,

    I used the bitfield configurations only, and the only issue was with the TZCTL2 reg configurations,

    for PCMC implementation we have to force Hi TZBU and TZAU.

     TZBD and TZAD had to be made do nothing;

    I was not using them.

    Thanks and regards

    Rupa