me, being the perfectionist that i am, i needed to find a way to come up with perfectly accurate MPG numbers for any trip.

now, i've been able to make accurate instant numbers before using an equation that's been posted a few times, but when averaging that out over a log, it comes out quite optimistic, so i came up with a better method.

now, the faster your datastream is, the better, so 160baud is pretty much not going to benefit much from this since their conditions change so much between samples.

what i do is export a CSV log from a tunerpro XDL file with the following items in it:

vehicle speed
fuel flowrate in gallons/hr

now to allow those two values to show up correctly(at least in the current version of tunerpro), you need to also export the values that fuel flowrate is created from. now it's generated by fuel flowrate in lb/hr, but the lb/hr value is generated via BPW and RPM, so a total list of items exported are:

MPH
flowrate in G/Hr
flowrate in Lb/Hr
BPW
RPM

you can export more, if you feel a need to, but not necessary for the MPG calc.

so, now that you have a CSV file filled with fun numbers, you need to create a few values:

log duration
average fuel flow in gal/hr
total fuel used
average speed
total distance traveled
and finally trip economy

if you've messed with spreadsheets before, this will be fairly simple, but here is how to create each(after scrolling all the way to the bottom of the document):

log duration
this is always the first item i see and is in column B(as Time, Seconds). it's displayed in seconds, so make a value underneath all of the nice numbers and take the last value and have a cell operation of "=B23554/3600". B23554 being the last cell number for this example, now you have the length of the log in hours.

average fuel flow
column E for this example. "=AVERAGE(E4:E23554)" now you have a averaged fuel flow over the entire log. since fuel flow takes RPM into account, cells with the engine not running won't effect the calculation(or in the case of RPM values that can't be 0, very little and to the point of where you could remove them beforehand). displayed in G/Hr.

Total fuel used
this uses the previously two generated values, so no column to worry about. "=C23558*C23556". now those cells are where i have log duration and average fuel flow stored, though yours will vary significantly. just multiply the two together and store them in a different cell. fuel used is displayed as gallons.

average speed
just like average fuel flow, just in a different column. for me, column G. "=AVERAGE(G4:G23554)". now we have average speed over the entire log. displayed in MPH

total distance travelled
just like total fuel used. multiply average speed with log time. "=C23561*C23556" and now we have miles traveled.

finally, we take miles traveled and fuel used to make miles traveled per gallon used(MPG)
"=C23562/C23559", with '562 being distance traveled and '559 being fuel used.

congratulations, you should now have something looking similar to this:



http://i.imgur.com/zagQj.png

keep in mind, i do this all in openoffice, so MS and others may be different.