PDA

View Full Version : How to modify calculated PIds

2000ssnb
November 17th, 2003, 01:27 AM
Hello,

I am new to this forum and would like to kow how
to create your own calculated PIDs (want to work on the
power calculations which I used to do in post calculations with ATAP,
inlcuding roating mass effects, power loss due to wind-resistance
when measured while driving, etc.

Thanks,

Gert

Blacky
November 17th, 2003, 03:10 PM
Example of how to create a calculated PID.

The PID will calculate the angular velocity of the crank shaft. We will create two formulae: one in metric m/s and one in imperial ft/s.

The equation is:
v = r * w
where:
r = crank radius = stroke/2
w = angular velocity = 2*pi*rpm/60
v = linear velocity at radius r
i.e. v = 2*pi*r*rpm/60

Assuming the stroke on an LS1 is 3.625 inches...
Stroke in feet is 0.30208, radius of crank is 0.15104 feet.
Stroke in meters is 0.092075 meters, radius of crank is 0.0460375 meters.

ft/s = 2*3.14159*0.15104*{SAE.RPM}/60 (where crank radius is measured in feet)
m/s = 2*3.14159*0.0460375*{SAE.RPM}/60 (where crank radius is measured in meters)

Both formulae can be simplified to:
ft/s = 0.002517*{SAE.RPM}
m/s = 0.004821*{SAE.RPM}

Calculated PIDs should be added to the calc_pids.txt file in the Configuration directory.
Usually, three entries need to be added to this file.

1. We need to add the units for ft/s and m/s.

(NOTE: common units are already defined in sae_generic.txt you do not need to add them in the calc_pids.txt file if they already exist in the sae_generic.txt configuration file.

Define the new units by adding the following entries under the *UNITS section in the calc_pids.txt file:

#Code System Abbr Description
#-------- ---------- -------- -------------------------------------------------------------
ftps Imperial ft/s "Feet per second"
mps Metric m/s "Meters per second"

Code is the code by which we can reference the units from other entries in the configuration files.
System is one of Metric, Imperial or None and specifies to which measuring system the units belong.
Abbr is the abbreviation that will be displayed by EFILive
Description describes the units, if the description contains spaces or commas it must be enclosed in double quotes. It is usually a good idea to include the quotes anyway.Next we need to define a SLOT.
For normal PIDs the SLOT defines Scaling, Limits, Offset and Transfer.
For calculated PIDs the SLOT defines Limits and the expression like this:

#Units Low High Fmt Expression
#------------ ------------- ------------- ---- --------------------------------------------------------------
*CLC-00-001
ftps 0.0 180.0 0.1 "0.002517*{SAE.RPM}"
mps 0.0 60.0 0.1 "0.004821*{SAE.RPM}"
The SLOT name *CLC-00-001 is made up of four segments:
* which is used in the configuration files as the "start of section" specifier. Since each SLOT is defined in it's own section, each SLOT name must begin with *.
CLC which declares the SLOT as a calculated PID SLOT.
00 which specifies the number of bits required to transmit the raw data from the PCM to EFILive. Since calculated PIDs are NOT transmitted from the PCM to EFILive this value is always 00.
001 which is a unique sequence number and may be any value between 000 and 899 inclusive. EFILive reserves 900-999 for pre-defined calculated PIDs (see sae_generic.txt for definitions of predefined calculated PIDs).
Low and high are used to specify the "normal" range of values of the PID. These values are used by EFILive to populate the gauge and chart scales
FMT is the number of decimal places that EFILive will display. EFILive rounds the value to fit the required number of decimal places.
Expression is the formula that is evaluated by EFILive. PID names must be enclosed in curly braces. If a PID has more than one unit defined and you want to select a particular unit (metric or imperial), then append a dot and the unit's code to the PID name, inside the curly brace.Lastly we need to add the PID itself.

#Code PRN SLOT Units System Description
#------------------------- ---- ------------ ---------------- ---------------- ------------------------------------------
CALC.CKSPEED F600 CLC-00-001 "mps,ftps" Performance "Crank speed"

Code is the PID name that is visible in EFILive and MUST begin with CALC. for calculated PIDs.
PRN (Parameter reference number) is the internal id of the PID. It must be unique. The OBD II specification reserves PRNs from \$F000 to \$F6FF for scan tools. Further, EFILive reserves \$F500 to \$F5FF for predefined calculated PIDs. We recommend using \$F600 to \$F6FF for your own calculated PIDs.
SLOT is the name of the SLOt that was added previously, without the * section marker.
Units is a comma separated list of units that MUST be declared in the associated SLOT definition. Only one unit from each system is allowed. (i.e. you can't have two imperial units or two metric units).
Description describes the PID.Note: calculated PIDs may contain other calculated PIDs. The order of evaluation of calculated PIDs becomes important. Calculated PIds are evaluated in PRN order. The calculated PID with the lowest PRN will be evaluated first.

2000ssnb
November 17th, 2003, 11:08 PM
Thanks for the help. I was wondering if I could just modify
the calculated power PID already available in EFILive6?
I am not sure how to do this, which file to open etc.
I understand the process once I am in the right file
in the program -

Gert

2000ssnb
November 18th, 2003, 06:18 AM
Blacky,

do I edit the calc_pids.txt for defining new calculated parameters.
In my copy of this file there are no entries in the fields.
Do I just add to these? Does the file automaticallaly get called up once I start EFILIVE6?

Thanks,

Gert

Blacky
November 18th, 2003, 06:51 AM
Thanks for the help. I was wondering if I could just modify
the calculated power PID already available in EFILive6?
I am not sure how to do this, which file to open etc.
I understand the process once I am in the right file
in the program -

Gert

You can edit the sae_generic.txt file to modify the existing calculated PIDs.
However that is not recommended because when you install the next update that file may be overwritten and you would lose your changes.

Create a new PID (copy the PID and SLOT details from sae_generic.txt) in the calc_pids.txt file.
A new PID will have a unique Code and a unique PRN.

Paul

Blacky
November 18th, 2003, 06:52 AM
Blacky,

do I edit the calc_pids.txt for defining new calculated parameters.
In my copy of this file there are no entries in the fields.
Do I just add to these? Does the file automaticallaly get called up once I start EFILIVE6?

Thanks,

Gert

Yes, just add entries to the calc_pids.txt file, it is automatically loaded by EFILive V6.

It is empty because it is reserved exclusively for user defined calculated PIDs. This file is NOT overwritten during installation of updates.

Paul

jimmyblue
January 19th, 2004, 10:04 AM
Can you guys make a PID that takes O2 voltage (V) and outputs
AFR by a table interpolation lookup:

O2_V AFR
0.000 25
0.100 20
0.200 18.5
0.300 17
0.400 16
0.500 14.5
0.600 14.6
0.700 14.7
0.750 14.8
0.800 14.0
0.825 13.7
0.850 13.2
0.875 13.0
0.900 12.0
0.910 11.5
0.920 11.0
0.930 10.0
0.940 9.0
0.950 8.0
0.960 7.0
0.970 6.0
0.980 5.0
0.990 4.0
1.000 3.0

Garry
July 3rd, 2008, 05:30 AM
Somehow I don't get it -- I set up a new calc pid, it shows up in the PID selection, but I can't make it show up in the dashboard ... e.g., I tried my luck with generating a calculated gear estimate, but couldn't even get the basis to show up ... here's an excerpt from calc_pids.txt:

*UNITS
gear None "." "Gear"

*CLC-00-906
gear 0.0 6.0 .0 "{SAE.VSS.mph}/{SAE.RPM}"

CALC.M6GEAR F614 CLC-00-906 "gear" Conditions "M6 gear"

What bugs me is that I get no clue from the scan tool why it doesn't present the PID in the dashboard for selection ... I know I have the VSS and RPM PID present in the logfile and the selected PIDs, as they are used in some other calc pids that are available for display ...

What am I missing here?

joecar
July 3rd, 2008, 05:49 AM

2002_z28_six_speed
July 3rd, 2008, 07:31 AM
Hello,

I am new to this forum and would like to kow how
to create your own calculated PIDs (want to work on the
power calculations which I used to do in post calculations with ATAP,
inlcuding roating mass effects, power loss due to wind-resistance
when measured while driving, etc.

Thanks,

Gert

EFI RWHP and EFI RWTQ

Garry
July 3rd, 2008, 06:47 PM

Attached ...

Ninety8C5
July 4th, 2008, 12:24 AM
Somehow I don't get it -- I set up a new calc pid, it shows up in the PID selection, but I can't make it show up in the dashboard ... e.g., I tried my luck with generating a calculated gear estimate, but couldn't even get the basis to show up ... here's an excerpt from calc_pids.txt:

*UNITS
gear None "." "Gear"

*CLC-00-906
gear 0.0 6.0 .0 "{SAE.VSS.mph}/{SAE.RPM}"

CALC.M6GEAR F614 CLC-00-906 "gear" Conditions "M6 gear"

What bugs me is that I get no clue from the scan tool why it doesn't present the PID in the dashboard for selection ... I know I have the VSS and RPM PID present in the logfile and the selected PIDs, as they are used in some other calc pids that are available for display ...

What am I missing here?

I was able to add the M6Gear gauge to the dashboard after I selected it as a supported PID. I think you had the units in the Calc_Pid file in the wrong place. I don't know if that had anything to do with it, but I moved it to what I think is the correct location (about 2-3 lines down from where it was).

2002_z28_six_speed
July 4th, 2008, 03:14 AM
all mine show up fine