cancel
Showing results for 
Search instead for 
Did you mean: 

How to reverse motor direction

DonCorr
Associate II

Hi All,

I have an STM32f302R8 with IHM07M1 with a Bull Runner 2804 motor. This may seem like a simple question but I cannot find any information as to reversing the direction of the motor. In my final project I will need to reverse the direction of the motor on occasion. Does anyone have any information that may help me?

DonCorr

1 ACCEPTED SOLUTION

Accepted Solutions
Fred V.
ST Employee

Hello @DonCorr,
Are you using the ST Motor Control SDK firmware to spin the motor? If yes, you can use its

MC_ProgramSpeedRampMotor1() API to set a negative speed reference and the motor will spin in the opposite direction.

Note however, that you cannot reverse the speed of the motor this way. The sensorless FOC code will lose the control of the motor at low speed. If you want to go from a positive to a negative speed (or vice versa), you'll need to stop the motor when reaching low speed (around 10% of the max speed, but that depends on the load; for this setup, with no or a very light load, one can go down to around 1200 RPM), set a negative (or positive...) speed ramp and then start the motor again (with MC_StartMotor1()). You may also need to tune with the rev-up  parameters to your needs. If you use the ST Motor Control Workbench that comes with the SDK, go to the Sensorless start-up parameters page or the Speed Sensing  Config. panel to configure them.

Another option would be to play with the open loop mode, switching between closed and open loop when spinning the motor at low speeds. Using the ST Motor Control Workbench that comes with the SDK, you can do that by ticking the Open Loop check box in the Debug Settings section of the Stage Configuration panel (Don't forget to regenerate, rebuild and reload you application in the STM32). But that option may be tricky to use.

In the hope it'll help.

View solution in original post

8 REPLIES 8
SRedd.5
Senior III

If you are using FOC then if you give negative IQ the motor will run in reverse direction.

DonCorr
Associate II

I am  using FOC (nice catch) but I have no experience in BLDC motors. Exactly how do I give negative IQ?

DonCorr

How are you running the motor in the forward direction?

Fred V.
ST Employee

Hello @DonCorr,
Are you using the ST Motor Control SDK firmware to spin the motor? If yes, you can use its

MC_ProgramSpeedRampMotor1() API to set a negative speed reference and the motor will spin in the opposite direction.

Note however, that you cannot reverse the speed of the motor this way. The sensorless FOC code will lose the control of the motor at low speed. If you want to go from a positive to a negative speed (or vice versa), you'll need to stop the motor when reaching low speed (around 10% of the max speed, but that depends on the load; for this setup, with no or a very light load, one can go down to around 1200 RPM), set a negative (or positive...) speed ramp and then start the motor again (with MC_StartMotor1()). You may also need to tune with the rev-up  parameters to your needs. If you use the ST Motor Control Workbench that comes with the SDK, go to the Sensorless start-up parameters page or the Speed Sensing  Config. panel to configure them.

Another option would be to play with the open loop mode, switching between closed and open loop when spinning the motor at low speeds. Using the ST Motor Control Workbench that comes with the SDK, you can do that by ticking the Open Loop check box in the Debug Settings section of the Stage Configuration panel (Don't forget to regenerate, rebuild and reload you application in the STM32). But that option may be tricky to use.

In the hope it'll help.

DonCorr
Associate II

I am using WorkBench 6.2.0. This information will take me a while to test while I get familiar with the SDK.  It sounds like a promising start. Thanks you.

DonCorr

Fred V.
ST Employee

You're welcome. Note that the ST Motor Control SDK comes with a set of documentations that will help you get familiar with it.

Best Regards,

FredV

Thanks for the start Fred. I have the Faulhaber motor merrily rotating along with the Hall effect sensors both clockwise and counter-clockwise.  Thanks again,

Don,Corr

HI Don, How did you go about reversing the direction.

It looks like it needs to stop and then reverse the direction. I was hoping to do it instantaneously. I'm using FOC with hall sensors.