ECM Proportional Control

Robert Rauscher
7/9/2000

Copyright 2000, Robert Rauscher, All Rights Reserved.

This is specific to the 747 ecm. However, the methods and madness
applies to many of the GM ecm's. (Use at your own risk, no guarantee
that any of this is correct, nor was it spell-checked!).


A) The PID controller term starts with the 'slow-filtered O2' sensor
value, and ends with the final calculated bpw.


B) The PID controller term always works in the opposite direction of
the immediate rich/lean O2 sensor reading.


C) The purpose of the PID controller term is twofold. First, it
is used to obtain the desired AFR quickly. Second, it is used to
maintain the switching of the O2 sensor about the desired AFR point.

The PID controller term starts with the O2 Error Term. This is the
amplitude of error, between the O2 sensor and the desired O2. This
value is used as a lookup index for the actual Proportional Error
Term.


Three tables define the desired O2 sensor upper and lower limits. These
limits are used to decide whether the O2 sensor is either: below, above,
or within the limit window. These are the error boundries.


The desired O2 Sensor tables are located at: 0x494, 0x499 and 0x49E. The
tables are indexed based on airflow, in gms/second, 0 - 64.


0x494: Mean R/L Threshold, used to determine (somehow), the direction,
(and speed?), of the O2 sensor. End result is a moving richer, or
moving leaner bit (L000E, b6, 0x40). Also used to determine the occurance
and an O2 x-count.


0x499: Rich O2 Threshold, used to define upper window boundry for
the O2 Error Term.


0x49E: Lean O2 Threshold, used to define lower window boundry for
the O2 Error Term.

The above table values are converted by: O2mv = TblVal * 4.34


The upper or lower boundry along with the current Filtered O2 Sensor
are used to calculate the O2 Error Value. This error value is then
used to lookup various proportional values. If the slow filtered O2
value is within the window, no proportional correction takes place
(prop term = 0).

When at idle, defined by L0002, b7 == 1, the above tables will have
a bias added to them. The effect is to lower the AFR for a more stable
idle. This value is located at: 0x2F7. (remember this one).

The flag at L0008, b1, (rich/lean) is set with a O2 sensor higher than
the upper window boundry. That bit is reset with an O2 sensor lower
than the lower window boundry.

If the O2 sensor is within the window, the bit is not changed.


D) Once the Slow Filtered Error Term is calculated, it is used as
a lookup index into the Proportional Gain table at: 0x4A8.

Another lookup is done for a Proportional Multiplier term, indexed
by airflow in gms/second, at: 0x4C7.

The two above terms are multiplied together, divided by 256 and
used as the adjustment to the INT term. If the O2 sensor is lean,
the prop term is added to the INT. If the O2 sensor is rich, the
prop term is subtracted from the INT term.

Of course, the INT term is then used for the BPW calculation.

The math:

PropTerm = (Gain 0x4A8[O2err] * FlowGain 0x4C7[gms/sec]) / 256.

This makes the FlowGain (@ 0x4C7), dictate a percentage of the Gain
table (@ 0x4A8). The end result will always be lower then the Gain term.


E) For the Proportional Duration, lookups are done using the same
indexes as the prop-gain. The Slow Filtered O2 Error Term is used as
a lookup index into the Proportional Duration table at: 0x4B5.

Another lookup is done for a Proportional Duration Offset term, indexed
by airflow in gms/second, at: 0x4C2.

The results of the lookups are added together for the Proportional
Duration Term.


F) The upper and lower R/L threshold tables can be used to move the
basic AFR. As they form the O2 Error Window, by raising the table values
toward the richer side, the overall engine AFR can be pushed toward
the rich side (lowered AFR).

This is important to understand, these three tables define the overall
AFR when in closed loop. The Proportional Term is always trying to
move the current O2 sensor toward these table boundries. The INT follows
the Proportional Term.


G) The value labeled 'stoich' needs to match the O2 sensor AFR switch
point. On the '747, this value is located at: 0x2AA. The value is 147,
for 14.7 AFR.


H) The Slow Filtered O2 Error Term is the delta of the current Slow
Filtered O2 value and the proper window boundry, upper or lower. This
term is then used to lookup the Proportional Gain Error from
table: 4A8. (See D above).

The lower window boundry is used to calculate the Error Term whenever
the O2 Sensor is below that value. The upper window boundry is used
whenever the O2 Sensor is above that value.


I) When in idle, the Proportional Gain and the Proportional Duration
use specific values for idle. The Prop Gain is at: 0x2F9, and the Prop
Duration is at: 0x2F8. These replace the table lookups at: 0x4C7 and
0x4B5, respectively.

For a rumpty-rump engine, it helps to set the idle Prop Term low,
this reduces/eliminates proportional action. This can have the effect
of smoothing the idle.


J) A Proportional Gain and Duration reset takes place whenever the
INT is reset. The most common cause of an INT reset, is the BLM 'cell
in use' changing. There is an option to have the INT reset on an accel
enrichment (pump shot). Location: 0x0006, b5, 0x20. Enable INT reset
on BLM change is located at: 0x0006, b4, 0x10. (set to 1 to enable
option for reset).

Other causes of an INT reset: DFCO, PE, open loop.


K) Movement of the INT takes place whenever the Slow Filtered O2 Error
Term exceeds four (4), and, the INT delay timer has expired.


Note: The PID part of all this is:

Proportional: This is the Proportional Gain Term described above.

Integral: This is the Proportional Duration mentioned above.

Derivative: The Proportional Gain Term and the Proportional
Duration are reset upon the O2 Sensor changing direction.


--