On-Line Gasoline MPG Calculator (Using MAF and/or MAP/IAT/RPM)

For those that want to calculate MPG using MAF (and/or MAP/IAT/RPM) for gasoline vehicles I've put together a Webpage with a Javascript-based air/fuel flow calculator...

http://www.lightner.net/obd2guru/IMAP_AFcalc.html

You may find this useful for "checking your work".

As many of you have discovered---based on comments here and email that I regularly receive---getting all the units and calculations exactly right can be hard. And, in an embedded system without floating-point support, avoiding integer overflow errors can proved difficult.

Best regards,

Bruce D. Lightner

[email protected]

http://www.lightner.net/lightner/bruce/

Usiing LOAD_ABS (OBD-II Mode 1 PID 0x43) to Estimate Vehicle MPG

:ohwell:
Quote:

Originally Posted by

**lightner**
There seems to be at least two different interpretations of the OBD-II parameter called "engine load" (i.e., LOAD, in the range of 0-100%), as reported over the OBD-II bus by modern engine computers. One version gives a LOAD value with is directly proportional to MAF (i.e., mass air flow). The other version seems to show that MAF is proportional to (LOAD x RPM).

So, if you want to solve for MAF using LOAD, first you need to determine which LOAD algorithm is being used by the vehicle in question, then you need to determine the appropriate constant scaling factor to derive MAF. Of course in one case you need to read RPM along with LOAD.

Given a calculated MAF, plus a periodic VSS (i.e., vehicle speed) reading, integrating these gets you incremental fuel consumed and distance traveled. Divide one by the other and you get MPG.

As I have noted before, using MAF to derive a fuel flow measured in gallons assumes a constant air-fuel (A/F) ratio and a fixed, known fuel density. Given that modern fuel injected engines are designed to run with a fixed, "stoichiometrically ideal" air fuel ratio of 14.7:1 almost all the time, using a constant A/F ratio for the MPG calculation makes good sense.

SAE J1979 defines a new OBD-II parameter, LOAD_ABS (i.e., Mode 1 PID 0x43) which is the normalized value of air mass per intake stroke displayed as a percent. This value is directly proportional to air flow rate which, as we know, is directly proportional to fuel flow (almost 100% of the time). Therefore integrating this percentage and then multiplying it by a constant---which will be unique for a given vehicle make/model/engine, will provide a good estimate of fuel consumed. With that and distance traveled---derived from integrating vehicle speed readings---we can calculate fuel consumption in miles per gallon (MPG). Q.E.D. :)

For the record, here's what the SAE standard says about this "new" OBD-II parameter:

The absolute load value has some different characteristics than the LOAD_PCT defined in Mode 1 PID 0x04. Vehicles which utilize spark or compression ignition engines for propulsion shall use the following definition for calculating LOAD_ABS:

LOAD_ABS = [air mass (g / intake stroke)] / 1.184 (g / litre) * cylinder displacement (litres / intake stroke)]

Derivation:

- air mass (g / intake stroke) = [total engine air mass (g/sec)] / [rpm (revs/min)* (1 min / 60 sec) * (1/2 # of cylinders (intake strokes / rev)],

- LOAD_ABS = [air mass (g)/intake stroke] / [maximum air mass (g)/intake stroke at WOT@STP at 100% volumetric efficiency] * 100%.

where:

- STP = Standard Temperature and Pressure = 25 oC, 29.92 in Hg (101.3 kPa) BARO

- WOT = wide open throttle.

The quantity (maximum air mass (g)/intake stroke at WOT@STP at 100% volumetric efficiency) is a constant for a given cylinder swept volume. The constant is 1.184 (g/litre) * cylinder displacement (litres/intake stroke) based on air density at STP.

Characteristics of LOAD_ABS are:

- Ranges from 0% to approximately 95% for naturally aspirated engines, 0% to 400% for boosted engines,

- Linearly correlated with engine indicated and brake torque,

- Often used to schedule spark and EGR rates,

- Peak value of LOAD_ABS correlates with volumetric efficiency at WOT.,

- Indicates the pumping efficiency of the engine for diagnostic purposes.

NOTE At engine off and ignition on the LOAD_ABS = 0 %.

All vehicles with spark ignition engines used for propulsion are required to support PID 0x43.

See Mode 1 PID 0x04 for an additional definition of engine LOAD.