Other Parts Discussed in Thread: C2000WARE, SYSCONFIG
Hi all,
My application, on a F28388D, uses 2 ePWM units to drive a phase-shifted full H bridge at a rather high PWM frequency (1 MHz).
The phase shift should be modifiable (of course) but also the PWM frequency should be modifiable (about -/+ 10% respect the nominal 1 MHz).
The straightforward implementation (and the one that requires less writes to ePWM registers during the cyclic interrupt) is to have the output A (ePWM-A) on the left leg going up on the ZERO event and down on the PRD event, and the inverse on the other ePWM module that’s driving the right leg.
The “B” signal to drive the lower mosfet on the same leg is obtained using the inversion in the DB unit.
Using this approach and using EPWMLINK register to link together the 2 ePWM modules, only one write to the TBPHS register of the “left” leg is required (the value is propagated by the EPWMLINK, and the programming is always correct also changing the PWM frequency changing TBPRD).
In this mode I don’t need to write nor use CMPA/CMPB (because the duty is always 50% and the points ZERO / PRD are enough to build a 50% square wave).
And of course this works.
Now i’ve to use the HRPWM mode. Following my understanding of the TRM and looking at the sample code “hrpwm_ex3_prd_updown_sfo.c” in C2000ware, I’ve successfully increased the resolution.
But I notice a strange behaviour:
- A) If I use CMPA = TBPRD/2, like in the TI sample code to generate the PWM outputs, all the 4 signals (the 2 of the 1st leg of the H bridge, coming out from ePWM2, and the other 2 coming out from ePWM3) are very stable, for any value of HR steps used (I use the AUTOCONV mode as required);
- B) If instead I use my original idea to use ZERO and PRD to toggle the PWM outputs, the pulses from the 2nd leg (ePWM3, which is linked using EPWMLNK) have a little jitter compared to ePWM2 outputs. The jitter is in the range of 5 ns, which is the equivalent of one TBPRD step.
Do you have any idea or suggestion?
Using option B) would require me to compute and write CMPA = TBPRD/2 to maintain a 50% duty, and this takes some time that is precious for me (being the PWM frequency 1 MHz).
Using option 2 instead the commutations are implicit in the architecture.
Thank you,
Alberto