Can I offset ePWM units by 1/3 period?

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Submitted by Joe on Fri, 04/20/2012 - 20:50

 

I'm trying to shift the PWM waveforms for ePWM1A, ePWM2A, and ePWM3A by 1/3 period with each other. Do you guys know how to do this?

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by pete on Fri, 04/20/2012 - 21:29.

    Each PWM unit has it's own free running counter. Fortunately for you, each PWM unit can be daisy chained to the next unit to synchronize it. You do this by configuring unit n to send a sync pulse output to unit n+1. The sync pulse sent by unit n can be used by unit n+1 to trigger a phase register load to its PWM counter. This has the effect of setting a phase relation between PWM units. VisSim lets you smoothly modulate the phase or use a fixed phase offset. The Time Base portion of the ePWM configuration lets you set this up. The phase register is called TBPHS (Time Base Phase). Check the option TBCTR=TBPHS on SYNCI pulse, this means that the ePWM counter will be set to value in the TBPHS register when the sync in pulse arrives.

    ePWM-time-baser.png

    The above setting assigns the value 10000 to the PWM Unit 2 counter when a SYNCI Input pulse occurs. Because we are in up/down count mode, the effective period of the PWM unit is 30000. A phase offset of 10000 will have the effect of offsetting unit 2 by 1/3 full PWM period from Unit 1. EPWMSYNO is set to send a pulse to PWM unit 3 when TBCTR = zero. If unit 3 is configured similarly to unit 2, then it will be offset an additional 1/3 period from unit 2.