I found a mitigation for the problem that I couldn't post to e2e.ti.com because they demand a company email (University won't do). See my self-answer below.
I'm using a TI microcontroller TMS320F2837xD, with PWM1 as a synchronization master (sync pulse at TBCTR == 0) to PWM2 and PWM4 (and therefore to PWM5). I'm using up-down count and all PWM duty cycles are held constant at 50% with CMPA. I use the phase register of PWM 1 to 5 (PWMx.TBPHS) as a control variable, that I constantly change.
The problem: whenever I go from TBPHS > CMPA to TBPHS < CMPA, the PWM will miss the TBCTR==CMPA comparison and won't turn off the output. This is because at the synchronization event TBCTR is loaded with TBPHS, making it go from above CMPA to below CMBPA. Since the comparator doesn't care about TBCTR<=CMPA but only TBCTR==CMPA, the output set is missed. This behavior is described in Figure 1. Figure 2 shows the actual waveforms, and how the glitch affects the output voltage of the full-bridge I'm driving.
Is there a way to avoid this glitch?
Below I link some forum entries with the same problem. None of them really offered a solution:
- https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/913278/ccs-tms320f28379d-phase-shift-pwm-malfunctioning
- https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/814513/tms320f280049-synchronization-causes-pwm-losing-issue
- https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/317898/phase-shift-sync-of-pwm-channels-with-variable-frequency---missed-compare-events
- https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/22575/f2808-epwm-sync-issue
Figure 1 - Diagram of the cause of the missed compare.
Figure 2 - Glitch at ~14.45ms. The missed compare happens for D2 and D6, D3 and D7 are their complementary outputs, respectively. The voltage waveforms from two full-bridges, for which D0 - D7 are the gate signals.
require users to provide a company or select partner institution email address to be able to post on E2E
. It wasn't clear which email domains are allowed / blocked, but I have an email address from a now defunct.co.uk
ISP which wasn't blocked as still allows me to login. \$\endgroup\$