NefMoto

Technical => Tuning => Topic started by: Speedy_Acc on May 05, 2020, 06:32:17 PM



Title: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 05, 2020, 06:32:17 PM
Alright, since I was not able to find anymore info about rolling antilag I decided to start a thread and make one. General idea is to re-use the current nef als/nls map.
Logic behind the rolling antilag map would be as follows : Cruise control off, switch up (+), floor the gas, recall "launch control" function, set launch rpm to current rpm. I'm having trouble finding the cruise control switch address so if anyone has some input and would like to add to the "re" development of the map, please post here! ;D


Title: Me7.1 Rolling antilag
Post by: bamofo on May 06, 2020, 09:35:47 AM
Alright, since I was not able to find anymore info about rolling antilag I decided to start a thread and make one. General idea is to re-use the current nef als/nls map.
Logic behind the rolling antilag map would be as follows : Cruise control off, switch up (+), floor the gas, recall "launch control" function, set launch rpm to current rpm. I'm having trouble finding the cruise control switch address so if anyone has some input and would like to add to the "re" development of the map, please post here! ;D

ME7info your ECU file and you will see the Cruise Master Switch. Thats the one you want to add to your ASM code.


Title: Me7.1 Rolling antilag
Post by: bamofo on May 06, 2020, 06:16:13 PM
I’ve been around the Fb groups for a couple years already. Recently started posting on nef tho.

If you still cant find it share your rom here and ill give you the address


Title: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 06, 2020, 06:20:28 PM
If you still cant find it share your rom here and ill give you the address


I’ll have a look in about 30 min. Its an mbox 2.7 file.


Title: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 06, 2020, 07:12:40 PM
Alright so cruise control up should be the following address : S_fgrhs
but it might also be a couple other options, see attached picture.


Title: Me7.1 Rolling antilag
Post by: bamofo on May 06, 2020, 07:14:36 PM
Alright so cruise control up should be the following address : S_fgrhs
but it might also be a couple other options, see attached picture.

Now go in your .ecu file and find the actual address that’s the variable name.


Title: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 06, 2020, 07:19:04 PM
My mistake, here it is.


Title: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 06, 2020, 10:15:04 PM
Did some more digging and I came up with this pseudo code based on Setzi62's code.

goes as follows: "updated code"

// Rolling Antilag
  {
    if (S_fgrat = 0 && S_fgrwb = 1 && wped > AccPedalThreshold)
    {
      // NoLiftShift is active
      if (counter_NoLiftShift < IgnitionCutDuration)
      {
      vziel_w = vfil_w            // Hold speed
        tsrldyn = 0;            // Interrupt ignition
        counter_NoLiftShift++;
      }
   }
    else
    {
      // Other conditions not true, don't allow ignition interruption
      // until cruise is released and pressed again
      counter_NoLiftShift = 0xFFFF;


where S_fgrat is the on off switch for the cruise stalk and S_fgrwb is the + on the cruise stalk and vziel_w is the target speed of cruise control. I am thinking of re-using the cut duration time or create a 2nd entry to adjust the jerking and bogging during the rolling antilag. As for the using "vziel_w" I don't know if the car will actually hold its speed through this function. The next step after finalizing the pseudo code would be to actually write it.

These are the addresses for each cruise control stalk options on an 2.7 Mbox :
vziel_w         , {TargetSpeedCruiseControl}        , 0x382088,  2,  0x0000, {km/h}    , 0, 0,    0.0078125,      0, {Zielgeschwindigkeit FGR}

S_fgrat         , {SwitchOffTipCruiseControl}       , 0x00FD86,  2,  0x0001, {}        , 0, 0,            1,      0, {Schalter Aus-Tip am FGR-Bedienhebelschalter}

S_fgrhs         , {MainSwitchCruiseControl}         , 0x00FD86,  2,  0x0002, {}        , 0, 0,            1,      0, {Hauptschalter am FGR-Bedienhebel}

S_fgrsv         , {TipSetDecCruiseControl}          , 0x00FD86,  2,  0x0004, {}        , 0, 0,            1,      0, {Schalter Setzen/Verzögern am FGR-Bedienhebel}

S_fgrwb         , {TipResetAccCruiseControl}        , 0x00FD86,  2,  0x0008, {}        , 0, 0,            1,      0, {Schalter Wiederaufnahme/Beschleunigen am FGR-Bedienhebel}



Anyone has some more input?


Title: Re: Me7.1 Rolling antilag
Post by: nyet on May 06, 2020, 10:43:35 PM
Deserves a thread. Thank you for bringing this topic from the dregs to something real.


Title: Re: Me7.1 Rolling antilag
Post by: fknbrkn on May 06, 2020, 11:43:06 PM
Iirc cc buttons are always false when the main switch turned off
So this might be a problem

As for the vziel_w
Do you want to hold speed by the closing tb and launching same time?
And why are you placed this equation inside the main thread?
I believe you want to hold speed that was in the moment you push the button and not every cycle after it
Even if vziel doesn't reset in main code, you came to accelerating car with raised vziel and probably some jerking until counter have reached. And what after? Where is the counter reset?

This code won't work



Title: Re: Me7.1 Rolling antilag
Post by: bamofo on May 07, 2020, 06:45:34 AM
Did some more digging and I came up with this pseudo code based on Setzi62's code.

goes as follows:

// Rolling Antilag
  {
    if (S_fgrat = 0 && S_fgrwb = 1 && wped > AccPedalThreshold)
    {
      // NoLiftShift is active
      if (counter_NoLiftShift < IgnitionCutDuration)
      {
   vziel_w = vfil_w      // Hold speed
        tsrldyn = 0;            // Interrupt ignition
        counter_NoLiftShift++;
      }
    }

where S_fgrat is the on off switch for the cruise stalk and S_fgrwb is the + on the cruise stalk and vziel_w is the target speed of cruise control. I am thinking of re-using the cut duration time or create a 2nd entry to adjust the jerking and bogging during the rolling antilag. As for the using "vziel_w" I don't know if the car will actually hold its speed through this function. The next step after finalizing the pseudo code would be to actually write it.

These are the addresses for each cruise control stalk options on an 2.7 Mbox :
vziel_w         , {TargetSpeedCruiseControl}        , 0x382088,  2,  0x0000, {km/h}    , 0, 0,    0.0078125,      0, {Zielgeschwindigkeit FGR}

S_fgrat         , {SwitchOffTipCruiseControl}       , 0x00FD86,  2,  0x0001, {}        , 0, 0,            1,      0, {Schalter Aus-Tip am FGR-Bedienhebelschalter}

S_fgrhs         , {MainSwitchCruiseControl}         , 0x00FD86,  2,  0x0002, {}        , 0, 0,            1,      0, {Hauptschalter am FGR-Bedienhebel}

S_fgrsv         , {TipSetDecCruiseControl}          , 0x00FD86,  2,  0x0004, {}        , 0, 0,            1,      0, {Schalter Setzen/Verzögern am FGR-Bedienhebel}

S_fgrwb         , {TipResetAccCruiseControl}        , 0x00FD86,  2,  0x0008, {}        , 0, 0,            1,      0, {Schalter Wiederaufnahme/Beschleunigen am FGR-Bedienhebel}



Anyone has some more input?

Ive been able to disable/enable with the S_fgrhs @ FD86. I havent changed it to adjust for rolling. Why do you want to have it adjustable? We could update this for an on/off with a higher rolling speed, or are you trying to turn this on for rolling at higher MPH/KPH.


Title: Re: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 07, 2020, 07:36:43 AM
Ive been able to disable/enable with the S_fgrhs @ FD86. I havent changed it to adjust for rolling. Why do you want to have it adjustable? We could update this for an on/off with a higher rolling speed, or are you trying to turn this on for rolling at higher MPH/KPH.

I’m trying to make it happen at high speed! Use rolling antilag vs brake boosting.


Title: Re: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 07, 2020, 07:37:40 AM
Iirc cc buttons are always false when the main switch turned off
So this might be a problem

As for the vziel_w
Do you want to hold speed by the closing tb and launching same time?
And why are you placed this equation inside the main thread?
I believe you want to hold speed that was in the moment you push the button and not every cycle after it
Even if vziel doesn't reset in main code, you came to accelerating car with raised vziel and probably some jerking until counter have reached. And what after? Where is the counter reset?

This code won't work



Thanks for the input, I’ll do some more digging!


Title: Re: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 07, 2020, 08:18:59 AM
I’m trying to make it happen at whatever speed! Basically switch cruise on, function calls launch control and holds curent speed.


Title: Re: Me7.1 Rolling antilag
Post by: bamofo on May 07, 2020, 11:15:57 AM


Interesting. Can you share the rom and the work you have so far? I can help but i cant guarantee I'm anywhere as good as the other people here. Gremlin made me re-Learn ASM and a ton of other junk so i have all this useless knowledge now i dont mind helping with.


Title: Re: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 09, 2020, 12:53:16 PM
Here is the current bin I'm using, its an mbox file with the nef nls/lc code implemented. I'll add the stock bin file as well if someone wants to develop a whole new program as well as the xdf file used to tune the mbox.


Title: Re: Me7.1 Rolling antilag
Post by: Speedy_Acc on May 09, 2020, 12:56:42 PM
I looked some more into the code, and it wont work as previously mentioned. There is no "reset" of the ignition cut after the cruise control is flicked on and wped > AccPedalThreshold. Could anyone chime in with a reset function for the following code as well as some more insight on the behavior of the car when "vziel_w = vfil_w" (cruise speed = vehicle speed) ? :

// Rolling Antilag
  {
    if (S_fgrat = 0 && S_fgrwb = 1 && wped > AccPedalThreshold)
    {
      // NoLiftShift is active
      if (counter_NoLiftShift < IgnitionCutDuration)
      {
      vziel_w = vfil_w            // Hold speed
        tsrldyn = 0;            // Interrupt ignition
        counter_NoLiftShift++;
      }
   }
    else
    {
      // Other conditions not true, don't allow ignition interruption
      // until cruise is released and pressed again
      counter_NoLiftShift = 0xFFFF;


Title: Re: Me7.1 Rolling antilag
Post by: bamofo on August 07, 2020, 07:58:55 AM
I looked some more into the code, and it wont work as previously mentioned. There is no "reset" of the ignition cut after the cruise control is flicked on and wped > AccPedalThreshold. Could anyone chime in with a reset function for the following code as well as some more insight on the behavior of the car when "vziel_w = vfil_w" (cruise speed = vehicle speed) ? :

// Rolling Antilag
  {
    if (S_fgrat = 0 && S_fgrwb = 1 && wped > AccPedalThreshold)
    {
      // NoLiftShift is active
      if (counter_NoLiftShift < IgnitionCutDuration)
      {
      vziel_w = vfil_w            // Hold speed
        tsrldyn = 0;            // Interrupt ignition
        counter_NoLiftShift++;
      }
   }
    else
    {
      // Other conditions not true, don't allow ignition interruption
      // until cruise is released and pressed again
      counter_NoLiftShift = 0xFFFF;

To do rolling antilag i took some ideas from different LC/NLS projects and then wrote some of the logic myself

Couple key things to note before the code.

1) ASM logic should be thought of backwards. Write these statements so that you have excluded all cases of why wouldn’t want it to run. That was my first mistake when i started dabbling.
2) Make sure whatever ram locations your using you understand what the multiplier is... Word/byte sometimes have different multiplier (me7info.exe) is your friend.
3) Use Flags - You will see people sharing other peoples work and you don’t understand why no-one will help... it is because that’s not the standard script that they originally grabbed from whoever it was... but flags allow you to log real quick with me7logger and figure out why something isn’t working.
4) The key i have found to implement a well working LC that doesn’t break things, control boost, and gurgle without messing with 15 other tables is the right hooks... Everyone hooks the UB for battery voltage because that routine is run all the time. Find ZWOUT as well and you can then command your timing during any of these events.
5) you don’t need NLS logic at all its a waste of time in this if you just write the initial run conditions right


Code logic for what your asking
- Reset flags or 0 them out
- if cruise is off Exit routine
- set a flag for tracking
-compare vfil to see if your going slow  Jump over next bullet if you are going slow (cause i want to run LC regardless set at 1km/h)
-if clutch isnt pressed exit to gurgle logic checks
-set flag b
-otherwise we have met the conditions to do LC / NLS with one pass.

Why? Because if im going super slow or stopped with the cruise lever on I want this to run. If im going over that speed and i push the clutch in i want it to go from my current RPM Limit 7500, to my new target (configurable)... which acts as two things... Great NLS because you are shutting off the coil packs... and if your on the highway you can clutch in and do it.


Key to this is ZWOUT - So when you get in a condition you have met at want to run this LC you need to set a flag that you can reference. In which case the ZWOUT hook will point to a small subroutine below all this... saying exit if this flag isnt set. done... in mine i have -24 degrees timing set for LC and Gurgle seems to like -14...

If you still cant get the logic to work... then im not sure how else to help here.


Title: Re: Me7.1 Rolling antilag
Post by: Speedy_Acc on August 07, 2020, 08:02:50 AM
Thanks a lot for the answer, but to be honnest, I gave up on the idea and I just bought a standalone


Title: Re: Me7.1 Rolling antilag
Post by: bamofo on August 07, 2020, 08:14:33 AM
Thanks a lot for the answer, but to be honnest, I gave up on the idea and I just bought a standalone

im sure 10 more people will ask this month so at least they will have an answer.


Title: Re: Me7.1 Rolling antilag
Post by: nyet on August 07, 2020, 11:03:47 AM
im sure 10 more people will ask this month so at least they will have an answer.

I appreciate you putting in the effort.


Title: Re: Me7.1 Rolling antilag
Post by: Khendal on August 11, 2020, 11:37:56 AM
Is there a way to have a unique tutorial on the way to disassembly correctly this ME7.1 bin from the start of IDA to the end ?
I read a lot of topics but there isn't a standard procedure to load a dissassembled ecu that works everytime, with every ida versions etc... 

*i'm not asking code to implement... i will looking for it...but at least know that i'm using a correct dissassembled ecu*

This post...is for also other ecu... me7.5, me7.1.1 med9.1 ....and so on... it would be interesting to have in this board


Title: Re: Me7.1 Rolling antilag
Post by: bamofo on August 12, 2020, 10:17:36 AM
Is there a way to have a unique tutorial on the way to disassembly correctly this ME7.1 bin from the start of IDA to the end ?
I read a lot of topics but there isn't a standard procedure to load a dissassembled ecu that works everytime, with every ida versions etc... 

*i'm not asking code to implement... i will looking for it...but at least know that i'm using a correct dissassembled ecu*

This post...is for also other ecu... me7.5, me7.1.1 med9.1 ....and so on... it would be interesting to have in this board

I only dissasemble the NLS/LC/Gurgle Code. The hooks are pretty easy to find and the ECU files are generated by either a ols project you already have or me7info.exe