Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
04-25-2006, 01:02 PM
|
#1
|
|
Newbie
Join Date: Aug 2004
Location: US
Vehicle: 1998 Honda Civic LX
Posts: 20
|
Calculating MPG using speed and air flow from OBDII readout
Hi, I'd like to add instantaneous fuel efficiency (MPG - miles per gallon) to OBD Gauge for Palm. I've only been able to find a single mention of how to calculate this from an article at Circuit Cellar http://www.circuitcellar.com/adverti...ghtner-183.pdf .
There, Bruce Lightner gives the formula:
MPG = (14.7 * 6.17 * 4.54 * VSS * 0.621371) / (3600 * MAF / 100)
= 710.7 * VSS / MAF
MPG - miles per gallon
14.7 grams of air to 1 gram of gasoline - ideal air/fuel ratio
6.17 pounds per gallon - density of gasoline
4.54 grams per pound - conversion
VSS - vehicle speed in kilometers per hour
0.621371 miles per hour/kilometers per hour - conversion
3600 seconds per hour - conversion
MAF - mass air flow rate in 100 grams per second
100 - to correct MAF to give grams per second
Is this what other software uses to calculate MPG? Are there other methods?
I just got my OBD2 All-In-One yesterday, and have just started playing around with it and OBD Gauge. I'm going to try and add the above formula to OBD Gauge and see what it gives. I'd really appreciate any info. Thanks
Last edited by maeliosa : 04-25-2006 at 04:26 PM.
Reason: to change title
|
|
|
04-27-2006, 06:09 AM
|
#2
|
|
Maximum Bitrate
Join Date: Jun 2003
Location: Hatfield, PA
Vehicle: 2004 Subaru WRX STi
Posts: 558
|
The software that came with the OBD reader I have, has some formulas for computing various things from the codes. One of which is instantaneous MPG, as follows:
instantaneous Distance D = VSS * t/3600
instantaneous Fuel F = 1 / (14.75 * 6.26) * MAF * t/60
instantaneous MPG = D / F
t is delta time.
So other than the conversion constants being slightly different, I would say your formula looks good.
__________________
*******************************
*******************************
|
|
|
04-28-2006, 02:59 PM
|
#3
|
|
Newbie
Join Date: Apr 2006
Posts: 2
|
so you can get accurate readings out of this?
When I replace my current Dell Axim, I'm consdiering using it as a GPS/OBD tool.
|
|
|
05-01-2006, 10:43 PM
|
#4
|
|
Newbie
Join Date: Aug 2004
Location: US
Vehicle: 1998 Honda Civic LX
Posts: 20
|
I haven't the slightest clue about how reliable this method is, that's what I hope to find out.
Unfortunately, my 98 Civic does not have a MAF sensor! However, hopefuly there can be another way. Right now I'm looking at PID $04, Calculated Load Value (CLV), defined as:
CLV = [current airflow] / [(peak airflow at WOT@STP as a function of rpm) * (BARO/29.92) * SQRT(298/(AAT+273))]
There's airflow! As for the other variables:
peak airflow: dunno what this value is
WOT = wide open throttle
STP = standard temperature and pressure (25C, 29.92inHg)
BARO = barometric pressure (maybe same as manifold air pressure MAP ?)
AAT = ambient air temperature
As you can see, the last two terms correct for temperature and pressure. If BARO happens to be from the MAP sensor, then we've got that. If AAT happens to be intake air temperature (IAT), then we've got that. Even if we don't have these values, the result won't be changed by a great deal.
Peak airflow is trickier. The easy and completely inaccurate route to get peak airflow would be to just multiply the engine displacement by RPM (divided by 2, since it takes two revolutions in a 4-stroke engine). However this assumes 100% volumetric efficiency (VE), which is generally not the case. We'd need the map of VE to RPMs, which of course the ECU happily holds within its silicon.
So we're missing a few crucial things. Perhaps we could at least get some value that's proportional to MPG. I'll try some things out.
Anyone else here have any ideas?
__________________
1998 Honda Civic LX
In VERY early planning stages now
---------------------------------
Awesome avatar from DannyWork@Flickr
|
|
|
07-19-2006, 12:22 AM
|
#5
|
|
Newbie
Join Date: Jun 2005
Posts: 46
|
Just saw this on Digg the other day...
Fueling a Lifestyle
In particular:
Quote:
Understanding the Engine
Internal combustion engines are often called aspirated engines because they are "air-breathing" machines. These engines burn a combination of air and fuel mixed at the stoichiometric ratio 14.7 to 1.17 In the past, fuel and air were mixed in the carburetor, relying on the venturi effect of the pipework to render the fuel into an aerosol.18 Modern systems rely on fuel injection, a process governed by the car's engine computer unit (ECU).19 A variety of sensors feed into the ECU providing real-time information so the computer can manipulate engine performance for optimal emissions. The ECU can regulate fuel flow precisely to match air intake or even adjust the spark timing for various RPM and engine loads.
A rough approximation of fuel use can be made through calculations on engine sensor data. Estimates on fuel consumption will be approximately equal to dividing the amount of airflow through the engine by 14.7, the stoichiometric ratio.20 Engine mass airflow may be determined either with an MAF (Mass Air Flow) sensor or through calculations on the MAP (Manifold Absolute Pressure) sensor.
(in case the server goes down, the equations in the image are:
Engine Mass Airflow = RPM * (Manifold Air Pressure / Absolute Temperature)
Fuel Mass = Engine Mass Airflow / Stoichiometric Ratio
)
Varying Speed
Using these equations, I can compare the fuel requirements for different driving speeds. To collect the necessary data, I configured the DigiMoto software to log data on the engine's RPM, intake temperature and manifold pressure. For the tests, I drove the Jeep at 45, 55, 65 and 75mph along the same stretch of Riverwatch Parkway. To ensure consistency, logging only took place after the appropriate speed was reached and locked into with cruise control.21 During the drive, the windows were left up for consistent aerodynamics and the air conditioning was left off to eliminate extra engine variables. The engine intake added approximately 13° of heat to the ambient air temperature resulting in 103° Fahrenheit (312.5° Kelvin).
So there you have it. I also have a Honda Civic and was wondering how you would calculate instant MPG when you don't have an MAF sensor. From the equation above it looks like you use the RPM, MAP, and intake air temperatures instead. I haven't taken my laptop, OBD-II reader, and car out for a spin yet to test it out but it should give everyone a start...
I'd recommend reading the entire article - it was very interesting. This guy did his research.
|
|
|
07-22-2006, 08:55 AM
|
#6
|
|
Newbie
Join Date: Apr 2006
Location: Porto, Portugal
Vehicle: 2003 Mercedes E
Posts: 2
|
This formula
Quote:
Fuel Mass = Engine Mass Airflow / Stoichiometric Ratio
and also Bruce Lightner's formula, assumes a perfect stoichiometric combustion of typical gasoline.
It will give reasonable values most of the time.
The results may differ from the correct ones due to:
1. Some (defective) engines may not have a perfectly Stoichiometric tuning.
2. Some gasoline may have different octane grade and modern cars will automatically tune the mixture ratio.
3. In the warm-up and during throttle change, the combustion is not stoichiometric.
Problems 1. and 3. can be corrected if we have access to the Lambda factor, measured from the exhaust gas:
Fuel Mass = Engine Mass Airflow / (Stoichiometric Ratio*Lambda)
I still dont know how to correct problem 2. Any ideas?
A note on Diesel engines:
A Diesel engine does not use stoichiometric combustion.
So, a reasonable approach of the fuel mass can only be achieved with the Lambda correction and the value of 14.5 for the Stoichiometric Ratio.
The density of Diesel fuel is 7.03 lbs/gal.
JML
|
|
|
07-22-2006, 03:15 PM
|
#7
|
|
Newbie
Join Date: May 2006
Posts: 21
|
There are 454 grams per pound, not 4.54.
__________________
Watch out, I have a soldering iron and a ham radio license (it's worse, it's an extra class license too!) and am not afraid to use them!
|
|
|
07-22-2006, 03:17 PM
|
#8
|
|
Newbie
Join Date: May 2006
Posts: 21
|
Quote: Originally Posted by JML
2. Some gasoline may have different octane grade and modern cars will automatically tune the mixture ratio.
Fuel Mass = Engine Mass Airflow / (Stoichiometric Ratio*Lambda)
JML
The lambda sensors are used to compensate for the varying grades of gasoline (well, they compensate for everything and only look at the composition of the exhaust gases). I suspect your correction calculation would be close enough.
__________________
Watch out, I have a soldering iron and a ham radio license (it's worse, it's an extra class license too!) and am not afraid to use them!
|
|
|
09-21-2007, 02:34 PM
|
#9
|
|
Newbie
Join Date: Sep 2007
Posts: 1
|
Let's Get the MPG Formula Right!
Quote: Originally Posted by maeliosa 
Hi, I'd like to add instantaneous fuel efficiency (MPG - miles per gallon) to OBD Gauge for Palm. I've only been able to find a single mention of how to calculate this from an article at Circuit Cellar http://www.circuitcellar.com/adverti...ghtner-183.pdf .
There, Bruce Lightner gives the formula:
MPG = (14.7 * 6.17 * 4.54 * VSS * 0.621371) / (3600 * MAF / 100)
= 710.7 * VSS / MAF
MPG - miles per gallon
14.7 grams of air to 1 gram of gasoline - ideal air/fuel ratio
6.17 pounds per gallon - density of gasoline
4.54 grams per pound - conversion
VSS - vehicle speed in kilometers per hour
0.621371 miles per hour/kilometers per hour - conversion
3600 seconds per hour - conversion
MAF - mass air flow rate in 100 grams per second
100 - to correct MAF to give grams per second
Is this what other software uses to calculate MPG? Are there other methods?
I just got my OBD2 All-In-One yesterday, and have just started playing around with it and OBD Gauge. I'm going to try and add the above formula to OBD Gauge and see what it gives. I'd really appreciate any info. Thanks
For the record, the first "one-line" MPG formula above, taken from my Circuit Cellar article, is off by 100! The "4.54" should in fact be "454". The correct formula is:
MPG = (14.7 * 6.17 * 454 * VSS * 0.621371) / (3600 * MAF / 100)
MPG = 710.7 * VSS / MAF
Note that OBD-II VSS reading is in kilometers/hour and MAF reading is grams/sec times 100.
This formula works very well in a modern automobile because the engine computer spends almost 100% of its time managing the fuel-air-ratio to 14.7, which it can do very well because of the "closed loop" feedback from the O2 sensor(s).
In fact, the accuracy of this method has been proven in literally tens of thousands of gasoline-powered vehicles. Accuracy within a few percent is typical, often limited by the accuracy of the vehicle speed reading (i.e., VSS).
As for other ways of doing this, especially if you don't have a MAF sensor, by knowing the displacement of the engine, and after a simple "calibration" using fuel tank "fill-up" data to find the only unknown, namely the "volumetric efficiency" (VE) of the engine, MAF can be calculated from RPM, MAP and IAT. With VE, one can use the following formulas to calculate a synthetic "mass air-flow" (MAF) in grams per second, all without a MAF sensor, using the "Ideal Gas Law", as follows:
IMAP = RPM * MAP / IAT
MAF = (IMAP/120)*(VE/100)*(ED)*(MM)/(R)
where manifold absolute pressure (MAP) is in kPa, intake air temp (IAT) is in degrees Kelvin, R is 8.314 J/°K/mole and the average molecular mass of air (MM) is 28.97 g/mole. Note that, in the above formula, the volumetric efficiency of the (4-cycle!) engine is measured in percent and the engine displacement (ED) is in liters.
The VE of my 1999 7.4L Chevy Suburban is about 65%. Smaller, higher performance engines can have VE's of 85% or higher.
Best regards,
Bruce D. Lightner
lightner@lightner.net
http://www.lightner.net/lightner/bruce/
|
|
|
10-30-2007, 08:21 PM
|
#10
|
|
Newbie
Join Date: Mar 2006
Posts: 50
|
I would suggest trying to use injector pulse width instead if it is available. Not all engines run at stoich all the time. For instance, some of the lean-burn Civics run closer to 17:1 when cruising. Also, when you floor it and your car goes into open loop, you may be running closer 12:1 to keep from popping your motor. Or before your car is warmed up in the winter, it is probably running open-loop. Wiring in a wide-band O2 sensor to accurately read the A/F ratio in realtime in conjunction with your MAF readings would be more accurate than just assuming you are running at stoich.
__________________
2006 Corolla S Ex-Audio 7" Epia MII ATI AIW VE 512MB Mini-Box.com M300 Case 100GB 2.5" HDD Z-COM XI-325HP+ Linksys WSB24/WRT54G w DD-WRT Treo 755p BT Modem Lite-On Slotload DVD GPS JVC AVX2 2x JL Audio 8" Alpine Type-S F/R
|
|
|
10-31-2007, 04:26 PM
|
#11
|
|
FLAC
Join Date: Mar 2004
Location: Florence Yall, BFKY
Vehicle: 98 Trans Am
Posts: 1,701
|
I use LtFt in the equation from something I saw here a few years ago, but running a few old OBD2 logs shows Lightner's code works quite well and faster with only 2 PIDs. It's a little sensitive when my MAF reads < 0.10 once in a while, so filtering that out helps. I wouldn't display it directly though. Average it out over several seconds using a circular buffer. I actually use a 3 second and 5 minute average to show more realistic numbers. I've also decided stoplights are bad for our economy. 
__________________
XPort 1.24 -GPS port splitter, logger, and USB device resume fix
|
|
|
11-06-2007, 03:22 PM
|
#12
|
|
Newbie
Join Date: Nov 2007
Location: Tulsa, OK
Vehicle: 1963 Ford Fairlane
Posts: 6
|
okay now how do you do it in a car without all those bells and whistles? (say a 63 Fairlane with a 221ci V-8 engine.)...some function of airflow to rpm?...
|
|
|
06-03-2008, 09:02 AM
|
#13
|
|
Newbie
Join Date: Jun 2008
Posts: 1
|
There are a number of senders that you can place inline. I don't have links handy, but the last time I went shopping for this, I found several options between $100-200 for kit built airplanes and marine applications. The aircraft ones are a little more expensive because they are designed not to be able to restrict fuel flow in the event of a failure. The one I spec'd sent a single pulse for every so many units of fuel that went through and cost about $180
I'd be going this route with my project if I hadn't found out about the OBD port. That only cost me $35 for the translator.
Good luck,
/z
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:13 PM.
|
|