Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 43

Thread: Designing a New Custom PE Mode PID..I need help..

  1. #11
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    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...?

  2. #12
    Lifetime Member 5.7ute's Avatar
    Join Date
    Oct 2006
    Posts
    1,840

    Default

    Quote Originally Posted by WeathermanShawn View Post
    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
    Last edited by 5.7ute; January 24th, 2011 at 06:17 PM. Reason: fixed 2 typos
    The Tremor at AIR

  3. #13
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    Shawn,

    The iff() function works like this:

    iff(cond, x, y)

    if cond is true then return x else return y.

  4. #14
    R.I.P Shawn, 1956-2011 WeathermanShawn's Avatar
    Join Date
    Jul 2008
    Posts
    1,807

    Default

    Quote Originally Posted by joecar View Post
    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..
    2002 Black Camaro Z-28 M6 Hardtop 11.0:1CR 425HP/410TQ SAE (400TQ@3500RPM)
    200cc Heads, 228/232 110+2 Cam, 1 3/4" LT's w/catts, GMMG, Koni Shocks, Hotchkis Springs, 35/21 Sways, 17" ZR1's, 3.90 Gears Roadrunner PCM LM-2 Serial Wideband
    EFILive Closed-Loop MAF/SD Hybrid Tune..


  5. #15
    R.I.P Shawn, 1956-2011 WeathermanShawn's Avatar
    Join Date
    Jul 2008
    Posts
    1,807

    Default

    Quote Originally Posted by 5.7ute View Post
    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?
    2002 Black Camaro Z-28 M6 Hardtop 11.0:1CR 425HP/410TQ SAE (400TQ@3500RPM)
    200cc Heads, 228/232 110+2 Cam, 1 3/4" LT's w/catts, GMMG, Koni Shocks, Hotchkis Springs, 35/21 Sways, 17" ZR1's, 3.90 Gears Roadrunner PCM LM-2 Serial Wideband
    EFILive Closed-Loop MAF/SD Hybrid Tune..


  6. #16
    Lifetime Member 5.7ute's Avatar
    Join Date
    Oct 2006
    Posts
    1,840

    Default

    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.
    The Tremor at AIR

  7. #17
    Lifetime Member 5.7ute's Avatar
    Join Date
    Oct 2006
    Posts
    1,840

    Default

    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
    The Tremor at AIR

  8. #18
    R.I.P Shawn, 1956-2011 WeathermanShawn's Avatar
    Join Date
    Jul 2008
    Posts
    1,807

    Default

    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)*1 5/({SAE.RPM}*{SAE.MAP.kPa})*{CALC.BEN1}"
    2002 Black Camaro Z-28 M6 Hardtop 11.0:1CR 425HP/410TQ SAE (400TQ@3500RPM)
    200cc Heads, 228/232 110+2 Cam, 1 3/4" LT's w/catts, GMMG, Koni Shocks, Hotchkis Springs, 35/21 Sways, 17" ZR1's, 3.90 Gears Roadrunner PCM LM-2 Serial Wideband
    EFILive Closed-Loop MAF/SD Hybrid Tune..


  9. #19
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    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...?
    Last edited by joecar; January 26th, 2011 at 07:57 AM.

  10. #20
    Joe (Moderator) joecar's Avatar
    Join Date
    Apr 2003
    Posts
    28,403

    Default

    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.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	VET calc pids in iff cause delayed calc.png 
Views:	147 
Size:	91.3 KB 
ID:	9764  
    Attached Files Attached Files
    Last edited by joecar; January 25th, 2011 at 06:11 AM.

Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. PID Availablity problems in passthrough logging mode.
    By XLR8NSS in forum FlashScan V2 BB Logging
    Replies: 2
    Last Post: November 29th, 2007, 01:45 PM
  2. How do you make a custom PID???
    By WiseGuyZ06 in forum General (Petrol, Gas, Ethanol)
    Replies: 2
    Last Post: October 10th, 2007, 11:20 AM
  3. Custom PID: What functions can you use?
    By 2002_z28_six_speed in forum General
    Replies: 2
    Last Post: September 3rd, 2007, 06:05 PM
  4. Why LM-1 Custom PID???????
    By 2002_z28_six_speed in forum General
    Replies: 3
    Last Post: June 4th, 2007, 12:52 AM
  5. Anyone made a custom mpg (or km/L) PID?
    By thunder550 in forum General
    Replies: 3
    Last Post: May 17th, 2006, 04:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •