NefMoto

Technical => Reverse Engineering => Topic started by: vwnut8392 on January 06, 2017, 09:47:15 PM



Title: Spark cut rev limiter ME7
Post by: vwnut8392 on January 06, 2017, 09:47:15 PM
i decided to try an idea i had about using the launch control routine to create a spark cut rev limiter. i have not personally tested this yet as i dont own a car to do it with but im having someone test it for me. If this works as intended it could be used as a safety rev limiter if set to 100 to 200RPM above NMAX. but i know 95% of people who will use this will set this limiter in place of their NMAX and if you do that set NMAX 100 to 200RPM above this limiter. i have coded another similar setup for another motronic and tested that personally with great results. i will post again once my tester tests my files for me. i have posted the original code below and the changes i made to it below along with the BIN file that is specially modified. i take to responsibility for the tuning in the file as i did not create it either.

Original code
Code:
C2 F4 99 C8 D7 00 81 00  C2 F9 39 73 40 49 FD 40
9A 26 13 20 F2 F4 40 9C  D7 00 81 00 F2 F9 30 73
40 49 9D 0B F2 F4 9E F8  D7 00 81 00 F2 F9 32 73
40 49 FD 03 F7 8E A4 8B  0D 2F 9A 26 29 20 8A 25
22 E0 F2 F4 9E F8 D7 00  81 00 F2 F9 36 73 40 49
FD 1A C2 F4 A8 89 D7 00  81 00 C2 F9 38 73 40 49
FD 12 D7 00 38 00 F2 F4  F0 4F D7 00 81 00 F2 F9
34 73 40 49 9D 11 F7 8E  A4 8B 08 41 D7 00 38 00
F7 F8 F0 4F 0D 09 D7 00  38 00 F6 8F F0 4F 0D 04
D7 00 38 00 F6 8E F0 4F  F3 F8 9C 89 DB 00 FF FF

Code modified for spark cut limiter
Code:
F2 F4 9E F8 D7 00 81 00  C2 F9 39 73 40 49 FD 12
9A 26 13 20 F2 F4 40 9C  D7 00 81 00 F2 F9 30 73
40 49 9D 0B F2 F4 9E F8  D7 00 81 00 F2 F9 32 73
40 49 FD 03 F7 8E A4 8B  0D 2F 9A 26 29 20 8A 25
22 E0 F2 F4 9E F8 D7 00  81 00 F2 F9 36 73 40 49
FD 1A C2 F4 A8 89 D7 00  81 00 C2 F9 38 73 40 49
FD 12 D7 00 38 00 F2 F4  F0 4F D7 00 81 00 F2 F9
34 73 40 49 9D 11 F7 8E  A4 8B 08 41 D7 00 38 00
F7 F8 F0 4F 0D 09 D7 00  38 00 F6 8F F0 4F 0D 04
D7 00 38 00 F6 8E F0 4F  F3 F8 9C 89 DB 00 FF FF


Title: Re: Spark cut rev limiter ME7
Post by: fknbrkn on January 07, 2017, 02:22:10 AM
its all about KFTSRL
no need for a custom code


Title: Re: Spark cut rev limiter ME7
Post by: adam- on January 07, 2017, 02:47:13 AM
Yeah, we talked about this the other week! :)

Dwell to 0.


Title: Re: Spark cut rev limiter ME7
Post by: Jim_Coupe on January 07, 2017, 03:58:04 AM
Dont understan.. If you use KFTSRL as spark cut you can get a soft cut rpm limiter? Am I right?  This table is maxed out at 6000rpm.. Do you increase this axis?


Title: Re: Spark cut rev limiter ME7
Post by: TijnCU on January 07, 2017, 04:05:33 AM
It is discussed here.
http://nefariousmotorsports.com/forum/index.php?topic=11664.0title= (http://nefariousmotorsports.com/forum/index.php?topic=11664.0title=)
I am working on a "soft" launch that uses the same function because I really like how fast the mentioned above ignition cut limiter is.
(setting szout_w to 0 at requested rpm)


Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 07, 2017, 10:29:45 AM
this is if you want your rev limiter to be just like the launch control. its really loud, obnxious, and lots of fire.

This video is testing the same concept above in my car. its not ME7 but it works and works well. i have it set to 6800rpm for testing in the video and my real rev limiter is 7200.

https://www.youtube.com/watch?v=22SuEaQoaDc


Title: Re: Spark cut rev limiter ME7
Post by: TijnCU on January 07, 2017, 10:43:31 AM
hehe love it  ;D


Title: Re: Spark cut rev limiter ME7
Post by: Jim_Coupe on January 07, 2017, 11:28:18 AM
Heheh nice :)   I need that lol


Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 07, 2017, 12:02:38 PM
i had my friend test the file i posted above and sadly it doesnt work as expected unless he flashed the wrong file. some help from the coding guru's would be nice right now.


Title: Re: Spark cut rev limiter ME7
Post by: fknbrkn on January 07, 2017, 11:57:21 PM
lets take a look at your code

Code:
seg08a:3A20                 mov     r4, nmot_w
seg08a:3A24                 exts    #81h, #1 ; 'Б'
seg08a:3A28                 [color=red]movbz   r9, byte_817339[/color]
seg08a:3A2C                 cmp     r4, r9
seg08a:3A2E                 [color=red]jmpr    cc_ULE, loc_8A3A54[/color]

...
seg08a:3A54 loc_8A3A54:                             ; CODE XREF: sub_8A3A20+Ej
seg08a:3A54                 movb    tsrldyn, ZEROS
seg08a:3A58                 jmpr    cc_UC, loc_8A3AB8

red parts are weird for me

first of all you comparing 16bit nmot_w with 8bit data
movbz   r9, byte_817339 ; = B0 = 44 RPM lol
use mov instead of movbz here like in original AL/NLS code
mov r9, word_81733A sounds good (mov r9, #0733Ah). and change this into your definition from 339 to 33A btw

next problem is the logic of your routine
comparing nmot_w with your value (6700rpm)
and then
cc_ULE, loc_8A3A54 ; here is movb    tsrldyn, ZEROS = spark cut

so if nmot_w LESS or EQU 6700 then you has spark cut? nice :)
use cc_UGE here

and finally again - just change KFTSRL for the same result. no need for custom routine




Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 08, 2017, 08:34:00 PM
lets take a look at your code

Code:
seg08a:3A20                 mov     r4, nmot_w
seg08a:3A24                 exts    #81h, #1 ; 'Б'
seg08a:3A28                 [color=red]movbz   r9, byte_817339[/color]
seg08a:3A2C                 cmp     r4, r9
seg08a:3A2E                 [color=red]jmpr    cc_ULE, loc_8A3A54[/color]

...
seg08a:3A54 loc_8A3A54:                             ; CODE XREF: sub_8A3A20+Ej
seg08a:3A54                 movb    tsrldyn, ZEROS
seg08a:3A58                 jmpr    cc_UC, loc_8A3AB8

red parts are weird for me

first of all you comparing 16bit nmot_w with 8bit data
movbz   r9, byte_817339 ; = B0 = 44 RPM lol
use mov instead of movbz here like in original AL/NLS code
mov r9, word_81733A sounds good (mov r9, #0733Ah). and change this into your definition from 339 to 33A btw

next problem is the logic of your routine
comparing nmot_w with your value (6700rpm)
and then
cc_ULE, loc_8A3A54 ; here is movb    tsrldyn, ZEROS = spark cut

so if nmot_w LESS or EQU 6700 then you has spark cut? nice :)
use cc_UGE here

and finally again - just change KFTSRL for the same result. no need for custom routine




Thank you for pointing out my errors. im just determined to do it this way because its easier and faster than having to hunt down KFTSRL for me. now that you've helped point out my errors i can just use the auto patcher for launch control and just make changes to the coolant temp check code, adjust the constant to the value to the RPM i want and done. i will still try the KFTSRL to compare it to how im doing it too just because im curious.


Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 08, 2017, 09:10:34 PM
Also thinking about my method can serve more  purposes than just adjusting KFTSRL. KFTSRL seems to just play on the stock rev limiter. my way of doing it can be used as a safety rev limiter on high power cars if set a couple hundred RPM higher than your fuel cut limiter. im sure some people here have driven or own cars powerful enough that when you miss a shift it over revs beyond the stock limiter. so its more than just a fun noise maker. my idea comes from VEMS standalone in my project car because it has a spark cut limiter that is setup by default 200 RPM less than the fuel cut limiter. the point of this is to have a safety buffer so its impossible to over rev the engine. i attached a picture from my VEMS configuration for an example.


Title: Re: Spark cut rev limiter ME7
Post by: fknbrkn on January 08, 2017, 11:23:49 PM
KFTSRL is not stock limiter. its a ignition dwell time map.
it can be used as rev limiter setting dwell to 0 at redline rpms (by changing rpm axis) with the same result as yours
stock fuel limiter can be used aswell


Title: Re: Spark cut rev limiter ME7
Post by: gman86 on January 09, 2017, 01:42:04 AM
Also thinking about my method can serve more  purposes than just adjusting KFTSRL. KFTSRL seems to just play on the stock rev limiter. my way of doing it can be used as a safety rev limiter on high power cars if set a couple hundred RPM higher than your fuel cut limiter. im sure some people here have driven or own cars powerful enough that when you miss a shift it over revs beyond the stock limiter. so its more than just a fun noise maker. my idea comes from VEMS standalone in my project car because it has a spark cut limiter that is setup by default 200 RPM less than the fuel cut limiter. the point of this is to have a safety buffer so its impossible to over rev the engine. i attached a picture from my VEMS configuration for an example.

By ensuring the coils won't charge above the RPM in KFTSRL, it's just as much a safety limiter. There will be no spark.


Title: Re: Spark cut rev limiter ME7
Post by: TijnCU on January 09, 2017, 01:58:02 AM
True, but since there will be fuel spraying in the manifold it can still produce damage  ;D Only a fuel cut will be absolutely harmless for the engine. But I agree that the engine will not be over revving the set limit. In our case, setting the fuel cut limiter above the spark cut is only to ensure fueling while ignition off to get noise and flames  :D


Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 10, 2017, 11:47:00 AM
well i guess there are officially 2 methods to achieve the same thing. you could say it is nice to have options.


Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 13, 2017, 05:14:52 PM
I attempted to modify the PHP script that auto patches the BIN files with spark cut rev limiter in place of the coolant temperature check at the beginning. i tested the script on a 1mb file and it seems to work fine. the RPM constant for the rev limiter is the last 2 pairs of bits (its a 16bit value with LSB checked and the equation for it is 0.25 * X in tunerpro). if anyone wants to give it go and report back if it works please do. the spark cut limiter is set to 6600 which is 200RPM less than the stock fuel cut limiter. if you dont want the spark cut rev limiter raise the value higher than your stock fuel cut limiter or 10,000RPM or simply patch with the original patcher that doesnt give this option.

Run this just like the other launch.php.
c:\php launch_LMTR.php (dump.bin) (dump.ecu)


Title: Re: Spark cut rev limiter ME7
Post by: sonique on January 16, 2017, 09:55:45 AM
same just exe file


Title: Re: Spark cut rev limiter ME7
Post by: vwnut8392 on January 17, 2017, 01:57:57 PM
same just exe file

Thanks for the update on this!