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.

TMS320F28031: PMSM FOC's Torque PID output gets saturated

Part Number: TMS320F28031


I have implemented Sensor less FOC for PMSM motor using Example codes given by TI.

It is running in torque loop only, i haven't added Speed loop because i need to run the motor in torque loop only. I have implemented a MPPT loop using PO method which gives the Reference command to PID block. It compares previous power and present power and increase/ decrease refernce command for the PID.

My motor is running ok but if i limit the Power or reduce the Power in running then Pid_Iq1.Out gets saturated. It is not recovering until i reduce my Reference command. but as per KC gain, it should come out of the Saturation. and beacuse of that my power remains constant and MPPT loop doesn't change the Command.

Can you please guide me to resolve this issue? can i use only torque loop in PMSM FOC or i have to use Speed loop on top of torque loop?

Do let me know if you need any more information.


  • That's normal, you have to change the reference value of the PI controller by manual or by using the speed controller, otherwise the feedback value is always smaller than the reference value, and the integral value will be saturation.

  • System requirement is torque control so can't put Speed control PI.

    I can put some intelligence in the code to change the reference value. But how to detect whether the PI loop is going in saturation before it actually goes? It will be helpful if you give some ideas?

  • You can check if the value of the integral variable is equal to the maximum or minimum variable of the PI controller.

  • Yes i tried that but when i increase PID Reference command then it immediately goes into saturation and motor speed drops. after that i have to reduce the reference command of PID by huge margin then only PID recovers from the saturation. This gives oscillations in speed. which is not acceptable.

    How do i know that what is the response time of my motor or how much reference command of PID, i can increase? if my software knows these details then i may control this better.

    please suggest any idea to predict saturation faster.

  • Did you try to tune the gains (Kp, Ki, and Kd) for the PI controller?

    How do i know that what is the response time of my motor or how much reference command of PID, i can increase?

    You might take a look at some textbooks about the PID or control theory that have the formula to calculate the response time, or you can simulate/calculate it with Matlab if you want to know the exact time. Generally, you can tune the control parameters to get the right response according to your system.