cancel
Showing results for 
Search instead for 
Did you mean: 

Brushless Motor control with Hall sensors (sensored)

glenn0010
Associate III
Posted on March 17, 2016 at 08:23

Hi there,

I have built my own circuits to drive a BLDC motor. So far I have managed to get an RC BLDC motor working quite smoothly in open loop. However my 1kW motor is not running good at all, it cgs at lows speed and locks up at high speeds. I am assuming since it has larger inertia hence in can only work in closed loop (i.e. with hall sensors)

For more information and videos on my progress so far visits this link

https://endless-sphere.com/forums/viewtopic.php?f=3&t=70870

Having said that I am struggling a bit to implement closed loop control. I have found this code which seems to be fine although it is not complete. Currently in the process of seeing what is happening via the datasheet. 

The code is found here: http://www.mikrocontroller.net/articles/STM32_BLDC_Control_with_HALL_Sensor

Now I think not everything is perfect in this code. My first question is where he is configuring TIM4 according to his calculations it take 3.5s for the Timer to overflow, however I consulted the datasheet and done my own calculations and the frequency comes out to 10.09Hz hence 0.1 sec for the timer to overflow not 3.5s. Is this correct?

0690X00000602sjQAA.jpg

Are my calculations correct?

Regards Glenn
1 REPLY 1
Gigi
Senior
Posted on April 01, 2016 at 15:03

Ciao

Computation seems ok.

Usually, in this, case some assumption that we are taking are wrong (for instance the stating frequency, prescaler used or autoreload value).

I suggest to go step by step, maybe putting in the output directly the MCO or use prescaler 0 and/or ARR = 1 to understand if the starting frequency is ok.

Anyhow is not a question related specifically to motor control so I can suggest to check also in the generic STM32 forums.

Ciao

Gigi