Tool/software:
Hi Team,
I have a question regarding the correct formula to calculate the phase shift for EPWM2 relative to EPWM1,
specifically in different ePWM counter modes (up, down, and up-down).
I came across a formula on this forum (LAUNCHXL-F28379D: Phase Delay between ePWM1 and ePWM2 in example epwm_ex3_synchronization) for calculating the time base phase shift (TBPHS) for EPWM modules:
TBPHS =(TBPRD * Desired Phase (In Degrees))/180 degrees
Based on this, I have a phase shift value of 300:
300 = (2000*x)/180, This results in a phase shift of approximately 27 degrees for EPWM2.
To achieve a delay of 153 degrees for EPWM2 with respect to EPWM1,
I calculate: 180 degrees - 27 degrees = 153 degrees
then : TBPHS = (2000*153)/180 = 1700
My question is whether these calculations apply to all counter modes (up, down, and up-down), or if they are specific to one mode, such as the up-counter mode.
Additionally, I noticed a different formula for phase shift calculation in the technical reference manual:
TBPHS = (phase angle*TBPRD)/360
If my counter mode is set to up-down, which formula should be used to correctly calculate the phase shift?
I would appreciate any clarification on this matter to ensure accurate phase synchronization in different counter modes.
Following the C2000 ePWM Developer’s Guide. Whichever formula mentioned in the developer guide didn't work for calculating TBPHS with an up-down counter. I noticed that for an up-down counter, TBPRD has to be multiplied by 2. When I use that phase shift value, I get the correct phase shift in the waveform. I calculated it for 22 degrees with the up-down counter." without multiple by 2 is 20.35, If I use multiple by then 40.7, If I am using multiple by 2 then only EPWM phase shift is working, For the up-down counter, multiply by 2. Please refer to the link below:
