Pages: [1]
Author Topic: Specific problems regarding NLS-routine  (Read 3066 times)
SoerenDa
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


« on: September 09, 2022, 02:41:01 AM »

Hey guys, this is my first thread on here, so bare with me.

Most of the time I'm a still reader on many many topics, trying to soak up as many knowledge as possible, as you can propably tell.
My expertise is round about the Audi C5 platform, as i tinker with it pretty regulary. My current cars are an 2004 Audi A6 C5 4.2, which is swapped to an S8 D2 AYS 40v engine mated to a manual 6 speed TDI box, running on LPG and an 2003 Audi RS6 C5 4.2tt swapped to manual TDI box, Tube manifolds, TTE 750 Hybrids, Wagner gen2 Intercoolers, 3" Downpipes and 3"dual exhaust, big injectors and pumps, currently waiting to do Air/oil seperator aswell as meth as it heatsoaks pretty bad and starts to knock at currently 1,8bar, so I'm stuck at 10 degrees of timing.

Now to the topic of this post:

Currently just for shits and giggles I'm tinkering with LC & NLS on the A6 since a while, but can't get it to work 100%. To be honest, it is driving me crazy and I'm starting to go ham as I looked at it for the last two weeks straight. Followed Seitzis PDF for the most part and had succes, but only partly. LC works like a charm, NLS not so much. It IS working, but not as intended. As I shift with the loud-pedal meshed to the floor it decreases RPM slightly for a split second, before continuing its way to make sweet love with the limiter WAY before my set 250ms. Hell, I even tried a damn second, but no change there, which leads me to be suspect about my ram-adress.

I troubleshot the following:
Different locations for the main function, configuration-variables, ram-counter and so on. I even disassembled the funktion aswell as my bin to my abilities, to fully understand it, as i am pretty new to custom code and want to understand it fully, before adding it.
Previous to that I logged a few maybe possible ram-adresses with Me7Logger, for example 384FF0 and 386000 which seemed to be non-used, which I am currently doubting.

I'm NOT asking to be spoon fed more as the PDF already did, just looking for a possible heads up as I'm stuck right now. Will include a log, disassembles as well as my variables, a virgin S8 Me7.1.1 bin and everything I did to understand whats going on, I'm sure it will help atleast someone in the future.

Explanation:
Kuppl_brems.12 = b_kuppl
Kuppl_brems.8   = b_br

Great forum guys, keep it going, learned a shitton of stuff here.

Sincerly,
Soeren
« Last Edit: September 09, 2022, 02:47:46 AM by SoerenDa » Logged
fknbrkn
Hero Member
*****

Karma: +177/-18
Offline Offline

Posts: 1402


mk4 1.8T AUM


« Reply #1 on: September 09, 2022, 03:31:26 AM »

You did awesome job )
But the problem is not in the ram locations etc. Take a look at the code, nls counter fires only once and restarts when !b_kuppl
Logged
BlackT
Hero Member
*****

Karma: +79/-39
Offline Offline

Posts: 1422



« Reply #2 on: September 09, 2022, 03:34:03 AM »

Also nls coundet can only count til 255, so max is 0.25 ms
Setting to second will not achieve nothing

I never look to many in that code, I only know it count so fast. What doesen't have sense beacuse that schould be 10 ms routine
255*10MS=2.55 SECONDS
But I say I never had time to investigate what is happening
I made my own code and it count like it schould I can set ignition max 2.55 seconds
« Last Edit: September 09, 2022, 03:37:57 AM by BlackT » Logged
_nameless
Hero Member
*****

Karma: +323/-450
Offline Offline

Posts: 2696



« Reply #3 on: September 09, 2022, 04:14:58 AM »

I have custom code that only works for only the time the clutch is used.
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/
SoerenDa
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


« Reply #4 on: September 09, 2022, 12:47:32 PM »

You did awesome job )
But the problem is not in the ram locations etc. Take a look at the code, nls counter fires only once and restarts when !b_kuppl


Thanks a lot for the kind words and the heads up!
I think I see what you are pointing at, but I'm not quite sure. Attached is my prediction.
Since I really just disassembled known working code here, how can there be such a severe fault? Did I mess something up while editing my variables? Seems quite unlikely to me..

Thanks in advance Smiley


Also nls coundet can only count til 255, so max is 0.25 ms
Setting to second will not achieve nothing

I never look to many in that code, I only know it count so fast. What doesen't have sense beacuse that schould be 10 ms routine
255*10MS=2.55 SECONDS
But I say I never had time to investigate what is happening
I made my own code and it count like it schould I can set ignition max 2.55 seconds

I completly forgot about it, shoud be 8bit then, so 255 is max? The 10ms come from how long it takes the Cpu to run one time through the main program and is dictated by the clock frequency i guess? Sorry, I'm really a beginner here.

I have custom code that only works for only the time the clutch is used.

Just to get that right, so your code is only executed while b_kuppl is true, so you save cpu load?
« Last Edit: September 09, 2022, 12:49:35 PM by SoerenDa » Logged
BlackT
Hero Member
*****

Karma: +79/-39
Offline Offline

Posts: 1422



« Reply #5 on: September 09, 2022, 11:36:41 PM »

There is a many solutions, in this level where youa re now I will do it like this
Don't use byte 386xxx to NLS counter.  You can use word...
FDDA   schould be free

Than you will run in other problems like ignition retard after shift, but leave that for later. Use this script to learn programing

10 ms is time CPU call that routine you are in, beacuse you hacked where tsrldyn is.
If you call your routine from lets say where zwgru is, it will be 1 ms.
There is no point for do that I only say this to get you better understand how ECU work
Logged
fknbrkn
Hero Member
*****

Karma: +177/-18
Offline Offline

Posts: 1402


mk4 1.8T AUM


« Reply #6 on: September 09, 2022, 11:56:08 PM »

Also nls coundet can only count til 255, so max is 0.25 ms
Setting to second will not achieve nothing

I never look to many in that code, I only know it count so fast. What doesen't have sense beacuse that schould be 10 ms routine
255*10MS=2.55 SECONDS
But I say I never had time to investigate what is happening
I made my own code and it count like it schould I can set ignition max 2.55 seconds

Nls counter are word. There is literally picture attached ))
I dont think zwgru is in 1ms raster also
Logged
fknbrkn
Hero Member
*****

Karma: +177/-18
Offline Offline

Posts: 1402


mk4 1.8T AUM


« Reply #7 on: September 10, 2022, 12:06:47 AM »

Thanks a lot for the kind words and the heads up!
I think I see what you are pointing at, but I'm not quite sure. Attached is my prediction.
Since I really just disassembled known working code here, how can there be such a severe fault? Did I mess something up while editing my variables? Seems quite unlikely to me..

Thanks in advance Smiley


I completly forgot about it, shoud be 8bit then, so 255 is max? The 10ms come from how long it takes the Cpu to run one time through the main program and is dictated by the clock frequency i guess? Sorry, I'm really a beginner here.

Just to get that right, so your code is only executed while b_kuppl is true, so you save cpu load?

Its just a non ideal old routine
Perfect for a learning how to make your own routines

Try to reset nls counter when !b_kuppl and also reset it when tsrldyn zeroed so it became an interval between ignition cuts.
Logged
BlackT
Hero Member
*****

Karma: +79/-39
Offline Offline

Posts: 1422



« Reply #8 on: September 10, 2022, 12:28:00 AM »

Nls counter are word. There is literally picture attached ))
I dont think zwgru is in 1ms raster also
Oh yes you are right, than only problem why it count to 255 is in this
movb NLS_COUNTER,  rl4

Changing that to
mov NLS_COUNTER, r4
Schould make it to count to 16 bit

Logged
prj
Hero Member
*****

Karma: +915/-428
Offline Offline

Posts: 5841


« Reply #9 on: September 15, 2022, 12:38:22 PM »

I think this counter is pretty stupid anyway.
I've done all the cars always with cutting ignition until clutch is released without any counters and it worked like a charm.
Actually it worked much better than with fixed value because if you are a little slow shifting then it's immediately much worse.
Logged

PM's will not be answered, so don't even try.
Log your car properly.
rogerius
Full Member
***

Karma: +61/-6
Offline Offline

Posts: 114


« Reply #10 on: September 16, 2022, 10:05:41 AM »

I think this counter is pretty stupid anyway.
I've done all the cars always with cutting ignition until clutch is released without any counters and it worked like a charm.
Actually it worked much better than with fixed value because if you are a little slow shifting then it's immediately much worse.
Excellent tip! Thanks
I will modify immediately my code.
Logged
SoerenDa
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


« Reply #11 on: September 21, 2022, 04:18:18 AM »

Hello again, sorry for not being able to respond for quite some time now, life got in the way.

I think this counter is pretty stupid anyway.
I've done all the cars always with cutting ignition until clutch is released without any counters and it worked like a charm.
Actually it worked much better than with fixed value because if you are a little slow shifting then it's immediately much worse.


I like this one, but unfortunately I think I am not able to compile my own functions by now. I have some c++ knowledge and it should be quite easy to write a routine for LC/NLS in C++, but I completely lack the knowledge how to compile it for c166 and integrate it in the Me7 properly. I pretty much just took the old code from the 551M files, learned about it in compiled form and changed the necessary places to the locations of my ecu. As I stated above I had some success, but not the full glory. After logging and scratching my head I started into learning how to disassemble it, which led me to the point I am at by now. I have a pretty hard time to understand why the code, which is working on so many files, will not work for me. The code is not ideal by any means, but I dont get why tsrldyn isn't zeroed for the time (even when max is 2.55s, which would be plenty) the clutch is pressed and the TPS is above the threshold. It's more like NLS counter is FF'd out from the beginning, which results in skipping the routine after one 10ms execution.

Mainly I try to understand what is different in my file from the other succesful implementations. Surely it is just my stupidity instead of anything beeing entirely different in my file.

Greetings,
Soeren
« Last Edit: September 21, 2022, 04:24:30 AM by SoerenDa » Logged
prj
Hero Member
*****

Karma: +915/-428
Offline Offline

Posts: 5841


« Reply #12 on: September 21, 2022, 04:41:45 AM »

I never ever used C compiler on C166.
Write asm and use the Keil assembler.

Or for simpler shit just write straight hex, C166 is really easy.
Logged

PM's will not be answered, so don't even try.
Log your car properly.
Pages: [1]
  Print  
 
Jump to:  

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