cancel
Showing results for 
Search instead for 
Did you mean: 

SPEED_MEAS Turns Negative at High RPM (27k) with Sensorless FOC on STM32

orse
Associate

I'm using ST MC Workbench v6.4.1  to generate sensorless FOC control code and trying to run a motor with the following setup:

  • PWM frequency: 50 kHz

  • Motor: 7-pole pair BLDC, 1750 Kv

  • Bus voltage: 24 V

  • Most other parameters are at default values

When I run the motor unloaded and increase the speed, the SPEED_MEAS parameter (observed in ST Motor Pilot) suddenly turns negative around 27,000 RPM. I’ve tried adjusting current loop and PLL parameters, but it didn’t help.

Any idea what could be causing this issue? How can I resolve it?

微信图片_20250916191403_48_301.png

3 REPLIES 3
GMA
ST Employee

Hello @orse,

Does the motor physically change its direction of rotation, or is only the SPEED_MEAS incorrectly reported?

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

Hi @GMA ,
The motor's rotation direction remains correct. It is only a measurement error.

 

GMA
ST Employee

Hello @orse,

 

Thank you for your report.
At this rotation speed level, the 6-step algorithm is typically more suitable.

For Sensor less STO-PLL, Speed variables are computed in SPEED_UNIT, which represents a tenth of a Hertz. To verify whether one of the internal variables has exceeded its dynamic range, modify the code as follows for testing purposes:

In mc_stm_types.h
/** Revolutions Per Minute: 1 Hz is 60 RPM */
#define U_RPM 60
/** Tenth of Hertz: 1 Hz is 10 01Hz */
#define U_01HZ 10
/** Hertz (Speed in Hz)*/
#define U_1HZ 1 /* (New definition) */
#define SPEED_UNIT U_1HZ /* Speed in Hz (modified) */
In drive_parameters.h
#define PID_SPEED_KP_DEFAULT                XXX /*/(SPEED_UNIT/10)*/ /* (modified) */
#define PID_SPEED_KI_DEFAULT                XXX /*/(SPEED_UNIT/10)*/ /* (modified) */

 

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