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.

TMS570LS3137: 6-PWMs generation with 120° shifting

Expert 1995 points
Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello all,

I cannot find a way to generate 6 PWMs each one delayed by 120° for motor control applications. My original idea was to set the HET in Halcogen for the PWM generation and counting the time by a counter which starts each pwm by the function PwmStart() once the time equivalent to 120° is reached, but any time the PWM being started synchronizes itself with the 1st and the same the others. The results is 6 PWMS but identical each other.

Can anyone suggest me a (reliable) way to introduce a phase relationship between PWM channels with CCS and Halcogen?

Regards,

  • Unfortunately the template HET program used by HALCoGen does not allow you to introduce phase delays between the PWMs.

    See the example provided on this thread: 

    You will need to adapt it per your requirements. The best way to study this would be to use the HET IDE to simulate it.

    Regards, Sunil

  • Hello,

    I think to have found a workaround but before to uncork the bottle, I would like to discuss about it with a HET expert justo to be sure it would not produce incremental errors:

    I implemented the 120° shift as period for the 6 PWM directly in Halcogen (the channels have different frequencies/periods);

    Afterwards, I set the correct value of frequency by code. The result is that when the frequencies are set up to the common value, the phase relationship is kept.

    At the o-scope it works (6 PWMs shifted of 120° each other), but as mentioned above I do not know if this method can lead to problems when held for long time (e.g. if at a certain point the 6 PWMs tend to align each other again). Can anybody help me to detect future problems if I use this method? Thanks.

    Regards

  • Hello,

    Can you upload the HCG project and / or the resultant code project to be able to check this? You can message me privately as well with this information if you wish.

    Regards,

    Sunil

  • Discussion offline. Final resolution to be posted here.

  • The method you suggested does work. However, the method shown in this post allows you to define both rising and falling edges with a finer resolution.

    Regards,

    Sunil