cancel
Showing results for 
Search instead for 
Did you mean: 

Using Hall Sensors for Position on STM32F407VGT6

zachary
Associate
Posted on June 10, 2015 at 00:16

Hi all,

I recently have configured hall sensors to TIM3 on the STM32F407VGT6 and have had success in using it to find an RPM speed based off the timer registers. However, I was wondering if there is a way to find position instead, using the Hall lines as encoder lines (i.e. every rising edge it increments the counter). I could not find any documentation indicating that this was directly possible in either ST documents or on the forum.

I know how to do position for a quadrature encoder or in this case for two of the Hall lines, but I don't know how to include the third. Would there be a way to take into account the third line without resetting the counter? Would some sort of XOR be available for two of the three lines?

Also, I've tried setting up all three as input capture lines to TIM3, but that just latches the counter every time they have a rising edge rather than increment the counter. Is there any way to make it increment instead of latching a free running counter in this mode?

Also, I'd prefer to be able to do this without having to write extra routines (minus initialization routines). The more I can put onto timer settings and less in a control loop, the better.

Any help would be greatly appreciated! Please ask if in need of any clarifications.

#tim #stm32 #encoder #hall
1 REPLY 1
Posted on June 10, 2015 at 05:01

You could XOR them, but this isn't going to let you determine direction, just count things. I suspect you're going to have to manage the CC1,CC2 and CC3, and infer direction by the sequence in which they occur.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..