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.

first duty cycle missing when ePWM period changes

Part Number: TMS320F280025

Hello Champs,

F280025 ePWM1 is set to synchronized with ePWM2(the same period) and the shadow load mode of phase-shift, period, CMPA for ePWM1 are all set to "Load on SYNC".

When the period changes, it's found out that the first duty cycle will be lost.

Would you please kindly help? Thanks!

Best Regards,

Linda

  • Hi,

    Its possible that depending on when the synchronization occurs and if the CMPA event controlling the duty is already passed, there is a possibility of missing pulse.
    Since it's the first cycle, you can always load an offset into the counter of ePWM2 by writing to the TBCNT reg, before starting the PWMs.

  • Hello Subrahmanya,

    Thank you for your reply. But the first pulse missing occurs only at every time of changing period, not the starting of PWM. Would you please help why there will be first pulse missing when period changes? Is it also necessary to load an offset to ePWM2 counter every time when period changes?

    Thanks!

    Best Regards,

    Linda

  • Hi,

    When synchronization happens counter value changes suddenly there is a chance of missing the compare event.
    This depends on multiple factors like current compare value, current counter value and new counter value when the sync happens.
    This could happen even if there is no change in the period value. 

  • Hi Subrahmanya,

    Would you please suggest how to find the root cause of missing compare event? Thanks!

    Best Regards,

    Linda

  • Hi,

    If you want to check this is happening due to missing compare event, you can try below experiment.
    Say PWMx is getting synchronized, set this to fixed duty cycle, you can use another PWMy compare event to generate sync event.
    Keep changing the compare value in PWMy, hence changing the time at which synchronization occurs, and see when the pulse goes missing.
    This should confirm that occurrence of Sync from PWMy w.r.t. compare event occurring in PWMx is the source of the problem or not. 

  • Hello Subrahmanya,

    Thank you for your suggestion. So in this experiment, is it necessary to enable and set TBPHS or not? Thanks! 

    Best Regards,
    Linda

  • Hi,

    There is possibility of missing compare edge in both cases, with or without TBPHS enabled.
    Frequency change, without TBPHS, could also result in missing edge if done incorrectly.
    So, you can try with TBPHS disabled first and then try enabled as well.