next up previous
Next: Idle Control Up: Megasquirt III Manual Previous: ITB Load Mode

Subsections

AFR/EGO Control

This section contains the settings necessary to do closed-loop Exhaust Gas Oxygen (EGO) control on the MegaSquirt III engine management system. Closed-loop EGO control allows the amount of fuel being injected to be changed so that the Air Fuel Ratio (AFR) matches the AFR set in the AFR table.

Settings

Image afrego

Basic EGO settings

These settings are used to control the behavior of the closed-loop EGO algorithm.

EGO Ports -

The EGO Ports settings allow the user to select the input port used to read the signal from the oxygen sensor. The number of EGO ports available depends on the number of sensors selected.

The following ports are available for the first EGO input:

The remaining EGO ports have the following input options:

AFR/EGO Sensor Mapping

The AFR/EGO Sensor Mapping settings allow individual injectors to be associated with available EGO sensors.

The following injector channels can be associated with a sensor:

The following EGO selections can be made for each injector channel:

Tuning

Simple Algorithm with Narrowband Sensor

A narrowband sensor is only accurate at exactly stoichiometric mixtures for the fuel being used (14.7:1 for gasoline). At around 0.5 volts, the mixture is stoichiometric. For leaner mixtures (above 14.7:1 for gasoline, above 1.0 lambda) the voltage dips slightly below 0.5 volts. For richer mixtures, the voltage goes above 0.5 volts. This behavior means that it is not possible to hold an exact mixture when running closed-loop with a narrowband sensor.

Because of this, the best algorithm to use with a narrowband sensor is the "simple" algorithm.

The simple algorithm adjusts the mixture richer if the sensor reads lean, and leaner if the sensor reads rich. It adjusts Controller Step Size percent every Ignition Events per Step. This can lead to a small oscillation in O2-based correction once the AFR reaches close to stoichiometric.

The following steps are recommended when tuning the simple algorithm with a narrowband sensor:

  1. Ignition Events per Step - When first tuning the engine, this should be set to a fairly low number (4-8) so that if the AFR is very far off, it is corrected quickly. Once the engine is better tuned, this number can be switched to a higher number to gain more stable correction behavior (8-16 or more).
  2. Controller Step Size - When first tuning the engine, this should be set to 2% so that when correcting, the engine reaches stoichiometric quickly. Once the engine is well tuned, this should be reduced to 1% to gain more stable correction.
  3. Controller Auth - When first tuning the engine, this should be set to 20% or higher. Care must be taken to watch how the algorithm is correcting. In some situations, it is possible for the sensor to read very lean when really the engine is running very rich. Once the engine is tuned, this should be set between 5% and 10%.
  4. Engagement Settings - Most of the remaining settings control how and when the closed loop algorithm is engaged. Engagement with a narrowband sensor should happen when the engine is nearly fully warm, 500-1000 rpm above idle, below 80% throttle, below about 80% load, just above the lowest load seen when barely pressing the throttle, and at least 30 seconds after the engine starts. These settings are because the sensor must be hot to operate, must not be used at high load due to the fact that the engine should be operated rich of stoichiometric, and must not be used at very low load because the oscillations will cause the engine speed to oscillate.

Simple Algorithm with Wideband Sensor

Tuning the simple algorithm with a wideband sensor is essentially the same as tuning it with a narrowband sensor with the caveat that the AFR target table is used to set the AFR target. It is still recommended that the EGO algorithm not be used at high throttle position/load due to the fact that the accuracy of the wideband sensor decreases dramatically with pressure and temperature changes caused by high load.

PID Algorithm with Narrowband Sensor

When using a narrowband sensor with the PID algorithm, all the same recommendations for settings given in the section describing the Simple algorithm should be followed.

Additionally, since it is nearly impossible to keep the narrowband sensor from oscillating, it is recommended to start by tuning the 'I' term until the target is reached with minimal oscillation. Once this point is reached. It is recommended that very little (if any) 'P' term is used since the 'P' part of the PID algorithm causes instantaneous reaction, and the response of the sensor is not proportional to the distance from stoichiometric.

PID Algorithm with Wideband Sensor

When using a wideband sensor with the PID algorithm, the same steps as when using a narrowband sensor can be followed for tuning the 'I' term.

Additionally, since the response of most wideband controllers and sensors is linear with AFR, a larger 'P' term can be used to help correct for fast changes in AFR. Caution must still be used however since there is a significant delay between the amount of fuel being injected changing and MS3 registering an AFR change as a result.

Finally, a small amount of 'D' term can be used to help slow response during very fast changes. This helps reduce overshoot of the target.


next up previous
Next: Idle Control Up: Megasquirt III Manual Previous: ITB Load Mode