Pretty accurate mpg calculator
#1
Supreme Member
Thread Starter
Pretty accurate mpg calculator
Not sure if this has been attempted before...
But I generated a mpg calculator using the injector pulse width from the scanner readout, along with vehicle speed and engine rpm. Actually fairly simple math with a bunch of unit conversions.
But it's very accurate compared to the results I get with the standard approach of measuring mpg. I measured ~23 mpg, the calculator says I'm getting 23.49.
I've attached it in the zip file. It needs Excel 2007 or higher to run though.
But I generated a mpg calculator using the injector pulse width from the scanner readout, along with vehicle speed and engine rpm. Actually fairly simple math with a bunch of unit conversions.
But it's very accurate compared to the results I get with the standard approach of measuring mpg. I measured ~23 mpg, the calculator says I'm getting 23.49.
I've attached it in the zip file. It needs Excel 2007 or higher to run though.
#4
Supreme Member
Thread Starter
#5
Senior Member
Join Date: Nov 2006
Location: Camden, MI
Posts: 672
Likes: 0
Received 1 Like
on
1 Post
Car: 1985 IROC-Z28
Engine: LB9
Transmission: 700R4
Axle/Gears: 3.73
Re: Pretty accurate mpg calculator
i was hoping you had cracked out an equation that would generate an accurate trip MPG..... the equations i come up with seem to work great for instant MPG calcs, but i've never gotten one to create an accurate trip value, always have significant error in either direction depending on the equation.
#6
Supreme Member
Thread Starter
Re: Pretty accurate mpg calculator
i was hoping you had cracked out an equation that would generate an accurate trip MPG..... the equations i come up with seem to work great for instant MPG calcs, but i've never gotten one to create an accurate trip value, always have significant error in either direction depending on the equation.
You'd simply add and formula-rize a column that looked at injector pulse width, engine rpm and vehicle speed. It would calculate an instantaneous mpg at each sample.
Then at the end of the data set, you'd run a mathematical average of all the mpg calcs for a trip average.
Send me a tunerpro .csv output file and I'll generate one.
Yeah for the spreadsheet I originally posted. I used an injector pulse width that corresponded to cruising at 65 mph constant speed on flat ground. Agreed it will not account for variability with acceleration.
#7
Senior Member
Join Date: Nov 2006
Location: Camden, MI
Posts: 672
Likes: 0
Received 1 Like
on
1 Post
Car: 1985 IROC-Z28
Engine: LB9
Transmission: 700R4
Axle/Gears: 3.73
Re: Pretty accurate mpg calculator
i worked out my own solution a while ago..... but it's a lot more involved than math on just the PC side of things. i was just more interested to see if someone could get an accurate trip value from the existing items sent over the datastream since mine were never quite correct.....
i had to cheat a bit and create some 16-bit accumulator values in the ECM's RAM that figure out distance and fuel used this ignition cycle, then spit that out to the PC to do the final math and keep track of trip distance and fuel used(since i could otherwise have done that division on the ECM side as well and only output 1 16-bit value).
i had to cheat a bit and create some 16-bit accumulator values in the ECM's RAM that figure out distance and fuel used this ignition cycle, then spit that out to the PC to do the final math and keep track of trip distance and fuel used(since i could otherwise have done that division on the ECM side as well and only output 1 16-bit value).
Trending Topics
#9
Supreme Member
Thread Starter
#10
Supreme Member
iTrader: (1)
Join Date: Jan 2002
Location: garage
Posts: 4,432
Likes: 0
Received 1 Like
on
1 Post
Engine: 3xx ci tubo
Transmission: 4L60E & 4L80E
Re: Pretty accurate mpg calculator
I tried doing calcs somewhat like this in TunerPro 4.x. I wanted to have one "pseudo" ALDL value that was made up of other real ALDL values. As an example, suppose you want to report MPG. That is a function of (BPW, RPM, Time, VSS). All of which the ECM reports. Granted that the BPW will have to be assumed to be constant over the Time period which it really isn't. It will give an averaging affect.
Does TP 5.x support mult-ALDL variable equations? I couldn't do it TP 4.x from memory.
MPG(INJ_BPW, RPM, ECM_TIME, VSS)
Does TP 5.x support mult-ALDL variable equations? I couldn't do it TP 4.x from memory.
MPG(INJ_BPW, RPM, ECM_TIME, VSS)
#11
Moderator
iTrader: (1)
Join Date: Mar 2002
Location: Chasing Electrons
Posts: 18,400
Likes: 0
Received 215 Likes
on
201 Posts
Car: check
Engine: check
Transmission: check
Re: Pretty accurate mpg calculator
i worked out my own solution a while ago..... but it's a lot more involved than math on just the PC side of things. i was just more interested to see if someone could get an accurate trip value from the existing items sent over the datastream since mine were never quite correct.....
i had to cheat a bit and create some 16-bit accumulator values in the ECM's RAM that figure out distance and fuel used this ignition cycle, then spit that out to the PC to do the final math and keep track of trip distance and fuel used(since i could otherwise have done that division on the ECM side as well and only output 1 16-bit value).
i had to cheat a bit and create some 16-bit accumulator values in the ECM's RAM that figure out distance and fuel used this ignition cycle, then spit that out to the PC to do the final math and keep track of trip distance and fuel used(since i could otherwise have done that division on the ECM side as well and only output 1 16-bit value).
They are roll over counters, 8-bit for the VSS pulses and 16-bit for the injector pulses.
RBob.
#12
Senior Member
Join Date: Nov 2006
Location: Camden, MI
Posts: 672
Likes: 0
Received 1 Like
on
1 Post
Car: 1985 IROC-Z28
Engine: LB9
Transmission: 700R4
Axle/Gears: 3.73
Re: Pretty accurate mpg calculator
I tried doing calcs somewhat like this in TunerPro 4.x. I wanted to have one "pseudo" ALDL value that was made up of other real ALDL values. As an example, suppose you want to report MPG. That is a function of (BPW, RPM, Time, VSS). All of which the ECM reports. Granted that the BPW will have to be assumed to be constant over the Time period which it really isn't. It will give an averaging affect.
Does TP 5.x support mult-ALDL variable equations? I couldn't do it TP 4.x from memory.
MPG(INJ_BPW, RPM, ECM_TIME, VSS)
Does TP 5.x support mult-ALDL variable equations? I couldn't do it TP 4.x from memory.
MPG(INJ_BPW, RPM, ECM_TIME, VSS)
Check out the $8D mask, it has VSS and injector PW accumulators in the ALDL stream. GM used this info for the trip computer (DIC). Easy to take a look and see how the data was collected on the ECM side.
They are roll over counters, 8-bit for the VSS pulses and 16-bit for the injector pulses.
RBob.
They are roll over counters, 8-bit for the VSS pulses and 16-bit for the injector pulses.
RBob.
mine isn't finalized since i never implimented it, just tested the code out to make sure that it works how i was expecting it to(1 mile increments after being held at 60MPH for 60 seconds, etc). now that i look at my code more.... there is at least one change i think i'm going to make since it currently does math based on how much a single injector has flowed. with a 20 gallon maximum value, it would take a multi-port engine a lot longer for increments to happen than what i was planning. a 6 injector engine would now actually be a 120 gallon max value, 8 injectors with 160 gallons..... cuts down on my fuel use resolution pretty significantly.
#13
Member
Join Date: Dec 2006
Location: Oklahoma
Posts: 183
Likes: 0
Received 0 Likes
on
0 Posts
Car: Too many to list...
Re: Pretty accurate mpg calculator
What do you plug in for injector pulse width? Plugged in 65 lb/hr for injector flow from my setup, not sure about pulse width though
7427 swapped TBI
7427 swapped TBI
#14
Supreme Member
Thread Starter
Re: Pretty accurate mpg calculator
It's the duty cycle.
For example, I got on an open stretch of road and got to steady state cruising speed, then noted the injector duty cycle on the scanner. Should be in milliseconds.
Figured it would be a good representative value for average highway fuel economy.
For example, I got on an open stretch of road and got to steady state cruising speed, then noted the injector duty cycle on the scanner. Should be in milliseconds.
Figured it would be a good representative value for average highway fuel economy.
#15
Member
Join Date: Dec 2006
Location: Oklahoma
Posts: 183
Likes: 0
Received 0 Likes
on
0 Posts
Car: Too many to list...
Re: Pretty accurate mpg calculator
So you just note your injector base pulse width on the dash in TunerPro and plug that value in to the spreadsheet, correct???
Very cool, thank you for sharing this.
Very cool, thank you for sharing this.
#16
TGO Supporter
Join Date: Jan 2000
Location: In your ear. No, the other one.
Posts: 1,861
Likes: 0
Received 0 Likes
on
0 Posts
Car: '89 Trans Am WS6
Engine: 350 TPI
Transmission: T5WC
Axle/Gears: 3.08 posi
Re: Pretty accurate mpg calculator
Yes, it does. And you can create statics by creating an ADX Value with the static value as the equation (e.g. "25.8"), then reference that static value in the equation of other ADX Values.
Thread
Thread Starter
Forum
Replies
Last Post
rb85TA
Organized Drag Racing and Autocross
26
09-14-2015 10:29 PM