cancel
Showing results for 
Search instead for 
Did you mean: 

Hall sensor(TIM3) fails to control TIM1 for motor controll

lauris
Associate II
Posted on January 25, 2014 at 14:06

Hello,

I most likely miss something, maybe anyone can get me on the right way. I'm using 

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

 as reference, in function 

BLDCMotorPrepareCommutation()

 I have placed some trace(blinking leds according to hall values read), that part seems to be working well, but at the TIM1 outputs I get 1st position I detect on interupt and after that is isn't changing.

Basically tracing leds which are switching inside that function does switch as predicted - showing value I read from hall sensors. TIM1 outputs changes only once - after reset.

I think it might be something with not loading shadow registers to real ones. how to confirm-solve this little issue?

Current application is just simple PMSM motor spin up.

Thank you in advance,

Laurynas.
2 REPLIES 2
chen
Associate II
Posted on January 27, 2014 at 18:46

Hi

Hmmm - what you are doing is not an easy thing to do.

BDLC motors are not easy things to implement.

The system is actually a closed loop feedback system where the hall effect sensor is a rotor position indicator.

Anything that is closed loop feedback is normally very hard to work out when something goes wrong (it is very difficult to work out if it is the cause or effect - output or the input that is causing the problem).

'' I have placed some trace(blinking leds according to hall values read), that part seems to be working well''

What do you mean this part seems to be working well?

Do the system read the hall effect sensor correctly?

Does it reliably detect when the magnet is over the sensor?

''TIM1 outputs changes only once - after reset.''

Start by ignoring the motor. See if you can reliably change TIM1 with different values.

Then check that you can reliably detect the hall sensor with Tim3.

I have not looked at the code but I suspect Tim3 must be set up in input capture or output compare in order to determine the period of the hall sensor going round.

lauris
Associate II
Posted on January 27, 2014 at 22:13

Hello,

Well looks like I found my problem, was trying to select wrong timer output(TIM4 instead TIM3) to control 1st timer. now need some picking up dead times, delays and ect. since motor is running, but it seems it isn't synchronized well.