Pages: [1]
Author Topic: Adding Timing Retard to launch control routine ME7  (Read 9544 times)
vwnut8392
Sr. Member
****

Karma: +18/-7
Offline Offline

Posts: 271


« on: July 28, 2017, 06:36:56 PM »

Ive been spending a lot of time working with VEMS standalone and it seems like it really helps to be able to retard timing at a certain RPM before the spark cut occurs. why i have the idea is because i have been working on an A4 1.8T with a T3T04B on it and with spark cut LC it will backfire and build boost for like only a second than the backfiring stops and its just like an RPM limiter with no more building boost. i think that being able to retard timing will allow more control over how much boost a turbo will make during launch control.

This is how i planned on laying out the code for it. im cutting out the NLS code for now just for testing reasons.

1. B kuppl=if yes go to 2.vfil w-if no go to normal routine.
2.Vfil w gets compared to constant=if yes go to 3.Nmot W-if no go to normal routine.
3.Nmot gets compared for timing retard RPM first. say a 1000RPM before LC RPM.=if yes go to 4.zwout-if no go to normal routine.
4.Zwout is compared to a negative timing constant. jump directly to 5.nmot for RPM compare again.
5.Nmot is compared for launch control RPM. if yes go to tsrldyn_Zeros (spark cut).

also in this code setup i considered adding TPS% comparison before or after 2.Vfil w just to make sure it cannot activate under normal driving.
lastly the only part im having a hard part understanding in the code is the jumps at the end of each step. for example at the end of the RPM comparison for launch control the hex is 9D 0B. i understand 9D is Unsigned Greater Than or Equal to but the 0B just doesnt make sense. 0B hex is 11 decimal. but if i count 11 bits forward in the code it doesnt jump to the second clutch switch check. could someone explain how the jumps work please because thats the only thing i dont get.
Logged
jcsbanks
Full Member
***

Karma: +17/-3
Offline Offline

Posts: 126


« Reply #1 on: August 02, 2017, 10:57:03 AM »

Better to show an example, because whilst I know C167 I do not know ME7.

However, my first guess is that it is because it is little endian.
Logged
_nameless
Hero Member
*****

Karma: +320/-448
Offline Offline

Posts: 2672



« Reply #2 on: August 02, 2017, 10:31:51 PM »

Better to show an example, because whilst I know C167 I do not know ME7.

However, my first guess is that it is because it is little endian.
-15 degrees
https://youtu.be/659dhhM3xWg
Logged

If you are in the market for a tune and would like the ease of downloading and flashing a dyno tested tune for a fair price check out https://instatune.sellfy.store/
jcsbanks
Full Member
***

Karma: +17/-3
Offline Offline

Posts: 126


« Reply #3 on: August 03, 2017, 12:01:42 AM »

Sorry I mean your question in the last paragraph aboyt jumps. Have you tried single stepping through the code in Lauterbach sim and watching the flags?
Logged
armageddon
Sr. Member
****

Karma: +20/-3
Offline Offline

Posts: 348


« Reply #4 on: August 03, 2017, 02:47:53 AM »

I am a noob at ASM but I found usefull to write it in keil to get the jumps right, I could not understand its logic either ...
Logged
nubcake
Sr. Member
****

Karma: +53/-4
Offline Offline

Posts: 401


« Reply #5 on: August 05, 2017, 03:13:54 PM »

I find it way easier to write such simple functions in raw asm. Set some kind of custom "B_ret" flag in your LC function, then add a check for that in ZUE function.
Or implement some kind of additional "dzw" var in ZUE and modify that from the main LC func.
Or ...

There's more than one way, you know. Wink

PS. If you're using IDA for disassembly, you can also write custom code in it (in raw hex ofc). Open hexdump, press F2 - and voila.
Logged
vwnut8392
Sr. Member
****

Karma: +18/-7
Offline Offline

Posts: 271


« Reply #6 on: August 29, 2017, 12:25:29 PM »

I did end up doing a crude patch to the original routine which i replaced vfil_w with zwout and set it to the maximum timing retard. it didnt really seem to make a difference in how the car acted. i did a log during the testing and it is pushing the negative timing constant into zwout but no visual or audible difference in how the car acted. i have been thinking about trying a different setup which ditches pushing 0 to tsrldyn and instead modifying the crank/cam angle value by pushing a false value to wnwkwas_w than adding timing retard on before that. only reason im thinking about modifying wnwkwas_w instead is because thats now most aftermarket standalone ECU's achieve their launch control. this is all just ideas but when i have free time i will modify a file for my car and see what it does.
Logged
Gonzo
Sr. Member
****

Karma: +20/-30
Offline Offline

Posts: 483


« Reply #7 on: September 14, 2017, 09:51:59 PM »

I did end up doing a crude patch to the original routine which i replaced vfil_w with zwout and set it to the maximum timing retard. it didnt really seem to make a difference in how the car acted. i did a log during the testing and it is pushing the negative timing constant into zwout but no visual or audible difference in how the car acted. i have been thinking about trying a different setup which ditches pushing 0 to tsrldyn and instead modifying the crank/cam angle value by pushing a false value to wnwkwas_w than adding timing retard on before that. only reason im thinking about modifying wnwkwas_w instead is because thats now most aftermarket standalone ECU's achieve their launch control. this is all just ideas but when i have free time i will modify a file for my car and see what it does.

You need to find routines that look up or write to zwout and then patch those routines to modify zwout. You can't just patch another unrelated routine and expect it to work.
Logged
TijnCU
Hero Member
*****

Karma: +60/-4
Offline Offline

Posts: 690


flying brick


« Reply #8 on: November 09, 2017, 12:40:45 PM »

If it works you'll hear it  Grin This is 12 degrees atdc. The routine is much more complex than the popular patch, and hooks directly in zwout.
https://youtu.be/X7F_kjVJjEM
Logged

vwnut8392
Sr. Member
****

Karma: +18/-7
Offline Offline

Posts: 271


« Reply #9 on: November 10, 2017, 02:19:39 PM »

If it works you'll hear it  Grin This is 12 degrees atdc. The routine is much more complex than the popular patch, and hooks directly in zwout.
https://youtu.be/X7F_kjVJjEM

Good work!!!! i can hear the timing pull back too! your definitely moving in the right direction. if it is possible to get it anywhere between -20 to -30 thats where you want to be. start timing retard 500 to 1000 RPM prior to your spark cut RPM and you'll get to the target boost pressure for launch quickly. basically when i setup launch control in VEMS standalone those are the base settings i start with. the timing retard helps the engine get to the desired boost quickly and the spark cut helps keep the engine at the desired launch RPM. normally there is fuel enrichment with the timing retard but you can live without it. heck the motronic might enrich enough on its own by the look of the video you posted.
Logged
TijnCU
Hero Member
*****

Karma: +60/-4
Offline Offline

Posts: 690


flying brick


« Reply #10 on: November 11, 2017, 01:55:51 AM »

start timing retard 500 to 1000 RPM prior to your spark cut RPM and you'll get to the target boost pressure for launch quickly. ......
 normally there is fuel enrichment with the timing retard but you can live without it. heck the motronic might enrich enough on its own by the look of the video you posted.
It starts retarding at 3500 and cuts spark at 4000 in this video. I have been working on additional fuel enrichment on this function too, but I made some register stack errors and then left it for future experiments because it had no priority. I have been talking to Mazer about this a lot during the time (it is based off his function) and the goal was to set fuel enrichment based on actual boost to help maintain boost pressure through a 2D map. I also want to do a 2D map for timing retard based on rpm to get a bit more control, there is no point in 3D maps with TPS for me because I just want to have the pedal floored in this function. At the time I just added adjustability for both RPM setpoints by pressing brake and setting the desired rpm with the throttle and cruise control, more for experimental purposes than as a permanent functionality because it is a bit crude. I just wanted to be able to set the ideal rpm points for my setup without reflashing all the time, but you still have to flash for timing settings. When I have my new engine ready I might start working on this again, because it is a fun feature. Also very detrimental on about every part in the drivetrain, especially in my case where I try to launch a 4000lb+ vehicle on 10" wide wheels.
btw, I am not planning on releasing code because I did not design the base function. I just try to return the favor to Mazer by providing a couple of plug in features for him
 to use. If he ever releases the code to the public I will be happy to add my plugins for free use.
Logged

vwnut8392
Sr. Member
****

Karma: +18/-7
Offline Offline

Posts: 271


« Reply #11 on: November 13, 2017, 07:50:26 PM »

It starts retarding at 3500 and cuts spark at 4000 in this video. I have been working on additional fuel enrichment on this function too, but I made some register stack errors and then left it for future experiments because it had no priority. I have been talking to Mazer about this a lot during the time (it is based off his function) and the goal was to set fuel enrichment based on actual boost to help maintain boost pressure through a 2D map. I also want to do a 2D map for timing retard based on rpm to get a bit more control, there is no point in 3D maps with TPS for me because I just want to have the pedal floored in this function. At the time I just added adjustability for both RPM setpoints by pressing brake and setting the desired rpm with the throttle and cruise control, more for experimental purposes than as a permanent functionality because it is a bit crude. I just wanted to be able to set the ideal rpm points for my setup without reflashing all the time, but you still have to flash for timing settings. When I have my new engine ready I might start working on this again, because it is a fun feature. Also very detrimental on about every part in the drivetrain, especially in my case where I try to launch a 4000lb+ vehicle on 10" wide wheels.
btw, I am not planning on releasing code because I did not design the base function. I just try to return the favor to Mazer by providing a couple of plug in features for him

 to use. If he ever releases the code to the public I will be happy to add my plugins for free use.

Good info in that what you've done. its sad to see you wont be releasing it but we can all hope mazer does. personally i stopped working on attempting this because i bought VEMS standalone so i have all this functionality without thinking and coding. i've grown tired of trying to figure this stuff out personally plus if and when i do come up with something new to add to this function i get shunned for it for one reason or another. now i understand why everyone keeps what they create to themselves aside from major tuners using it for profit. but seriously good info on your end lets us at least know that it is possible to achieve a timing retard along with the launch control. if this ever goes open to public it will be a huge help for people running ME7 with larger than stock turbos because timing retard is must with a anything beyond the K0X frame turbos.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.023 seconds with 17 queries. (Pretty URLs adds 0s, 0q)