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.

Invert EPWM signal

Other Parts Discussed in Thread: CONTROLSUITE

Hi I`m doing an inverter to control a 40KW induction motor. I need to raise the epwm voltage to 15V and i`m using an schmitt trigger inverter. My question is if it is possible to invert the EPWM signal? so I can get the correct signal after the schmitt trigger inverter.

Thanks. 

  • Ola Alejandro,

    Yes you can invert your PWM signal. You need to change your compare law for the PWM channel.

    Example: if you have set now

     

     

     

    ePWM[nChannel]->AQCTLA.bit.CAU = AQ_CLEAR;

    // Set PWM1A on event A, up count
    ePWM[nChannel]->AQCTLA.bit.PRD = AQ_SET; // Clear PWM1A on period event
    ePWM[nChannel]->AQCTLB.bit.CAU = AQ_SET; // Clear PWM1B on event A, up count
    ePWM[nChannel]->AQCTLB.bit.PRD = AQ_CLEAR; // Set PWM1B on period event

    you need to change it into

    ePWM[nChannel]->AQCTLA.bit.CAU = AQ_SET; // Set PWM1A on event A, up count
    ePWM[nChannel]->AQCTLA.bit.PRD = AQ_CLEAR; // Clear PWM1A on period event
    ePWM[nChannel]->AQCTLB.bit.CAU = AQ_CLEAR; // Clear PWM1B on event A, up count
    ePWM[nChannel]->AQCTLB.bit.PRD = AQ_SET; // Set PWM1B on period event

    and your PWM output will be inverted.

    Best regards

    Andreas

  • Yes, as answered earlier ... the polarity of ePWM signals can be changed however remember to set your deadband unit correctly toprovide correct "off" period between switchings.

  • Thanks a lot for your answeres, do you know hot set it. I`m trying to change the polarity in the following code (is from the HVACI FOC of controlSUITE)

             /* Init Action Qualifier Output A Register for EPWM1-EPWM3*/ \

             EPwm1Regs.AQCTLA.all = AQCTLA_INIT_STATE; \

             EPwm2Regs.AQCTLA.all = AQCTLA_INIT_STATE; \

             EPwm3Regs.AQCTLA.all = AQCTLA_INIT_STATE; \

    \

             /* Init Dead-Band Generator Control Register for EPWM1-EPWM3*/ \

             EPwm1Regs.DBCTL.all = DBCTL_INIT_STATE; \

             EPwm2Regs.DBCTL.all = DBCTL_INIT_STATE; \

             EPwm3Regs.DBCTL.all = DBCTL_INIT_STATE; \

    \

             /* Init Dead-Band Generator for EPWM1-EPWM3*/ \

             EPwm1Regs.DBFED = DBCNT_INIT_STATE; \

             EPwm1Regs.DBRED = DBCNT_INIT_STATE; \

             EPwm2Regs.DBFED = DBCNT_INIT_STATE; \

             EPwm2Regs.DBRED = DBCNT_INIT_STATE; \

             EPwm3Regs.DBFED = DBCNT_INIT_STATE; \

             EPwm3Regs.DBRED = DBCNT_INIT_STATE; \

     

    What I think I should do is to change the INIT_STATES macros

    /*----------------------------------------------------------------------------

    Initialization constant for the F280X Action Qualifier Output A Register. 

    ----------------------------------------------------------------------------*/

    #define AQCTLA_INIT_STATE ( CAU_SET + CAD_CLEAR )

     

    /*----------------------------------------------------------------------------

    Initialization constant for the F280X Dead-Band Generator registers for PWM Generation. 

    Sets up the dead band for PWM and sets up dead band values.

    ----------------------------------------------------------------------------*/

    #define DBCTL_INIT_STATE  (BP_ENABLE + POLSEL_ACTIVE_HI_CMP)

     

    #define DBCNT_INIT_STATE   200   // 200 counts = 1.33 usec (delay)  (for TBCLK = SYSCLK/1)

    changing the order of AQCTLA_INIT_STATE.
    DO you know what should I do with the dead band configuration?? 

  • Alejandro,

    How should we be able to tell you what to do with the dead band without knowing your application???? Think about yourself, read the manual and if still something is not clear come back to the forum

    Best regards

    Andreas