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.

TMS320F28379D: missing pulse in EPWM for phase shifted full bridge

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi, 

i am using 28379D for hardware testing of phase shifted full bridge converter. i am using up-down count mode for EPWM. TBPRD for up-dwon count mode is 1000(50kHz). both CMPA and CMPB with 500(50% duty). i have configured EPWM 1 as master and EPWM 6 as slave for controlling phase shift between the legs. during the testing we observed there was a missing pulse from EPWM 6 pins. after searching few e2e forum threads i understand that there is a a missing action of action qualifier for few conditions like when TBCTR<CMPA and TBPHS>CMPA , TBCTR>CMPA and TBPHS<CMPA. however, i also found some TI people suggesting to use T1, T2 actions whenever phase update happening at the instant SYNCIN pulse coming from master EPWM so that missing action doesn't happen.

after configuring T1,T2 action with SYNCIN pulse from EPWM 1(master), we have edited code for suitable action at this instant. the problem of missing pulse has been solved for phase phase jump from below CMPA to above CMPA and also for above CMPA to below CMPA. but there is still a problem of missing pulse for large duty changes like 0.1 to 0.9 or 0.2 to 0.8 . i will attach the result for case of duty change from 0.1 to 0.9. please suggest a solution to this. other than this there is a frequency change in EPWM output for one cycle whenever there is a jump in duty from  0 to 0.1 or 0.1 to 0.2 so on, i will also attach the waveform for reference, as you can see that from cursor measurement frequency is 47.6kHz. this is happening without T1, T2 event and also with T1,T2 events. i am also attaching the code for implementing T1, T2 action events with if loop condition inside isr. also all the EPWM 1, 6 configuration.

   

1) waveform for 0.1 to 0.9 duty jump

2) waveform for 0.1 to 0.2 duty jump showing frequency change to 47.6kHz instead of 50kHz.

  • Hi Mugundhan,

    Could you please elaborate on the duty changes from 0.1 to 0.2,or 0.1 to 0.9 changes because, the images of the scope seem ~50 % duty? Also, what is the interrupt source that corrects the phase / action qualifier. is it the epwm1_isr or epwm6_isr and what is the event of these?

    thanks and regards,

    Madhava 

  • the green color plot is the EPWM 1(master) waveform, blue color plot is the EPWM 6(slave) waveform. EPWM 6 is phase shifted with respect to EPWM 1. here CMPA registers are always 50% of TBPRD, hence on or off period is always 50%. 

    you can see from the 2nd plot, before the duty change both the waveforms with phase shift/duty(0.1) occupy 2 horizontal divisions with each 10us. hence period is 50kHz. after changing phase shift/duty to 0.2, you can see that X1,X2 cursors which shows frequency reduces to 47.6kHz for one cycle and comes back to 50kHz.

    also when duty changed from 0.1 to 0.9 you can see in 1st waveform on pulse is longer for one cycle making frequency to reduce to 35.7kHz. after this cycle it comes back to 50kHz.

    EPWM 1 is used for isr whenever TBCTR = TBPRD.

  • Hi Mugundhan,

    also when duty changed from 0.1 to 0.9 you can see in 1st waveform on pulse is longer for one cycle making frequency to reduce to 35.7kHz.

    When you change the duty cycle from 0.1 to 0.9, what specifically is changing (i.e. if you are changing your CMPx values, what are you changing them from/to and how are you updating them?). It might also help if you could sketch out a quick diagram of your current EPWM signal output(s) (showing action qualifiers, loading of new values, etc.) so I can better understand what you are trying to do Slight smile

    You are correct that sometimes there can be missing action qualifiers due to syncing and updating values, but there are ways to successfully implement this regardless; the T1 and T2 are typically used, so it's good to see you already implemented them.

    Best Regards,

    Allison

  • sorry for the delay,

    i have attached the drawing for the case of phase/duty change from phase = 18 degrees(or duty 0.1) to phase = 162 degrees( or duty 0.9). CMPx value is always constant which is equal to 50% of TBPRD. A quasi square wave is expected in the phase shifted full bridge converter by shifting one of the leg's phase.

    you can see with respect to master EPWM 1, the carrier of slave EPWM 6 shifted from phase = 18 degrees(or duty 0.1) to phase = 162 degrees( or duty 0.9). you can see that ON time for the EPWM 6 is longer than usual, this is due to TBCTR of EPWM 6 shifted from 18 degrees to 162 degrees at the instant master TBCTR = 0 (or 360 degrees). 

    i am also attaching the code that i edited recently for the conditions used for T1 events.

         

  • Hi Mugundhan,

    Thanks so much for the diagram. I believe I understand the setup a bit better now. The phase shift is applied when a sync pulse comes every EPWM1 counter = 0? 

    Looking at the images of your code - could you also explain what "d1" and "d2" variables are? Based on the d1/d2, are you implementing T1/T2 similar to my suggestion in this previous post?

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1312604/tms320f28379d-tms320f28379d-phase-shift-pwm-missing-pulse 

    Could you also attach the PWM configurations/code of your project or copy/paste your code using the "Insert" --> "</> Code" buttons on E2E? This way I can better navigate your code and try things out myself if needed. Also, did you start your project with any of our C2000Ware examples as a reference? 

    Best Regards,

    Allison