Skip to main content
Associate
January 14, 2026
Question

Need help with Tuning FOC in StevalESC001

  • January 14, 2026
  • 5 replies
  • 793 views

Hi, 
I am using StevalESC001 board and MCSDK latest version to implement FOC on a custom motor.  

I am facing a few issues while testing it with load. I am unaware of what might be the cause of these issues if anyone could direct me towards what might be happening it would be helpful. 

First of all, during the startup motor sometimes starts spinning in anticlockwise direction that too at a very high speed. This behavior is random, I haven't yet identified any pattern into it, and it becomes more frequent when testing with load. I also noticed that sometimes Iq value shown in motor pilot is -10A initial which seems wrong, shouldn't it be 0 initially?

Another issue is with the Actual RPM and the RPM shown in motor pilot, the RPM shown by motor pilot is 300 to 500 more as compared to actual RPM the motor is spinning at. The difference increases as we increase the throttle. Also, motor seems to reach its capacity at only half throttle. It is producing only 600 g of thrust when expected at full throttle is 1kg. It seems to saturate at a 50% throttle and above that there is no change in speed, torque or thrust. Iq fluctuations also increase a lot, and it constantly makes correction, so the motor spins also fluctuate. Overall behavior is very unstable after 500g of thrust and 50% throttle, even the motor pilot starts twitching. All these testing errors are happening when load is applied, otherwise the motor works fine. 
Also, after changing the throttle it is reflected pretty late in the motor. There is noticeable lag into execution. 
I have a hypothesis that there is some issue in Iq and Id calculations due to FOC parameters not being tuned but I am not sure how to tune them. Can someone help me with this?

5 replies

federico.rodighiero87
Explorer
January 19, 2026

some details are needed, what is the feedback here ? hall, encoder, sensorless ?

HW/FW Motor Control Engineerhttps://www.linkedin.com/in/federicorodighiero/
Associate
January 19, 2026

Sensorless (observer + PLL) 

federico.rodighiero87
Explorer
January 19, 2026

then probably startup issues are related to rotor position at startup and alignment 

HW/FW Motor Control Engineerhttps://www.linkedin.com/in/federicorodighiero/
Associate
January 19, 2026

That makes sense, but how can I make it right? I have tried making changes into the startup profile section, but the issue still persists. Is there any way to properly tune it? 

federico.rodighiero87
Explorer
January 19, 2026

what motor is it ?

HW/FW Motor Control Engineerhttps://www.linkedin.com/in/federicorodighiero/
Associate
January 19, 2026

It's a BLDC custom motor. 

GMA
Technical Moderator
January 19, 2026

Hello @Prof_McGonagall,

Did you use the Motor Profiler tool for your motor? 
A misalignment in speed measurement can result from an incorrect pole pair value.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
Associate
January 20, 2026

Hello, @GMA 

Yes, I used the Motor Profiler tool for creating the motor profile and also verified the pole pair value. The issues still persist. 

GMA
Technical Moderator
January 21, 2026

Hello @Prof_McGonagall,

The sensorless STO-PLL algorithm is based on back-EMF estimation. You mention a speed range of 300 to 500 RPM, which may be too low to allow accurate estimation.
What is the maximum speed of the motor? At this maximum speed, are the estimated speed and measured speed aligned?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
Associate
February 10, 2026

Hello @GMA,

Thank you for the clarification and for suggesting the comparison between speed reference, estimated speed, and measured speed.

Based on further observations on my setup, I noticed that the speed reference set in Motor Pilot and the estimated speed reported by Motor Pilot are closely aligned over a wide range. For example: 1572 RPM reference → ~1560 RPM estimated

Previously, I was comparing against an external RPM sensor which I now believe may not be sufficiently reliable, so I am arranging a proper tachometer for more accurate mechanical speed measurements. For the moment, it appears that from the controller’s perspective, speed reference tracking is reasonably consistent.

However, even with this apparent alignment, several issues persist when testing under load:

  1. Motor Pilot instability at higher RPMs
    At higher speeds, Motor Pilot begins to glitch (UI flickering / abnormal behavior), and in one instance it switched to an unexpected interface state. I am attaching a video to illustrate this behavior. It is unclear whether this is purely a UI issue or a symptom of instability in the control loop at higher speeds.

  2. Low thrust and poor efficiency
    The motor produces significantly less thrust than expected for the electrical power consumed. For example, I was expecting approximately 1 kg of thrust around ~150 W based on comparable setups, but in my case the system requires ~250–260 W to reach much lower thrust. The motor also heats up rapidly at higher RPMs, suggesting poor efficiency or sub-optimal torque production.

  3. Poor responsiveness to throttle changes
    The speed response to throttle commands is quite slow. When increasing or decreasing the throttle, the motor speed ramps up or down gradually with a noticeable delay, whereas the application requires a much faster response.

  4. Occasional reverse rotation at startup
    As mentioned in my original post, the motor sometimes starts spinning in the opposite (anticlockwise) direction at high speed during startup. This behavior is non-reproducible and occurs more frequently when load is applied.

I attempted adjusting PLL and speed regulator parameters, but this generally led to increased instability (for example, sudden speed drops at higher RPM) without noticeable improvement in thrust or efficiency.

I would appreciate any guidance, suggestions, or references you may have that could help address these behaviors or point me in the right direction for further investigation.

Thank you for your time and guidance.