PDA

View Full Version : Can't get calculated PID to work for MPG



PSWired
August 5th, 2005, 05:08 AM
Hi folks, trying to create a calculated PID to give an MPG readout in the scan tool. Problem is that the PID won't show up in the "Data" tab even when selected on the PID selection tab. The PID is set to multiply lb/hr of airflow by the current AFR to get lb/hr of fuel, then convert lb of gasoline to gallons of gasoline to get gallons/hr of gasoline. Multiplying the vehicle speed in MPH by the inverse of GPH gives the final MPG readout. Here's the contents of my calc_pids.txt file:

# ================================================== ============================
# File details
# ------------
#
# This section defines various details about the file format.

*FILE

#Parameter Value Description
#---------- ---------------- ---------------------------------------------------
VERSION 7.1.1 File version
DECSEP . Decimal separator used in this file


# ================================================== ============================
# Units
# -------------------
# See sae_generic.txt for more information on the *UNITS section

*UNITS

#Code System Abbr Description
#-------- ---------- -------- -------------------------------------------------------------
#None None "" "No units"

mpg Imperial mpg "Miles travelled per gallon of fuel"


# ================================================== ============================
# Add slot definitions here
# --------------------------------
# See sae_generic.txt for more information on "SLOT" formats
#
#Units Low High Fmt Expression
#------------ ------------- ------------- ---- --------------------------------------------------------------

*CLC-00-001
mpg 0.0 100.0 0.2 "(1/({SAE.MAF.lbpm}*(60)*(1/{GM.AFR})*(1/42.5)*(7.4805)))*{SAE.VSS.mph}"


# ================================================== ============================
*PRN - Parameter Reference Numbers
# --------------------------------
# See sae_generic.txt for more information on the *PRN section
#
#Code PRN SLOT Units System Description
#------------------------- ---- ------------ ---------------- ---------------- ------------------------------------------

CALC.MPG F600 CLC-00-001 "mpg" Fuel "Miles per gallon"

Dirk Diggler
August 5th, 2005, 05:55 AM
try this it worked for me

(1/({SAE.MAF.lbpm}*60*(1/{GM.AFR})*(1/42.5)*(7.4805))*{SAE.VSS.mph}

PSWired
August 5th, 2005, 12:00 PM
Doesn't look like that worked. The PID isn't even showing up in the "Data" tab when it's selected. BTW, I'm using v 7.2.3 pre release 002 (build 246).

joecar
August 5th, 2005, 12:59 PM
On the Data tab display, click on the "System" column (to sort by System) and see if it shows up.

PSWired
August 5th, 2005, 01:20 PM
I don't have a system column on my Data tab section. I sorted by another column and it didn't show up. When I select another PID it shows up just fine.

TAQuickness
August 5th, 2005, 10:30 PM
CALC.MPG F600 CLC-00-001 "mpg" Fuel "Miles per gallon"

2 things.

Change F600 to F001

Take the quotes off mpg

PSWired
August 6th, 2005, 04:27 AM
Okay, made those changes and still not getting the PID showing in the Data section. One other thing I noticed- the description of the PID in the PID tab is "Miles per gall" instead of "Miles per gallon" if that means anything.

TAQuickness
August 6th, 2005, 05:06 AM
Okay, made those changes and still not getting the PID showing in the Data section. One other thing I noticed- the description of the PID in the PID tab is "Miles per gall" instead of "Miles per gallon" if that means anything.

you need a caraige return after the last line

have you logged any data yet?

joecar
August 6th, 2005, 05:22 AM
PSwired,

You're right: I see the CALC.MPG pid under the "PIDs" tab but not under the "Data" tab.

Under the PIDs tab though, I see the description as "Miles per gallon".

I can log data on this pid;

My other calculated pids in calc_pids.txt show up under the Data tab; these have a PRN ranging from F060 to F070.

(BTW: what are these constants 42.5 and 7.4805...?)

joecar
August 6th, 2005, 06:23 AM
Hmmm... I tried moving stuff around in calc_pids.txt (quotes, spaces, fields, CLC-00-XX, FXXX, etc...) and it still doesn't show up under the Data tab; but my other calculated pids do.

TAQuickness
August 6th, 2005, 07:27 AM
PSWired and Joecar - The unit is the problem.

Change "mpg Imperial mpg "Miles travelled per gallon of fuel""

to "mpg None mpg "Miles travelled per gallon of fuel""

TAQuickness
August 6th, 2005, 07:28 AM
(BTW: what are these constants 42.5 and 7.4805...?)

Yes, where do these come from/represent?

PSWired
August 6th, 2005, 03:29 PM
Working! The units thing was the problem. Thanks!

The 42.5 constant is the number of pounds a cubic foot of gasoline weighs. 7.48 is the number of gallons in a cubic foot.

Any comments on the accuracy of this method of determining MPG? Is the MAF sensor really accurate enough to give a good indication here?

joecar
August 6th, 2005, 04:41 PM
..."mpg None mpg "Miles travelled per gallon of fuel""...
Yes, confirmed it works now.
:2 thumbs up:

TAQuickness
August 7th, 2005, 02:31 AM
Working! The units thing was the problem. Thanks!

The 42.5 constant is the number of pounds a cubic foot of gasoline weighs. 7.48 is the number of gallons in a cubic foot.

Any comments on the accuracy of this method of determining MPG? Is the MAF sensor really accurate enough to give a good indication here?

If your MAF is 100% bone stock, and you haven't messed with the MAF tables, it should work. I would think the GM.DYNAIR would be more accurate though.

bink
August 7th, 2005, 04:50 AM
Working! The units thing was the problem. Thanks!

The 42.5 constant is the number of pounds a cubic foot of gasoline weighs. 7.48 is the number of gallons in a cubic foot.

Any comments on the accuracy of this method of determining MPG? Is the MAF sensor really accurate enough to give a good indication here?

If your MAF is 100% bone stock, and you haven't messed with the MAF tables, it should work. I would think the GM.DYNAIR would be more accurate though.

Dynair would probably be more accurate if your VE table is accurate (and that would assume accurate IFR and offsets). FWIW.
Cheers,
joel

TAQuickness
August 7th, 2005, 07:29 AM
Working! The units thing was the problem. Thanks!

The 42.5 constant is the number of pounds a cubic foot of gasoline weighs. 7.48 is the number of gallons in a cubic foot.

Any comments on the accuracy of this method of determining MPG? Is the MAF sensor really accurate enough to give a good indication here?

If your MAF is 100% bone stock, and you haven't messed with the MAF tables, it should work. I would think the GM.DYNAIR would be more accurate though.

Dynair would probably be more accurate if your VE table is accurate (and that would assume accurate IFR and offsets). FWIW.
Cheers,
joel


Very true. Guess the only way to find out is to top her off and reset the ODO