NefMoto

Technical => Tuning => Topic started by: IWay on February 01, 2021, 05:31:18 AM



Title: 5120 hack clarifications
Post by: IWay on February 01, 2021, 05:31:18 AM
Hello all,

I’ve got the 5120 Hack to work on 8N0906018H 0004, but still have the general questions below;

-   What exactly are the ASM edits achieving, if we are scaling the required elements in the config, why are we needing to edit the code? Also if we are editing the code why is it not
        possible to edit the 2560mBar limit to a greater value? Resolved see further down trail

-   How do the VCDS edits work, is it just a report x 2 edit or something else? Resolved see further down trail

-   4Bar MAP sensor values, using the attached pdf I come out with; Resolved see further down trail

        Min Pressure   50   Min Voltage   0.3           
        Max Pressure   400   Max Voltage   4.7           
                        
        DSLGRAD =   79.54545       For 5120 Hack divide by 2 =   39.77273
        DSLOFS =           26.13636       For 5120 Hack divide by 2 =   13.06818

        Yet when using these values the car doesn’t go very well, they are clearly wrong.

        How are the DSLGRAD / DSLOFS of 437.5 / 31.25 values arrived at using the below formulas and specification PDF?
 
        DSLGRAD = (MAXPRESSURE - MINPRESSURE) / (MAXVOLTAGE - MINVOLTAGE) = xxx.x
        DSLOFS = MAXPRESSURE - (DSLGRAD * MAXVOLTAGE) = xx.xxx

In the log & bin attached I’m limiting the boost via KFLDRL, while testing, which explains the squirmy boost profile.

Thanks


Title: Re: 5120 hack clarifications
Post by: zamzu on February 01, 2021, 05:42:43 AM
You write here a formula, but cannot calculate?

You have your "." at wrong place, pressure is not 50 & 400


Title: Re: 5120 hack clarifications
Post by: IWay on February 01, 2021, 05:58:28 AM
Am I reading the PDF wrong?

Using values from PDF;

DSLGRAD = (400KPa – 50KPa) / (4.7V – 0.3V) = 79.54    5120 hack /2 = 39.77
DSLOFS   =         400KPa - (79.54 * 4.7V)     = 26.13    5120 hack /2 = 13.06

Even using mBar it still comes out different from the established working values?

Min Pressure   500   Min Voltage   0.3         
Max Pressure   4000   Max Voltage   4.7         
                  
                  
                  
DSLGRAD =   795.4545455      For 5120 Hack divide by 2 =         397.7272727
DSLOFS =   261.3636364      For 5120 Hack divide by 2 =         130.6818182

How are people getting the below from the PDF?

Min Pressure   420   Min Voltage   0.4
Max Pressure   4100   Max Voltage   4.646

PS

Any thoughts on the other points?



Title: Re: 5120 hack clarifications
Post by: zamzu on February 01, 2021, 06:12:54 AM
You use mBar and 0,5/4,5 volt


Title: Re: 5120 hack clarifications
Post by: IWay on February 01, 2021, 07:10:46 AM
Ahh,

I get it, you use the graph on the right hand side of the PDF not the table on the left, would have been easier if I could speak German (the whole thing would be easier if I could speak German).

Thanks


Title: Re: 5120 hack clarifications
Post by: zamzu on February 01, 2021, 07:38:58 AM
This is also covered in s4wiki in pure english.


Title: Re: 5120 hack clarifications
Post by: sonflasch on February 09, 2021, 11:30:28 PM
 -> What exactly are the ASM edits achieving, if we are scaling the required elements in the config, why are we needing to edit the code? Also if we are editing the code why is it not
possible to edit the 2560mBar limit to a greater value?

= you give the ECU for example 500mbar corresponds to 1000mbar Otherwise higher processing is not possible.  (ASM changes are inevitable)
disadvantageous you change the resolution a little bit ,

from ori ECU files:
DSLGRAD
stock map->541.00
3bar map ->658.81
4bar map ->875 

DSLOFS
stock map-> -16.41
3bar map -> -63.52
4bar map -> 62.5


->   How do the VCDS edits work, is it just a report x 2 edit or something else?
= yes the formula has to be edited, similar to edc15 16 only that you have to do it in code

 


Title: Re: 5120 hack clarifications
Post by: IWay on February 10, 2021, 04:06:27 AM
= you give the ECU for example 500mbar corresponds to 1000mbar Otherwise higher processing is not possible.  (ASM changes are inevitable)
disadvantageous you change the resolution from 10mbar to 20mbar ,

I understand the principle, I was asking what are the ASM edits specifically changing and asking why the 2560mBar limit can't be edited in the ASM thus avoiding the whole 5120 hack?

Is there something in the ROM which prevents a simple edit in the EPROM, if not I can't see why an edit of the EPROM code wouldn't lift the 2560mBar limit?

Thanks for your answer on the VCDS edits.


Title: Re: 5120 hack clarifications
Post by: nyet on February 10, 2021, 01:37:57 PM
why the 2560mBar limit can't be edited in the ASM

You completely misunderstand the nature of the limit.


Title: Re: 5120 hack clarifications
Post by: IWay on February 11, 2021, 01:51:29 AM
Enlighten me


Title: Re: 5120 hack clarifications
Post by: prj on February 11, 2021, 01:58:46 AM
Enlighten me
How about enlighten yourself with the info that's been posted on here time and time again.


Title: Re: 5120 hack clarifications
Post by: IWay on February 11, 2021, 02:57:09 AM
I'm not expecting to be spoon fed.

I was expecting a look here https://........ response.

Tried looking through the posts but can't find the required information.

Please send a link so I can enlighten myself.

Thanks


Title: Re: 5120 hack clarifications
Post by: IWay on February 11, 2021, 04:16:30 AM
Somone pointed me in the right direction.

Without compling the whole thing you can't just use two registers next to each other to store a number larger 255.

If you were just to use 0.1*255 instead of 0.01*255 to represent boost, the resolustion would go down to 100mBar.



Title: Re: 5120 hack clarifications
Post by: nyet on February 11, 2021, 12:43:16 PM
Somone pointed me in the right direction.

Without compling the whole thing you can't just use two registers next to each other to store a number larger 255.
If you were just to use 0.1*255 instead of 0.01*255 to represent boost, the resolustion would go down to 100mBar


A register is 16 bits not 8.

ps_w and rl_w are 16 bit quantities.



Title: Re: 5120 hack clarifications
Post by: IWay on February 12, 2021, 02:39:48 AM
Lost me now, if it's 16 Bit a value of 65536 can be stored.

Where is 2560 limit comming from?


Title: Re: 5120 hack clarifications
Post by: nyet on February 12, 2021, 01:18:21 PM
Code:
0054, 00, ps_w                , 0, {mbar    }, 0, 0, 0.0390625,      0, {Saugrohr-Absolutdruck (Word)}

From s4wiki page
Quote
Absolute maximum measured boost is 0xffff/25.6 = 2559.96 mBar (DSLOFS = 0), and 2543.55 mBar (DSLOFS=-16.40646)

1*10/256 = ?


Title: Re: 5120 hack clarifications
Post by: IWay on February 15, 2021, 05:20:13 AM
Thanks for your patience on this, but you might have to spell it out.

I can see the relationship between the numbers, but I'm failing to see where the limit is encountered other than in the code.

If the limit is in the code can't we just change the code to;

0054, 00, ps_w                , 0, {mbar    }, 0, 0, 0.078125,      0, {Saugrohr-Absolutdruck (Word)}

IE

0xffff/12.8 = 5119.92 mBar

Or Am I completely missing something?


Title: Re: 5120 hack clarifications
Post by: nyet on February 15, 2021, 03:00:13 PM
Thanks for your patience on this, but you might have to spell it out.

I can see the relationship between the numbers, but I'm failing to see where the limit is encountered other than in the code.

If the limit is in the code can't we just change the code to;

0054, 00, ps_w                , 0, {mbar    }, 0, 0, 0.078125,      0, {Saugrohr-Absolutdruck (Word)}

IE

0xffff/12.8 = 5119.92 mBar

Or Am I completely missing something?


That's not the code. That is just the logger translating what it is logging into a human readable format.


Title: Re: 5120 hack clarifications
Post by: IWay on February 16, 2021, 02:58:37 AM
Sorry,

Just not getting it,

16 Bit = unsigned 65K numbers, signed 32k positive & 32K negative.

Did notice that 2559.96 x 0.039063 = 99.999, so the presure range is represented by 0 to 100 decimal?updated post, This is wrong, pressure range not represented by 0 to 100 decimal

Sure once it's spelt out I'll go AHH, that's obvious or that's strange who thought of doing it that way!


Title: Re: 5120 hack clarifications
Post by: nyet on February 16, 2021, 06:17:15 PM
If the limit is in the code can't we just change the code to;

0054, 00, ps_w                , 0, {mbar    }, 0, 0, 0.078125,      0, {Saugrohr-Absolutdruck (Word)}

This is literally what the 5120 hack does. It modifies the ECU so that is true. Unless you follow exactly every bit of ASM change recommended, you are not doing what you just asked.


Title: Re: 5120 hack clarifications
Post by: IWay on February 17, 2021, 02:30:19 AM
Think I'm getting it now;

65535 x 0.039063 = 25.6

So 1mBar = 25.6 units in the code.

So the developers decided that they would use 25.6, not 12.8, 51.2 or some other number to factor the mBar value?

Strange why not just use 1 to 1??

IE, it’s a code limit not a hardware limit.

The term “hard limit”, is what has been throwing me, was beginning to think that there was some smoke & mirrors going on.

So we are changing the code to scale, 1mBar = 12.8 units in the code.

Then we are doubling or halving the maps as required to accommodate the higher possible mBar value.

So it could be called the 12.8 hack!

Please tell me the above is correct or it will be time to sit in the corner & start rocking back and forth.

Thanks

PS
I’ve got it working a treat.


Title: Re: 5120 hack clarifications
Post by: nyet on February 17, 2021, 03:21:10 AM
Nope now you've got it.


Title: Re: 5120 hack clarifications
Post by: IWay on February 17, 2021, 04:10:26 AM
Cool,

Stlll strange they didn't use 1 to 1?


Title: Re: 5120 hack clarifications
Post by: nyet on February 17, 2021, 01:22:21 PM
Cool,

Stlll strange they didn't use 1 to 1?

That would be pretty terrible resolution and would completely confuse the PID due to quantization error


Title: Re: 5120 hack clarifications
Post by: prj on February 17, 2021, 01:56:42 PM
Diesel uses 1:1 in mbar and has no issue. 1:1 is just fine.
These sensors are not even specified to that precision.

It's done like this for no particular reason whatsoever.


Title: Re: 5120 hack clarifications
Post by: IWay on February 18, 2021, 02:00:42 AM

It's probably a hangover from something previous, I've seen it before from developers.

The developer thought process goes, "if it works why change it and it's quicker to use something that's already there and working than start again"

Probably got it from some industrial or scientific process that needs the extra accuracy, Bosch do all sorts of things.

Or they just did it to be awkward ;)


Title: Re: 5120 hack clarifications
Post by: nyet on February 18, 2021, 02:11:27 AM
yah it is sort of arbitrary, but there are only a few commonly used 16 bit scales in ME7, i guess they picked the one that was easiest to use.

Very few 16 bit values are 1:1 (are there any actually? I should go look) , since presumably engineers all think they need float ability, though ya, if it was Bar it would make sense, but mBar?

interesting discussion.


Title: Re: 5120 hack clarifications
Post by: d3irb on February 18, 2021, 07:56:33 AM
Remember as we start trying to infer "what were the developers thinking" (which is half the fun of RE!) that a lot of model code is codegen, not hand-written (more and more so as we reach newer ECUs).

So the decision to use this arbitrary-seeming precision, even back in the ME7 days, just as well may have been driven by which value types easily or natively plugged into some block or another in whatever modelgen software was in use - I think for ME7 this was probably ASCET, more modern stuff is moving more and more to Simulink.


Title: Re: 5120 hack clarifications
Post by: prj on February 18, 2021, 10:55:18 AM
Up until MED17 the C code was written mostly by hand.

At end of MED17 and with MG1, everything is autogen.


Title: Re: 5120 hack clarifications
Post by: IWay on February 19, 2021, 02:26:05 AM
Autogen!

I know how this ends, I've seen Terminator and Dark Star :D


Title: Re: 5120 hack clarifications
Post by: Imho on August 23, 2024, 01:26:03 PM
Hi,
I recently moved from 3bar map to 4bar sensor (281.006.059).
calculated values for DSLOFS=31.7 and DSLGRAD=437
with those car drives ok, afr is fine and  actual pressure seems to match my boost guage but the desired pressues  (plsol) is 700mbar at idle and much lower than my actual request in log.
having 400mbar+ difference for actual vs desired does not trigger throttle cut so its only logging issue... ?
 


Title: Re: 5120 hack clarifications
Post by: prj on August 24, 2024, 01:52:05 AM
plsol is irrelevant on idle.


Title: Re: 5120 hack clarifications
Post by: Imho on August 25, 2024, 02:37:51 AM
plsol is irrelevant on idle.

ok but desired pressure is also wrong with WOT - again no throttle cut even with 400mbar difference - should i log something else than plsol ?

Edit
need to fix my statement actualpressure is wrong as well ;)