Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/01/01 23:37
Read: times


 
#14682 - RE: Speed measuring
Jacek,

Let's combine the statements "don't need very good accuracy" and "turns per minute" and see where they might take us.

Suppose the number of wheel rotations is counted over a period of one minute. The microcontroller could display the pulse counter in "turns per minute". Note that a one minute timer is also needed so the micro will transfer the pulse counter contents and reset the pulse counter to begin the next one minute timing period. Note also, the speed display is updated only once per minute.

Now, let's say you'd like a display update every half a minute. If your application can stand the error, simply take the counter contents and shift it left one bit to multiply by two and display the result. If you wish speed updates more frequently, continue to decrease the period over which pulses are accumulated, preferably by factors of two so as to use shift operations to your benefit.

Note that by clearing the pulse counter at the end of each accumulation period, the lowest speed that can be indicated increases. By not clearing the pulse counter (using incremental counts), you can retain low speed measurement.

The difference equation averaging four measurement periods of incremental pulse counts in one minute looks like -

S(n)=[p(n)+p(n-1)+p(n-2)+p(n-3)]/4

where S(n) is the indicated speed,
p(n) is the incremental count over the current 15 second period, p(n-1) is the incremental pulse count over the previous 15 second interval, and so on for p(n-2) and p(n-3).

This moving average can be extended to as many periods as you wish to obtain the desired update rate. Be prepared to observe a one minute decay of speed indication if the wheel is capable of sudden stops.

Don't use this method of speed measurement in a speed sensor in a control loop as it has too much lag.

Bruce

List of 7 messages in thread
TopicAuthorDate
Speed measuring            01/01/70 00:00      
RE: Speed measuring            01/01/70 00:00      
RE: Speed measuring            01/01/70 00:00      
RE: Speed measuring            01/01/70 00:00      
RE: Speed measuring            01/01/70 00:00      
RE: Speed measuring            01/01/70 00:00      
RE: Speed measuring            01/01/70 00:00      

Back to Subject List