2015-06-09 03:16 PM
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 #hall2015-06-09 08:01 PM
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.