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.

TMS320F28375S: Synchronization Issue with EPWM2, EPWM6, and EPWM8 on TMS320F28375S

Part Number: TMS320F28375S
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello Team,

I am using a TMS320F28375S microcontroller and I have selected EPWM2, EPWM6, and EPWM8 for my application. I am facing issues with synchronizing these EPWMs.

i am able to generate the EPWM properly with proper duty cycle but my EPWMs are not starting at same time. i want that my EPWM2, EPWM6 and EPWM8 starts at same time but myEPWM6 starts after EPWM2 and 8 starts after 6.

From the synchronization diagram in the reference manual, it appears that EPWM2 is naturally synchronized by EPWM1, EPWM6 by EPWM5, and EPWM8 by EPWM7. However, I have not used EPWM1, EPWM5, and EPWM7 in my setup.

Could you please provide guidance on how to synchronize EPWM2, EPWM6, and EPWM8 on same time?

also there is a specific behaviour in PWM outputs: - If I set the duty cycle of EPWMxA to 50% and EPWMxB to 40%, then EPWMxB goes high after EPWMxA completes 5% of its cycle and goes low when EPWMxA has 5% remaining.

For example, with a 10 kHz signal:

- EPWMxA has a period of 100 microseconds. It remains high for the first 50 microseconds and low for the next 50 microseconds.

- EPWMxB is low for first 5 microseconds and then goes high (5% of 100 microseconds) and go low at 45 microseconds (5% before the end of the high period of EPWMxA).

Here’s a more detailed example:

- EPWMxA high from 0 to 50 microseconds.

- EPWMxB high from 5 to 45 microseconds.

is this behaviour ok or both should start at same time?

Thank you!

Thanks and Regards

Muzammil Qureshi

  • Hi Muzammil,

    One approach to synchronizing the EPWMs is to use the synchronizing/phasing hardware in the EPWM modules.  That is, TBCTL.SYNCOSEL bit, and TBPHS register.  This allows you to sync PWMs or change the phasing on-the-fly, whereas with the TBCLKSYNC method the phasing is statically configured at initialization time.  However, the syncing is through a controller PWM module (e.g. EPWM1) to base the syncing off of, which you specified you are not using here. 

    Another approach for you that I'd suggest you be sure to do would be to sync the EPWM modules by using the TBCLKSYNC feature.  If you initialize the TBCTRs to the same values and then starting all ePWM clocks together using TBCLKSYNC, they should align. Are you already doing this?

    Best Regards,

    Allison

  • Hello Alison,

    Thank you for your reply. 

    One approach to synchronizing the EPWMs is to use the synchronizing/phasing hardware in the EPWM modules.  That is, TBCTL.SYNCOSEL bit, and TBPHS register.  This allows you to sync PWMs or change the phasing on-the-fly, whereas with the TBCLKSYNC method the phasing is statically configured at initialization time.  However, the syncing is through a controller PWM module (e.g. EPWM1) to base the syncing off of, which you specified you are not using here.

    although did not understand this properly because i have configured PWMs using sysconfig but

    Another approach for you that I'd suggest you be sure to do would be to sync the EPWM modules by using the TBCLKSYNC feature.  If you initialize the TBCTRs to the same values and then starting all ePWM clocks together using TBCLKSYNC, they should align. Are you already doing this?

    yes i have tried it and now my PWMs are synchronised properly.

    could you please provide clarification on my second confusion which i have mentioned regarding duty cycle in previous message?

    Thanks and Regards

    Muzammil Qureshi

  • Hi Muzammil,

    Glad to hear they are synchronized!

    The duty cycle of each channel (channel A vs. B) will depend on what you configure your TBPRD to be for the EPWM and what action qualifiers you configure for each individual channel. When you say you are setting them to 50% and 40%, what are the TBPRD and action qualifiers that are being used then? Are you saying the output is different than you expect based on the action qualifiers? Can you provide an oscilloscope capture or diagram showing what you see vs. what you expect?

    Best Regards,

    Allison

  • Hello Allison,

    I am generating 10KHz PWM on EPWM2A and EPWM2B. for that, my settings are as follows

    by this settings, the waveform which i am getting is 

    in above image, channel 0 is EPWM2A and channel 1 is EPWM2B.

    In the image, it is observed that EPWM2B goes high a short time after EPWM2A goes high.

    I thought both will go high at same time.

    what changes i have to do so that i can get that waveform? i.e. both goes high at same time.

    thanks and regards

    Muzammil Qureshi

  • Hi Muzammil,

    Your configurations set channel A high on CMPA-up and set channel B high on CMPB-up. CMPA = 2500 and CMPB is 3000. Channel A and Channel B are a pair (they are based on the same EPWM instance and, hence, the same counter)) so naturally channel A will go high first when the counter reaches 2500, then channel B will follow when the counter keeps counting and reaches 3000. If you want both to go high at the same time, you need to make sure the action qualifier values are the same (there are many different configurations of action qualifiers that will result in this, but as an example, you can set CMPA and CMPB equal to the same value here). Note that you can also alternatively use CMPA for both channel A and B action qualifiers, so you could set both channel A and channel B high on CMPA-up (or some other specified counter value) if you'd like.

    In general, I'd recommend looking at some of our documentation that explains the functioning of the EPWM modules to help familiarize with the settings/outputs:

    Best Regards,

    Allison