"Lambda, fueling and AF-XIED for Dummies" by knutk on ukgser's site, with minor tweaks by me
Emission regulations require engines to limit pollution. It's a fairly complex picture, but let's focus on the subject that annoys us, the fueling of the engine, or rather, a lack of fuel it needs to run well.
Background: Lambda vs AFR (air fuel ratio)
In an ideal world, perfect combustion for an engine is when every drop of gasoline finds an oxygen molecule to bond with, so when the mixture is ignited, every drop of gasoline burns, with no excess.
To understand how well the vehicle is coping (with the fueling its receiving from the various parameters its measuring, mapped to a list of what to inject under which conditions), it analyses the combustion. To do this the manufacturer installs an O2 sensor in the exhaust system. The O2 sensor reacts to the amount of vacant (unused) oxygen molecules. And when there's no remaining oxygen in the exhaust, this condition is defined as Lambda 1.0. For a gasoline engine, Lambda 1.0 will be reached when the AFR is at the stoichiometric 14.7:1, i.e 14.7g of air to 1g of gasoline.
So why mess with Lambda, rather than the AFR?
The O2 sensor is searching for excessive oxygen. Different types of gasoline (with ethanol etc) may offer different AFRs. However, regardless of what type of gasoline the engine is burning Lambda 1 will ALWAYS be the condition where all the oxygen is used.
To reduce confusion, we'll stick to common gasoline offering an AFR of 14.7 for Lambda 1 and debate how a Narrow band (NB) O2 sensor works in BMW boxers up to the introduction of the 1250 shiftcam engine - (which uses a different sensor type.)
The Picture below is borrowed from NightRider who produce the AF-XIED. Its showing the output of a Narrow Band sensor when warm, where the O2 sensors emit voltage in accordance with this chart below.
The scales of AFR are adjusted to reflect gasoline that produces Lambda 1 at AFR 14.7 and the picture shows the varying O2 sensor voltage outputs when subjected to differing AFR values. The three different coloured curves show the voltage output also changes with temperature. Noting, when you look along the 0.5V line, all three curves deliver the same voltage around an AFR of 14.6 - 14.8.
The ECU uses this O2 sensor feedback to know if the engine is running too lean or too rich. Whilst expecting the standard engine map and its long term adaptions to land a voltage from the sensor around 0.5V / 0.6V (AFR 14.7). With a 0.8V output, the AFR is down to 14.2-ish. and from there on, the voltage reading vs AFR become less accurate. However the ECU isn't interested in the voltage and doesn't care if its above or below 0.5V. The ECU only sees richer than or leaner than the AFR 14.7 target (even when the voltage output slightly varies with AFR in a highly non-linear manner).
When running, the amount of fuel injected is calculated from tables inside the ECU (called maps, hence remapping means changing the value in these tables). The tables offer information on how long (time in milliseconds ) the injectors are to be opened, depending on RPM, throttle position etc. There are actually several maps, but for simplicity lets just say there are preinstalled maps.
So fuel is delivered according to the maps. However, in order to fine tune the fueling, the O2 sensor offers feedback on the combustion. These small adjustments, called for by the O2 sensor, are called Short Term Trim, and it is basically a number that adds or subtracts to whatever time value is being used opening the injectors.
But keep in mind, the exhaust reflects the result after the combustion, i.e the O2 sensor will not tell ECU what to do. It tells the ECU how it did. Let's say the air filter is clogging up, restricting the airflow to the cylinder. Now, the pre-determined values from the maps will give the engine too much fuel, since the engine gets less air than expected. And the O2 sensor will tell the engine that the fueling is too rich, thus it needs to trim down on the amount of fuel. In a steady condition, this will work pretty well, but it will always need a couple of strokes of the piston in order to first analyse, and then inform if too lean or rich in a continuous process on and on.
Now if its always getting things wrong and reacting to it that's pretty stupid. So in comes the Long term trim (adaptions): At every condition (rpm vs throttle position), the Short term trim will be stored. It's tendency for richening or leaning is stored in small steps. But the point is, if a given condition consistently calls for a need of adjustment, this adjustment will be stored in the Long Term Trim table. And this table is part of the equation when the ECU collects data from different maps in order to determine the fueling. BMW calls the Long Term Trim the Adaptive map This is the map that gets zeroed out when ever BMW talks about restoring the adaptive values (wiping the adaptions).
So, what does the AF-XIED do, and how?
If we take a look at the curve below, the curve shows the voltage from a warm O2 sensor, and this is what the ECU receives. (Data from a -15 LC boxer) with time in seconds along the bottom
Up to 10 seconds, the engine is running on a steady throttle. After 10 seconds the engine is accelerating.
In the first 10 seconds, the voltage from O2 sensor flickers between 0.1V and up to 0.9V. When the voltage is < 0.5 V the ecu notices its 'Lean' and it will add a small amount of fuel. Then it keeps adding fuel until the O2 voltage reads >0.5V. Now it's too rich, so reduce the fueling. This is done by correcting the short term trim.
At the 10 second time mark, the throttle is opened up. Now we see that the voltage jumps up to a steady 0.9V. Refer the table of O2 sensor voltage output vs AFR. The green curve reflects the 1200F temp of the O2 sensor, a fairly common condition, i.e when adding throttle, the AFR is richened to 13.6.
What is the big deal about 13.6? Well, the world is not perfect, hence in order to utilise all the oxygen molecules, we actually need to throw in some extra fuel for good measure. Practical tests have shown that adding a bit more fuel will make sure all the O2 molecules get their share of gas, and more molecules with fuel + O2 mixed means a more powerful burn during combustion, i.e more power
The point I'm trying to say is: Any tuning of the engine that only involves controlling the fuel to air mixture will offer very little top end power, as the ECU OEM fueling already offers the added fuel at full throttle (Full throttle has not been the focus of emission control, even if that may change in the future).
Tuning involving changing the AFR will benefit when the throttle isn't fully open, as in the condition in the first ten seconds of the chart above. And generally, when throttle is opened up in the higher range (the limit varies depending of the type of engine).
Here is where the AF-XIED shines:
Have a look at the chart below. It shows what the AF-XIED at setting 8 does to the engine.
Red curve is the voltage from the O2 sensor and now being analyzed by the AF-XIED, the blue curve shows the voltage produced by the AF-XIED and transmitted to the engine.
The Voltage from the O2 sensor (the red line) is read by the AF-XIED, and it stops this data reaching the BMW ECU. However the AF-XIED analyses the voltage creating the blue curve, and transmits this to the ECU. The ECU has no knowledge about the fittment of the AF-XIED, and behaves as if its direct feedback from the O2 sensor.
Remember: High voltage = Rich. Low Voltage = Lean.
If we amplify the red curve, we will notice that every time the red curve drops below a straight line, the AF-XIED signals a low voltage to the ECU (And Low voltage = Lean condition). The ECU gets a Lean condition signal and reacts to it by richening the fuel. But, we don't want the fuel to go excessively rich, so when the red curve rises slightly above the straight line, (hence going to rich), it's time to stop the ECU richening the fuel mix. And this is done by the AF-XIED increasing the voltage emulating the O2 sensor. Where the voltage output follows the actual O2 sensor voltage and sends this to the ECU. The ECU will react to this richer than 0.5 V condition by once again starting to lean the mix, and on and on....
AF-XIED tweaks are more clever than you may think
The OEM variation between lean and rich being so slow actually does not reflect Bosch's ability for accurate control. Rather its a deliberate need to feed the CAT with oxygen (as CATs use oxygen to convert CO to CO2). Its delivered to the CAT through the exhaust and is controlled to produce periods with excessive O2 in order to feed the CAT. Hence the slow reaction time that allows for periods with too much oxygen. So you should set the AF-XIED to a value rich enough for a smooth running, and no more. Which is why they recommend going from a low value and slowly increasing during set up, one step at a time. And the point of allowing time (100 miles or more) between each change allowing the ECU to rebuild the Long Term Trim each time the setting has been changed. Note: these only save to the ECUs adaptions if the key is off for 10 seconds (and I believe after reaching operating temperature and its been run through all gears).