AnsweredAssumed Answered

Using Hall Sensors for Position on STM32F407VGT6

Question asked by deschaux.zachary on Jun 10, 2015
Latest reply on Jun 10, 2015 by Clive One
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.