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-F28379D: C2000 Control Loop Frequency For Motor Driver

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: TMDXIDDK379D, C2000WARE

Hi Team

I am trying to build a motor driver for my project and I am a bit new and inexperienced about this issue. I have a couple of questions regarding both the control side and the embedded side. If experienced people can give me answers about my problems, I would be grateful! My questions: 1) I have developed a model. Position control with FOC. My PWM carrier frequency is 10khz and the sample time of my model is 10e-5 sec. I have checked the frequency response of all 3 loops. After the check the bode plot, I have seen that my bandwidth according to -3dB is 500Hz for the Current loop, 150 Hz for Speed Loop, and 14 Hz for the position loop. I have developed an LPF for all these bandwidths. With these bandwidths and Low Pass Filters, I have observed pretty good current waveforms, Back EMF waveforms, and also speed and positions. But When I check the other industrial applications, the people said that for example, the current loop control freq is 24khz, speed is 4 Khz and Position is 2Khz for their application. It seems too much for me. What is the problem with that? Am I right about that, I mean the bandwidth which I get from bode plots are representing the control loop frequency of my loops? 2) As I said before, my sample time in the model is 10e-5 sec, ie. 100 kHz. When I put my model into F2837xD MCU, all my loops and models time step must be 10 Khz. Isn't it? 3) Also I have encountered a few videos about FOC with F2837xD in Matlab and they are looking a bit different from my model. I have designed all my loops and blocks on my own, I mean I didn't use any block related to F2837xD. After all these steps, I have built my model as C codes and get into F2837xD MCU. But all after this, I have seen a few videos and documents about my application. Some people are using DMC(Digital Motor Control) and FCL(Fast Current Loop) Libraries. I don't even use them in my application. Are these libraries required for me? I am asking this because I have tried to run my code in F2837xD and the code interrupted instantaneously after a few sec of start and I have gotten many errors related to "division". As I said, I am running all codes with 10-5 sample time and 10kHz carrier freq in my MCU. After that, I have reduced my sample time and It seems running, at least not interrupting. As I said, I am a bit new about this application and my questions seem too much but If you can help me with my questions I would be grateful! Thank you!

  • 1. To get a higher outer loop bandwidth, the inner loops should be supportive. I mean, the inner loop should have higher bandwidth. For current loop, 4KHz bandwidth is possible by using FCL. With FCL, the sample to control latency is about 1microsecond and can potentially give a current loop bandwidth of 1/4th of the sampling frequency. For speed loop and position loops, the motor should be supportive of higher bandwidth and is heavily influenced by the inertia of the system. If the inertia of your motor is high, you cannot get even 1KHz for the speed loop and will be further lower for position loop.

    Recommend to review TI user guide on FCL for more information.

  • Hi. I have the same issue but I am a bit confused. I have checked all bode plots for my all loops and I have look at my bandwidth according to -3dB. So as far as I understand, these are my control loop frequencies. For example, I have seen 1500 Hz bandwidth for the current loop in the bode plot. It represents my sample time for this loop in MCU. Am I right?

  • Yes, the sampling time has a contribution in there.

  • Hi. Thank you for your answer. It seems more clear to me but I couldn't understand what you mean by "current loop bandwidth of 1/4th of the sampling frequency". Also, I have seen a few application, BLDC-FOC, as far as I see, the current control loop of one of the application seems 24 Khz. It's quite a big value. Hence, as far as I know, PWM carrier freq must be at least 24 kHz. How can I achieve these loop speeds? Can FCL be enough?

    Also, I have seen a few codes, They are using DMC (Digital Motor Control) Library blocks. I have written my codes as C code. I mean all my clarck, park, inverse park, PIDs, and LPFs are C code. Should I use this DMC block also? What is the benefit of using them? Thank you!

  • So, as far as I understand LPF frequency is not equal to my control loop sample time. I mean If my current cut-off frequency of LPF is 1500 Hz, can I get my control loop sample time 1/1500 = 6.66e-4 in MCU? or not? If not, How can I calculate my sample time for each control loop?

  • The current loop bandwidth is the maximum frequency of the loop input signal that the controller is capable responding to within the limits of 3dB or 180 deg phase lag. For the example you mentioned, for a 24KHz current loop bandwidth, the pwm frequency should be near 100KHz. FCL is good for such high bandwidth reqs.

    You could use your own code. DMC code was just a reference to get started and it is not necessarily the optimal form of code writing.

  • Thank you for your answer. So, as far as I understand, If my current loop bandwidth is 24 Khz, the sample time of the current loop in C2000 should be 24 kHz. Am I right? I mean, The running speed of my current loop should be at this level in C2000.The relation between control loop bandwith and loop working speed, ie. sample time, is confusing my mind.

    I have taken a look at FCL but I couldn't find any example code and documents are looking too short. Can you share with me a code or example for FCL?

    Also, I have seen that FCL is using SVPWM but I am using SPWM. Can I integrate my own SPWM codes in FCL?
  • No, for 24KHz bandwidth, you need atleast twice the samples to even capture the signal. But stability and phase margin constraints will kick in to demand a higher sampling freq. With FCL, we can manage with 4 times.

    There are examples available in MCSDK for FCL, look at the project at 

    C:\ti\c2000\C2000Ware_MotorControl_SDK_3_00_01_00\solutions\tmdxiddk379d\f2837x\ccs

    SPWM is also good for FCL.

  • Thank you so much!

    It's resolved my issue.

    By the way, is it possible to integrate my own SPWM code to FCL? or Hoıw can I integrate sample SPWM code to FCL? Is there any example or guide for that?

  • You can call your pwm routine instead of svpwm routine.

    With this, am closing this thread.