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.

TMS320F28335: Synchronized PWM for harmonics elimination

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Hello,

I'd like to use synchronized PWM (or harmonics elimination PWM, or "synchronous" PWM) on 28335 DSP. I believe there are many ways on how to do it, but maybe there is some "best practice" solution on how to do it (for production quality). To describe it in more details, the PWM is driven by the argument of stator frequency and the argument together with precalculated angles determine the instant of switching.

The angles are given by modulation depth and wt is calculated from the speed sensor + slip frequency (ACIM is the target). This technique is very popular for low-switching frequency converters or high-speed drives (traction drives).

I'd like to keep certain features of ePWM module active, like deadtime insertion and double-buffered (shadow mode) access. I'm also planning to switch between classical PWM and HEPWM in runtime.

Thank you in advance!

Matej

  • Hi,

    This query has been assigned to the expert. Please expect delay in response due to the US holiday on Monday.

    Thanks
    Vasudha

  • Hi Matej,

    Unfortunately, as of today, Ti C2000Ware do not have the publised solution for this pertucular use case of harminic elimination PWM (synchronized PWM) for any C2000 device.

    I believe that you may have to develop this PWM method on your own for this case.

    Apologies for the inconveniece!

    Regards,

    Sumit

  • Hi,

    I was not expecting an example code, just some guidance on how to implement it from someone who knows the device from the top to the bottom. E.g. "use the Action-Qualifier Submodule".

    My idea is this:

    1) the period setting will be set to fit the slowest stator frequency for this mode (thus very high number, in combination with pre-scaler - e.g. from 20ms to 6ms period of the sine wave). The counter register will be reset every time the sinewave goes around.

    2) since the "angle" of switching is determined by SW, there will be a fast and short interrupt (like 100kHz) which would evaluate the "angle" of switching and do the action using Action-qualifier Continuous Software Force Register (AQCSFRC). I'm expecting the Dead-Band Generator to do its job and insert the deadtime. Fast and short interrupt is important to get the resolution as good as possible.

    Maybe you have some ideas.

    Thank you,

    BR,

    Matej

  • Hi Matej,

    Thanks for the details.

    We are looking into this and will let you know once we have some thoughts on this or if we need more detail.

    Thank you for your patience!

    Regards,

    Sumit

  • Hi Matej,

    Would you be able to provide some figures of the actual waveforms you are trying to achieve? We don't provide support in implementing specific algorithms or techniques, that is not where our expertise lie, but rather support in regards to device configuration. It would be up to you to implement the technique you are describing, but we can help with specific questions about the features of the device or the IP. 

    Best Regards,

    Marlyn

  • Hi Marlyn,

    I was not expecting more and thank you for following up.

    The gate signals are at the top-left chart, with reference stator voltage position and sine wave reference at the bottom. On the right, there are just the frequency and amplitude of the sine wave (for your reference).

    Zoomed view is shown below:

    The algorithm calculates switching angles "alpha1" to "alphaN" (as shown in my original post, N = 7 in my case) based on amplitude and actual stator vector position (theta). If the theta meets the "alphaX" point, the gate signal for the power switch is set or cleared.

    To achieve this, I need:

    1) software control of the PWM outputs - Deadband module is expected to work normally

    2) resolution of the switching should be as fine as possible - I'm expecting to use 100kHz interrupt which would only do a read of the theta and compare it with calculated "alphaX", then force the outputs based on current state (I'm planning to use a simple state machine here)

    3) The "standard" PWM mode should be suspended to not interfere with the algorithm above. I was planning to set the PRD register to some very high number so the compare would not happen at all (I can do a restart of the CNT register before the compare would occur. I'm not sure with this approach. Or, I can simply set the ref value for the PWM to some very high so the output is basically always set and then I can force the output low by SW anytime.

    4) For your reference: the sine wave frequency will change from approx. 50 Hz to 150 Hz, thus the period of a single waveform starts at 20ms and goes down to 6.6ms. During this time, I should be able to control the outputs by SW with no PWM compare involvement.

    Some articles about the technique:

    Thank you for your comments,

    Best regards,

    Matej

  • Hi Matej,

    1) software control of the PWM outputs - Deadband module is expected to work normally

    Are you planning on using complementary pairs? Or you just want the delay applied to rising and falling edges? Either way the deadband module can be utilized for both.

    2) resolution of the switching should be as fine as possible - I'm expecting to use 100kHz interrupt which would only do a read of the theta and compare it with calculated "alphaX", then force the outputs based on current state (I'm planning to use a simple state machine here)

    If you want to force the outputs after the comparison happens you can use the trip-zone submodule with a software force. You will have to independently force the A and B channels to their respective states. The trip zone submodule comes after the deadband submodule so at this point the A and B channels are independent.

    There is the alternative of using the action qualifier software force but this comes before the deadband submodule so the complementary pairs will still hold depending on your dead-band settings.

    3) The "standard" PWM mode should be suspended to not interfere with the algorithm above. I was planning to set the PRD register to some very high number so the compare would not happen at all (I can do a restart of the CNT register before the compare would occur. I'm not sure with this approach. Or, I can simply set the ref value for the PWM to some very high so the output is basically always set and then I can force the output low by SW anytime.

    You can use the global load/one-shot load feature to update when compare values/action qualifier software force will take place. This is a really useful feature for when the control algorithm/control calculations are asynchronous to the EPWM switching frequency. Please take a look at this feature. It is described in the TRM and in the "Safe and Optimized PWM Updates in High-Frequency, Multi-Phase and Variable Frequency Topologies" section of The Essential Guide for Developing With C2000RealTime Microcontrollers

    Best Regards,

    Marlyn

  • Hi Marlyn,

    This is really helpful. And I belive the answer will help more people with similar goals.

    Maybe just to clarify: my application is a 3-phase bridge driven ACIM.

    Regarding the settings of ePWM running "on the background" while fully SW controlled, I just realized that it may keep running with standard PRD settings. The CMPA (or CMPB if needed) values could be set to zero to keep the standard output of the PWM constant and at well defined level. Then, the Action qualifier will be used to control the outputs and (as you've said) use the dead-band to insert the deadtime to complementary switches. Anyway, the global load is definitely a great hint for the transition between different modes I'm planning to use.

    Thank you,

    Best regards,

    Matej

  • ...and finally one note to the above: Global load feature is available only for

    TMS320F2838xD/S • TMS320F2837xD/S • TMS320F2807x • TMS320F28004x • TMS320F28003x • TMS320F28002x

    Since I'm still using 28335, the global load is not in play. Anyway, I take it as a motivation for our HW guys to migrate to 28389.

  • Hi Matej,

    Thank you for adding extra information for others to reference. Yes, I apologize, the global loading feature was introduced in our newer devices. This along with other enhancements have been implemented. I do suggest transitioning to the F2838x if your design cycle allows it. 

    Best Regards,

    Marlyn