by Tony » Tue Jul 22, 2008 6:35 pm
First thing you need to know are the maximum and minimum roller rpm, let's assume a 10:1 operating speed range.
Maybe 500 rpm to 5,000 roller rpm ?
You should almost certainly be able to select a suitable vehicle gear to work somewhere within that roller speed range.
If there are 20 pulses per revolution, that would give 10,000 pulses per minute, on up to 100,000 pulses per minute.
Dividing by sixty we get 166.6 Hz to 1,666 Hz.
We need to convert that to time between pulses.
166.6 Hz converted to milliseconds is 1,000/166.6Hz = 6.0 milliseconds.
And 1,000/1,666Hz will be 0.6 milliseconds.
The next thing to look at is the particular microcontroller you plan to use, and how it can best measure that period range. There are two aspects to this, resolution and time overflow.
Let's assume we have a sixteen bit counter that counts up to 65,535 and it is clocked from a 1Mhz source. It will increment every microsecond, and overflow back to zero, and continue counting up to maximum every 65.535 milliseconds. It does this continuously, it just keeps counting up to the maximum time, than overflowing through zero and counting up again, over and over again all by itself.
What happens is that an incoming pulse from the dyno takes a snapshot of this counter and records the exact count at the time of arrival. You then must store that value away in ram. The next incoming pulse takes another snapshot of the same counter. If you subtract the old value from the most recent value, you get the time interval in microseconds between successive pulses in microseconds.
At exactly 500 roller rpm, we end up with a measured time interval of 6 milliseconds, and a value after subtraction of 6,000 (microseconds)
At exactly 5,000 roller rpm we end up with a time interval of 0.6 milliseconds and a value after subtraction of 600 (microseconds).
To convert microseconds back to rpm, just divide three million by the period in microseconds.
3,000,000 divided by 6,000 microseconds gives 500 rpm.
3,000,000 divided by 600 microseconds gives 5,000 rpm.
This method gives excellent speed resolution, and a very fast speed update rate.
The only problem is that the speed readings will very likely jump around due to mechanical jitter and vibration, but as we are receiving from 166 to 1,666 true speed readings every second, we can afford to average over many readings, and still get very fast response to real speed changes.
My own dyno works exactly this way, and this method of rpm measurement works very well.
Also known as the infamous "Warpspeed" on some other Forums.