DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

Pretty accurate mpg calculator

Thread Tools
 
Search this Thread
 
Old 07-20-2014, 09:46 AM
  #1  
Supreme Member

Thread Starter
 
ULTM8Z's Avatar
 
Join Date: Jan 2003
Posts: 4,035
Received 193 Likes on 167 Posts
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.
Attached Files
File Type: zip
ULTM8Z's mpg calculator.zip (8.0 KB, 65 views)
Old 07-20-2014, 06:52 PM
  #2  
Member

iTrader: (3)
 
jakemussman's Avatar
 
Join Date: Aug 2009
Location: WA
Posts: 350
Likes: 0
Received 1 Like on 1 Post
Car: 1990 Camaro RS
Engine: LT1
Transmission: 4L60E
Axle/Gears: 10 bolt, 3.73 Ratio, Torsen LSD
Re: Pretty accurate mpg calculator

Pretty cool. Thanks for posting it up.
Old 07-21-2014, 03:54 PM
  #3  
Supreme Member

iTrader: (1)
 
junkcltr's Avatar
 
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

Why not make it a gauge or something like that in TunerPro?
Old 07-21-2014, 08:52 PM
  #4  
Supreme Member

Thread Starter
 
ULTM8Z's Avatar
 
Join Date: Jan 2003
Posts: 4,035
Received 193 Likes on 167 Posts
Re: Pretty accurate mpg calculator

Originally Posted by junkcltr
Why not make it a gauge or something like that in TunerPro?
Good idea...

But that's probably going to require someone with some programming skills which I don't have...
Old 07-22-2014, 10:58 AM
  #5  
Senior Member

 
Saar's Avatar
 
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.
Old 07-22-2014, 11:41 AM
  #6  
Supreme Member

Thread Starter
 
ULTM8Z's Avatar
 
Join Date: Jan 2003
Posts: 4,035
Received 193 Likes on 167 Posts
Re: Pretty accurate mpg calculator

Originally Posted by Saar
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.
That wouldn't be at all difficult using a csv output from Tunerpro for a trip.

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.
Old 07-22-2014, 12:37 PM
  #7  
Senior Member

 
Saar's Avatar
 
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).
Old 07-22-2014, 08:19 PM
  #8  
Member

 
The_Punisher454's Avatar
 
Join Date: Jul 2004
Location: Salem,Oregon.
Posts: 419
Likes: 0
Received 1 Like on 1 Post
Car: '74 Firebird, '84 vette
Engine: 454 twin turbo, 350 HSR
Transmission: 4L80E, 700R4
Axle/Gears: 9", Dana36
Re: Pretty accurate mpg calculator

do your calcs consider injector performance?
Old 07-22-2014, 10:08 PM
  #9  
Supreme Member

Thread Starter
 
ULTM8Z's Avatar
 
Join Date: Jan 2003
Posts: 4,035
Received 193 Likes on 167 Posts
Re: Pretty accurate mpg calculator

Originally Posted by The_Punisher454
do your calcs consider injector performance?
Not sure what you mean by injector performance. It accounts for the flow rate (entered in lb/hr by the user).
Old 07-23-2014, 08:35 AM
  #10  
Supreme Member

iTrader: (1)
 
junkcltr's Avatar
 
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)
Old 07-23-2014, 09:03 AM
  #11  
Moderator

iTrader: (1)
 
RBob's Avatar
 
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

Originally Posted by Saar
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).
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.
Old 07-23-2014, 12:21 PM
  #12  
Senior Member

 
Saar's Avatar
 
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

Originally Posted by junkcltr
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)
yes, V5 allows for a LOT of data manipulation that wasn't possible in V4.

Originally Posted by RBob
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.
maybe i'll do a mini-compare/contrast here....

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.
Old 08-02-2014, 01:20 AM
  #13  
Member
 
Cdeez's Avatar
 
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
Old 08-04-2014, 06:55 PM
  #14  
Supreme Member

Thread Starter
 
ULTM8Z's Avatar
 
Join Date: Jan 2003
Posts: 4,035
Received 193 Likes on 167 Posts
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.
Old 08-08-2014, 08:02 PM
  #15  
Member
 
Cdeez's Avatar
 
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.
Attached Thumbnails Pretty accurate mpg calculator-afdsafdsafdsa.png  
Old 01-05-2015, 06:15 PM
  #16  
TGO Supporter

 
Mangus's Avatar
 
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

Originally Posted by junkcltr
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)
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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
92firebirdguy
TBI
59
09-01-2016 07:53 AM
Mdenz3
LSX and LTX Parts
3
12-10-2015 11:18 AM
my86bird
Firebirds for Sale
9
10-23-2015 12:20 PM
rb85TA
Organized Drag Racing and Autocross
26
09-14-2015 10:29 PM
86IROC112
Cooling
6
09-11-2015 04:04 PM



Quick Reply: Pretty accurate mpg calculator



All times are GMT -5. The time now is 09:20 AM.