Linear Sensors

peter paul fenske pfenske at direct.ca
Fri Jun 14 07:21:47 GMT 1996


Tnx everyone who helped me with this problem.
In the end result? there appear to be two ways to handle nonlinear
sensors like the CTS or MAT. The simplest is to use a lookup table.
Algorithm is to load X reg with location of table. Get the AD value 
for the CTS and use ABX inst to add to X reg. Then use a indexed load
to get your corrected value. Pretty neat and a lot of aftermarket
ECMs do this. Carried to extremes you can linearize or create full
scale for all sensors(TPS, Map, Mat, MAF). One can even use a table
to create RPM values from timer compare differences. Lookups like
this run extremely fast. About the only disadvantage is lots of 
Prom space, run out of eeprom pretty fast, with an inability to
change large spaces in the operation region quickly. Although
an algorithm can be programmed to do this I suppose.

Now to the second method. I looked in my old digital controls 
book and this method is known as piecewise linear correction.
Quess I was looking at something blond across the hall when the
Prof was discussing this. Anyways the scheme works by breaking up
the sensor data into discrete regions. Then a correction factor is
added to each segiment(not sure if multiply), add is easier, to
linearize the sensor data. This could be construed a poly fit.
REALIZE the math is done outside. Only the results are used.
With a little work a table for a generic motors CTS can be made
that gives 1.8 degrees resolution with 255 values starting at
-110.2 degrees. This method seems to be the way OEMs do it.

As to why we need a fractional value or more commonly 0 to 255
range. Most speed density tables are a 15 by 15 or some such
thing. So one would thing a value between 0 and 15 is enough.
Realize the base pulse you get is coarse in value.
For homebuilt or some aftermarket ECMs this is adequate. What
happens in OEMs is a four point interpolation takes place.
This gives much finer control of injector pulse width.

Well Tnx everyone for their generous assistance.
Will keep you guys informed. Yes I am going to the dungeon
to find some more material.
CU:peter




More information about the Diy_efi mailing list