Crank Angle Sensor resolution - Re: Old 486 ..
Peter Gargano
peter at ntserver.techedge.com.au
Mon May 8 21:36:33 GMT 2000
Diehl, Jeffrey wrote:
> For every rpm range, you use an appropriate frequency to run a counter.
No! In practice, you'd use a counter of appropriate width (8, 10, 12, 16,
24 - whatever) bits that's clocked at a fixed frequency to give you the required
resolution at the highest RPM you expect. The counter's width defines a minimum
RPM at which things work (eg. for 4 uSec counter, to timer over a 250 mSec
period, you need to count to 250,000/4 = 62,500 => width of 16 bits. A
250 mSec period may correspond to 4 events/Sec or for a 4 cylinder, say
2 revs/Sec = 120 RPM, a not unreasonable speed to expect to be able to
generate a reliable spark count).
> This counter is started by an event from the cam/flywheel sensor. So, you
> know which tooth triggered the event. You know that the given frequency
> will divide the event into N intervals. So, you can develop positioning to
> any desired resolution.
Yes!
Without trying to confuse you, the (hardware) counter does not really need to be
as wide as I calculated, as long as the software is prepared to do some of the
counting itself. For example, to time 1/4 sec with the above 4 uSec clock rate,
and using just an 8 bit counter, the software must be prepared to count the
first 255 "overflows" of the 8 bit counter, and then set up the hardware counter
to produce an output somewhere on the 256th count.
A micro like the 68HC11 has multiple 16 bit counter/timer registers that can be
set to clock at 4 uSec, and produce an output pulse at a future time - These are
called "output compare" events. The corresponding input side of things is called
an "input capture" regsister, and can be setup to capture the system's 16 bit
counter whenever an input event occurs. So, to produce an output pulse at a future
time, with an accuracy of 4 uSec, the micro just waits for the input capture event
(notified via an interrupt), adds the number of 4 uSec periods required, and then
plugs this value into the output compare register. The hardware does the rest.
Peter
----------------------------------------------------------------------------
To unsubscribe from diy_efi, send "unsubscribe diy_efi" (without the quotes)
in the body of a message (not the subject) to majordomo at lists.diy-efi.org
More information about the Diy_efi
mailing list