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: 28335 ECAP in APWM mode , change the CTRPHS while duty is not 0

Part Number: TMS320F28335


Dears 

   We have problem about using the ECAP as APWM output

 1.  We using the ECAP to drive the IGBT in APWM mode, tECAP is synchronous with the EPWM( EPWM is used to drive other IGBT)

2.  Want to change the CTRPHS while working , and the duty is not 0

3. Turn out that if I do that , there will be a wrong duty output , for example  ,

   a.  CAP1(PWM period) is 3750 ,  if   CTRPHS change from 2500 to 500, while the CAP2 is 2400(duty 36% )

   b. if the TSCTR=2400, output become high ,  the if the TSCTR =2500,  the CTRPHS(which was 500) was loaded to the TSCTR,   that means , TSCTR  recount  from  500 

  c. after TSCTR = CAP1, output become low, 

  d, So  the output duty indeed large more than 36%, which could be 89%((3750-2400+2000)/3750), that is dangerous and unacceptable

 So 

  A.  Did the ECAP have some register like EPwmxRegs.AQCSFRC in EPWM , that I could set the APWM output high or low ?If  Yes , I could set the APWM low while I change the CTRPHS 

  B. Could I set the CTRPHS load  when the TSCTR =CAP1 ? 

 C. Besides two above ,any solutions to solve this peoblem ?

Thans very mucn for  hep!

  • Webber,

    I need to clarify some things.

    Is it OK for your "on time" of the APWM signal to increase for one cycle?

    Is it OK for your "off time" of the APWM signal to increase for one cycle?

    Either on time or off time has to change, for one cycle, if the phase between the ePWM's output and the APWM's output changes.

    You should check your ePWM1SYNCO selection, you might be able to change this and get more desired results.

    Please let me know the answers to my questions above,
    Cody

  • Cody

      Thanks for reply

        The "off  time" increase for just one cycle when I change the CTRPHS, that is OK,   

        Not the "On time " increase, because of the danger of saturation for the inductance

     

    The ECAP  is sync to the EPWM, And I can not change the EPWM Phase because it is used to drive other IGBT,

     

      

  • First of all, I am assuming that the ePWM and APWM you want to SYNC have the same period.

    I think this solution will work if both of your signals track together, meaning are low at the same time and high at the same time. :

    You should invert the PWM signal, switch the values in AQCTLx.(details: PWM User Guide) And invert the APWM's Signal, ECCTL2.APWMPOL(details: ECAP User Guide). If the signals were syncing during a high time previously, they should now be syncing during a low time. This will cause the low duration to extend when they sync, which you stated should be OK.

    Similar to the first method, you may be able to change the value in TBCTL.SYNCOSEL to send the sync pulse during a low time(see the PWM User Guide).

    Sorry I didn't get a chance to test either method, but I think both could work. Please let me know, I'm excited to find out if one of these solutions work for you!

    Regards,
    Cody

  • Thanks Cody

      As I  understand , your suggetion is as below

    1.  If  the  APWMPOL is 1(active low, so if  TSCTR =CAP1, APWM output became high ) ,  and CAP1 is lower than  CTRPHS, before the sync signal came ,the APWM output is high,  and then after the sync signal came, the TSCTR recount, So the high time extend, 

     2. Then ,if  change the APWMPOL  to  0 , which means before the sync signal came ,  the APWM output is became low , so the TSCTR recount just extend the low time

    Am I  right?

    but  I have some qustions below 

    1. if the CAP1 is bigger than  CTRPHS, which means , before the sync signal came , the APWM output is high,

    2.  Then after the sync signal, the TSCTR change frome 2500 to 500,  So led to the extending the high time  

    I have 4 APWM output , and each of them are 90 degree delay,  which means

     CTRPHS for APWM1 is   0

     CTRPHS for APWM2 is   937

     CTRPHS for APWM3 is   1875

     CTRPHS for APWM4 is   2812

    and the duty is not certain(depending on the working environment , varies from 0% ~ 80%),  So  when the sync signal came , the APMWx  output can be high or low,   Change the CTRPHS when the sync signal  came may led to extend high time or low time or both of them all extended ; And that does not make differences whether  the  APWMPOL  is 0 or 1 

    I test  that , and the result  is just like above ;

    BR!

    webber

  • Yes, you have the general idea. And yes if you have a variable duty cycle that trick wont work 100% of the time. Let me think about this one, and I will get back to you.

    Regards,
    Cody
  • Thanks Cody, Waiting for your news
  • Webber,

    sorry for the delay, the ePWM modules should be able to do this. Do you have any ePWM's available in you system?

    Some more questions,

        1.When are you sending your sync value from the ePWM?

        2.Is the phase between each APWM constant?

        3.Is it OK if your on time is smaller than your expected value for 2 back-to- back periods? (If this is ok you could reconfigure your GPIO mux and drive the pin low while you adjust the phase. The APWM would be running in the background the whole time just not driving the GPIO.)

    Regards,
    Cody

  • eh, no , I dont have any other avaliable ePWM , all are used to drive other IGBT;

    about the questions
    1. I send the sync while ePWM TBCTR = 0
    2. Yes,phase between the APWM is constant
    3. I dont konw if I suddenly change the Pin configure from the APWM to GPIO while the APWM is outputing would lead to some unknow danger .But , thanks to your suggetion ,I think if I force the duty to 0 while I adjust the CTRPHS maybe Okay, I will try that

    Thanks !

    BR

    webber