This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F2808 ePWM Sync Issue

Champs,

A customer of mine is experiencing an issue with the Sync functionality of the ePWM in his specific setup (externally synchronized interleaved buck): 

The problem is that the external synchronization signal does not have exactly the same frequency, may be there are a couples of Hz of difference. This difference makes PWM1 finish before its period (maybe one count). This makes PWM2 be reset to T/2 one count before. If the comparator was programmed for T/2-1, the PWM does not turn off on that period because the counter jumped from T/2-2 to T/2. This seems to be a very particular case, but these values are around 50% duty cycle and the converter is usually around those values. When this condition happens, I see current spikes because the PWM is spontaneously held at 100% duty.

 

At counter equals zero I turn on, at counter equals CMPA I turn off. The problem is when the counter is loaded with the PHASE value (it is an interleaved stage) and CMPA has that same value (or PHASE-1, I'm not sure). Under that particular situation the PWM doesn't turn off for the whole cycle.

 

I found a solution for this problem, but I don't know if it could produce any side effect. The solution that I found is assigning a shorter period to PWM2. Hence it starts before to count from zero and when PWM1 resets PWM2 (assigning T/2 because of the phase shift), I can be sure that PWM2 is above that value because it started to count before (it has a shorter period).

 

The values that I am using are: External PWM period is T, PWM1 period = T-1 and PWM2 period = T-3.

 

This gives me 1 count of margin for PWM1 and 2 counts of margin for PWM2. With less margin it improved but the problem didn't disappear completely.

 I don't think this a very specific case because it should happen in any externally synchronized interleaved converter. Could you please ask the Digital Control engineers if they have experimented with this converter (externally synchronized interleaved buck for example)?  Has anyone else ran into this issue?  Regards, Tim Love
  • Tim,

    The customer is right.

    When you are using up-count mode for both ePWM modules (ePWM1 and ePWM2) and synchronizing PWM2 to PWM1 with a 180 deg phase shift, you may encounter this problem when there is a jump in the TBCNT2 value due to synchronizing pulse coming from ePWM1 and the CMP value lying between this jump. The only way around this problem, that i can think of, is in your code where the new CMP value is calculated check for the CMP value being less than and v.close to the TBPHS value (amount will depend on how much variation you may expect in the input synchronization period). If this is the case, change the CMP value to TBPHS+1.

    There is another way around this problem but only applicable if you are not using Hi-res PWMs. If you use the up-down count mode for PWM1, then you could use the ePWM1B output to drive the 2nd phase of the buck stage (instead of using ePWM2 output). In this case, CMPA would be modulating phase 1 duty while CMPB will modulate the Phase 2 duty such that the action qualifier configuration for the two outputs (ePWM1A/1B) always generates 180deg out of phase PWMs. The only issue on an external sync pulse would be if the CMP values are too small (close to the ZRO event). Of course there would be a way to get around this problem as well but may involve some software overhead.

    Hope this helps.

    - Hrishi