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.

TMS320F280025-Q1: From forcing EPWM1A and EPWMB low to EPWM1A and EPWM2A counter compare mode

Part Number: TMS320F280025-Q1

Hi

 I am using 280025 and I am configuring EPWM.I need to change EPWM1 from forcing EPWM1A and EPWMB low to EPWM1A and EPWM1B counter compare mode.

 The code of forcing EPWMxA and EPWMxB low:

The code of EPWMxA and EPWMxA counter compare mode:

When I change EPWM1 from forcing EPWM1A and EPWMB low to EPWM1A and EPWM1B counter compare mode every five interrupt cycles.I find EPWM1B always changes to high ahead of the first period.

The yellow line(channel1) is EPWM1A,the green line is EPWM1B(channel2)is EPWM1B,I think the remarked area of EPWM1B should be low.Where should I do extra configuration.I have cofigurated the counter compare value as following:

What should I do furthermore?Could you give me some advice?

thanks!

  • .I need to change EPWM1 from forcing EPWM1A and EPWMB low to EPWM1A and EPWM1B counter compare mode

    What do you mean change to counter compare mode? You disable SW continuous force?

  • Hi

    YesI disable SW continuous force firstly and then I can set EPWM to counter compare mode.If I dont disable SW continuous force mode.Although I set EPWM to counter compare mode,the EPWMxA and EPWMxB will be both low because I configurate them to SW continuous forcing low originally.My question and my focus isWhen I change EPWM1 from forcing EPWM1A and EPWMB low to EPWM1A and EPWM1B counter compare mode every five interrupt cycles.I find EPWM1B always changes to high ahead of the first periodThe red marked area.

    Please read my original question as well.

    Answer: .I need to change EPWM1 from forcing EPWM1A and EPWMB low to EPWM1A and EPWM1B counter compare mode.What do you mean change to counter compare mode? You disable SW continuous force?

    thanks!

  • Well when you remove the SW continuous force, the EPWM resumes normal operation. 

    Depending on when you do this in the cycle, thats what the EPWM outputs will be.

  • HI

    I dont how to set the time when to remove the SW continuous force?I try to add following code in initialization as following:

    EPWM_setActionQualifierContSWForceShadowMode(base,EPWM_AQ_SW_SH_LOAD_ON_CNTR_ZERO_PERIOD);

    However,it doesnt take any effect.

    Then I found that it seemed to happen because of DeadBandFed,if I mask the reative code as following:

     void H_L_PWM(uint32_t base,float duty)

    {

     

        EPWM_setDeadBandDelayMode(base, EPWM_DB_RED, true);

        //EPWM_setDeadBandDelayMode(base, EPWM_DB_FED, true);

     

        EPWM_setActionQualifierContSWForceAction(base,EPWM_AQ_OUTPUT_A,EPWM_AQ_SW_DISABLED);

        EPWM_setActionQualifierContSWForceAction(base,EPWM_AQ_OUTPUT_B,EPWM_AQ_SW_DISABLED);

     

        EPWM_setCounterCompareValue(base, EPWM_COUNTER_COMPARE_A, (1-duty)*EPWM_TIMER_TBPRD);

       

    }

     

    The scope will be:

    Not like before:

    But the FED time disappear as well.Then I try to add following code in initialization:

    EPWM_setDeadBandControlShadowLoadMode(base,EPWM_DB_LOAD_ON_CNTR_ZERO);

    I release the mask of DeadBandFed,then the scope changes to following:

    No matter how I modify the code,the green scope doesnt change its direction.If the green scopes polarity can be Toggled.It will be my ideal goal: From forcing EPWM1A and EPWMB low to EPWM1A and EPWM2A  counter compare  mode.Could you give some advice?

    Thanks!

  • When do you set OUTPUT A to HIGH? on what event?

  • Depending on when you set the OUTPUT A high (during which event) and when you switch the EPWM mode, you can avoid the unwanted pulse.