A method and system are disclosed for compensating a mass air flow signal
produced by a mass air flow sensor in fluid communication with an air
intake passageway of an internal combustion engine. A mass air flow
signal produced by the mass air flow sensor is monitored and an expected
oxygen concentration of exhaust gas produced by the engine is determined.
A compensation parameter is determined as a function of the expected
oxygen concentration and a measured value of the oxygen concentration of
the exhaust gas. A compensated mass air flow value is determined as a
function of the mass air flow signal and the compensation parameter.