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.

TMS320F28335: Turning off EPWM module based on voltage feedback at ADC.

Part Number: TMS320F28335

I am trying to run a 3 phase inverter and a dual active bridge converter (DAB) together from the F28335. For the inverter, I am making the firing sequence and sending that word to the GPIO pins for firing. For the DAB, I am using the EPWM modules 1 and 2 to get two pairs of complimantary pulses, However, based on certain output voltage feedback (vdf), I need to switch off the DAB i.e. EPWM1A,  EPWM1B, EPWM2A, EPWM2B all should be zero. I am trying to do this with the the Action Qualifier Continuous Software Force Register (AQCSFRC). However, I see that EPWMxA and EPWMxB still remain complimetary to each other. I am not able to force both of these together to zero. 

I am using the following code. The logic is such that the EPWM modules should be off if 255<vdf<295.

if (vdf > 295)
{EPwm1Regs.AQCSFRC.all = 0x00;  //Forcing disabled, i.e., has no effect
EPwm2Regs.AQCSFRC.all = 0x00;}  //Forcing disabled, i.e., has no effect


else if (vdf< 255)
{EPwm1Regs.AQCSFRC.all = 0x00;  //Forcing disabled, i.e., has no effect
EPwm2Regs.AQCSFRC.all = 0x00;}  //Forcing disabled, i.e., has no effect


else
{EPwm1Regs.AQCSFRC.all = 0x05;   //turn off both EPWM1A and EPWM1B
EPwm2Regs.AQCSFRC.all = 0x05;}  //turn off both EPWM2A and EPWM2B

 

Am I doing something wrong? Ow would it be a better idea to use the Trip Zone module. I dont have idea how to configure the trip zone based on the voltage feedback. Some help on this will be highly appreciated! 

  • Hi!

    I would recommend reviewing the Figure labelled "Time-Base Submodule Block Diagram" in the F283xx TRM.  In it, you'll notice that the Deadband submodule comes after the Action Qualifier.  This means that deadband will always attempt to get added.

    You'll also notice that the Trip Zone submodule is just before the PWM signal is output. 

    I would recommend investigating the TZ.  You can force a trip (TZFRC) based on conditionals in your software & also clear the trip condition via software.


    Thank you,
    Brett

  • Dwijasish,

    Brett's answer is correct. Please Look at the figure. Each module affect the PWM output sequentially until arrive at the GPIO pin.

    Since the DB always creates complimentary pairs of whatever the AQ sends to it the AQ software force cannot be used to force low when the DB is configured into a complementary mode.

    Please use the trip-zone for this purpose.

    Regards,
    Cody 

  • Brett and Cody,

    Thanks your help in this regard. I did realize that I have to use the TZ submodule to operate the system as desired by me. I scrolled through the reference guide for the EPWMs and figured out how to software force the EPWM outputs. I am making the TZFRC 1 to turn off the EPWM modules and again making the TZCLR bit high when I need to start the EPWMs. The code is shown below.

    if (vdf < 255)
    {EALLOW;
    EPwm1Regs.TZCLR.bit.OST = 1;
    EPwm2Regs.TZCLR.bit.OST = 1;
    EDIS;}


    else if ( vdf > 255 && vdf < 295)
    {EALLOW;
    EPwm1Regs.TZFRC.bit.OST = 1;
    EPwm2Regs.TZFRC.bit.OST = 1;
    EDIS;}


    else if (vdf > 295)
    {EALLOW;
    EPwm1Regs.TZCLR.bit.OST = 1;
    EPwm2Regs.TZCLR.bit.OST = 1;
    EDIS;}

    Regards,

    Dwijasish