Skip to main content
CKlei.1
Associate II
June 2, 2021
Solved

How to switch from torque mode to speed mode while motor is running?

  • June 2, 2021
  • 4 replies
  • 2383 views

We're using STM32 MCSDK to control a high torque BLDC motor. The motor is equiped with hall sensors. Due to high torque at startup, we start the motor in torque mode. When running, we would need the speed control mode.

But if we change the control mode on-the-fly from torque mode to speed mode (when reaching a certain speed), the motor stops immediately after executing MC_ProgramTorqueRampMotor1() and ramps up from zero speed.

Furthermore: how can I switch from HALL sensor mode (main sensor) to sensorless obserer (auxiliary sensor) on-the-fly?

Any help/hints/tips are welcome :)

This topic has been closed for replies.
Best answer by CKlei.1

OK, I solved it by my own.

To switch from torque to speed mode, it only requires a MC_ProgramSpeedRampMotor1() command with a ramp length of 0ms.

When the speed SP is equal to the actual mechanical average speed (MC_GetMecSpeedAverageMotor1()), the transition from torque mode to speed mode is perfectly smooth. :thumbs_up:

4 replies

CKlei.1
CKlei.1AuthorBest answer
Associate II
June 2, 2021

OK, I solved it by my own.

To switch from torque to speed mode, it only requires a MC_ProgramSpeedRampMotor1() command with a ramp length of 0ms.

When the speed SP is equal to the actual mechanical average speed (MC_GetMecSpeedAverageMotor1()), the transition from torque mode to speed mode is perfectly smooth. :thumbs_up:

Imen GH
ST Employee
June 2, 2021

Hello @CKlei.1​ ,

Really glad to know you overcame this problem and thanks for sharing your solution.

Your answer is marked as Best answer . This will help other users find that answer faster.

Imen

MFlee.1
Visitor II
March 28, 2022

Hi there,

Thanks for posting the solution for the Torque to Speed modes.

Did you also figure out how to transition from Hall to Sensorless on the fly as well? I am trying to do the same on my application but whenever I try to do the transition, the device stalls.

Thank you!

CKlei.1
CKlei.1Author
Associate II
March 31, 2022

Hey MFlee.1

Unfortunately, I did not figure it out how to switch control modes (hall to sensorless) on the fly.

I have to admit that the project is dormant at the moment. Too many inconsistencies/ambiguities in the ST MC firmware or only limited support from ST itself...

A real pity.

But let me ask: how did you do the transition from hall to sensorless respectively what are the parameters on which you decide to switch?