cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 BLDC sinusoidal commutation

sebastianr
Associate II
Posted on May 11, 2012 at 15:45

Hello,

has anyone tried out to implement a sinusoidal commutation for STM32 controllers? I'm already working with a block commutation quite similar to that:

http://www.mikrocontroller.net/articles/STM32_BLDC_Control_with_HALL_Sensor

(also mentioned in some other post here).

It works well but to improve efficiency, I'm working on sinusoidal commutation now, that means, I want to change the PWM duty cycle of one PWM block sinusoidal. At the moment it's constant over the whole commutation step.

Whats the best way to do that? I tried to start another timer which changes the PWM duty cycle (CCR val of PWM timer) e.g. 20 times corresponding to a sinus-half-wave with 20 sampling points. These points I stored in a pre-calculated LUT. However when changing the PWM value in the IRQ Handler of the timer, the motor is jerking and vibrating more and the speed isn't constant anymore. I use a simple PI speed-controller.

Does someone have a few tips for me?

thanks in advance!

regards,

sebastian
3 REPLIES 3
davef967
Associate II
Posted on June 08, 2012 at 06:14

For a sine drive you don't want to use a 1/2 sine wave to modulate your voltage or current comand.  You want to use only the portion from 60-120 degrees.  Thus it starts and ends with a value of 0.866.

DaveF

sebastianr
Associate II
Posted on June 22, 2012 at 10:30

I don't understand. Of course I want to use 1/2 sine wave from 0-90° because the PWM ratio has to be low at beginning/end of a block and highest und the middle of one block. Or am I wrong?

regards,

sebastian

davef967
Associate II
Posted on August 28, 2012 at 19:20

Yes of course, you are correct.  I must have been asleep.  I think what may have confused me is your reference to the ''commutation step''.  For a sine drive all of the phases are driven simultaneously over the entire electrical cycle using center based PWM.  

So phase A is modulated by  sin(theta) where theta is the electrical angle.  Similarly Phase B is modulated by sin(theta+120) and phase C by sin(theta=240).  Note that the sine value goes positive and negative.  You can use a simple LUT for this with 90degrees of sine data but you must make it negative in the appropriate place.

Again, sorry for the previous confusion...

DaveF