2016-03-17 12:23 AM
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 linkhttps://endless-sphere.com/forums/viewtopic.php?f=3&t=70870Having 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_SensorNow 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?Are my calculations correct?Regards Glenn2016-04-01 06:03 AM
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