Flywheel/Encoder patterns

Todd Knighton knighton at net-quest.com
Sat Dec 7 17:03:40 GMT 1996


Mazda Ebrahimi wrote:
> 
> As soon as I get a little more involved in actual programming, I'll come up with a lot
> of questions for you.  Regarding the length of the interrupts, this is the way I'm
> planning things right now:  I'll be running a foreground loop with no time driven tasks,
> which constantly calculates fuel and spark values based on latest readings.  The result
> of the most recent completed calculations are four numbers: inj_delay, inj_ontime,
> ign_delay, ign_ontime (dwell).  When an interrupt is generated, the following happens:
>         -advance degree count,
>         -check for reference count (i.e. at this degree count, do I have to load any
> counters?  This only happens 8 times a rotation (v8)).
>         -if reference is reached, load decoder with external counter value;
>         -return
> this is in addition to calculating RPM.
> 
> I'm running a 16 bit 32 MHz processor.

	Sounds like you should be fast enough, don't know if your flywheel
sensor will have high enough resolution to work at any high speeds, a
hall effect would work better.
	How big are your counters, 16, 26, 32-bit.  Running at 32Mhz you have
to make sure your counters won't overflow at low speed, this is why
Porsche stayed with 6Mhz with 16-bit counters, any faster and you'd be
overflowing the counters all the time waiting for the next tooth.
	To get things going you could just setup some constants initially, Coil
On tooth, Coil Off Tooth, Injector On Tooth, Injector Off Tooth with
some basic injector times and ignition timing just to get the thing
fired to work out your hardware.  Then start adding in functionality as
you go.

Todd Knighton
Protomotive Engineering



More information about the Diy_efi mailing list