cancel
Showing results for 
Search instead for 
Did you mean: 

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

CKlei.1
Associate III

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 :)

1 ACCEPTED SOLUTION

Accepted Solutions
CKlei.1
Associate III

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:

View solution in original post

4 REPLIES 4
CKlei.1
Associate III

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

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
Associate

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
Associate III

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?