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.

TMS320F28027: Current harmonic cancellation in FOC motor control

Part Number: TMS320F28027
Other Parts Discussed in Thread: CONTROLSUITE, TIDM-HV-1PH-DCAC, MOTORWARE, C2000WARE

In the design of my drive control (sensored FOC) I have reached a very promising point using the F28027 Controller on a custom layout, worth mentioning without InstaSpin – so this is a “classic” F28027 Controller. The mathematical transformations are largely based on the open source software part of InstaSpin and “controlSuite motor app blocks” and delivers as described already good results.

However, the phase current shows a 5th - and 7th harmonic / harmonic wave, which limits the maximum usable power of the system due to a distortion of the current. I assume that TI has already dealt with the issue of "harmonic cancellation" in the field of motor control. I have already found some approaches from the literature dealing with harmonic elimination. Examples would be an AFC controller for harmonics or, as described in reference design TIDM-HV-1PH-DCAC, the use of a 2P2Z - compensator.

Ultimately, I am still at the beginning with my elaborations on this topic.


1. Is there ideally source code specifically for the implementation in the field of motor control?

2. Should I use a compensator like the one shown in the ref. Design (TIDM-HV-1PH-DCAC), how are the coefficients determined for a harmonic cancellation?

3. TI offers a tuning guide for PID controllers, is there comparable literature for compensators?

4. Are there other approaches to eliminate the harmonics?

 

I would be delighted to have initiated an interesting discussion here and am looking forward to the exchange.

Best regards Benjamin

  • Much of the 5th and 7th harmonics are typically due to dead band compensation. If you take care of that, you should see much relief.

    For your other queries,

    2 -> We have not tried, so I don't want to promise anything. You are free to try and see how it goes.

    3 -> Will leave it for others to answer

    4 -> You cannot fully eliminate, but minimize. Besides deadband comp, you can increase the switching frequency / add external passives, but they are not cost optimal.

  • Just a note regarding the third point.

    The TIDM-HV-1PH-DCAC reference design uses several 2P2Z compensators from the DCL (termed "DF22" compensators) to remove harmonics by configuring them as PR controllers. This worked because the grid connected inverter is fixed frequency, so the compensators don't change. We don't have that situation in motor control so I'm not sure how a similar approach could be applied.

    There isn't currently a compensator tuning guide document in the DCL, though perhaps there should be. I'll add an enhancement request for that. In principle it's a matter of pole-zero selection and then mapping the frequencies to coefficients. There are supporting functions in the DCL which do the latter.

    Regards,

    Richard

  • Unfortunately, I currently have too little background knowledge about compensators. However, I see from the file "voltagesourceinvlcfltr.c"  (TIDM-HV-1PH-DCAC reference design) from line 359 that here the controller coefficients are determined / calculated. It is noticeable that the define "AC_FREQ" is used.

        kiV_5H = KIV_5H;
        wrcV_5H = WRCV_5H;
        woV_5H = 2.0*PI_VALUE*AC_FREQ*5;
        computeDF22_PRcontrollerCoeff(&gv_r5, 0,kiV_5H,woV_5H,
                                       ISR_CONTROL_FREQUENCY,wrcV_5H);

    In the first approach, it would be conceivable for me to insert the electrical speed instead of AC_FREQ and to recalculate the coefficients before the actual compensator call in each interrupt.

    I have tested the approach with deadband compensation, the influence on the harmonics in my case, however, is very low.

    Has InstaSpin already had approaches to eliminate harmonics from the phase currents? If so, can this be found in the "openSource" section?

    Regards,

    Benjamin

  • You can't do that, unfortunately.  A compensator contains internal dynamic data, like a digital filter, so each new output depends on previous inputs and outputs.  If the coefficients are re-computed each time the previous internal data is invalid.  There's no way of knowing what you'll get.

    A further complication is that the reference deign you mentioned was written for devices (F2837x and F28004x) which contain a floating-point unit.  I'm sorry I hadn't realised until your last post that the device you're currently using is fixed-point, so you won't be able to use the DCL.

    I think the way forward is to remain with the functions provided in MotorWare for this device.  If you need additional filtering functions for example, you can make use of the fixed-point filter functions in C2000Ware at:

    C:\ti\c2000\C2000Ware_2_00_00_02\libraries\dsp\FixedPoint

    I'll defer to a colleague on the InstaSpin part.

    Regards,

    Richard

  • "You can't do that, unfortunately.  A compensator contains internal dynamic data, like a digital filter, so each new output depends on previous inputs and outputs.  If the coefficients are re-computed each time the previous internal data is invalid.  There's no way of knowing what you'll get." Thank you for this explanation.

    On the subject of number format: Fortunately, I am very familiar with TI's development environments and various application programs. The first step is understanding. In most cases, I can translate the functionality into IQ format by myself or as you have already mentioned by using a library.

    Even while I was writing this answer, I noticed the vibration compensation library from InstaSpin. Is it possible to use these for phase currents and harmonic cancellation? I am looking forward to the answer of a responsible colleague. Thanks a lot!

    Regards,

    Ben.

  • Any updates on the InstaSpin part?

  • That's a different concept, the vibration compensation example in InstaSPIN is for reducing the mechanical vibration by adding a feedforward control in some applications, such as air conditioning compressors. It can't be used for phase current and harmonic cancellation.

  • Hello. Meanwhile, two weeks have passed and unfortunately I have not yet received a clear answer to point 1 of my questions. I would like to ask you for a reply. Many thanks.

  • Dead band compensation is the primary way to beat the harmonic distortion. Secondly, I would say that if you can increase the bandwidth of current loop, then it can potentially minimize the distortion. However, to do that, the feedback sensing signal should be pretty clean and free from noise as much as possible (we don't have a quantified SNR for this). As such, a dedicated example code to minimize 5th and 7th harmonics is not available from us.

  • Thank you very much for this clear answer, even though I was hoping that other ways than deadband compensation would be shown. As already mentioned, I have already started the first deadband compensation tests, with very little impact.