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.

TMS320F2812 PWM polarity and dead-time flexibility

Other Parts Discussed in Thread: TMS320F2812

This question is concerning the (lack of) configurability of the dead-band timing for different PWM pin polarities.  The application is for a DC/DC converter utilizing a half-bridge of IGBTs.  I am using a TMS320F2812 DSP to generate a symmetric PWM using Event Manager A's GP Timer 1, Full Compare Unit, and Dead-Band Timer.  For reference, consider page 60 of 152 and Figure 2-5 in application note spru065e.  For the purpose of this discussion, consider only outputs PWM1 and PWM2, driven from Dead Band Unit A, driven from Compare Unit 1, driven from the symmetric waveform generator of GP Timer 1.

 

In my application, PWM1 and PWM2 are a complimentary pair:  PWM1 drives a high-side switch in a half bridge and is active high (when pin PWM1 is high, the high-side switch is on).  PWM2 drives the low-side switch and is also active high (when pin PWM2 is high, the low-side switch is on).  To generate complimentary signals, the ACTRA register is configured such that one of the two pins is active low and the other is active high.  There are two such cases.  The first problem is that one of these configurations correctly generates a "dead time" and the other configuration actually generates an "overlap conduction / shoot through time," which will damage the converter.

 

This, in itself, would not be a problem as there is one combination which works.  The problem is that this working combination centers the "off time" around the zero crossing of Timer T1's T1CNT.  My application requires me to invert the polarity of the PWMs such that the "on time" is centered around T1CNT = 0.  I can not find a combination in the T1CON, GPTCONA, COMCONA, DBTCONA, and ACTRA registers which will allow such a scenario.  The simple question is: can I change the polarity of the signal PHx, the output of the symmetric waveform generator?

 

Is there any solution purely within the DSP, without relying on external logic?

 

Thanks to all in advance.

  • I'm not sure I fully understand your problem, It sounds like you are setting up a PWM with the compare unit so that one timer generates complimentary high and low signals,  if so, make sure u have the deadband unit configured to prevent short throughs.  However, if you are confident you have done everything right (ie followed the examples and such) then you may have ESD fried your DSP, that has happened to me several times when PWM just don't work like they should.

     

    Here is some sample code on how to properly setup a PWM, this example is for a 3 phase inverter which is basically 3 paralleled half bridges:

        PieCtrlRegs.PIECRTL.bit.ENPIE = 1;
        PieCtrlRegs.PIEACK.all = 0xFFFF;     
        EvbRegs.EVBIMRA.all=0x0000;                // interupts reset
        EvbRegs.EVBIFRA.all=0xFFFF;        
        EvbRegs.EVBIMRA.bit.T3PINT=1;
        EvbRegs.EVBIFRA.bit.T3PINT=1;
        PieCtrlRegs.PIEIER4.bit.INTx4=1;   
        EINT;
        ERTM;
        PieVectTable.T3PINT=&Inverter_isr;
        EvbRegs.T3CON.bit.TENABLE=1; 

        EvbRegs.T3CON.all=0x1000;        //cont up mode, x1 prescaler
        EvbRegs.T3PR=1250;                //20kHz for up count

        EvbRegs.DBTCONB.all=0x06F0;        //6 out of F db timer period,db enable x/16prescale
        EvbRegs.COMCONB.all=0xCAE0;        //compare enabled,immediate reload registers
        //-----------------------
        //Dead band configuration
         EvbRegs.DBTCONB.bit.DBT             = 13;    //15;    // 12;
        //Setting the deadband for 8usec   
         EvbRegs.DBTCONB.bit.DBTPS           = 4;    //5;     // 3;    x/8prescale
        //Deadband prescaler = 8
         EvbRegs.DBTCONB.bit.EDBT1           = 1;
        //Enable Deadband Timer for PWM 1/2
         EvbRegs.DBTCONB.bit.EDBT2            = 1;
        //Enable Deadband Timer for PWM 3/4
         EvbRegs.DBTCONB.bit.EDBT3            = 1;
        //Enable Deadband Timer for PWM 5/6
        EvbRegs.ACTRB.all=0x0666;
        EvbRegs.ACTRB.bit.CMP7ACT        = 2; //2 active high
        EvbRegs.ACTRB.bit.CMP8ACT        = 1; //1 active low
        EvbRegs.ACTRB.bit.CMP9ACT        = 2; //0 forced low
        EvbRegs.ACTRB.bit.CMP10ACT       = 1; //3 forced high
        EvbRegs.ACTRB.bit.CMP11ACT       = 2; //2
        EvbRegs.ACTRB.bit.CMP12ACT       = 1; //1
        EvbRegs.GPTCONB.all=0x0000;
        EvbRegs.EXTCONB.all=0x0000;

    interrupt void Inverter_isr(void)
    {
        EvbRegs.CMPR4 = sAlpha;
        EvbRegs.CMPR5 = sBeta;
        EvbRegs.CMPR6 = sGamma;   

    //-----------------------------------------------------------------------------
        loopcount++;
        Tz_incr=Tz_incr+Tz*2;        // based on 20kHz entry rate
        fAlpha=2*PI*Fund_freq*Tz_incr;  // fAlpha = 0-2PI
        if(fAlpha>6.28) // check if alpha >2*pi radians
        {
            Tz_incr=0;
            fAlpha=0;
     
        }   
       
        fBeta=fAlpha+(2*PI/3);
        if(fBeta>2*PI)
        {
            fBeta-=2*PI;
        }
       
        fGamma=fAlpha+(4*PI/3);
        if(fGamma>2*PI)
        {
            fGamma-=2*PI;
        }

        // updating duty cycles of PWM1,PWM2, PWM3

        sAlpha = (((V_Ref/V_Dc)*sin(fAlpha)*(EvbRegs.T3PR>>1))+(EvbRegs.T3PR>>1));
        sBeta = (((V_Ref/V_Dc)*sin(fBeta)*(EvbRegs.T3PR>>1))+(EvbRegs.T3PR>>1));
        sGamma = (((V_Ref/V_Dc)*sin(fGamma)*(EvbRegs.T3PR>>1))+(EvbRegs.T3PR>>1));

        EvbRegs.EVBIFRA.bit.T3PINT=1; // Set timer 1 underflow mask register
        EvbRegs.EVBIMRA.bit.T3PINT=1;
        PieCtrlRegs.PIEACK.bit.ACK4=1; // acknowledge interrupt

    }

  •   You could also move to the F2823x or F2833x series with the newer ePWM moduls (replacing EV).  This will easily do what you are looking for. These also have improved ADC, DMA, and more RAM....for the same price.

  • Hello Adam - unless you are tied to 281x devices for business or product reasons, purely from engineering and deveopment point of view  it will be better for you to seriously consider current devices with next generation PWM and other peripherals - Chris already suggested the devices. Note, not only EV is less flexible than latest peripherals your support pool for EV may also go down in future .