ECM Proportional Control Robert Rauscher 7/9/2000, updated 12/4/00 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). Note: Values such as 0x22D are eprom table addresses. These you can easily change. Values such as L0004 are RAM variables. These are used by the ecm during it's processing. INTRO: The proportional and integral fuel correction logic is complex. There is no way that I can cover all aspects of the ecm logic. This paper is designed to give a working view of what the ecm is trying to accomplish. I have also covered some changes that can help when tuning hot street engine. The proportional PID term starts with the O2 sensor reading, and ends with a correction to the final calculated bpw. The PID proportional term always works in the opposite direction of the immediate rich/lean O2 sensor reading. The purpose of the PID proportional controller term is twofold. First, it is used to attain 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 (or difference), between the O2 sensor and the desired O2. This value is used as a lookup index for the actual proportional error term. The combination of the proportional term and the INT term is referred to as the closed loop correction term (CLT). When in open loop, neither the proportional term or the INT term as used. There are two filtered O2 sensor values kept by the ECM. One is a fast filtered value that follows the changing O2 sensor reading closely. The second is a slow filtered value that lags the changing O2 sensor reading. AIRFLOW TERM: The volume of air moving through the engine is used for many of the PID term lookups. The airflow is defined as grams of air, per second, per cylinder, that is moving through the engine. The term is abbreviated as gms/sec. This term is calculated from the current MAP and current RPM. Volumetric efficency is not used. In the '747 code, the max value is clipped at 64 gms/sec. The calculation is gms/sec = rpm * map * constant. It is not the most accurate term, however, it is sufficent. It is important to realise that it takes a finite amount of time for a change in the bpw to be reflected in the O2 sensor reading. This time frame is referred to as the 'transport delay'. This delay varies according to the airflow through the engine. O2 ERROR BOUNDRY TABLES: Two 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. These values are the actual voltage output of the O2 sensor. A third table defines the O2 sensor cross point. The desired O2 Sensor tables are located at: 0x494, 0x499 and 0x49E. The tables are indexed based on airflow, in gms/second. They are five-line tables from 0 - 64 gms/sec, every 16 gms/sec. 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). 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 It is rare that any of these three tables will need to be changed. !) 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 another table. 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. 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. PROPORTIONAL ERROR TERM: 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/sec, at: 0x4C7. The two above terms are multiplied together, divided by 256 and the result is used as the adjustment to the CLT term. 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 starting gain term. To create the CLT, the proportional term is either subtracted, or added 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. The result is the CLT term. The CLT term is then used to adjust the BPW calculation. For highly tuned engines (IE: hot street stuff), the proportional gains can to too high. The effect is the engine surging under steady state cruising. Reducing the gain and multiplier values can reduce this problem. The values in these tables can sometimes be cut in half. PROPORTIONAL DURATION TERM: For the proportional duration term, 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. AFR: 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. INTEGRATOR: The INT seems to follow the proportional term, however, is does not. The INT moves independent of the proportional term. The INT is updated whenever an O2 sensor x-count does not occur within a certain timeframe. Even with the proportional gains set to 0, the INT will still move. Movement of the INT takes place whenever the slow filtered O2 error term exceeds the value at: 0x2F4, which is typically 4, along with the INT delay timer expiring without any x-counts. STOICH: 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. Conjecture: This stoich value, plus the R/L O2 error boundries, define the O2 sensor output levels. This ties the O2 sensor calibration into the bpw equation. As the R/L O2 Error Boundries define actual O2 sensor stoich switch point in output volts. The 14.7 AFR switch point of the O2 sensor is now 'calibrated' into the bpw calculation. If a different fuel is used, with say a stoich value of 16.1, by placing the value of 161 at 0x2AA, the bpw is again calibrated for that fuel. If you now want to command the ecm to change the bpw enough for a 15.3 AFR, by using 153 in the bpw calculation, the bpw will be increased the proper amount to produce that AFR (in open loop). Remember that when in closed loop, the stoich value is used in the bpw calculation. In open loop, the desired AFR is used in the bpw calculation (say, when it's 5 degrees out, and the engine is first started, the desired afr might be 9.0). Another example: Say a new O2 sensor was developed, for gasoline, that costs $3.00. Good deal. However, the stoich switch point output voltage is at 625mV, opposed to the current sensors switch point of 450mV. By changing the R/L O2 error boundry table values, this new O2 sensor can be calibrated for the bpw calculation. Instead of the tables straddling the 450mV value, set the table values to straddle the new 625mV O2 sensor value. IDLE: When in idle, the proportional gain and the proportional duration use specific values. 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 rumpity-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. Also, do not forget about the O2 error bias value at: 0x2F7. This value can be used to decrease the AFR at idle. Again, for a rumpity engine, it can calm down the idle. RESET's: A proportional gain and duration reset take place whenever the INT is reset. It is also reset whenever an O2 x-count is logged. 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). An INT reset is the setting of the integrator to it's mid-point (128). This is where no integrator fuel correction is made. Enable 'pump shot' reset of INT is located at: 0x006, b5. Enable 'BLM change of cell in use' reset of INT is located at: 0x006, b4. (set to 1 to enable option for reset). Other causes of an INT reset: DFCO, PE, open loop. PID: The PID part of all this is: Proportional: This is the Proportional Term described above. Integral: This is the Integrator or INT term mentioned above. Derivative: There is either not one used, or the resets of the INT and Proportional Term could be considered. (note that the loop is slow enough to not require a derivative term). -eof-