- Jul 17, 2020
stancecoke said:Thank you for your assessment!
As you know, I'm using commercial China hardware, so I have to take the processor and the pinout "as is".
Some users report "misfires", audible random ticking or clicking while the motor is running.
I can't really reproduce this. So one idea is, there are sometimes problems with the order of the interrupts...
Actually I read in the halls by GPIO_EXTIx. The motor hall signal is on PA0, PA1 and PA2, so I could use Timer2 input capture channel 1,2 +3 also. I can not assess whether this makes a big difference
I'd guessed this was the case.
If it's specific to some users, perhaps noise on the hall inputs causing commutation errors? Some motors hall sensors are much noisier than others I've found. Are they filtered? I found on my first rev PCB it wouldn't work with ST firmware because the noise from the motor coupling onto the halls was triggering the timer reset/interrupt. I'd say misfire/bangs was closer to the mark than ticking...
I dealt with this in the second version with a filter, but also, rather than using interrupt, I now sample the hall state mid pwm period where there's minimal noise, and so it seems completely immune (on either hardware) at the expense of a few clock cycles.
Of course it may be something completely different. Unfortunately I don't have one of these motors/controllers despite attempting to buy one, otherwise I'd have a fiddle with your firmware.