Short and Long Term Fuel Trim

Short and Long Term Fuel Trim

One of the great things about tuning in volumetric efficiency mode is that once the fuel system is set up correctly the engine almost tunes itself – and that’s exactly what we are going to look at in this article. 

If you’re not familiar with the concept of Volumetric Efficiency (VE), what it is, how it works, and the advantages of an EFI system that uses a VE model for fuel delivery we suggest you brush up on your knowledge here.

If you want to jump straight to the point here is the condensed version:

VE Tuning Basics

When tuning an engine in VE mode the fuel map is actually mapping the amount of air going into the engine, the number that you see in the fuel map is typically between 50 and 100, this number represents how efficiently the engine fills with air at the particular load and rpm site in the map. So 80 in the VE map means the engine fills to 80% of its capacity at this load and RPM.

The ECU then uses this calculated airflow rate along with the injector flow rate and target air-fuel ratio to determine how long to open the fuel injector for.

If you have all the correct information in the ECU for injector flow rate, fuel type and engine capacity plus your MAP sensor and intake air temp sensor are working correctly when we measure the actual air-fuel ratio in the exhaust it should match the values we put into the target air to fuel ratio. If the actual and the target air-fuel don’t match – chances are the numbers you put into the VE map aren’t accurate for the particular load and RPM you are operating in.

So what do you do? You tune the VE map, or in other words, you modify the base fuel map, which is actually an airflow map. Increase the number for more fuel, decrease the number for less fuel. This is done in each cell of the map until your actual air-fuel ratio matches your target air-fuel ratio.



ECU, tune thyself

So if all we are really doing in tuning the VE map is adjusting the VE number up or down until our actual and target air-fuel ratios meet – can’t we just tell the ECU to do this automatically and learn this information. Like self-tuning?

The short answer to that question is yes. When you add a wideband O2 sensor to any Elite or NEXUS series ECU, the ECU can be set up to apply these fuel corrections automatically. Some people call this auto-tune, others call it self-learning, it’s all the same thing. In Haltech terminology, it’s called Long Term and Short Term Fuel Trim (LTFT and STFT).

Short Term Fuel Trim

To turn on O2 control in the Haltech NSP tuning software navigate to the “Fuel Tuning” section and turn on the “O2 Control” function checkbox. You can also navigate to all the tuning functions by pressing the F4 button and turn on O2 control from here.



In the O2 Function Setup page, we have the control parameters that the O2 control is going to work under, most of these are easily understood. Things like Initial Engine Run Time, Minimum Coolant Temp, and Minimum and Maximum RPM settings don’t need any explanation.

We will concentrate on the 4 settings that we get the most questions. The dropdown box allows you to select which sensor you are going to use for O2 control. 9 times out of 10 this will be the only sensor you have so it’s a simple decision. However, there are times where you may have more than 1 O2 sensor in which case you would select the configuration of O2 sensor that matches your engine.



In our example, the engine is a straight-six, but since it’s got two exhaust manifolds and two 02 sensors we will assign a Wideband to each bank.



The next setting in the software is the “STFT Enrichment” and “STFT Disenrichment”. This is where we need to understand how the O2 control system works in a broad sense.

Short Term Fuel Trim can be thought of as an instantaneous adjustment because the O2 sensor looks at the actual air-fuel ratio, compares that to the target air-fuel ratio if they are different an immediate correction is made.

However this Short Term Fuel Trim is just that – short-term. It does not get stored or saved anywhere, so no ‘learning’ is ever applied. For the ECU to learn and save this information we need to go down to the Long Term Fuel Trim settings which we’ll get to shortly. First, we need to clarify the least understood setting in the Short Term Fuel Trim function and that is the Target Oscillation Amplitude.



The default setting here is 0.0, which means if the ECU is targeting a 14.7:1 air-fuel ratio then the O2 control system tries to maintain a steady 14.7:1. If we were to put say 1 air-fuel ratio point in here and the target air-fuel ratio was 14.7:1, the O2 control would try and oscillate the actual air-fuel ratio between 13.7 to 15.7.

Why would you want the air-fuel ratio to bounce around for this? To control your emissions. In order to achieve near-zero tailpipe emissions, we must use a catalytic converter. A catalytic converter works like a sponge in that it continuously fills up and empties so it needs a continuous, oscillating mixture off slightly lean then slightly rich mixture. That oscillation amplitude is what this setting is for. If you are not familiar with tuning an engine to achieve a high level of emissions reductions we recommend leaving this value at 0.

Long Term Fuel Trim

For the ECU to actually learn or save any information about the required fuel trims we have to turn on the Long Term Fuel Trim (LTFT).



We have some similar settings here, LTFT Minimum and Maximum Values, a Minimum Temperature under which the ECU won’t learn any O2 control and there is also this “Long Term Fuel Trim Rich Bias” value.



Think of this as a safety factor. The long-term 02 control will target and learn according to what values are in the target air-fuel ratio map. However if you put a value of say 3% in the “Rich Bias” setting, the O2 control learns to a value 3% rich of the target and then relies on the Short Term Fuel Trim to remove that extra 3%. The reasoning behind this is if the O2 sensor becomes unplugged or fails for any reason, the ECU has learned 3% on the safe side.

There are a couple of other control parameters that are worth mentioning; the first one is the Long Term Fuel Trim Gain map – this map sets the speed at which the O2 control converts the instantaneous short term trim into a long term learned value – the bigger the number the faster the learning.



The theory here is as engine speed and engine load increase there is enough reliable data to write to the long-term learned value as quickly as possible. At lower engine speeds and lower engine loads, you may end up chasing your tail if you write to the long-term trim too quickly so you slow down the writing to long-term and allow the short-term instantaneous correction to do the bulk of the work. This is why you see smaller gain values in the low RPM areas of this map.

Want to know more?

Where is the Target AFR value is coming from? The ECU gets that information from the “Target Lambda” map but we don’t target the same lambda or AFR value for each load and RPM. If you want to know why – watch our AFR vs Ignition Timing video.
    • Related Articles

    • Long Term Fuel Trim

      How it works The Long Term Fuel Trim is a function where the ECU can learn the correct amount of fuel required over a period of time so that the Target and Actual measured AFR are equal. Sometimes this is referred to as Auto-Tune. Both Narrowband and ...
    • Knock Long Term Trim

      Ignition Tuning - Knock - Long Term Trim Enable Long Term Trim Select this box to enable long term trim of Knock Control Long Term Retard This is the amount of long term retard that will be applied for each knock detection event that occurs in that ...
    • Boost Control Long Term Trim

      This node allows you to enable, disable and reset the long term trim learning in the ECU. Enable Long Term Trim - Enables the Long Term Trim control. LTT Min TPS - Long Term Trim control is active only when the TPS is greater than this amount. This ...
    • Knock Control Bank Long Term Trim

      Knock Control Bank Long Term Trim This table shows long term trim adjustments based on prior engine knock events. From the Knock - Long Term Trim page you have the option to reset this table or you can Apply to Base Table which applies the ...
    • Long Term Trim

      Long Term Trim This node allows you to enable, disable and reset the long term trim learning in the ECU.  The Apply to Base Table button will apply any long term trims to your Base Idle Control table. Long Term Trim Gain This table controls the rate ...