Hi,
I don't see the need for an encoder.... he has two sensors detecting the wheelchair, they are spaced 1m apart and he wants to measure the time it takes the wheelchair to travel that 1m, then convert that to velocity.
However, more details are needed to come up with a suitable solution.
At the specified top speed of 20km/h it takes 180ms to travel 1m. But at the specified minimum speed of 0.0km/h it takes forever. Obviously you can't time that no matter how many bits you have. So you're going to have to specify a minimum speed other than 0. Next question is what requirements you have when it comes to resolution, is it enough if the display shows the speed in steps of 1km/h or do you need steps of 0.001km/h - or perhaps something in between?
Since you're using a 16F part you're limited to WORD sized variables (without resorting to the N-Bit routines or similar).
Are the 1m distance fixed or can you move the sensors closer/further apart? Doing that could possible make the math easier and/or the result more accurate.
/Henrik.
Bookmarks