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.

LAUNCHXL-F29H85X: ramp up the duty cycle

Part Number: LAUNCHXL-F29H85X
Other Parts Discussed in Thread: SYSCONFIG

 

I have some urgent questions in the mean time.

Could you please tell me how we can ramp up the duty cycle when we start the PWM?

The situation is that we want to start with a duty cycle of 1% (100 ns) and ramp up to 50% (5 us) by increasing the 1 count of the CMPB every 1 ms.

We already plan to use the 1 ms CPU timer that is configured in your example- and this will result in a ramp up time of 0.98 seconds.

  1. Can I use the ePWMxA Event Output action under EPWM action qualifier and configure Set output pins to Low  when ePWMxA Timer base counter up equals COMPB ? I have to change the event to Set output pins to Low  when ePWMxA Timer base counter down equals COMPB for the third PWM, correct?

Here is a screenshot of the sysconfig for PWM2 (l2):

  1. If this is the case, and the other PWMs are phase shifted, I do not need values in the CMPA and CMPB registers, right? Because the phase shift is applied in the Phase Shift Value under EPWM Time Base as shown below (l2):


  2. Finally, would we always update the PWM when a new cycle starts or would we update this asynchronously when we write the value in the program?
    We would like to update the duty cycle with every new cycle, and not instantaneously when we update the code in the control loop.
  • Hi Jan,

    1. Can I use the ePWMxA Event Output action under EPWM action qualifier and configure Set output pins to Low  when ePWMxA Timer base counter up equals COMPB ? I have to change the event to Set output pins to Low  when ePWMxA Timer base counter down equals COMPB for the third PWM, correct?

    Yes you can configure the ePWMxA/B Event outputs in any way. If you need to update these action qualifier events in subsequent PWM periods they can be shadow'ed to reflect changes on the next PWM period. 

    If this is the case, and the other PWMs are phase shifted, I do not need values in the CMPA and CMPB registers, right? Because the phase shift is applied in the Phase Shift Value under EPWM Time Base as shown below (l2):

    Once a sync occurs, whatever is in the TBPHS will be reflected in the TBCTR. CMPA/CMPB registers do not need to be updated. 

    However please note of the cases where TBPHS is > CMPA/B, you will get a missed action. Also note of the counter direction after a sync occurs. You can either set the counter to start counting up after a sync event or start counting down after sync event.

    Finally, would we always update the PWM when a new cycle starts or would we update this asynchronously when we write the value in the program?
    We would like to update the duty cycle with every new cycle, and not instantaneously when we update the code in the control loop.

    To update the PWM, ideally you update all shadow registers before the next shadow to active load event occurs that you have configured.

    Best regards,

    Ryan Ma