NefMoto

Technical => Tuning => Topic started by: s5fourdoor on June 26, 2012, 12:02:02 PM



Title: rs4 decoding
Post by: s5fourdoor on June 26, 2012, 12:02:02 PM
for the last few weeks I've been trying to reverse engineer the rs4's characteristic features, comparing the k-box to the m-box.
the search overall has gone pretty well.  let me share some things i've found.  2.7t + k04's, this applies to you.

one of the big outstanding issues is that audi changed axis values.  as prj - and other's have noted, the 8-bit load variable restricts maximum load to 191.25 for the m-box.  what this means is that if you are running a m-box, you are going to have alot of trouble getting around that detail.

i took the easy route when trying to replicate the rs4's ecu:  be as unobtrusive as possible.

the maps you'll need may be more than what's shown here.

kfmirl - boost
kfmiop - torque
rlvmxn, rlvsmxn, kfmizufil - torque intervention disabling
kfldhbn - pressure limitations
kfldrq2, ldrq0s, ldrq0dy, kfldimx, kfldrl, ldrq1st  -   corrected PID calibration
kfped, kfwdksmx - pedal adjustments
tldoban, kfdluls - overboost kill and intervention disabling
kfdmdaro, kfdmdadp, kifzghg - [dashpot?]: complicated integrators from the torque model which cause nasty timing oscillations
kfzw1, kfzw2, kfzwop1, kfzwop2, kfzwmn, kfzwms:  timing tables




Title: Re: rs4 decoding
Post by: nyet on June 26, 2012, 12:04:35 PM
awesome start

add these to your list, btw (ARMD) :

KFDMDARO
KFDMDADP
KIFZGHG


Title: Re: rs4 decoding
Post by: nyet on June 26, 2012, 12:06:58 PM
humph. no axis data?

i can probably modify mapdump to dump these maps in a more useful format.



Title: Re: rs4 decoding
Post by: s5fourdoor on June 26, 2012, 12:09:51 PM
now for some progress talk.  the most difficult engineering issue i've come across relates to the timing curves and cam switching.
timing curves quite literally determine the progression of an engine under all circumstances.
going from idle to WOT, timing.
going from WOT to partial, timing.
going from partial to light throttle, all timing...    get where i'm going with this?
idle - i hope you dont' have idle timing issues... lmfao.

anyways, i took the KFZWOP, KFZWOP2, and KFNW maps and stitched together what ME7 actually sees, which we call ZWGRU[opt].
i did this for both the S4 and the RS4.  let's take a peek at those:



Title: Re: rs4 decoding
Post by: s5fourdoor on June 26, 2012, 12:10:41 PM
humph. no axis data?

i can probably modify mapdump to dump these maps in a more useful format.



axis values are all the m-box.      believe me i'm all for switching to the k-box though...


Title: Re: rs4 decoding
Post by: nyet on June 26, 2012, 12:15:44 PM
Those graphs look distinctly like timing curves for differing fuels...


Title: Re: rs4 decoding
Post by: nyet on June 26, 2012, 12:17:00 PM
Also, I almost forgot one of the most critical pid maps - KFLDRL


Title: Re: rs4 decoding
Post by: s5fourdoor on June 26, 2012, 12:20:35 PM
Those graphs look distinctly like timing curves for differing fuels...

my exact observation...


Title: Re: rs4 decoding
Post by: s5fourdoor on June 26, 2012, 12:24:43 PM
the biggest deduction i've reached thus far - after using the rs4 maps: the stock m-box timing is stupidly aggressive.  audi built the 2.7t k03 engine to be a torque monster, area under the curve, over-tech-mologied.  this does not work for the rs4 style turbos, nor bigger turbos.  let me show some evidence as seen on the iso-load timing plots.
this needs to be accounted for, and ideally calculated from a theoretically derived optimum.

please see the direct evidence posted here which shows that the stock m-box timing curves need massive changes.  believe me, i do not have the solution for this yet.  and further this is made much more difficult because of the two timing maps.  obviously you want any solution to use them correctly, like the oem would have done...


Title: Re: rs4 decoding
Post by: s5fourdoor on June 26, 2012, 12:27:46 PM
awesome start

add these to your list, btw (ARMD) :

KFDMDARO
KFDMDADP
KIFZGHG

gladly, can you recheck the spreadsheet to make sure the tables are to your liking?   i'm not sure the values are correct...


Title: Re: rs4 decoding
Post by: nyet on June 26, 2012, 12:41:23 PM
hmm for some reason axis data is still missing for me.

BTW i REALLY like where this is going!

About time somebody did this.


Title: Re: rs4 decoding
Post by: Rick on June 26, 2012, 01:27:05 PM
Of course M box timing needs massively changing for K04's!  Load is not restricted to 191 either in the M box.

It's irrelevant what you start with, you should tune for the application at hand.  C box, K box, M box, D box, they all end up with the same results once I've finished tuning them.

Rick


Title: Re: rs4 decoding
Post by: nyet on June 26, 2012, 01:55:10 PM
Of course M box timing needs massively changing for K04's!

I've done a WHOLE lot of adustments in high load/high rpm regions, but not so much elsewhere.

Got any advice to give for those non-WOT areas?


Title: Re: rs4 decoding
Post by: prj on June 27, 2012, 05:40:01 AM
Yeah, load is not restricted to 8 bit in any of these.
What is restricted to 8 bit are the *axes* on most important maps in the M-Box.

In the K-Box, all those axes are 16 bit, and you can rescale timing etc properly, not just run everything higher than 190 load off of the 190 load column.


Title: Re: rs4 decoding
Post by: s5fourdoor on June 27, 2012, 09:27:00 AM
Yeah, load is not restricted to 8 bit in any of these.
What is restricted to 8 bit are the *axes* on most important maps in the M-Box.

In the K-Box, all those axes are 16 bit, and you can rescale timing etc properly, not just run everything higher than 190 load off of the 190 load column.
We need to accelerate the community switching to this...


Title: Re: rs4 decoding
Post by: nyet on June 27, 2012, 09:47:28 AM
i just need to get a kbox kp together using prj's conversion as a base


Title: Re: rs4 decoding
Post by: s5fourdoor on June 27, 2012, 10:47:37 AM
Is this seriously all?  Obviously MLHFM+MLOFS+KRKTE+TVUB would need immediate adjustment for base startup, right?
Other than that, is there anything risky?  It seems very straightforward.  Ohh, we'd need to publish an XDF which has the modified launch control, right?  So that will need porting as well...


Title: Re: rs4 decoding
Post by: nyet on June 27, 2012, 10:53:04 AM
yea basically.

i am not currently using launch control so that part doesn't worry me :)


Title: Re: rs4 decoding
Post by: s5fourdoor on June 27, 2012, 11:51:25 AM
the grind continues...


Title: Re: rs4 decoding
Post by: s5fourdoor on July 07, 2012, 06:08:23 PM
Large update to follow: RS4 ignition timing successfully reverse-engineered.


Title: Re: rs4 decoding
Post by: s5fourdoor on July 08, 2012, 02:51:51 PM
Using MATLAB, I did a fine-grained linear interpolation for both the S4 and RS4 KFZW/OP tables.
Please let me be very clear about this.  I used a technique known as blending to jump over the Variable KFNW issue.
This means the following for the high-level executive thinkers here:
    On one end of the spectrum I had the correctly interpolated RS-4 tables.
    On the other end I had the S-4 tables.

To the RS-4 tables I associated a value Lambda, to which the (1-Lambda) residual from the S4 was added to create the tables.
Audi knew what they were doing.  They run much lower timing during sub-50% load situations.  This isn't to be ignored.
Please note that the lambdas are 1.00 in idle-to-low throttle situations...

If you guys want a different table, with different lambda values, don't spit venom at me.
Tell me what you want and i'll input this into my routine and give you the results.
I chose these lambdas to be conservative because the RS4 has different compression, rods, and heads...
TBH, there probably isn't too much risk to run Lambda 1.0, perhaps somebody will volunteer to do some logs?
The methodology used to chose these Lambda's focused on where in the maps I thought the K03's / K04's were active.
[We can diverge on this more, but I think it's OT to get into more detail.]

Load       Lambda
9.75           1.0
18.00           1.0
27.00           1.0
39.00           0.8
50.25           0.6
62.25           0.4
74.25           0.4
97.50           0.4
120.75       0.4
144.75       0.4
168.00       0.6
191.25   0.8

This applies to KFZW1 / KFZW2 / KFZWOP1 / KFZWOP2.  Leave KFNW and KFNWWL alone.  [For now.]
For KFZWMS and KFZWMN straight RS-4 tables were used as input, rather than a blending.

I HAVE NOT FULLY TESTED THESE TABLES YET.  You are an alpha tester just like me and are at your own risk.
Please see the original download for the updated attachment.



Title: Re: rs4 decoding
Post by: prj on July 09, 2012, 03:27:53 AM
You are making some sort of mistake.
0.4 is well below rich limit.

That's 5.9 AFR...

P.S.
I don't see the point in over-analyzing this. Just use RS4 software. Trying to port it to M-Box is dumb.


Title: Re: rs4 decoding
Post by: s5fourdoor on July 09, 2012, 07:38:41 AM
You are making some sort of mistake.
0.4 is well below rich limit.

That's 5.9 AFR...

P.S.
I don't see the point in over-analyzing this. Just use RS4 software. Trying to port it to M-Box is dumb.

I should not have used the term lambda.  I should have used the term blending-factor.
Yes, everyone is more than excited to switch the new ecu-box, but nobody has tried it to my knowledge.


Title: Re: rs4 decoding
Post by: prj on July 09, 2012, 08:11:32 AM
Works just fine on my car, added NLS to it etc.


Title: Re: rs4 decoding
Post by: s5fourdoor on July 09, 2012, 09:26:12 AM
Can you provide more details?
Was your car originally a M-box?  What tables did you change from the stock box?
Is this the XDF you posted a few weeks ago...?


Title: Re: rs4 decoding
Post by: prj on July 09, 2012, 02:52:40 PM
Yes, it's the XDF I posted, I continued working on it and found the needed parameters that were missing.

My car is originally K-Box, but M-Box to K-Box needs 95040 flash and immo delete AFAIK.


Title: Re: rs4 decoding
Post by: phila_dot on July 09, 2012, 03:28:13 PM
I would expect alot of changes would be required to account for the differences in the engine.


Title: Re: rs4 decoding
Post by: s5fourdoor on July 09, 2012, 03:37:31 PM
I would expect alot of changes would be required to account for the differences in the engine.

my reservations exactly...


Title: Re: rs4 decoding
Post by: prj on July 09, 2012, 03:45:04 PM
Not really.
Only specific thing is oil temp based rev limiter, but that can be easily fixed by setting to the same value across the table.

Just set KRKTE and MAF correctly, and it'll work just fine. You guys are way overcomplicating these things. Mass-flow systems adapt really well, and the changes in VE between RS4 and S4 are not THAT big anyway.

It's still all about conditions for certain cylinder filling and the engines are close enough.


Title: Re: rs4 decoding
Post by: nyet on July 09, 2012, 03:55:27 PM
Considering the amount of time i've wasted copying F box PID stuff to my base mbox k04 file, i'd say using k-box as a starting platform would be a great idea.

I just need to get prj's xdf into a usable (pared down, english, foldered) .kp


Title: Re: rs4 decoding
Post by: jibberjive on July 17, 2012, 04:23:54 PM
Awesome thread.  I stumbled by this, and I'm glad I did!

the most difficult engineering issue i've come across relates to the timing curves and cam switching.
Yeah, one night I set off to learn what I could from the RS4 cam switching to try to apply the RS4 stuff to my big port head and RS4 cam-like setup, and I found out that we can't really interpolate, or even correlate really, values for the cam switching maps from the RS4 to the S4. 

Where the S4 pretty much uses:

KFNW
KFNWWL
 

The RS4 has all sorts of maps, and obviously a scheme of how they all work together (around pg 809 in the FR):

KFNWWLE   Cold engine
KFNWSE   Hot engine
KFNWKRE   Knocking
KFNWWLLE   B2 cold engine
KFNWLLE   B2 warm engine
KFNWKHE   Cat heating
KFNWKHLLE   Map for cam spread in cat heating on B2



Title: Re: rs4 decoding
Post by: s5fourdoor on July 17, 2012, 06:18:45 PM
Absolutely right.  There's a totally different system on the RS4 which is noticeably more complicated.  I tried to just stick to the easiest route, after which I just modified the expected ZWGRU switchover points, so nothing looked crazy abrupt.


Title: Re: rs4 decoding
Post by: jibberjive on July 24, 2012, 06:58:58 AM
I would expect alot of changes would be required to account for the differences in the engine.
When I first thought of this, I was worried about that too (regarding changes in VE due to cams, compression ratio, heads, etc), but then I thought about all of the big turbo tuner APB cars that have engine mods such as 3.0 engines running big port heads, 8.7-9.3 compression ratio, all running really well on the modified stock m-box code (meant for small port 2.7 with 9.3 CR and tame cams).  Other than maybe a few tweaks like the oil temp thing listed here, I think the K-box code would be adaptable and work very well, even on a stock APB engined (or whatever) car. Just my feeling about it.

My car is originally K-Box, but M-Box to K-Box needs 95040 flash and immo delete AFAIK.
Do you by chance have the dump from a K-box 95040 saved that you can share?

Considering the amount of time i've wasted copying F box PID stuff to my base mbox k04 file, i'd say using k-box as a starting platform would be a great idea.

I just need to get prj's xdf into a usable (pared down, english, foldered) .kp

I don't want to duplicate work, but let's divide and conquer this thing, if possible.  Let me know if/how I can help aid the work in transitioning over to a K-box.

If I can find a k-box 95040 file, I'll probably try getting this at least running on my currently M-box S4 soon.


Title: Re: rs4 decoding
Post by: nyet on July 24, 2012, 08:12:17 AM
Welp, I'm super busy so I don't really have time to commit to this effort anyway.

The best thing would be to simply take the current .kp and make a k-box kp out of it :)

work your way down the list...

IF i have time, i'll work my way UP the list :)


Title: Re: rs4 decoding
Post by: jibberjive on July 24, 2012, 12:48:38 PM
Welp, I'm super busy so I don't really have time to commit to this effort anyway.

The best thing would be to simply take the current .kp and make a k-box kp out of it :)

work your way down the list...

IF i have time, i'll work my way UP the list :)
That would be done by taking the current m-box .kp (can you link me to it? I only have the one from 3/28/2011.) and hand editing every map to put in the addresses that are shown in the K-box XDF?  Why would we go from an XDF, to a .kp by hand, to port it back to an XDF?  I wouldn't be surprised if there's something I'm not getting.


Title: Re: rs4 decoding
Post by: nyet on July 24, 2012, 12:56:57 PM
Because many people find winols to be a better tool than tunerpro.

If all we wanted was a pretty xdf, I could actually automatically convert the m-box xdf to k-box using the prj's defs (using mesim), but it would take work.

Alternately, I could take prj's xdf and filter out the maps NOT in my xdf ... also automated..



Title: Re: rs4 decoding
Post by: jibberjive on July 24, 2012, 01:19:16 PM
Ah, I was assuming a nice, full XDF was the end goal, not a .kp.  I personally prefer the ease of use of tunerpro for the tuning aspect, so a nice XDF would probably be my main goal.  Since you've got automated tools and skills that render any of my possible contributions obsolete (with regards to developing the definition files), I'll probably not spend 10's of hours of doing something that would likely be done in minutes by you ha.

For now, I've got enough definitions to get me started, so I think this will be my personal game plan:

1. Search for a K-box 95040 dump.
2. While searching for a K-box 95040 dump, I'll modify a stock K-box bin with my fueling/MAF stuff and flash it onto an ECU with an M-box 95040, to see if the K-box 95040 is necessary and to try to get the tune at least running on the car.
3. Once running, I'll add maps into the XDF as I need them (and as I'm able to find them), and try to start incorporating one-by-one the different tweaks from my current M-box tune.


That's my tentative plan of attack anyways.


Title: Re: rs4 decoding
Post by: prj on July 24, 2012, 02:07:06 PM
I'll pull the 95040 off of my car for you, but it won't happen until 6th of August.


Title: Re: rs4 decoding
Post by: jibberjive on July 24, 2012, 02:31:14 PM
I'll pull the 95040 off of my car for you, but it won't happen until 6th of August.
Thanks for you help!


Title: Re: rs4 decoding
Post by: nyet on July 24, 2012, 02:32:16 PM
That would be done by taking the current m-box .kp (can you link me to it? I only have the one from 3/28/2011.)

http://nyet.org/cars/files/


Title: Re: rs4 decoding
Post by: RS4boost on July 24, 2012, 02:44:25 PM
Hi guys,

I have uploaded my complete 551K .kp and .ols file with more than 3.300 maps and values here:

http://nefariousmotorsports.com/forum/index.php?topic=2306.0title=

Have fun and I hope you like it...

regards

Thomas


Title: Re: rs4 decoding
Post by: nyet on July 24, 2012, 02:57:03 PM
WOW excellent! I will take a peek time permitting.


Title: Re: rs4 decoding
Post by: jibberjive on July 24, 2012, 03:19:14 PM
Killer post Thomas!


Title: Re: rs4 decoding
Post by: jibberjive on July 24, 2012, 03:22:55 PM
Thomas just uploaded the K-box RS4 EEPROM flash as well, here:

http://nefariousmotorsports.com/forum/index.php?topic=2308.0title=


Looks like we just made the switch to K-box ;D


Title: Re: rs4 decoding
Post by: RS4boost on July 24, 2012, 03:26:08 PM
Killer post Thomas!

Thanks,

I hope I could help a little.


Title: Re: rs4 decoding
Post by: S3driver on July 24, 2012, 03:29:55 PM
Great job man  :) :) :)


Title: Re: rs4 decoding
Post by: Rick on July 25, 2012, 09:19:45 AM
i really really dont  see the point of this.  I tune a LOT of these and the end result is no different from ECU to ECU.  Spend your time tuning, not trying to flash different images!


Title: Re: rs4 decoding
Post by: s5fourdoor on July 25, 2012, 10:53:38 AM
Are the K and Q box EEPROM's the same thing?  Do we have the Q-box EEPROM as well or does it not even matter?
There's a ME7 95040 EEPROM programmer, let me check if that can be generally used.


Title: Re: rs4 decoding
Post by: RS4boost on July 25, 2012, 12:48:25 PM
Are the K and Q box EEPROM's the same thing?  Do we have the Q-box EEPROM as well or does it not even matter?
There's a ME7 95040 EEPROM programmer, let me check if that can be generally used.

Hi,

EEPROM data structure from 551K and 551Q are alsolutly equal.

The only differents between both dumps is the ECU coding and the car specific entrys FIN, WFS and login code.

ECU coding for european RS4 with 551K with "Euro 4 norm" (with cat, rear O2 sensors and SLS), is 10711.
For the japanese RS4 551Q box it is 5711 without cat...

So it is also coded in flash variable VARDEF "Default Variante für Variantencodierung" at 155D6.

The posted 551K EEPROM is read with ArgDub`s "ME7_95040 - EEPROM programmer".
So we know it works fine. ;)

Regards Thomas


Title: Re: rs4 decoding
Post by: prj on July 25, 2012, 01:11:02 PM
i really really dont  see the point of this.  I tune a LOT of these and the end result is no different from ECU to ECU.  Spend your time tuning, not trying to flash different images!

Very simple, in K-box a lot of the LOAD axes are rescaled to 16 bit, so it is possible to tune this file properly without underscaling load even on high power output cars.
This is not true for any other 2.7T image.


Title: Re: rs4 decoding
Post by: jibberjive on July 26, 2012, 10:13:05 AM
i really really dont  see the point of this.  I tune a LOT of these and the end result is no different from ECU to ECU.  Spend your time tuning, not trying to flash different images!
Along with the 16bit load axes, there are alot of other parameters that stock on the RS4 are closer to where we would modify our S4 files to (like ARMD, stage 3 boost PID, etc).  And not everyone modifies all ranges of all of the tuning maps (like every section on timing maps), so the RS4 stock values are likely a better value than the stock K03 ECU's for us bigger turbo guys.  That being said, I personally was looking for an excuse to start from scratch and make my modifications one at a time, so the switch to the K-box does that for me.  If I had a completely ironed out tune with no intended changes for the future, I probably wouldn't bother with switching.

I'm curious how my load notch will look with the RS4 as a base (see this thread for reference http://nefariousmotorsports.com/forum/index.php?topic=1848.0 ).  It will be cool if using the RS4 box as a base takes care of that for me, saving me the time of tinkering with it on my M-box.


Title: Re: rs4 decoding
Post by: s5fourdoor on July 26, 2012, 11:04:42 AM
i really really dont  see the point of this.  I tune a LOT of these and the end result is no different from ECU to ECU.  Spend your time tuning, not trying to flash different images!

the axis limitations are pretty annoying man.  i don't care what type of tuning you do, it may be good.  for me if i can't get precision in my operations, i fall apart.  call that a criticism or a weakness, idc, i manage that and play my strengths.  anyways why do you even care?  do you really think we are wasting our time with this concept?  why?  be constructive.


Title: Re: rs4 decoding
Post by: prj on July 26, 2012, 01:16:30 PM
jibberjive, to mostly remove the notch, the last column of KFPBRKNW and KFPBRK should be set to equal values.


Title: Re: rs4 decoding
Post by: jibberjive on July 26, 2012, 01:53:52 PM
jibberjive, to mostly remove the notch, the last column of KFPBRKNW and KFPBRK should be set to equal values.
Thanks for the info.  I'll see if I still have it with the K-box, and if so, this gives me something to try.  Thanks.


Title: Re: rs4 decoding
Post by: prj on July 26, 2012, 03:07:02 PM
You will have it.