How To: Use Learning View to verify closed-loop MAF scaling

Original Source / Web Archive

I started to write this while helping someone out via PM, but decided that this would make good reference material so I’m posting it here. After reading this post, you will know how to interpret the “AF Learning #1” values displayed in the Learning View utility. I will not explain how to act on that information, except to say that RomRaider has a MAF scaling feature built in, and there are spreadsheets available in the “tuning utilities” subforum.

To get a copy of Learning View, go here:topic2772.html

Keep in mind the while Learning View is a nice way to get a rough idea of how good your tune is, there isn’t much you can do the tune based on the information shown by Learning View. You’ll generally need data logs to get enough information to actually make good changes.

Common misconception:

The “AF Learning” values in Learning View generally do not indicate that you are running rich or lean. They show how much fuel the ECU has learned to add or subtract in order to achieve the desired AFR during closed-loop fueling, which is the ECU’s fueling mode for idle, cruise, and mild acceleration.

If they are pegged at their maximum or minimum value (+15% or -15% for most Subaru ECUs), then the ECU isn’t able to correct for whatever is wrong, and you are indeed running rich or lean.

If they’re not pegged, then you’re neither rich or lean. The ECU has learned to achieve its target AFR. That target is generally 14.7:1, plus or minus a few percent, for the best compromise between fuel consumption and toxic exhaust emissions.

The AF Learning values do tell you how far your MAF scaling is off, and they show roughly how much it’s off, in a few different airflow ranges, spanning idle, cruise, and mild acceleration.

Some background information:

The ECU has two methods to control fueling, which we call “closed loop” and “open loop.” Closed loop is primarily for idle, cruise, and light acceleration; open loop is primarily for hard acceleration[1]. In both modes, the ECU uses the Mass Air Flow (MAF) sensor to measure the amount of air flowing through the engine. In open loop mode, the ECU simply commands the injectors to squirt the appropriate amount of fuel to reach the desired AFR for the air flow. In closed loop mode, the ECU additionally uses the O2 sensor to measure the AFR, and it uses this information to “close the loop,” adjusting the amount of injected fuel for the next combustion cycle.

The transitions between open and closed loop are somewhat complex, but for the sake of discussion it is enough to know that the boundary between open and closed loop tends to be around 60 grams per second of airflow. Driving up a steep hill in 5th gear I’ve observed the car using closed loop at about 65 g/s, but I’ve also seen it switch at lower flows, around 50 g/s.

When operating in closed loop, the ECU maintains “fuel trims” which indicate how much fuel should be added or subtracted at different air flow ranges. This can compensate for variations in MAF sensors, MAF sensor housings, fuel composition, and so on.

The fuel trims can be observed with a logger or with the Learning View utility. Most stock Subaru tunes that I’ve seen, including my own car, use four trims, for the following air flow ranges:

AF Learning #1 A: 0-5 grams per second. This is idle.

AF Learning #1 B: 5-10 g/s. A little more than idle, but so low it’s difficult to reach with the car in gear.[2]

AF Learning #1 C: 10-40 g/s. This covers most of your cruising.

AF Learning #1 D: 40+ g/s. This is light acceleration, or cruising uphill. There is no strict upper bound for this range, but again the switch to open loop tends to happen around 60 g/s.

Do not confuse the “AF Learning” parameters with “AF Correction.” If you’re looking at a number that fluctuates widely and rapidly, you’re looking at the Correction value, which is not helpful. The ECU itself observes this value and uses it to make fueling adjustments, and over time it will adjust the Learning values based on trends in the Correction value. If you’re familiar with signal processing, the Learning value is just a low-pass-filtered view of the Correction value. I have watched the A value climb to +15% over the course of several seconds while I had a vacuum leak, but under normal circumstances the Learning values change so slowly they’re boring to watch.

AF Learning #2 may be for Subarus with stereo O2 sensors, such as the 6-cylinder naturally aspirated models with one O2 sensor for each bank of cylinders. However I’m not certain of this. I have not seen them in use on 4-cylinder Subaru yet, though.

The ROM has a table that determines the boundaries between the different air flow ranges, so you can adjust them if you wish. [3]

At last, we reach the interesting part:

On most Subarus, fuel trims are reset when the ECU is reflashed. It takes time for each fuel trim to ‘settle in,’ and of course the ECU can only make adjustments to the trim for the range that you’re driving in, so you cannot trust the trims that you see right after a reflash. It may require a conscious effort to drive in the 40+ airflow range to get that trim to settle in, since normal cruise won’t do it, and stabbing the throttle too hard will put you right into open loop. Watching the fuel trims in real time is instructive – you can do this with RomRaider’s logger, or by refreshing Learning View every few seconds, or with SawMill’s fuel trim gauge screen.

If the value of a fuel trim is positive, that means that the ECU has determined that it needs to add a bit more fuel to achieve the desired AFR.[4] In other words, the ECU has determined that the MAF sensor scaling is too low in the corresponding air flow range. Conversely, a negative fuel trim indicates that the ECU is reducing the fuel delivery for that range, meaning that the MAF scaling in that range is slightly too high.

The general consensus is that if the fuel trim values are within -5% to +5%, then the sub-60-g/s (closed-loop) region of your MAF scaling is good enough.

Since the fuel trims float around as you drive, you should sample them a few times before making adjustments, if you’re seeing values that are within a couple percent of zero. But, if they’re off by more than 5%, then your scaling would certainly benefit from an adjustment.

If your top-end trim (40+ in the example above) is off by more than 5% you should stay out of boost until/unless you have verified that your AFRs are on target in open loop. The reason is that top-end trim value is in effect during open loop operation.

It’s possible that your car was tuned with a value of zero in the top fuel trim. In that case, if you see a positive value in the top trim, your car is probably running richer than before. Conversely if the top trim goes negative, you are now running leaner than before, and at increased risk of detonation.

However it is also possible that your top trim was settled in (for example -3%) the last time you logged your open loop AFRs. Suppose that you then use those logs to adjust your open loop fueling. After resetting your fuel trims during the reflash, your AFRs will be off until the fuel trim settles in again. But once it settles to your original value (-3% in this example), then that value just means that you’re back where you expected to be.

In other words, the significance of the top end fuel trim depends on your logging/tuning workflow, and on whether or not your fuel trims reset when your ECU is reflashed.

There is a table that governs the minimum and maximum values for the fuel trims. On my 2005 Legacy GT, these were -15% and +15%, but I’ve seen other values in other stock tunes. If you see one or more of your fuel trims equal to the minimum or maximum possible value, your MAF should be adjusted before you drive the car further than you’re willing to walk. A trim of 15% on my car means that the MAF scaling is off by more than 15%, but there’s no indication of how much further off it is. Maybe 16%, maybe 60%.

Values at the minimum or maximum indicate a serious problem that needs to be fixed. Perhaps you’ve changed your MAF sensor housing, and you need to revise your MAF scaling to accommodate it. Perhaps your O2 sensor is failing. Perhaps you’ve got a vacuum leak. Whatever the cause, it should be fixed ASAP.

[1] That’s not 100% accurate, but it’s usually true. ECU also uses open loop when the O2 sensor is warming up, or when the O2 sensor has failed, and so on. It uses closed loop for the onset of hard acceleration, as determined by the closed loop delays. All of this is outside the scope of this discussion though.

[2] My only guess is that Subaru created this range for light deceleration, however I have no confidence in that guess.

[3] Because the 5-10 g/s range is so difficult to reach, I decided that it was pointless, and changed my ranges to the following:

A: 0-10 g/s
B: 10-20 g/s
C: 20-40 g/s
D: 40+ g/s

That makes each range easy to reach. I am slightly curious about Subaru’s reasons for dedicating a fuel trim to the 5-10 range, but I have not had any driveability issues with this scheme, and it makes the MAF easier to verify so I have no plans to change it back.

[4] As I write this, the desired AFR in closed loop mode is assumed to be 14.7. There is some speculation that the ECU may vary the desired AFR slightly for emissions control (for example, to heat up the cat), and Merchgod has hinted that a future ECU definition update might make it possible to adjust the desired AFR in closed loop, but for now, assume 14.7.

Revision history:

June 8 2009, added a paragraph about AF Correction parameters.
Sept 24 2011, added the ‘misconception’ section.