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.

TMS320F28P550SJ: Unexpected ePWM Behavior for Large TBPHS Values in Up-Down Count Mode

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: TIDM-1000, C2000WARE

Hi TI Team,

I am using ePWM in up-down count mode with TBPRD = 1071. EPWM1 is the master and EPWM4 is a phase-shifted slave (PHSEN = TB_ENABLE).

While testing with a fixed duty of 0.7 (CMPA ≈ 749), I observed that EPWM4 operates correctly up to TBPHS = 1392, but at TBPHS = 1393 and above, the PWM output stops switching and gets stuck (EPWM4A = LOW, EPWM4B = HIGH).

Interestingly

2 × TBPRD - CMPA
= 2142 - 749
= 1393

which exactly matches the failure point.

Is there any ePWM limitation or known behavior when TBPHS >= (2 × TBPRD - CMPA) in up-down count mode? Can CAU/CAD events be missed in this condition for a phase-shifted slave PWM?

Any guidance would be appreciated.

  • Hi Vishwa,

    To better understand the situation can you provide the following details

    1. What is the reason for having a TBPHS value higher then TBPRD, what is your application?
    2. What is the Action qualifier configuration of EPWM1 and EPWM4?
    3. Which even generates the sync out pulse from the EPW1?
    4. What is the count direction after the sync event?

    Regards,
    Harisyam

  • Hi Harisyam,

    Thank you for the response.

    1. Reason for TBPHS > TBPRD / Application

    The application is a 3-phase Vienna Rectifier PWM generation. The ePWM modules are configured in up-down count mode. Since one complete PWM cycle in up-down mode corresponds to 2 × TBPRD, I used:

    PHASE_R_SHIFT = 0
    PHASE_Y_SHIFT = (2 * TBPRD)/3 = 120°
    PHASE_B_SHIFT = (4 * TBPRD)/3 = 240°
    With TBPRD = 1071:
    PHASE_Y_SHIFT = 714
    PHASE_B_SHIFT = 1428
    The intention was to obtain 0°, 120°, and 240° carrier phase displacement between R, Y, and B phases.
    2. Action Qualifier Configuration

    EPWM1 and EPWM4 use the same AQ configuration:

    AQCTLA.CAU = AQ_SET;
    AQCTLA.CAD = AQ_CLEAR;
    TB_COUNT_UPDOWN
    Dead-band is enabled in complementary mode:
    DB_FULL_ENABLE
    DB_ACTV_HIC
    3. Sync-Out Event from EPWM1

    EPWM1 generates Sync-Out on counter zero:

    EPwm1Regs.EPWMSYNCOUTEN.bit.ZEROEN = 1;

    4. Count Direction After Sync Event

    The slave PWMs are configured with:

    EPwm4Regs.TBCTL.bit.PHSEN = TB_ENABLE;
    EPwm4Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;

    PHSDIR is not explicitly configured in up-down mode.

    Additional observation:

    With TBPRD = 1071 and a fixed duty of 0.7 (CMPA ≈ 749), EPWM4 operates correctly up to TBPHS = 1392. At TBPHS = 1393 and above, EPWM4A remains LOW and EPWM4B remains HIGH with no PWM switching observed. This boundary matches:

    2 × TBPRD − CMPA
    = 2142 − 749
    = 1393
    Please let me know if this behavior is expected or if there are any recommended restrictions on TBPHS relative to CMPA in this configuration.

    Regards, Vishwa

  • Hi Vishwa,

    Why do you need carrier phase displacement between the three phases?

    You can also refer to our reference design TIDM-1000 Vienna rectifier for the more details on implementation of Vienna rectifier. 

    Having a value for TBPHS higher than TBPRD is not a common use case. Also, if you have a very high value of TBPHS (higher than TBPRD), it is possible to miss one of the actions CAU since the TBCTR will be reset again from the sync out pulse of EPWM1. Assuming the counter direction is down after the sync event.

    Can you also share the expected pulses in a drawing if I missed something.

    Regards,
    Harisyam

  • My understanding is that in up-down count mode, one complete carrier cycle is 2×TBPRD, so I used TBPHS = 1428 to represent 240° phase shift (1428 < 2×TBPRD = 2142). However, during testing I observed that with TBPRD = 1071 and CMPA = 749 (70% duty), PWM operation is normal up to TBPHS = 1392 and fails at TBPHS = 1393 and above. Since 1393 equals (2×TBPRD − CMPA), it appears a CAU/CAD event may be getting skipped as you mentioned
  • Why do you need the phase shift within the switching period for Vienna rectifier, you can get your line cycle phase shift with aligned carriers.

    Can you share the expected waveform in a drawing, as having a TBPHS higher than TBPRD is not a common use case.

    You can also refer to our reference design TIDM-1000 Vienna rectifier for the more details on implementation of Vienna rectifier. TIDM-1000 reference design | TI.com

    The firmware for Vienna rectifier can be found in C:\ti\c2000\C2000Ware_DigitalPower_SDK_5_06_00_00\solutions\tidm_1000 if you download the digital power SDK from C2000WARE-DIGITALPOWER-SDK Software development kit (SDK) | TI.com

    Regards,
    Harisyam

  • I now understand from your comments and the TIDM-1000 reference design that a Vienna rectifier may not require carrier phase displacement, since the required 120° phase relationship is already present in the modulation references (Va, Vb, Vc). Thanks