cancel
Showing results for 
Search instead for 
Did you mean: 

BLDC Motor Control [FOC] Speed ramps

Daniel Husztikd
Associate II
Posted on October 11, 2017 at 15:23

I use a BLDC motor with Hall-sensors and ST FOC 4.3 (STSPIN32F0).  Everything works fine, but when I want to use speed ramps, speed just do not change. The software indicates correct speed ramp, but instead, nothing happens. What is this issue? Which component should I use, to have correct speed ramps? Thank you. 

#stspin32f0 #speed-ramp #bldc #hall-sensors #brushless-motor
13 REPLIES 13
Daniel Husztikd
Associate II
Posted on October 11, 2017 at 23:11

I have determined, that the motor always spins at the maximum speed, and I can not slow it down with speed ramps. 

WANG RENDONG
Associate II
Posted on October 12, 2017 at 04:29

Dear Sir

For trying to help you resolve the issue, firstly, would you describe how you implement speed ramp in your FW by using MCI functions?

Thanks.

Best regards,

Wang RD

Posted on October 12, 2017 at 07:54

Normally,

void MCI_ExecSpeedRamp(CMCI oMCI, int16_t hFinalSpeed, uint16_t

hDurationms) should be called by setting the target rotor speed and duration time in your FW if you do not use Workbentch(WB) to send this command to FW.

Or, without any modification for FW, ramp command can be sent from WB.  In 'advanced ' label, push button 'Exec ramp', the command (final speed and duration time from present) will be sent to FW.

Best regards,

Wang RD

Daniel Husztikd
Associate II
Posted on October 12, 2017 at 13:00

ADDITIONAL INFO: My motor spins at 6500rpm maximum and has 3 Hall sensors mounted at 120 degrees. 

Posted on October 12, 2017 at 12:13

Dear Rengdong!

Thank you for your reply. I use the 

MCI_ExecSpeedRamp function that you mentioned. If I use the FOC algorithm to compute, I can use speed ramps as I want, and thus I can modify the speed during run. If I use Hall-sensors as my main sensor, (and no other sensors) the speed ramps do execute (according to MCI_RampCompleted function), but the duty cycle of the PWM signal stays constant. When starting with Hall-sensor mode, it always spins up the motor to the maximum speed, and I can not change that. I have no idea, what is wrong with my setup. I dont think, that the Hall-sensor mode dont support ramps. Maybe there is an error in the FOC firmware? 

I am waiting for your answer!

Thank you for your time and assistance!

Daniel

Hani Chahine
Associate II
Posted on October 14, 2017 at 16:44

I had the same issue.

Your speed PI tuning is not right and the speed loop is winding up massively. Try increasing the gains of your speed PI controller. Also, reduce the PI divisors until you are in the correct range. 

I had to make huge changes compared with the small motor that comes with the kit and its standard  project settings because our motor is much bigger so needed higher speed controller gains.  

Posted on October 16, 2017 at 09:33

Thanks Hani! I was looking for the issue in the last week. I am very happy, that you said that, I had no more ideas where to search for the issue. I also have a more powerful and bigger motor, than the example. 

Altough, I am not a big expert in tuning PI controllers. 

This is my controller: 

0690X00000608cRQAQ.png

In your motor, what range found out to be sufficent?

Thank you

Daniel
Posted on October 16, 2017 at 11:28

You were absolutely right! After tuning the regulators, the speed ramps works like charm. Thank you!

But the torque is quite weak. What do you recommend to enforce it? 

Posted on October 16, 2017 at 15:41

Hard to say. Could be any number of issues. 

Torque comes from the current. Specifically q-axis current. Either your motor is weak (demagnetized) or you haven't configured the max current properly or your hall alignment is out by some margin thereby applying more d-axis current than q-axis. I think you can check this by running the motor in torque control and applying ONLY Id reference and Zero Iq. If the motor spins then your your hall alignment is wrong. The motor should lock because the current should be applied in phase with the flux and not generate any real torque.