cancel
Showing results for 
Search instead for 
Did you mean: 

problem in PWM output

SS.Sagar
Associate III
Posted on May 09, 2016 at 19:30

Hello,

I m configuring STM32F303xx processor for driving BLDC motor driver IC.

I have read the datasheet of the same processor.

From that i found that we can use TIM1 in Combined PWM mode (for driving 3-Phase BLDC motor).

But i m confused. There is one more mode as ''6-step PWM generation''.

So, Plesae suggest me which mode we can use for driving BLDC motor.

#3phase-bldc
3 REPLIES 3
knielsen
Associate II
Posted on May 10, 2016 at 08:33

When switching the H-bridge, you need to ensure that the upper MOSFET is off before the lower is turned on to avoid short-circuiting your supply. This is called dead-time insertion.

Some driver ICs like ST's L6234 have automatic dead-time insertion. In this case a straight-forward PWM can be used which is supported by any timer.

Otherwise, you need to use the advanced timers like TIM1 / TIM8 to handle the dead-time insertion from the STM32F303xx.

Hope this helps,

 - Kristian.

SS.Sagar
Associate III
Posted on May 14, 2016 at 12:35

Hi,

Yes, i m going to use driver ic L6230, and it also has dead time facility. 

So, i m going to use TIM1 for that. 

And In which mode i should configure the timer? Combined PWM mode , right?

knielsen
Associate II
Posted on May 14, 2016 at 17:04

You should be able to just use the basic PWM mode. Setting the CCRn registers defines the duty cycle and hence the effective voltage over each motor coil. I have some old example code that does this:

https://github.com/knielsen/stm32f4_motor_test/blob/master/main.c

I haven't used combined PWM mode, but if I understand correctly it does not make much sense to use it with the L6230. Since the L6230 has internal logic that controls both upper and lower MOSFET from a single input inX.