This is an old revision of the document!
It's simply impossible to give a full account of engine operation and ECU tuning concepts in a couple paragraphs. So please don't take the following as a complete summary of everything involved. It's not. This section is simply intended to orient the reader's mindset in the right direction with some high level concepts.
The engine works by igniting a mixture of air and fuel. The ratio of air to fuel is a key ingredient in producing power. Too much air or too much fuel (or too little of either) causes poor running conditions, misfires, etc. The mechanism used to ignite the mixture is a spark from the spark plug. The exact timing of this ignition process relative to piston position is another critical item in producing power. This is call “timing” or “ignition advance”.
The whole process of injecting fuel in the right amount related to the amount of air going into the engine and firing the spark at the exact right moment is all coordinated by the ECU. The ECU needs to know how much air is entering the engine to know how much fuel to inject. It also needs to have some idea of how much cylinder pressure is involved to schedule ignition advance appropriately.
The amount of air going into an engine is a critical piece of information the ECU needs to know very accurately so that it can accurately calculate how much fuel to inject. If the real airflow going into the engine is different from the amount the ECU thinks is going into the engine, the ECU will schedule an inappropriate amount of fuel and the engine's operation will suffer as a result. So accurate airflow metering is really important.
Things that can contribute to inaccurate airflow metering include intake air leaks (blown couplers, leaky seals, etc.) or just simply an airflow sensor that's reporting inaccurate values. Stock Mitsubishi airflow sensors generally need little adjustment, assuming they are installed properly and have a nice long, straight path for air in front of the sensor. Installations with 90 degree bends right at the MAF inlet or mushroom style air filters can cause inaccuracies even with otherwise stock Mitsubishi MAF sensors because both change *how* the airflow passes through the metering section of the MAF.
Installing a non-stock MAF like a GM MAF is a whole 'nother can of worms. Suffice to say it can be done, but can require even more attention to detail to keep the airflow reported to the ECU as accurate as possible.
The bottom line is that you need accurate airflow readings to the ECU if you want the ECU to inject accurate fuel.
From the amount of air the ECU is told is going into the engine, the ECU calculates an amount of fuel required to maintain a 14.7:1 A/F ratio using stock injectors at stock fuel pressure. This is where things can get a little tricky to keep straight in your head. The ECU is coded from the factory to account for the configuration the engine came with from the factory. That is, stock injectors and stock fuel pressure. On a stock 2G DSM, that's 450 cc/min injectors at 43.5psi base fuel pressure. On a stock 1G manual DSM, that's 450 cc/min injectors at 37psi. Stock 1G automatics came with 390s at 43.5psi. This determines the flow rate of fuel into the engine. From that flow rate assumption, the ECU can calculate how long to hold the injectors open to get a specific flow rate required for the air it believes is coming into the engine.
So, you have two things now that the ECU needs to have accurate information on. First, it needs accurate airflow to calculate fuel flow requirements and second, it needs to know if you've changed anything that affects fuel flow into the engine. If you change base fuel pressure or you swap in different injectors, you have to adjust the ECU's fuel flow calculations to take this into account.
At some point, air and fuel is going into the engine and getting all mixed up and pressurized by the piston going up on the compression stroke. The ECU then schedules the ignition of that mixture. The precise point at which the ignition takes places is very critical. Firing too early (advanced too far) can cause very bad things to happen as cylinder pressures increase dramatically beyond design limitations and stuff starts to break. Firing too late (too retarded) generally just causes poor performance. So the trick is finding the happy middle ground.
The ECU from the factory has a couple big tables it uses to look up basic ignition advance values. Those values, just like the A/F ratio values for fuel, are tweaked a bit based on operating conditions. But the bulk of ignition advance figures comes straight from the ECU's timing tables. As engine speed (RPM) increases, timing needs to increase as well. “Why” is a long story, but take it for granted that it does. As engine load (cylinder pressure) increases, timing needs to decrease. So these ignition tables are laid out with RPM on one axis and engine load on the other. The result looks something like the following.