Odometer

From Elcano Project Wiki
Jump to navigation Jump to search

There is odometer hardware on both the Drive-By-Wire board and on the High Level board. Normally the speed and odometer will be computed on the Drive-By-Wire board and passed to the HighLevel board as a CAM message. However, there is the capability for either board to process the signal and compute speed and distance traveled. The odometer sensor is a reed switch positioned so that it detects a magnet attached to a spoke of the vehicle. The magnet opens and closes a switch once per revolution. The hardware on the circuit board has a pull-up resistor that converts the open/closed switch to a high or low voltage. This signal is input to an interrupt pin of the Arduino. There is an edge transition that occurs once per wheel revolution. This signal triggers an interrupt that logs the time of the signal. Speed is computed from the time that it takes to make one wheel revolution. This is the same system used on a standard bicycle cyclometer. The odometer is constructed from a cyclometer pick-up where the wire has been cut and soldered to a barrel plug connecting to the circuit board. Most trike have two speedometers. One goes to a standard human readable cyclometer, and the other goes to an Arduino. They should be calibrated to give the same reading. Cyclometers are calibrated based on wheel diameter or circumference. When computing speed, thee should be a reasonable limit on how fast the trike can go. Any signal edge that would make it too fast is a glitch and should be rejected. The instrument is incapable of telling whether the trike has stopped or is just moving slowly. It should time-out to zero speed instead of staying at the last measured speed forever. It may help to extrapolate slowing speeds and set speed to zero at the right time.