Pages: [1]
Author Topic: Community Project : MED91 5120 Hack - Development in Progress  (Read 1164 times)
elias
Full Member
***

Karma: +20/-3
Offline Offline

Posts: 65



I wanted to start a conversation regarding making that patch available. There are some people who did it already, however this information stays closed source and nobody is willing to share informations.

So i do share at least my research on that topic, which may or may not help someone to develop that patch. Maybe someone else will share some more informations.

All the informations which i cover apply to the 1K8907115F_0040 binary.

Lets start:
Generally speaking the Wastegate Duty Cycle is driven using a PID System. It takes certain parameters(refer to FR) and produces the duty cycle out of it. In Bosch Terms its called LDRPID.

If you inspect the A2L, you will notice that most variables related to the LDRPID like ps_w are scaling only to 2.5 bar.

One of the exceptions which you can find is the variable pvd_w which is scaling to 5 bar. Its explicitely written in the description("Wertebereich von 0...5120hPa" = values from 0-5120hpa").

pvd_w is "Pressure before throttle valve".

However this value is never used in LDRPID. LDRPID uses pvdkds_w. pvd_w is converted to pvdkds_w at some point in time. pvdkds_w is scaling only to 2.5 bar. Both pvd_w and pvdkds_w are uint16 datatypes.

So how does this scaling work? Lets make a example:
pvd_w(in RAM): 0xFFFF
pvd_w(as human readable value): 5 bar

pvdkds_w (in RAM): 0xFFFF
pvdkds_w (as human readable value): 2.5 bar

So after closer inspection of the code, i found the point where its getting converted. You can find that code in 0xca1a4:
"rlwinm     r6 ,r3 ,0x1 ,0xf ,0x1e"
what it basically does is: pvdkds_w = (pvd_w & 0xffff) << 1;
"Easier" said its: pvdkds_w = 2*pvd_w

So the first step to making that 5120 patch, is to remove the "multiply * 2" in the conversion to let it go up to 5 bar instead of 2.5 bar. However this is only the first step of the journey, as you will have to adjust all the maps in the LDRPID to make sure its working correctly. Some maps will need multiplying by 2, some will need dividing by two. I assume some other vars needs patches as well. One example is maybe fpvd_w, which has similar logic.

To remove the conversion you can use:
add        r6 ,r3 ,r0 instead the rlwim.
                           

Hope it will help someone one day. For now its too big as a task for me alone. Will report back if i get new informations.
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6034


« Reply #1 on: May 19, 2024, 11:55:18 PM »

LDRPID is only part of the problem, the bigger issue is that load will stop getting calculated correctly, there are more mods required.
If you don't need over 2 bar boost just fit 3 bar sensor and underscale, it works reasonably well enough.
Logged

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

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