Other Parts Discussed in Thread: TMDSDOCK28379D
Is it possible to change ePWM counting direction from up-down to down-up online, every half of the fundamental period?
I would like to implement the AZSPWM method. To get the PWM signals, the following algorithm is used: If the slope of the reference phase voltage is positive then the modulating waveform is compared with Vtri and if the slope of the reference phase voltage is negative then the modulating waveform is compared with -Vtri.
In MATLAB Simulink for ePWM block help file says I can set 'Counting direction after phase synchronization' if I select 'Set counter to phase value specified via input port' which creates a phase input port, PHS, on the block.
Further, in the help file, it says:
Counting direction after phase synchronization — Counter direction after phase synchronization
Count down after sync (default) | Count up after sync
Configure the timer to count up or down, following synchronization. This parameter corresponds to the phase direction (PHSDIR) field of the Time-base Control Register (TBCTL).
Dependencies
This parameter appears when Counting mode is Up-Down and Synchronization action is Set counter to phase value specified via dialog or Input port.
PHS looks like a logical input? Is this correct? For the AZSPWM algorthm, the idea is to generate a logical signal (slope) for each ePWM based on the PWM reference slope, e.g. TRUE = rising slope, use Up-Down (Vtri) and FALSE = falling slope, use Down-Up (-Vtri).
Fig 1: fsw = 5 * f0, Fig 2: fsw = 4 * f0
Edit: direction change can happen anywhere on the counting waveform; it all depends on when the slope change is detected.
So far in my ePWM blocks, 'Syncronisation action' is set to 'Disable'.