PDA

View Full Version : Designing a New Custom PE Mode PID..I need help..



WeathermanShawn
January 24th, 2011, 03:42 PM
I need some help. I am trying to make a Calculated Pid that defines PE Mode.

Heres my PID so far..

*CLC-00-004
factor 0.5 1.0 .2 "{GM.EQIVRATIO} > 1.00 & {SAE.RPM} > 2000"

So far what it gives me is a (1) if it is 'true' and a (0) if false. Does anybody know how I can define an expression that might say 'PE Mode' and Non-PE Mode? I have been trying to utilize the EFILive 'iff' syntax, but I am stuck.

If I can pull it off I want to make 'PE Mode' a condition for yet another PID..

Anybody know? Thanks in advance..

ChipsByAl
January 24th, 2011, 03:47 PM
Shawn, PE mode can be configured in many different ways. I have seen it engaged at idle and with non-typical EQ values. Possibly the PCM/ECM in use can report PE mode active/inactive already in a PID. Would that be helpful?
Al

WeathermanShawn
January 24th, 2011, 03:51 PM
Sure would Al.

I agree PE Mode is a little convoluted. Thats why I was just trying to get the 'real' PE mode. Same problem with the SAE.FUELSYS PID..Open-Loop is shared, so its tricky.

I am open to any ideas though. Its a little over my head at this point..

5.7ute
January 24th, 2011, 04:11 PM
"iff({commanded EQ}=1,calc pid if true,calc pid is false)" It would end up a long pid by putting your expressions for true & false in the 1 pid but should hopefully keep it a bit more accurate.(And would simplify things for a newbie)
I dont have Efilive on my pc at work anymore to verify this, but I used the iff() function in some of my earlier pids & it worked out ok.
FWIW I like the way you are going with this idea. It will save a lot of filtering for getting the tables close. However manual filtering will still be necessary to remove some throttle transients IMO. (once you get OCD about your tune)

swingtan
January 24th, 2011, 04:22 PM
I did one a while back for the brake pedal switch in the E38. It looks like this...

CALC.BRKPEDAL [Calculated] "Brk Switch" "Brake Switch Condition"

*CLC-00-2045
None 0 1 0 "iff((raw({GM.BRKR})&8)=8,1,0)"

CALC.BRKPEDAL F400 CLC-00-2045 None Brakes Brake pedal active

This displays in a chart with the label "BRKPedal" and is "0" when off and "1" when on. In a Dash, I simply set an alarm so the gauge goes "red" when the brake is applied.

The actual "iff" statement is a bit tricky as it uses the actual PID raw data to give the final result, for the brake pedal stuff it was for the "bit mapped data" so needed to select the correct "bit" to decide if the bake was actually on/off.

I believe that what you want to do is create a new "units" setting in Scan tool. This would be used like gm/Sec, kPa, Seconds etc but would be called (for example) "state" . The values for this might be "off, on". I'm not sure if you can "create" new "units", but maybe you can use the external 12 switch "units" which is "Active". So when PE mode is enabled, it would show as "Active"?

Simon

PS. Demo of the brake PID working on a virtual dash is here....

http://www.youtube.com/watch?v=UEU9Hb8hE1E

joecar
January 24th, 2011, 04:23 PM
Also look at GM.TSTATE03 which contains a bit named "Fuel Power Enrichment Mode Active"

[ I don't know why it's defined in an auto trans pid ]

I'm not sure if this bit is applicable in all instances.

joecar
January 24th, 2011, 04:28 PM
I need some help. I am trying to make a Calculated Pid that defines PE Mode.

Heres my PID so far..

*CLC-00-004
factor 0.5 1.0 .2 "{GM.EQIVRATIO} > 1.00 & {SAE.RPM} > 2000"

So far what it gives me is a (1) if it is 'true' and a (0) if false. Does anybody know how I can define an expression that might say 'PE Mode' and Non-PE Mode? I have been trying to utilize the EFILive 'iff' syntax, but I am stuck.

If I can pull it off I want to make 'PE Mode' a condition for yet another PID..

Anybody know? Thanks in advance..Something like this:
"iff({CALC.PEMODE}, x, y)"
where iff returns x when PEMODE is 1 and y otherwise.

I'm not sure if you have to do this:
"iff(raw({CALC.PEMODE}), x, y)"

swingtan
January 24th, 2011, 04:33 PM
More on the 12v switch PID.

the lines in the saegeneric.txt file looks like this...

Active None Active "Voltage active or not"

*UNM-16-912
Active 0.0 1.0 .0 * 1.0 0.0

EXT.SW1 F405 UNM-16-912 "Active" External "External 12V Switch 1"

Looking at the data indicates that this will still only display as "0" or "1" though. To be honest, that's what you really want if you are going to use it in conjunction with another custom PID though.

Simon

WeathermanShawn
January 24th, 2011, 05:34 PM
Simon and others:

In all honesty it is a little over my head..But your last comment makes sense. I can display it as a 0.0 or 1.0.

What am I trying to do is say if PE Mode =0, then use CLC-00-003..
If PE Mode =1.0 then use CLC-00-004..

*CLC-00-003
% 0.0 100.0 .2 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}"
VE 0.0 3.0 .4 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}"

*CLC-00-004
% 0.0 100.0 .2 "iff( CALC.PEMODE},1)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"
VE 0.0 3.0 .4 "iff( CALC.PEMODE},1)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"

I'm 'choking on the 'iff' expression. When an user is in PE Mode I want them to use the WO2BEN Pid, when they are not in PE Mode then calculate the PID using LTFTBEN.

By the way, nice vid on that brake!!!

joecar
January 24th, 2011, 05:48 PM
Would this work...?


*CLC-00-002
factor ... "{GM.EQIVRATIO} > 1.00 & {SAE.RPM} > 2000"

*CLC-00-003
% ... "..."
VE ... "..."

*CLC-00-004
% ... "..."
VE ... "..."

*CLC-00-005
% ... "iff({CALC.PEMODE}, CALC.VE3.%, CALC.VE4.%)"
VE ... "iff({CALC.PEMODE}, CALC.VE3.VE, CALC.VE4.VE)"

. . .

CALC.PEMODE F002 CLC-00-002 factor ...
CALC.VE3 F003 CLC-00-003 "%,VE" ...
CALC.VE4 F004 CLC-00-004 "%,VE" ...
CALC.VET F005 CLC-00-005 "%,VE" ...


where the dots ... represent the parts I left out (range/precision, system).

joecar
January 24th, 2011, 05:52 PM
Or this:

define CALC.SELBEN to be "iff({PEMODE}, CALC.WBO2BEN, CALC.LTFTBEN)"

and then in the VE equations use {CALC.SELBEN} instead of CALC.WBO2BEN or CALC.LTFTBEN.


"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.SELBEN}"
"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.SELBEN}"


Question is: does iff() allow calc pids in its then and else parts...?

5.7ute
January 24th, 2011, 05:53 PM
Simon and others:

In all honesty it is a little over my head..But your last comment makes sense. I can display it as a 0.0 or 1.0.

What am I trying to do is say if PE Mode =0, then use CLC-00-003..
If PE Mode =1.0 then use CLC-00-004..

*CLC-00-003
% 0.0 100.0 .2 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}"
VE 0.0 3.0 .4 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}"

*CLC-00-004
% 0.0 100.0 .2 "iff( CALC.PEMODE},1)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"
VE 0.0 3.0 .4 "iff( CALC.PEMODE},1)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"[/B]

I'm 'choking on the 'iff' expression. When an user is in PE Mode I want them to use the WO2BEN Pid, when they are not in PE Mode then calculate the PID using LTFTBEN.

By the way, nice vid on that brake!!!

Shawn, the method shown won't work as you need a true,false returned value for the pid. First expression after the comma is true, then the false value. So you would have something like this
*CLC-00-003
% 0.0 100.0 .2 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN},{SA E.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1})"

VE 0.0 3.0 .4 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN},{SAE.MAF. gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1})"

I havent checked for typos but it will give you an idea.(I just fixed a couple)
Cheers Mick

joecar
January 24th, 2011, 05:55 PM
Shawn,

The iff() function works like this:

iff(cond, x, y)

if cond is true then return x else return y.

WeathermanShawn
January 24th, 2011, 06:12 PM
Or this:

define CALC.SELBEN to be "iff({PEMODE}, CALC.WBO2BEN, CALC.LTFTBEN)"

and then in the VE equations use {CALC.SELBEN} instead of CALC.WBO2BEN or CALC.LTFTBEN.


"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.SELBEN}"
"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.SELBEN}"


Question is: does iff() allow calc pids in its then and else parts...?


Still trying it..

WeathermanShawn
January 24th, 2011, 06:14 PM
Shawn, the method shown won't work as you need a true,false returned value for the pid. First expression after the comma is true, then the false value. So you would have something like this
*CLC-00-003
% 0.0 100.0 .2 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN},{SA E.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1})"

VE 0.0 3.0 .4 "iff( {CALC.PEMODE},0)"{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN},{SAE.MAF. gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1})"

I havent checked for typos but it will give you an idea.(I just fixed a couple)
Cheers Mick

Seems like it's close..For some reason it won't calculate the VE values now..I'm sure it is operator error on this end. Sounds like it is doable though?

5.7ute
January 24th, 2011, 06:21 PM
Certainly doable. As I said there may be a few typos in the expression that will prevent it from working. Since I dont have efilive on this pc I cant get it sorted at this end for a while.

5.7ute
January 24th, 2011, 06:27 PM
Just to add I personally wouldnt have it relying on another calc pid as this may cause slight inaccuracies in the data. I would use commanded AFR or EQ as the operator.
Also I think it should be iff( {CALC.PEMODE}=0),{SAE.MAF.gps
not iff( {CALC.PEMODE},0)"{SAE.MAF.gps

WeathermanShawn
January 24th, 2011, 07:19 PM
Copy that on the CALC.PID being used to calculate another one. At some point I can try the 'STATE' PID Joecar mentioned.

Joe, still looking at your expressions.

Everything seems to work, but I am not sure if I have the 'iff' set-up properly. You see it is still calculating both VE Tables..Its like I don't have the 'false' condition expressed, or it is simply a spelling or position error.

Thanks, it is a lot of work..but could make a life a lot easier for new and experienced tuners alike..

*CLC-00-002
factor 0.5 1.0 .2 "{GM.EQIVRATIO} > 1.00 & {SAE.RPM} > 2000"

*CLC-00-003
% 0.0 100.0 .2 "iff( {CALC.PEMODE}=0),{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}"

VE 0.0 3.0 .4 "iff( {CALC.PEMODE}=0),{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}"

*CLC-00-004
% 0.0 100.0 .2 "{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"

VE 0.0 3.0 .4 "{SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"

joecar
January 25th, 2011, 04:49 AM
Shawn,

Look closely at iff() syntax: iff(cond, then, else)


*CLC-00-002
factor 0.5 1.0 .2 "({GM.EQIVRATIO} > 1.00) && ({SAE.RPM} > 2000)"

*CLC-00-003
% 0.0 100.0 .2 "iff(!{CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}, 0)"
VE 0.0 3.0 .4 "iff(!{CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}, 0)"

*CLC-00-004
% 0.0 100.0 .2 "iff({CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445. 2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}, 0)"
VE 0.0 3.0 .4 "iff({CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}, 0)"


Also note these things:

The ! operator does a NOT which inverts the logical sense,
i.e. !true = false and !false = true.

& is the bitwise AND, && is the logical AND, you need &&.


Is that what you're trying to say...?

joecar
January 25th, 2011, 05:33 AM
Mick is correct... using calc pids in iff() seems to produce a delayed waveform.

I tried to undelay by enclosing the pids in frame( , -1) but that just produced garbage.

joecar
January 25th, 2011, 06:09 AM
Same with this aproach (SELBEN)... the SELBEN iff() uses pids delayed by one frame.

Look closely, you will see that SELBEN is delayed by one frame compared to WO2BEN1.

joecar
January 25th, 2011, 06:10 AM
Shawn, so this approach seems the best:


Shawn,

Look closely at iff() syntax: iff(cond, then, else)


*CLC-00-002
factor 0.5 1.0 .2 "({GM.EQIVRATIO} > 1.00) && ({SAE.RPM} > 2000)"

*CLC-00-003
% 0.0 100.0 .2 "iff(!{CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}, 0)"
VE 0.0 3.0 .4 "iff(!{CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}, 0)"

*CLC-00-004
% 0.0 100.0 .2 "iff({CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445. 2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}, 0)"
VE 0.0 3.0 .4 "iff({CALC.PEMODE}, {SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}, 0)"


Also note these things:

The ! operator does a NOT which inverts the logical sense,
i.e. !true = false and !false = true.

& is a bit AND, && is a logical AND, you need &&.


Is that what you're trying to say...?

joecar
January 25th, 2011, 06:13 AM
What about this:


*CLC-00-003
% 0.0 100.0 .2 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445. 2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}))"
VE 0.0 3.0 .4 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}))"


I haven't tried that and I'm wondering if it fits (upto how many characters can a calc pid be...?)

WeathermanShawn
January 25th, 2011, 09:08 AM
Joe:

Interesting on the delay..I'm assuming that would be a 'fatal flaw'..

I must be doing too much copying and pasting..I can never seem to get the CALC.VET Table to produce a value. If I can straighten out my calc_pids.txt file to look like yours that would help.

I'll also do a short log with GM.STATE03 PID selected and see how that goes.

Thanks for the help. Do you think it is doable or are we just going to have to live with filtering in lieu of this concept?

joecar
January 25th, 2011, 09:30 AM
What about this:


*CLC-00-003
% 0.0 100.0 .2 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445. 2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}))"
VE 0.0 3.0 .4 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.LTFTBEN}))"


I haven't tried that and I'm wondering if it fits (upto how many characters can a calc pid be...?)
This approach also has the delay...

The only way I see to go is take this approach and make the following changes:
- replace {CALC.BEN1} with ({GM.EQIVRATIO} * {EXT.WO2LAM1})
- replace {CALC.LTFTBEN} with (({SAE.LONGFT1} + {SAE.LONGFT2})/200+1)

i.e. replace all calc pids with their base definition, i.e. avoiding all calc pids in the iff(), this should eliminate the one frame delay.

joecar
January 25th, 2011, 09:35 AM
i.e.

*CLC-00-003
% 0.0 100.0 .2 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445. 2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*({GM.EQIVRATIO}*{E XT.WO2LAM1})), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*(({SAE.LONGFT1}+{S AE.LONGFT2})/200+1)))"
VE 0.0 3.0 .4 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*({GM.EQIVRATIO}*{EXT.WO2 LAM1})), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*(({SAE.LONGFT1}+{SAE.LON GFT2})/200+1)))"

Shawn, copy/paste this, I believe I have all the parentheses balanced and accounted for.

WeathermanShawn
January 25th, 2011, 09:36 AM
Yea, that makes sense.

For some reason on my last log I neglected to log EXT.WO2LAM1 so one of my BEN PIDS is different than yours and creating confusion in my mind.

So, I am going to take a short drive and re-do a decent PE Mode log. Perhaps when you are comfortable with it, you can re-post your calc_pids.txt file. I'll sync up with it here so it makes more sense. I.E., copying and pasting leads to errors..

joecar
January 25th, 2011, 09:43 AM
Another idea: if wideband is present, then use this for both PE and non-PE calculations of VE...

joecar
January 25th, 2011, 09:44 AM
({GM.EQIVRATIO}*{EXT.WO2LAM1}) can be replaced with ({GM.EQIVRATIO}/{EXT.WO2EQR1})

i.e.

*CLC-00-003
% 0.0 100.0 .2 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*3445. 2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*({GM.EQIVRATIO}/{EXT.WO2EQR1})), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*3445.2/(5.669*{SAE.RPM}*{SAE.MAP.kPa})*(({SAE.LONGFT1}+{S AE.LONGFT2})/200+1)))"
VE 0.0 3.0 .4 "iff({CALC.PEMODE}, ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA.C}+273.15)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*({GM.EQIVRATIO}/{EXT.WO2EQR1})), ({SAE.MAF.gps}*({GM.DYNAIRTMP_DMA. C}+273.15)*15/({SAE.RPM}*{SAE.MAP.kPa})*(({SAE.LONGFT1}+{SAE.LON GFT2})/200+1)))"


I'll re-edit my calc_pids.txt and try it out when I get home tonite.

joecar
January 25th, 2011, 09:50 AM
Yes, please excuse the abuse of colour, I was trying to use it to make sure I had balanced the parentheses. :doh2:

joecar
January 25th, 2011, 09:53 AM
...

For some reason on my last log I neglected to log EXT.WO2LAM1 so one of my BEN PIDS is different than yours and creating confusion in my mind.

...Instead of including the EXT.WO2xxx pids in the BBL pidlists, I set the V2 Device Settings to include all serial/digital wideband pids.

joecar
January 25th, 2011, 10:03 AM
If the PE bit in TSTATE03 works correctly then maybe we can filter on it.

Blacky
January 25th, 2011, 10:14 AM
A quick note on the frame delay talked about earlier in the thread. If you use calculated PIDs in the expression of other calculated PIDs then you must ensure that the calculated PIDs are evaluated in the correct order.
Calculated PIDs are evaluated in PRN order.
So if you have something like this:

CALC.APID = CALC.CPID / CALC.DPID

Then CALC.CPID and CALC.DPID MUST have a lower PRN than CALC.APID.

Regards
Paul

joecar
January 25th, 2011, 10:16 AM
A quick note on the frame delay talked about earlier in the thread. If you use calculated PIDs in the expression of other calculated PIDs then you must ensure that the calculated PIDs are evaluated in the correct order.
Calculated PIDs are evaluated in PRN order.
So if you have something like this:

CALC.APID = CALC.CPID / CALC.DPID

Then CALC.CPID and CALC.DPID MUST have a lower PRN than CALC.APID.

Regards
PaulAhh... I see... thanks.

joecar
January 25th, 2011, 10:32 AM
Shawn,

Try this calc_pids.txt, I rearranged the PRN numbering of the calc pids (as Paul said, they are calculated in PRN order)...

there should be no delay with this one... :cheers:

I like this one the best because it is the simplest (see CALC.SELBEN).

I haven't had the chance to try it yet.


Notice I shortened PEMODE to PE.

You may have to modify the WO2BEN1 pid to use /WO2EQR1 instead of *WO2LAM1 (depending on what you already have logged).

joecar
January 25th, 2011, 04:52 PM
Reopened thread... (...I don't know if I may have accidentally closed it).

If anyone has any reason for this thread to be closed please let me know.

joecar
January 25th, 2011, 05:07 PM
Hmmm... I see the one frame delay in SELBEN even tho I reordered the PRN numbers... sanity check required.


F220 is calculated from F020, F110, F200.

CALC.SELBEN is defined as "iff({CALC.PE}, {CALC.WO2BEN1}, {CALC.LTFTBEN})"

WeathermanShawn
January 25th, 2011, 06:30 PM
Yea Joe similar experience on this end. I have not stared at it long enough to see if it just the first frame when you enter PE Mode or all of them.

Here was my afternoon run. I could not get CALC.VET to give a value, so I attached an error message.

The TSTATE03 did not return anything.

Still working on it. I think we are close...

WeathermanShawn
January 25th, 2011, 06:41 PM
I got CALC.VET to work. I changed GM.MAF to SAE.MAF (which I always use).

Any preference on that?

Maybe we need to collaborate with the 'programmers' on the frame delay. Unless we redefine one of the CALC.Pids or utilize a frame offset in the program..I don't see anything in your logic thats wrong. Somewhere in that same section of the Scan Tool I recall a code for 'frame'. May or may not be the solution..

TFZ_Z06
January 25th, 2011, 09:59 PM
& = bitwise
&& = logical

based on your criteria, this might work: (i haven't tested..)
calc.pid1 iff ({GM.EQIVRATIO} > 1.00 && {SAE.RPM} > 2000, "PE Mode", "Non PE Mode")

calc.pid2 iff (calc.pid1 = "PE Mode" , something, something else)

WeathermanShawn
January 25th, 2011, 11:00 PM
Thanks TFZ ZO6..

Thats a good tip. We may be able to get this to work in the current form.

Joe, the problem with the Frame lagging appears to be isolated to WO2BEN1 Pid. It does not lag when computing LTFTBEN's. Perhaps the PRC of the LTFT Bank1 & 2 are pertinent.

Anyway I got it to work by doing this:

*CLC-00-220 factor 0.5 1.5 .4 "iff({GM.EQIVRATIO} > 1 && {SAE.RPM} > 1200, {GM.EQIVRATIO} * {EXT.WO2LAM1}, {CALC.LTFTBEN})"

I simply utilized the entire expression. It would still work with CALC.PE Mode expressed, but it was when I replaced the WO2BEN1 expression that it solved the lag problem. Perhaps it was having to compute WO2BEN1, then LTFTBEN..compare then re-compute.

Give it a shot.

joecar
January 26th, 2011, 10:51 AM
I emailed Paul about the lag.

WeathermanShawn
January 26th, 2011, 10:57 AM
Thanks.

Looks like with the latest software update it works! See attachment for new CALC.PID that allows for calculation of the enitre VE Table utilizing both a narrowband and wideband simultaneously. See the following thread for more information:http://forum.efilive.com/showthread.php?15236-A-New-Twist-on-CALC.-VE-Table..Computing-the-Entire-VE-Table.&highlight=calc+ve

By the way Joecar thanks for your work (along with Mick, Simon, and others). I went from clueless to a 'sweet' PID in 3 days. Joe you do great work on this CALC.Pids!

Thanks again..Shawn..