• Hello Guest, welcome to the initial stages of our new platform!
    You can find some additional information about where we are in the process of migrating the board and setting up our new software here

    Thank you for being a part of our community!

Everything I Thought I Knew About AFR and Wideband O2 Gauges Was Wrong

bobxyz

Board Member
Joined
Aug 29, 2014
Location
Boulder CO
Well, not everything but certainly my understanding of the basics wasn't right....

This thread is a continuation of side comments in: http://forums.turbobricks.com/showthread.php?t=330454 (thanks gross polluter)

Let's start off with a simple quiz to see what the audience knows. For reference, stoichiometric AFR of gasoline (93 octane) is 14.7, E10 is 14.2 and E85 is 9.9. Assume a standard MegaSquirt setup with default (drop down menu) selection of a common Wideband Gauge (Innovate, AEM, etc.).

Question 1: When using gasoline, the WB02 gauge reads 15.1. Is the engine running rich or lean?

Question 2: When using E10, the WB02 gauge reads 14.5. Is the engine running rich or lean?

Question 3: When using E85, the WB02 gauge reads 11.0. Is the engine running rich or lean?

Question 4: True or false - Stoichiometric AFR is the mixture for complete combustion, resulting in no leftover fuel and no leftover oxygen; rich is insufficient oxygen, resulting in leftover fuel; lean is insufficient fuel, resulting in leftover oxygen?

Question 5
: A Wideband O2 or Universal Exhaust Gas Oxygen (UEGO) Sensor is often described as measuring the O2 content of the exhaust gas to provide an accurate AFR reading. When running rich, there is no leftover O2 in the exhaust - what's going on?

Question 6: Does a Wideband O2 Sensor actually measure AFR or Lambda?

Question 7: If I want to run E85 with MegaSquirt, can I simply change the AFR table to the desired E85 AFRs (~7.5 to ~10.5) then run VE Analyze to tune the VE table?

Question 8: In MegaSquirt, how can I adjust for seasonal fuel blend changes (e.g. E85 goes to E70 during Winter)?

Question 9: What does the MegaSquirt IncorporateAFR mode do?


Thanks for playing, I'll post my answers and discussion in a couple days.
-Bob
 
Questions #1, #2 and #3 don't address the issue of how the controller is programmed. The O2 sensor and controller really generates a lambda value. So, when the sample gas has a lambda of 1, if you have programmed the controller for gasoline, it will output an analog voltage that would display 14.7 on your analog AFR meter. If you programmed it for E 85, it should read 9.9. If you don't like that, buy an analog gauge that displays lambda. A lambda of 1 will be stoich regardless of fuel type, although you can still screw that up because the programmers generally allow you to set any (within reason) analog output voltage for a lambda value. That is how the vendors get a wide band controller to emulate a narrowband O2 sensor. They program in a response curve that has a negative slope with a much much higher slope value.

If you want to figure out how the sensor cell in the O2 sensor really works, and what happens when there is an O2 deficit in the sample (low AFR), and get into the discussion of heater control strategies and all the other black art stuff, I suggest you tag up with an electrochemist. I have read the Bosch application guides for the wideband sensor and their proprietary control chip - a couple of times. Each time I think I understand it, I put the document down and then it takes about 2 minutes and it has all gone dark.

With respect to question #7, I 'think' the easier way would be to recalculate the Req Fuel value using your new stoich fuel value. This would alter the Req Fuel value, increasing the PW for oxygen rich fuels. You would have to make sure that for max output does not exceed an acceptable duty cycle. Going from 14.7 to 9.9 almost increases the PW by 50%. I don't think you need to mess with your AFR tables. Remember that a value of 14.7 in the table is a lambda of 1. As long as you don't reprogram your wide band controller for the oxygen rich fuel, the wide band will output an analog voltage equivalent to 14.7 AFR and the MS will think the AFR is neutral (lambda of 1) and everything should be OK. Reprogram the wideband for your new fuel and you would severely screw yourself up. It might be nice if MS had an option to program the AFR table as a lambda rather than as a AFR. That way, a value of 1.0 coming out of the wideband means stoich and a value of 1.0 in the table means stoich - regardless of what the fuel type is. Anyway, that is my back of the envelope theory - I would want to plough through the fuel equations to make sure there is no trap that would screw it up. Doesn't MS3 have a flex fuel sensor input? Surely they are not reconfiguring the whole AFR table and all the other AFR inputs based upon the flex fuel output?
 
Question 4: True or false - Stoichiometric AFR is the mixture for complete combustion, resulting in no leftover fuel and no leftover oxygen; rich is insufficient oxygen, resulting in leftover fuel; lean is insufficient fuel, resulting in leftover oxygen?

False?

165107860.jpg

I've always seen graphs like this that show the exhaust gas composition. It was always explained that 14.7:1 was just the best balance of power output, emissions, and economy. Possibly also the best "balance" of leftovers for a catalytic converter to process?

I've never actually even heard or looked at the actual definition of words like lambda and stoichiometric. I know generally what they mean, but probably not close to technically correct.
 
Stoichiometric and stoichiometry are chemists terms, not piston head terms and are pretty well defined. Gasoline is a variable product depending on the refinery, the feed stock and the blending for the particular time of year (I think winter gas in the great white north tends to have more light weight volatile components in it). That's why that graph shows a band of possible ratios for the stoichiometricaly correct ratio for gasoline and air. 14.7:1 is the commonly used stoichiometric number for gasoline. That means 14.7 lb of air mixed with 1lb of 'perfect' gasoline following combustion would leave you with water, CO2 and heat and no left over gasoline or oxygen (in a perfect world). Note that if you want to do the mass balance equations yourself, 14.7 is the ratio for air to gasoline. Gasoline combines with oxygen so there is a whole bunch of stuff (primarily nitrogen) that you have to subtract out when you are doing the balance equation using air as opposed to pure oxygen.

With 3 way catalysts, the OEMs generally ran their engines right at 14.7 because that's where the catalyst had optimal efficiency. Actually with narrow band O2 sensors the ECU caused the engine to oscillate back and forth around 14.7 because going a bit above 14.7 provided excess O2 which replenished O2 on the surface of the catalyst and improved the efficiency of clean up. I don't know what the latest technology is so I don't know whether they still do this.

The commonly accepted idea seems to be that maximum horsepower is achieved with an AFR that is something less than stoichiometric. Search around and you can find lots of opinions on the 'number' - at the very least it probably varies with the engine being tested. The common wisdom seems to be that in an engine where the limitation is the amount of air that can enter the engine, it is always better to add a little more fuel to insure that all the O2 is used up in the event that fuel - air mixing is imperfect. I think peak combustion temperatures are achieved at 14.7 (or a little less than 14.7 if you have imperfect air - fuel mixing). If you are cautious, you might choose to run an even lower AFR ratio at peak power to reduce combustion temperatures; however, at some point power output will start to drop because reduced temperatures = less power (everything else being equal).
 
The [hopefully] correct answers to quiz, or at least my new understanding of how this all works, are:

Q6: Does a Wideband O2 Sensor actually measure AFR or Lambda?

A: A wideband O2 sensor measures Lambda, where Lambda is (current AFR) / (stoichiometric AFR). The value shown by normal dashboard AFR gauges, and in the default MegaSquirt setup, is:
AFR Gauge = 14.7 * lamba​
This displayed value is the actual AFR for 93octane gasoline but is not the actual AFR for other fuels (E10, E85, etc.)

Q1: When using gasoline, the WB02 gauge reads 15.1. Is the engine running rich or lean?
Q2: When using E10, the WB02 gauge reads 14.5. Is the engine running rich or lean?
Q3: When using E85, the WB02 gauge reads 11.0. Is the engine running rich or lean?

A: Lambda=1.0 is stoichiometric (neither rich nor lean), lamba less than 1 is rich, lambda greater than 1 is lean. Since normal WB02 gauges are actually showing lambda*14.7, anything less than 14.7 is rich and anything greater than 14.7 is lean regardless of the fuel. So the answers are: (slightly) lean, (slightly) rich, (hog) rich.

Q4: True or false - Stoichiometric AFR is the mixture for complete combustion, resulting in no leftover fuel and no leftover oxygen; rich is insufficient oxygen, resulting in leftover fuel; lean is insufficient fuel, resulting in leftover oxygen?

A: True - I didn't mean for this to be trick question, but just something to think about before the next question.

Q5: A Wideband O2 or Universal Exhaust Gas Oxygen (UEGO) Sensor is often described as measuring the O2 content of the exhaust gas to provide an accurate AFR reading. When running rich, there is no leftover O2 in the exhaust - what's going on?

A: This is the interesting question, and I'll try to explain my new understanding of what's going on. For reference, these links provide varying levels of more in-depth information:
B&G Principles of Tuning Programmable EFI Systems: http://www.megamanual.com/begintuning.htm
B&G Tuning Your MegaSquirt-II: http://www.megamanual.com/ms2/tune.htm
B&G How the Wide Band Sensor Works: http://www.megamanual.com/PWC/LSU4.htm

A wideband O2 sensor is built up from a narrowband O2 sensor, a tiny exhaust gas test chamber, and a bi-directional oxygen pump cell. The test chamber is setup so that it is continuously sampling the exhaust as it flows by. If a positive current is run through the O2 pump cell, oxygen is pumped out of the test chamber. If a negative current is run through the pump cell, oxygen is pumped into the test chamber. The pump cell can generate its own oxygen from the water in the exhaust as needed (i.e. when running rich and no oxygen remains in the exhaust, the O2 pump can still generate the tiny bit of oxygen needed for the test chamber).

For lean measurements, the oxygen pump removes O2 from the test chamber until the narrowband O2 sensor flips around stoich. The pump current is proportional to the O2 removal rate, and that rate that is proportional to the excess O2 in the exhaust.

For rich measurements, the exhaust includes partially combustion by-products of Carbon Monoxide CO, and Hydrogen H2. When O2 is added to these in the test chamber, they recombine into Carbon Dioxide CO2 and Water H2O. If enough O2 is added, the CO/H2 by-products will all re-combine and excess O2 will remain. This excess O2 then flips the narrowband O2 sensor reading around stoich. The pump current is proportional to the O2 generation rate. This can be scaled to get the percent of excess fuel in the exhaust.

[Side comments: pumping oxygen into the WB02 test chamber to complete the fuel reaction is the same mechanism used to reduce tailpipe emissions, but on a tiny scale. In the dark days of early emissions control, aka 1970s emissions monstrosities, air injection or air pumps were added to pump air into the exhaust to complete the fueling reaction when running rich.

Modern catalytic converters temporarily store oxygen to react and reduce NO and HC emissions. The catch is that the oxygen storage capacity of a cat is limited and the engine must be cycling rich-lean-rich-lean around stoich to allow the oxygen storage to be replenished during the lean cycles.

If there is a misfire when running rich, both partially burnt fuel and unused oxygen go into the exhaust gas. In this case, combustion may continue in the exhaust pipe but usually excess oxygen remains and the wideband reads the mixture as lean (O2 remaining). I'm a little fuzzy on the full details here -- the actual reading depends on reaction rates and percentage composition of the exhaust from a misfire.]

OK? Is this understandable? Anything I can try to explain better?


Q7: If I want to run E85 with MegaSquirt, can I simply change the AFR table to the desired E85 AFRs (~7.5 to ~10.5) then run VE Analyze to tune the VE table?

A: No! Since the WB02 is measuring lambda, and the default gauges are reporting lambda*14.7, you want to setup the AFR table as if you were running 93octane gasoline with an AFR of 14.7. VE Analyze compares the reported AFR value to the value in the AFR table and adjusts VE based on the ratio of: (reported AFR / target AFR). Since this is actually using lambda, VE Analyze is adjusting VE to reach lambda of (target AFR/14.7). If you put the E85 stoich AFR value of 9.5 in the table, VE Analyze thinks you want AFR of 9.5 for gasoline (aka hog rich), and will max out the injectors trying to dump huge extra fuel into the engine.

[Side comment: I haven't tried this, but MegaSquirt does allow you to enter a custom wideband O2 calibration curve that includes two voltage and "AFR" endpoints. If you can find the lambda calibration curve for your WB02 sensor, you should be able to enter the voltages with the corresponding scaled AFR values for the fuel that you're running. You'll also then need to set the "StoichiometricAFR" value in GeneralSettings and setup the AFR table for the actual AFR of the fuel you're using. Finally, you'll need to reprogram the dashboard O2 gauge to display true AFR for your fuel instead of 14.7*lambda (I don't think some gauges even allow this). All in all, it seems much easier to keep everything scaled to a stoich gasoline AFR of 14.7 and just understand that the readings are lambda*14.7 regardless of fuel.]


Q8: In MegaSquirt, how can I adjust for seasonal fuel blend changes (e.g. E85 goes to E70 during Winter)?

A: I'm not sure, but I'd agree that changing req_fuel would be easy and would esentially rescale the whole VE table for the change in actual fuel AFRs. You'd probably want to run a log with the new fuel and use offline VE Analyze to figure out an average change in fueling (unless you somehow know exactly what your local gas station is supplying), and then use that average change to adjust req_fuel.

Since Acceleration Enrichment is specified in terms of milliseconds of additional injector opening time, the AE won't change when req_fuel is adjusted (AE is a fueling adder, not a multiplier). This is a relatively small error, but you could re-adjust AE when changing fuel blends if really needed.

[Side comment: I was surprised how cheap new flex fuel blend sensors have become -- looks like <$100 for name brands, and only ~$50 for chinabay. MS2, MicroSquirt, and MS3 all support using a flex fuel sensor to provide a fueling multiplier (based on the sensor output frequency) -- see the Fuel Sensor menu under Fuel Settings. For a standard 240/740 brick, what fuel system components need to be changed due to the more corrosive nature of E85?]

Q9: What does the MegaSquirt IncorporateAFR mode do?
See: http://forums.turbobricks.com/showpost.php?p=5568956&postcount=14

[Side comment: I like incorporateAFR mode because it let's me think about the problem in terms of true engine VE, with desired AFR accounted for separately, but yes, it's certainly more complex when first starting out.]

Cheers,
Bob
 
Question 4: True or false - Stoichiometric AFR is the mixture for complete combustion, resulting in no leftover fuel and no leftover oxygen; rich is insufficient oxygen, resulting in leftover fuel; lean is insufficient fuel, resulting in leftover oxygen?

:lol: If any engine ever managed to complete it's combustion there would be no need for catalysts. ;-)

I feel like this is incidental to the conversation anyways. A charge at a particular mixture may be more likely to completely combust but whether or not that actually happens seems to have more to do with the physical parameters / dynamic properties of the engine.

With 3 way catalysts, the OEMs generally ran their engines right at 14.7 because that's where the catalyst had optimal efficiency. Actually with narrow band O2 sensors the ECU caused the engine to oscillate back and forth around 14.7 because going a bit above 14.7 provided excess O2 which replenished O2 on the surface of the catalyst and improved the efficiency of clean up. I don't know what the latest technology is so I don't know whether they still do this.

Now that's interesting.
 
Since Acceleration Enrichment is specified in terms of milliseconds of additional injector opening time, the AE won't change when req_fuel is adjusted (AE is a fueling adder, not a multiplier). This is a relatively small error, but you could re-adjust AE when changing fuel blends if really needed.

[Side comment: I was surprised how cheap new flex fuel blend sensors have become -- looks like <$100 for name brands, and only ~$50 for chinabay. MS2, MicroSquirt, and MS3 all support using a flex fuel sensor to provide a fueling multiplier (based on the sensor output frequency) -- see the Fuel Sensor menu under Fuel Settings. For a standard 240/740 brick, what fuel system components need to be changed due to the more corrosive nature of E85?]

Ah yes, AE. Forgot about that, probably because my B20E seems to benefit from an absence of AE.

I was unaware of the fact that MS2 supported Flex Fuel. With that revelation, I figured it should be pretty easy to figure out how tuning parameters are adjusted to compensate for the change in the stoichiometric ratio associated with the fuel change. It would be just a matter of checking the MS2 source code to see how the code handles the flex fuel input. The MS2 source code used to be available; but, I don't seem to be able to find any versions on the Web.
 
Back
Top