Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Embedded if statements?

  1. #1
    Lifetime Member
    Join Date
    Jan 2007
    Posts
    298

    Default Embedded if statements?

    Before I go through alot of work...

    would efi live calc pid support embedded iff's? six deep?

  2. #2
    Lifetime Member
    Join Date
    Jan 2007
    Posts
    298

    Default

    Yes. EFI live does support them it seems.

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

    Default

    iff(boolean_condition, then_calculation, else_calculation)


    Last edited by joecar; July 2nd, 2008 at 01:40 AM. Reason: typo

  4. #4
    Lifetime Member
    Join Date
    Jan 2007
    Posts
    298

    Default

    Such would be correct.

    But no case statments, elseifs, do whiles or fors..... sigh

  5. #5
    Lifetime Member
    Join Date
    Jan 2007
    Posts
    298

    Default

    Basically I fabbed a casestatement from 7 embedded if statements. It is super hard to logically understand by just looking at it but it seems to work ok. It kinda guesses what gear I am in. Seems to work.

  6. #6
    Lifetime Member Garry's Avatar
    Join Date
    Jun 2006
    Posts
    649

    Default

    Cool ... care to share?
    Garry Glendown * '17 Fifty 2SS MT * 99 Firehawk Convertible (for sale)

  7. #7
    Lifetime Member
    Join Date
    Jan 2007
    Posts
    298

    Default

    Could do that. Do you have M6 or A4? I don't think it would work for A4 due to stall up and the 4L60E can only lock up in 3 and 4.

    Basically, I took the theory that MPH/RPM was appox constant IN GEAR and fell in a certain range for each gear.

    Like this:

    IF MPH/RPM>X AND MPH/RPM<Y,
    ......gear = 6
    ..........ELSE
    ...............IF MPH/RPM > A AND MPH/RPM <B,
    ....................gear =5
    ..........................ELSE
    ........
    the periods are to mark the position

    I made a case for each gear and finally I stated if it isn't in any of those ranges just say 0. 0 could mean alot of slipping or not moving or in N.


    What gears do you have? I wrote out code for my car. It is a M6 with 4,56 gears.

    I can't test it much because my laptop battery dies in less than 1 min. I applied it to a logged file and it seemed to work. Haven't tested in real time yet.

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

    Default

    lookup(x, a1,b1, a2,b2, a3,b3, ...)

    let x = MPH/RPM

    then gear = look(x, x0,0, x1,gear1, x2,gear2, x3,gear3, x4,gear4, x5,gear5, x6,gear6, x7,0)

  9. #9
    Lifetime Member Garry's Avatar
    Join Date
    Jun 2006
    Posts
    649

    Default

    Mine is an M6 w/ 3.73 ... sounds pretty straightforward ...
    Garry Glendown * '17 Fifty 2SS MT * 99 Firehawk Convertible (for sale)

  10. #10
    Lifetime Member Ninety8C5's Avatar
    Join Date
    Sep 2003
    Posts
    454

    Default

    Quote Originally Posted by Garry View Post
    Mine is an M6 w/ 3.73 ... sounds pretty straightforward ...
    Same here. I would be very interested if someone could work out the values as the PID GM.GEAR doesn't seem to work for the M6.

Page 1 of 2 12 LastLast

Posting Permissions

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