Challenge! (Everyone loves a...)
> I know I'm asking a lot. I had thought of just counting the number of
> pulses in a given time frame (e.g., .25 seconds), then
> multiplying it out to
> a full minute, but the error would be more than a few hundred
> RPM, which
> produces unacceptable error at slower speeds. I'd have to
> count pulses for
> at least a full second or two to get reasonable accuracy this
> way. At 4MHz,
> this would be a 24-bit number, which isn't too bad. I was
> just hoping there
> was an easier way.
Count pulses for a period. Based on the number of pulses in that period
(lots for high RPM, few for low RPM) decide on the size of your window. 1-2
seconds for low speed, .25 for high speed. Dynamic window size. Re-think the
window size at the end of the window (just loop). Perhaps have several
window sizes. May be easier than dealing with 24-bit numbers.
Just a thought...
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email mitvma.mit.edu with SET PICList DIGEST in the body listserv
seeking: ubicom lib math dsp
In reply to: <F75L1SCeX8KShPdHfKs000052e8@hotmail.com>
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the