Tool/software:
As part of a phase-controlled converter application, we require two PWM drives which can vary their relative phase in both directions and also operate with variable frequency. Our application uses ePWM1 as a sync source for ePWM4 and both are running in up-down counter mode. The ePWM1 sync out event is CTR=0 and this is used to load PHS=0.5*TBPRD in ePWM4 and start counting down after sync. This phase value can be modified by the action of the controller, up (towards +180°) or down (towards -180°).
Calculation of new frequency value and writing those new values to ePWM modules is handled by a constant rate ISR task.
Here is a simple version of exemplary model in Simulink where frequency is gradually incrementing up to a value before resetting again.


When the frequency is constant (i.e. with TBPRD fixed), the scheme works as intended. However, when TBPRD is varied and when ePWM4 PHS=0.5*TBPRD, pulse dropping on ePWM4 occurs when the frequency is increasing (but not in the case of decreasing frequency).
It appears that the dropping/missing pulse event only happens when the phase of ePWM4 is very close or equal to 0.5. However, the exact problematic range depends on the rate of change of frequency.
If the SYNCO of ePWM1 is disabled, the missing/dropping of pulse does not occur, but in our application, sync is required to load the required phase value into ePWM4.
We have noticed that this is linked to CTRD = CMPA and CTRD = CMPB but do not know why that is.
Attached screenshots of oscilloscope shows ePWM1 in yellow, ePWM4 in cyan and trigger event (CTRD = CMPA) output on GPIO toggle in magenta.
When PHS=0.5*TBPRD in ePWM4, those trigger events (CTRD = CMPA) are not occurring as regular as expected, with intermittent missing pulse happening from time to time.
However, when PHS=0.501*TBPRD in ePWM4, those trigger events seem regular as expected, with ePWM4 not missing any pulses.
Any advice and explanation would be much appreciated.
Thanks