aaaaannnnd.....we have a tach.
This one turned out to be a little bit tricky, because everything looked good at low speed, but as soon as I tried testing it with the motor running, the measures went to crap.
Finally, it occurred to me that maybe my time wasn't high enough resolution, so I swapped over from calling
time.time()
to
time.time_ns()
This changed my timer precision from more-or-less a millisecond or so of precision to a nanosecond of precision. Given that the interval between two spark firings could be down in the 5ms or so range, that seems pretty obvious in hindsight.
Once I did that, other than having mis-counted the number of zeros in my multiplier to get RPM's, the values were pretty much dead in line with my existing tach.
Also, on a whim I tried putting the sensor on the ignition wire just to see what would happen and it worked perfectly, so I'll probably just roll with that going forward.
The one change I'm going to have to make is that I added a 0.1uF capacitor on my output to clean up the signal, so I need to add that to my board.
Also, the rattling in the video is my flywheel cover being mostly loose.
Now, I just need to get the accelerometer going, which, critically, is about getting it calibrated to give me meaningful data. I'm also a little curious how it's going to do with the vibration of the motor, but I'll cross that bridge when I come to it. It's just breakout board on the main board, so it's all a software problem.
Next up will be getting the wiring inside the frame, figuring out where I'm going to mount the Pi itself. I'm still thinking under the seat, but we'll see.
Oh, and start gathering some telemetry.
So to close, I'm pretty happy with where I'm at right now, which is all of my critical telemetry is now working:
- Tach
- CHT
- EGT
- Gear
- Throttle Position
- Speed (GPS)
- Position/Direction (GPS)
I have more Hall Sensors coming (they're super cheap, like a buck apiece off Amazon), so I might use one of those for the clutch. I can just put a magnet on the clutch arm and detect the clutch status that way.
I even have a linear Hall Sensor that I could wire it into my Analog-to-Digital converter and get *exact* clutch position as a % of throw, but that may be more information than I can actually take advantage of.