Skip to main content
Associate II
April 13, 2026
Question

Rotor starts in wrong direction sometimes.

  • April 13, 2026
  • 3 replies
  • 154 views

I'm using an STM32G431 and MCSDK 6.4.1. It's a 340 VDC BLDC motor with two pairs of magnets, running in FOC mode with HAL sensors. The motor works well most of the time, but it often starts in the wrong direction and then returns to the correct direction after a few revolutions. This happens when trying to move forward or backward. Sometimes the motor goes into "hard commutation"—the current is higher at about half the normal current, and a sound indicates that the rotation isn't as smooth as usual. I tried adjusting the HALL_PHASE_SHIFT setting in 15-degree increments and settled on the smoothest rotation in both directions. Debugging the HAL sensors showed stable sector readings in both directions and no interference in these signals.

What else can I try to make rotations reliable? Would an oscilloscope help?

3 replies

GMA
ST Technical Moderator
April 13, 2026

Hello @BlachaL,

ST Motor profiler provides a HALL Sensor profiler. 
For more information, see the wiki page.

If you agree with the answer, please accept it by clicking on 'Best answer'.Best regards.GMA
BlachaLAuthor
Associate II
July 30, 2026

By adjusting the PID parameters, I was able to achieve more controlled RPM. However, I still have trouble starting the motor after the previous action was to stop it at high torque (tightening the screw). Loosening it sometimes causes it to start in the wrong direction and then reverse in the right direction.

GMA
ST Technical Moderator
August 3, 2026

Hello ​@BlachaL,

Are you still using the MCSDK6.4.1 version?
Could you try with the MCSDK6.4.2? As mentioned in the Specific changes introduced in the ST Motor Control Workbench chapter of the MCSDK release note: 
Improved Open to Closed loop transition overshoot behavior thanks to current and speed PIDs anti-windup feature. 

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