Page 3 of 3
Re: mimicking a speed signal output from arduino
Posted: Sat Mar 23, 2024 6:24 pm
by 944er
The software solution is fine, he just needs to take care that his counters are big enough that low speeds don't overflow, plus handle the special case of 0 speed. He could probably treat anything under 5 MPH as zero and save some hassle. If the 30Hz low end is the barrier, the hardware solution could be made to work by slowing the system clock down by 4 or more, as long as the SPI port can be made to operate with that system clock speed (assuming 5 or below is 0.)
Re: mimicking a speed signal output from arduino
Posted: Sat Mar 23, 2024 6:32 pm
by Tom
944er wrote: Sat Mar 23, 2024 6:24 pm
The software solution is fine, he just needs to take care that his counters are big enough that low speeds don't overflow, plus handle the special case of 0 speed. He could probably treat anything under 5 MPH as zero and save some hassle. If the 30Hz low end is the barrier, the hardware solution could be made to work by slowing the system clock down by 4 or more, as long as the SPI port can be made to operate with that system clock speed (assuming 5 or below is 0.)
My code above was an early and simpler version of my SpeedoBooster code. I put a lot of effort into the 0 speed case for sure. That's a special challenge as the wheels start to slow toward zero. The speedometer itself (on the 944) does not handle sub 1-mph speeds very well either, compounding the issue. If it gets isolated pulses that are spaced too far apart, the speedometer will just bounce a little with each tick. I can't remember the speed I picked, but I ultimately decided it's better to kill all pulses if the speed is under like 1 or 2 mph...