fechter said:
The gate drive for the low side FETs will be exactly the same timing as the hall sensor signals.
There must be a 5v line out of the processor that goes to the low side gate driver. This would be a buffered version of the hall signal.
I'm really going to have to make a video to demonstrate the problem, here
. The signal going into the gate driver is going to exhibit the same behaviour as the raw hall signal. You're certainly going to get a pulse that you (or the CA) can count, but there is no guarantee that the pulse is proof of forward motion.
When I was trying to sort out the best place to tap in to a Shenzhen controller for speed last year, I was new to how the controller actually worked. I wired up a little breadboard with LEDs (and dropping resistors) on it, and tied directly into the hall sensors so I could observe the commutation sequence in action. Then, after seeing how THAT worked, I wired my counter into one of the signals and rotated the wheel exactly one revolution by hand. I Counted 23 pulses. Great! (I thought).
So I hooked everything up to use the hall pulse to drive my speedometer/odometer. Moving the wheel by hand (again), I confirmed that the counts were consistent with the wheel revolution. So, the next test was to power the wheel (low throttle, so I could keep track of the valve stem - which I was using as a visual reference for a rev counter) and move it through 100 revolutions - expecting, at the end, that I'd see 2300 hall counts... But NO! WAY more!
Thinking I'd buggered something up in translating this to a real circuit, I spun the wheel by hand (again) - this time through only 10 revolutions. 230 pulses, as should be. Hmmm...
Thinking that noise was the problem, I buffered the raw hall signal (through a transistor, and with a small cap and pull-up resistor on the output). This didn't change the result. The count was consistently too high (and I suspect more or less, depending on how much throttle is applied). And THAT got me thinking again... I *could* have tried a bigger cap (the signal I was creating was being fed into an Schmitt trigger before getting to the counter, so any squishyness to the signal would be cleaned up - but then I worried that TOO big of a cap would cause a problem at higher revs - keeping the cap charged, and dropping signals). I put an LED back on the circuit so that I could see when the sensor was active, and then rotated the wheel to the point where the LED only just came on. Then I backed off a hair. Locking the front brake so the bike wouldn't move, I applied some throttle - and got the expected juddering complaining sound that one expects to get (until the controller realizes that the motor is stalled and stops trying). The bike hadn't moved an inch, but I had enough hall counts to suggest that I'd just rocketed a hundred feet in a few seconds...
That's when "digital Phil" said, "to heck with this - I need PROOF the bike is moving before I generate ANY pulses", and that's what prompted me to add a 2 chip digital filter (two cheap and readily available logic chips, actually) to the equation. I now get a hall count that I can take to the bank.
This is actually a subject that will warrant a separate thread - I'll put together some more details, the circuit, and how it is used it later this week (may "day job" is getting in the way :-(). I've actually integrated this little 2 chip circuit into the end of the cable running from my motor into the controller. This way, I don't have to keep fooling around with individual controllers to get a reliable signal - it' "part of the wheel", and works with ANY of my controllers. (Doesn't help the freewheeling motor guys, though). Will document what it does - and I've included a light show in the final unit (it was too cool not to - I like das blinkenlights
).
Before everybody gets their knickers in a knot, though... It's possible that not ALL setups will exhibit this behaviour. If your wheel contains hall sensors that latch (and don't unlatch until they see a magnetic reversal), then you're probably fine. The ones in the GM motor don't do that, and this is what started this whole "experience".