Air/Fuel ratio calculation

Fingers

Village Idiot
Vendor/Sponsor
Apr 1, 2008
1,714
84
48
White Oak, PA
Do you just paste that into the calc pids.txt file?


More or less. The EFI manual explains it better than I can in this limited format. But to help, here is my entire cal_pid.txt file as an example.


Code:
# ==============================================================================
# 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"


# ==============================================================================
# Add slot definitions here
# --------------------------------
# See sae_generic.txt for more information on "SLOT" formats
#
#Units             Low          High      Fmt  Expression
#------------ ------------- ------------- ---- --------------------------------------------------------------
*CLC-00-001
CAdeg              0             180       .2	"{SAE.RPM}*{GM.MAINBPW}*3/500000"

*CLC-00-002
CAdeg              0             180       .2	"{SAE.RPM}*{GM.PILOTBPW}*3/500000"

*CLC-00-003
Deg              -45              45       .1   "{GM.MNINJTIM}-{CALC.MainCAdeg}"

*CLC-00-004
Deg              -45              45       .1   "{GM.PIINJTIM}-{CALC.PilotCAdeg}"

#Equiv
*CLC-00-005
:1               0.0              1.5      .2   "({GM.MAINBPW}+{GM.PILOTBPW})*SQRT({GM.FRPACT})/({CALC.CYLAIR}*16115)"

*CLC-00-006
:1               0.0              1.5      .2   "({GM.FUELQ_MAIN_DMA}+{GM.PILOTRATE})*0.012236/{CALC.CYLAIR}"

#Rail Performance
*CLC-00-007
%                0                250      .2   "100*{GM.FRPACT}/{GM.FRPDES}"

*CLC-00-008
F                0                600      .2   "{EXT.TEMP.F}-50"

*CLC-00-009
Deg              -45              45       .1   "{GM.PIINJTIM}-{CALC.MainInjEnd}"

*CLC-00-010
Deg              -45              45       .1   "{CALC.MainCAdeg}-({CALC.EventCAdeg}/2)-{GM.MNINJTIM}"

#Unitless Fuel rate.
*CLC-00-011
mm3              0.0              1000     .1   "({GM.MAINBPW}+{GM.PILOTBPW})*SQRT({GM.FRPACT})*{SAE.RPM}/100000"

#MPH based on TOS.
*CLC-00-012
mph              0.0              120     .1   "{GM.TOS}*0.026"


#Internal Tranny Slip
*CLC-00-013
rpm              0.0              100     .1   "{GM.TURBINE}/lookup({GM.GEAR},1,3.1,2,1.81,3,1.41,4,1,5,0.71)-{GM.TOS}"


#"iff({GM.GEAR}=1,({GM.TURBINE}/3.1)-{GM.TOS},iff({GM.GEAR}=2,({GM.TURBINE}/1.81)-{GM.TOS},iff({GM.GEAR}=3,({GM.TURBINE}/1.41)-{GM.TOS},iff({GM.GEAR}=4,({GM.TURBINE})-{GM.TOS},iff({GM.GEAR}=5,({GM.TURBINE}/0.71)-{GM.TOS},0)))))"


#Internal Tranny Slip
*CLC-00-014
%                0.0              100     .1   "{GM.GEAR}"


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

CALC.MainCAdeg                 F601 CLC-00-001   CAdeg            Fuel		"Main Pulse Crank Angle Degrees"

CALC.PilotCAdeg                F601 CLC-00-002   CAdeg            Fuel		"Pilot Pulse Crank Angle Degrees"

CALC.MainInjEnd                F601 CLC-00-003   Deg              Fuel          "Main Pulse End"

CALC.PilotInjEnd               F601 CLC-00-004   Deg              Fuel          "Pilot Pulse End"

CALC.Equiv                     F601 CLC-00-005   ":1"             Performance   "A/F ratio"

CALC.Mitch                     F601 CLC-00-006   ":1"             Performance   "A/F ratio Mitch"

CALC.Rail                      F601 CLC-00-007   %                Performance   "Rail pressure performance"

CALC.TEMP                      F601 CLC-00-008   F                Performance   "Corrected Turbo Outlet"

CALC.EventCAdeg                F601 CLC-00-009   Deg              Fuel          "Total Pulse Events Crank Angle Degrees"

CALC.Idealdeg                  F601 CLC-00-010   Deg              Fuel          "Ideal Main Pulse Adjust"

CALC.FuelRate                  F601 CLC-00-011   mm3              Fuel          "Fuel Rate (unitless)"

CALC.TrannyMPH                 F601 CLC-00-012   mph              Transmission  "Output shaft based MPH"

CALC.Slip                      F601 CLC-00-013   rpm              Transmission  "Tranny Clutch Slipage"


CALC.gear                      F601 CLC-00-014   %                Transmission  "Gear"
 
Last edited:

JOHNBOY

< Rocking the Big Single!
Aug 30, 2006
2,159
0
0
Saegertown, Pa
I wrote a PID that uses pressure and duration to estimate the fuel being used compared to the air ingested. The scaling factor will need to be adjusted to your truck's injectors and tune. I set it to read 1:1 just as smoke comes out of the pipe.

Right now, it is limited by your MAF sensor's range. I have another, yet untested version that uses speed-density to estimate the air flow, but it is greatly affected by the engines volumetric efficiency. The MAF is more accurate and I am trying to learn enough to have the PID switch between the two methods when the MAF maxes out.

I'll post the MAF PID if anyone is interested.


What do you think about going to say a 5" inlet tube and rescaling the MAF? I use the MAF to help with spooling but anything over 10 psi it is of the end with this turbo. Speed density would be great but as you said it is most likely not going to be sensitive enough down low. I wonder how much sensitivity the MAF would lose in a 5" inlet. Probably alot.:confused:
 

Racehemi

New member
Feb 4, 2008
10
0
0
I have used an Innovate LM-1 along with Jon’s EQ PID off and on since early 2006 with good results. Keep in mind Jon’s formula is setup for an LLY so like he mentioned, if using the PID for another engine family you will need to make some changes and verify accuracy, preferably with a WB02.

For those who do not know what an LM-1 WB02 is

The LM-1 is a hand-held instrument used to measure the Air/Fuel Ratio (AFR) or Lambda for an engine. For gasoline-driven engines, the theoretically optimal air fuel ratio is 14.7 pounds of air for every pound of fuel. At this ratio, theoretically, all available oxygen in the air combines with all available fuel. This ratio is called the stoichiometric ratio. Stoichiometric for different fuels are as follows:

Gasoline 14.7
LPG (Propane) 15.5
Methanol 6.4
Ethanol 9.0
CNG 17.2
Diesel 14.6

Innovate is 7.5 to 22:1 IIRC.
Edit to add link with good info.
http://www.innovatemotorsports.com/products/lm2.php

The LM-1 has the ability to measure and display (on the LCD screen) AFR’s between 10:1 – 80:1 However, because the analog output (LM-1) is programmed to output between 1.0 V for an AFR of 10 (gasoline) and 2.0V for an AFR of 20 and 2.0V we are not able to log AFR above 20:1 using the EFILive. Considering the 1v-2v output I found the Wide Band AFR 1 - PLX {CALC.AFR_PLX1} PID works best, the formula looks like this AFR = {EXT.AD1}*2+10. This limits our logging ability to AFR’s between 12:1-20:1, which is typically the higher throttle positions.

Here are some typical numbers I have observed in my truck

60-80:1 = warm idle
35-60:1 = typical light cruise to idle
15-18:1 = light smoke or haze out of the tailpipe
10-14:1 = lower the number the more black smoke


If anyone is interested, I am considering selling my LM-1 and buying an LM-2 for use on some up coming dual exhaust gasser projects.
 
Last edited:

Fingers

Village Idiot
Vendor/Sponsor
Apr 1, 2008
1,714
84
48
White Oak, PA
What do you think about going to say a 5" inlet tube and rescaling the MAF? I use the MAF to help with spooling but anything over 10 psi it is of the end with this turbo. Speed density would be great but as you said it is most likely not going to be sensitive enough down low. I wonder how much sensitivity the MAF would lose in a 5" inlet. Probably alot.:confused:

5"-6" would still work well, but you must keep the turbulence in the pipe down to a minimum. I personally would install a gas lens to clean up the flow approx 1/2-1 pipe diameter from the sensor. A 1/4" mesh would probably be enough.

The trick here is not to rescale the sensor to actually indicate say twice the value. None of your tables are indexed that high. You need to simply know that 30 lb/sec is 60 lb/sec and adjust your tables accordingly.

FWIW, going from 4" to 5" would reduce the sensor output by approx 64% of the original output for the same flow. That is, you range would increase appox 1.5 times.

The only reasonable way to use speed density would be to switch from MAF based to Speed/density above a give MAF value. You could calibrate the S/D function by adjusting it so the MAF and S/D calcs are the same in the cross over range. Guess I will have to revisit that for you Mr Jordan.
 

JOHNBOY

< Rocking the Big Single!
Aug 30, 2006
2,159
0
0
Saegertown, Pa
5"-6" would still work well, but you must keep the turbulence in the pipe down to a minimum. I personally would install a gas lens to clean up the flow approx 1/2-1 pipe diameter from the sensor. A 1/4" mesh would probably be enough.

The trick here is not to rescale the sensor to actually indicate say twice the value. None of your tables are indexed that high. You need to simply know that 30 lb/sec is 60 lb/sec and adjust your tables accordingly.

That a great idea. Very simple. I like that Idea a lot.
FWIW, going from 4" to 5" would reduce the sensor output by approx 64% of the original output for the same flow. That is, you range would increase appox 1.5 times.

The only reasonable way to use speed density would be to switch from MAF based to Speed/density above a give MAF value. You could calibrate the S/D function by adjusting it so the MAF and S/D calcs are the same in the cross over range. Guess I will have to revisit that for you Mr Jordan.I been having some issues with the trucks mid range. Specificly from 2000 to 2500 rpm. It would be real nice to have some sort of SD to see what is going on. Hot humid days cause more trouble than cool nights. But I may have found the cause. I had an errror in my timing tables. Bad math on my part. I thought my injector centerline split was 60% BTDC ,40% ATDC it was more 100% BTDC.:banghead:

Thanks for posting the pids.
 

rcr1978

Active member
Apr 1, 2007
790
26
28
Spring Creek, NV
Make sure you are logging the pids that are needed for the calculated pids, check the calc pid file in user config to see what ones need to be logged per pid.
 

jason86

Marv
Dec 30, 2008
78
0
6
Sacramento, CA
help

i followed the manual but it never does tell you how to open the pid in scan tool. i did everything you and it said and i dont see it on the list of pids anywhere.