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.

TMS320F28379D: PWM pulses missing during variable phase-shift with variable frequency operation

Part Number: TMS320F28379D

Hello,

I am running an ac-dc converter, which uses a full bridge inverter and full bridge rectifier. All these four half bridges (two inverter half bridges and two rectifier half bridges) in the converter need to be operated at 50% duty cycle. The phase shifts between them should be modulated, and the frequency of operation should be varied according to the line cycle voltage to achieve the PFC operation of the converter.  I am using ePWMs 1 - 4 for this purpose and loading the TBPRD and TBPHS values of these ePWMs from the lookup table, which stores phase shift and frequency values with respect to the ac line voltage.

Operating frequency of the converter varies from 275 kHz to 300 kHz (corresponding TBPRD values varies from 365 to 330 respectively). 

Phase shifts of these half-bridges 2 to 4 vary in the following ranges with respect to half-bridge-1:

Half-bridge 2: always 180 degrees

Half-bridge 3: 25 degrees to 130 degrees

Half-bridge 4: 130 degrees to 225 degrees

ePWMs 1 and 2 output is fine as expected, but pulses are missing out in ePWM 3 for some duration, and also compare skip events are occurring intermittently for a cycle or two in ePWMs 3 and 4.

 

I understand that while actively changing TBPHS and CMPA values, I need to be a little careful. While updating TBPHS and CMPA values, if my new CMPA value is falling between the new TBPHS and old TBPHS value, I am making my new CMPA value to be new TBPHS + 1 for that one switching cycle and back to the desired CMPA value after that.

Even after implementing this thing in my code, I was facing the same issue. 

Any comments or suggestions to get rid of this issue?

Thanks and regards

Dheeraj

  • Hi Dheeraj,

    Do you have shadow loading enabled for the TBPRD and CMPA values? What is your counter mode and what are your AQ actions? It would be helpful to see how you are configuring EPWM3 or EPWM4. 

    Best Regards,

    Marlyn

  • Hi Marlyn,

    Thanks for your reply.

    Shadow loading is enabled for TBPRD for counter equals zero. Shadow loading is not enabled for CMPA.

    Counter mode is up-count. AQ actions: EPWM 3A/4A - set when counter equals zero, and clear when counter equals CMPA value. EPWM 3B/4B are set to be complementary to EPWM 3A/4A, respectively. 

    Best regards,

    Dheeraj

  • Hi Dheeraj,

    Thank you for providing more information. Would it be possible to setup the shadow loading for both TBPRD and CMPA to occur on the Period or ZRO/PRD events. Since you are using up count mode, ZRO and PRD are technically the same event but there might be issues with other of operations. Additionally, what is providing the synchronization for EPWM 2, 3 and 4, is it when TBCTR of EPWM 1 is zero?

    I am using ePWMs 1 - 4 for this purpose and loading the TBPRD and TBPHS values of these ePWMs from the lookup table, which stores phase shift and frequency values with respect to the ac line voltage.

    Is this occurring within one of the EPWM ISRs or another ISR? In general, if its not within an EPWM ISR, then I would recommend looking into global loading/one-shot load mode. You could figure out what values are needed and then setup a one-shot flag that would load all of the shadow to active registers for TBPRD/CMPA etc. at the same time (potentially even across EPWM modules if you set up linking between them), this can help reduce the chance that one EPWM module gets updated before another and reduce the risk of missing pulses as you are seeing for EPWM 3 and EPWM 4. 

    Best Regards,

    Marlyn