Tuning w/ N20 TMAP to see 22+ Boost

shushikiary

Sergeant
Jun 4, 2018
304
173
0
Ride
335xi
Found something interesting.

If I turn the ignition on before I start the car, I get the code, but if I go straight from key insert to start without first turning the ignition on, then I dont get the code. Normally I turn the ignition on before starting the car to let the fuel pumps prime the line (the enable on my controller is tied to ignition, but the BMW normally turns the fuel pumps on when you unlock the car to do the same (without the ignition on, but with my custom LPFP setup it doesnt)).
 
Last edited:

impuls

Specialist
Jan 28, 2018
92
60
0
Ride
'07 335i
Better don't rely on that spreadsheet...
My car was targeting 28 instead of the planned 24 PSI.
Will remove this notice once I found the problem and confirmed it to work.


Tried to create a spreadsheet to help with scaling tables.

Just enter the values used in the 3 cell Map Conversion table in "Map Conversion" sheet.
On the same sheet you can get scaled Load values for PSI / Load you enter.

To rescale a table with Load on X Axis, Copy&Paste the table values and the Load values into "Base Table".
"Map Conversion Adjusted" will contain values according to what you configured in "Map Conversion".
Adjusted values will be a linear interpolation, if your scaled load values lie far outside of the original table that will not be a very good guess.

"Manual Adjusted" can e used to interpolate values when adjusting an axis manually.


Could someone also confirm that important tables that need to be scaled are:
-Load Target *
-Fuel (Bank 1/2)
-Fuel Scalar
-Timing (Main)
-Timing (Spool)
-Timing (Fail Safe)
-Timing (Unk Throttled)
-Timing (Unk Emergency Limp)
-Load Target Limit Factor ( Charge Air Temp)
-Vanos *

I guess it is safe to ignore:
-Load to Torque Limit *
-Torque Loss
 

Attachments

  • table_scaling.xlsx
    196.8 KB · Views: 353
Last edited:
  • Like
Reactions: Jeffman

impuls

Specialist
Jan 28, 2018
92
60
0
Ride
'07 335i
Don't forget Load2Torque, BRO, and PID tables as well
Thanks for pointing me to those tables.

The Load to Torque Limit tables are just used to calculate the torque DME will see based on load as far as I know. Am I missing something?
If that's all those table do I will probably report a bit lower values above 140 load, guess no big deal but I guess I will just fix them.

Boost request offset, not sure. Why adjust it?
X-Axis is intake cam spread no load, but probably there are other reasons to adjust it?

Where you referring to the WGDC PID tables?
I rescaled boot setpoint already, but I think I will have to do some manual rework due to the scaled MAF Req.
Guess it would be better to use WGDC (RPM x Boost Setpoint) to avoid building a base table based on somehow skewed MAF Req values.

Whats really confusing and scaring me right now is that I once saw a boost request of 28 with a load request of about 190.
I have few other WOT logs showing boost target at ~24 PSI with a load request at ~190 so I am not sue what to think about it.

According to my math I am targeting 24 PSI , but maybe my math is flawed?
Would be really appreciated if someone could double check.

That's my Map Conversion:

upload_2018-10-11_21-21-19.png


I am targeting a load of 196 that should make the DME target ~18.8 PSI (unscaled).
18.8 PSI are mapped to ~3,5 V which equals to ~24 PSI with the N20 TMAP.
See yellow line below.

upload_2018-10-11_21-28-27.png
 
  • Like
Reactions: Jeffman

shushikiary

Sergeant
Jun 4, 2018
304
173
0
Ride
335xi
Because of the compressed scaling changes in boost request get exaggerated, what used to be a change from say 20 PSI to 18.5 PSI is now a much larger change in actual boost request.

Based on a ton of factors (IAT, coolant temp, barro pressure, etc) the requested boost to meet a load changes. At altitude in my car before going hybrids and N20, I'd see a change in boost request from 23 PSI for 210 load on hot days with an IAT in the 120's to 17.5 PSI with an IAT of -8 on a very cold day. That swing would be HUGE with the compressed scale. Thankfully we are tricking the ECU into thinking its operating in a much lower load area and thus the swing is not as bad as it is at 210 load, but its still large.

With the N20 and my hybrids I've seen 28 PSI boost request on stupid hot days with 120 IAT, and down to 23 PSI with a 30 deg IAT on cold days with a 185 load request.

I'm not sure there is an easy way to make that range be smaller. I do know that having your WGDC base table properly scaled for the MAF you're requesting and the boost setpoint factor will make it easier to hit those wider range targets with base WGDC, but at the same time, do you want to?

For my self, I don't want to boost up to 28 PSI when its really hot out, its too much WGDC on the turbo's at altitude. At the same time I would like to hit 26 PSI when its 90 IAT, and I'd like to stay at 24 or so for 40, and then lower when its even colder. This means that for the same WGDC base to hit 26 PSI its likely I'll get throttle closures in the cold (and I do).

The way to fix this in my opinion, is the proper WGDC table scaling, as well as making the P and I negative error spots more aggressive, as well as the d factor to help prevent overshoot, and relaxing on the throttle closure aggression table. I don't want to however change the positive error to be more aggressive because I don't want to try to push my WGDC too high in the silly high boost request times. One could argue I should do this by limiting the max WGDC, but that would then cause that same limit to apply to spool in low RPM unless you're using lean spool mode. So another way to deal with it would be to limit the WGDC max, then use lean spool. One has to be careful though because when in lean spool at low RPM you could hit way more boost than you want if your boost request is too high, so proper load targeting at low RPM is important when using lean spool.

If there is a way to help even out such a wide variance in requested boost, I'd love to know more about it.
 
  • Like
Reactions: Jeffman

RSL

Lieutenant
Aug 11, 2017
937
501
0
That seems like a big swing on a non-scaled map. I've had 100F+ IAT differences between summer and winter with maybe a 1psi difference on scaled maps with hybrids. I'd be curious how much the ambient pressure changed between your target differences. It may be a larger factor for target than any temp. My ambient remained relatively stable around 14.2psi +/- 0.1 whether it was 25F or 110F outside.

If target has room to move up and is allowed to, it certainly will as the DME sees fit. That doesn't mean actual has to follow it up closely past a certain point, just depends how things are setup. You could certainly hold actual at 10psi with a 30psi target if you wanted without any limit table or it ever touching negative errors. Not saying you wouldn't run into other issues with a gap that big, just that WGDC as-is can be used to set a more or less max %/actual whether target is 0.1 or 20psi above it. Other option is to make sure target can't go higher than the absolute max boost you want and allow +/- errors to trim it as you see fit relative to it.

Almost seems easier to setup 2-3 bins with the minor tweaks for the specific conditions/goals if you've got months of essentially the same weather and it's 2 minutes to flash. If there are huge environmental swings throughout the day, not an ideal option. If you're set on running a single bin year-round though, consider what you correctly pointed out and at what scaling looks like...may have a needlessly large factor causing needlessly large swings.
 

shushikiary

Sergeant
Jun 4, 2018
304
173
0
Ride
335xi
I've found that the swings at altitude are larger than at sea level.

My ambient pressure is usually between 12 - 12.4 psi, if I go up into the mountains I've seen it as low as 9.5 psi at 12,000 feet.

This seems to indicate to me that there is some model, likely related to AR ratio on the compressor and shaft speed (... maybe the turbo efficiency map of the stock turbo?) that plays into what the requested boost is. Thus the larger swing at higher altitude because the boost set point factor is that much higher for the same relative requested boost.

Anyways, my point was that yes, running 1 map for all conditions (how I think it should be, including going to low altitude and back), you should set base WGDC high enough that the PID can hit your target when its a reasonable temperature/altitude, which then prevents it from going too high when the boost request is silly high at high temp/altitude, and then change the negative error sections of the PID to keep overboost from being an issue when you get too cold/low altitude.

Otherwise if you make the PID gains high enough with a low base WGDC so that you dont get any boost overshoot at cold/low altitude, you're then likely to get a huge WGDC at bank to meet the big requested boost target.
 

RSL

Lieutenant
Aug 11, 2017
937
501
0
I've found that the swings at altitude are larger than at sea level.

My ambient pressure is usually between 12 - 12.4 psi, if I go up into the mountains I've seen it as low as 9.5 psi at 12,000 feet.

This seems to indicate to me that there is some model, likely related to AR ratio on the compressor and shaft speed (... maybe the turbo efficiency map of the stock turbo?) that plays into what the requested boost is. Thus the larger swing at higher altitude because the boost set point factor is that much higher for the same relative requested boost.

Anyways, my point was that yes, running 1 map for all conditions (how I think it should be, including going to low altitude and back), you should set base WGDC high enough that the PID can hit your target when its a reasonable temperature/altitude, which then prevents it from going too high when the boost request is silly high at high temp/altitude, and then change the negative error sections of the PID to keep overboost from being an issue when you get too cold/low altitude.

Otherwise if you make the PID gains high enough with a low base WGDC so that you dont get any boost overshoot at cold/low altitude, you're then likely to get a huge WGDC at bank to meet the big requested boost target.
Yeah, I'd expect that to be a challenge, but really why PID is a good thing, barring the annoying trade-offs. I wonder how the RPM x Setpoint logic responds in these situations since much of the usual tables are ignored. That might be an interesting test.

There's probably an easy table fix to tone down target swing size, but that doesn't mean easy to find. There are modeled turbine flow tables, compressor efficiency, intake manifold to exhaust manifold PR, WG pressure to ambient PR vs. turbine flow, etc. not to mention probably hundreds of environmental factors/offsets for various things. Without tracing the target calculation, could probably spend an eternity finding and testing tables to see if/how they affect it.

There are IAT sensor parameters already defined for anti-lag, but I've paid zero attention to them or what their changes hit. It would be just one possible temp consideration that you might be able to mess with relatively easily.
 

impuls

Specialist
Jan 28, 2018
92
60
0
Ride
'07 335i
The DME is definitely compensating the lower air density caused by higher IAT.

I have a single log from a pull on the Autobahn and the boost requested for a load of ~194 is ranging from 18.5 to 21.1 (hit limit) PSI.

See https://datazap.me/u/impuls/autobahn?log=0&data=3-6-14-18-22&solo=3-6-14-18&zoom=0-131
(I know timing corrections at the end of the log are ugly and I know I should get a better FMIC)


To be honest I am quite sure the DME will always try to get a specific air mass into the cylinder no matter what is the IAT and most likely also no matter what is the ambient pressure. Does make sense when building a car that is supposed to behave consistently, but it is not particularly helpful when trying to squeeze out as much power of a motor as possible.

Based on the log above it seems the DME is really trying to target a pretty constant air density (for same load) entering the cylinder and the numbers seem even more consistent when considering small variances in load. Note that at 138°F IAT DME was not able to target more boost due to the Boost Ceiling.

81°F101°F138°F
Air Denisty1.151.111.04
Boost Target18.519.321.1
Load195.5194.1194.4
Density Target2.632.602.57
Density/Load 1.34 1.33 1.32
[TBODY] [/TBODY]


Generally PID / will not change a thing about how much boost the DME is targeting, but tuning it carefully will help to not actually reach harmful boost levels. To be honest I would prefer to really target what I want to run and not rely on just not reaching the requested boost.

What I think can fix this issue:
Load Target Limit Factor (Charge Air Temp) and Load Limit Factor can be used to adjust load based on IAT and ambient pressure. It should not be too difficult to setup at least the IAT table to compensate the adjustments the DME is making to the boost request by reducing the load.

When I had this strange log with 28 PSI boost request the IAT was 80°F while in other logs with 24 PSI the IAT was at 60°F.
Considering the scaling this could account for 2 PSI, not sure what caused adding two more.
Now that I accidentally deleted the log anyways I am planning to only compensate the IA T as written above an collect a few proper logs.
 
  • Like
Reactions: Hydra Performance

shushikiary

Sergeant
Jun 4, 2018
304
173
0
Ride
335xi
Hmm, an interesting idea.

How does the math work on the load limit factor table? Mine is currently set to .130 all across the board.

It seems the load limit factor (charge air temp) 1.000 means 100% and .990 means 99% of the load target?
 

RSL

Lieutenant
Aug 11, 2017
937
501
0
Target dips don't seem to correlate with a sudden IAT change or anything else immediately obvious to me. In fact, target drops a small amount steadily on a constant set point and then both fall together largely at "some" point. I'd be more inclined to believe something else is acting on it since it does it relatively high in all the gears. There are a lot of things besides IATs and ambient pressure that affect target.

https://datazap.me/u/impuls/autobahn?log=0&data=3-4-5-6-22&solo=5-6&zoom=0-131

To be honest I would prefer to really target what I want to run and not rely on just not reaching the requested boost.
That's pretty much what I was getting at in the prior posts: you don't need to hit target (or technically even be close to it) to limit the actual boost where you want.

0.13 might be high, depends how other things are set and what loads actually look like. It limits load that can be requested, which may be higher or lower than load targets, but it's not the only table that affects requests. Not sure on the math or absolutely positive a % of what pressure, but would bet on it actually being fuel related.
 

impuls

Specialist
Jan 28, 2018
92
60
0
Ride
'07 335i
Target dips don't seem to correlate with a sudden IAT change or anything else immediately obvious to me.
The dip seems to be delayed, but what it dips to correlates with IAT corrected boost target very well, it was clise to perfect for the points I have chosen.

My theory right now is that DME just delays reducing target while not hitting target anyways.

That's pretty much what I was getting at in the prior posts: you don't need to hit target (or technically even be close to it) to limit the actual boost where you want.

Some say being under target for to long will disable PID leaving you at WGDC Base. Actually my main motivation is I want the DME to obey and understand what is happening.

Right now doing some charting and statistics with 5 logs (different tune versions, different ambient) trying to proof that we can predict boost target based on load if we consider IAT and pressure corrections
 

WOT808

Specialist
Aug 7, 2017
80
56
25
Ride
E90 335i
Right now doing some charting and statistics with 5 logs (different tune versions, different ambient) trying to proof that we can predict boost target based on load if we consider IAT and pressure corrections

I quit messing around with load targets on my scaled/n20 map because boost target wasn't reliable. PID would 'time out' if boost target was too high for my stock turbos to reach.

I've since moved load out of the way and used BLM to define my boost target per given maf req with success.

https://datazap.me/u/m6keharr/new-injectors?log=0&data=3-6-23
 

RSL

Lieutenant
Aug 11, 2017
937
501
0
^^ This is essentially what I was talking about. Setting actual boost where you want max and then adjusting target to it. I assume actual was in relatively the same place even when target was set higher. PID timeout also seems to vary and might be less of an issue depending how boost control is tuned and, obviously, just how big gap/error/PID add is, for how long, RPM, etc. People run below target some amount for long periods all the time without issue, some very below target. Others can timeout in one gear.

The concern was target moving up, which is why I mentioned it, but moving at all or how much on temps is what's on the table. I'll be curious how the 5 revisions are different and how the stats change between them compared to the overall average.
 

WOT808

Specialist
Aug 7, 2017
80
56
25
Ride
E90 335i
Yes, I noticed boost target would vary a bit (based on temps I'd guess) when I was using load to set target.
I don't have access to my BIN right now so the figures below aren't 100% accurate.

Now, boost target is pretty consistent when using the method below.
1) Move load target out of the way
---- My load target is flat and maf req and RPM have a positive slope
2) Set your max boost via the Boost Ceiling table
---- My Boost Ceiling is set to ~1.19 bar (~24 psi scaled)
---- This will set the max your tune will target
3) Set Boost Limit Multiplier table values to define target boost per maf req
---- My values taper from 3.0 to 2.3X toward 450 maf req (6k rpm)

 
Last edited:
  • Like
  • Agree
Reactions: RSL and Jeffman

impuls

Specialist
Jan 28, 2018
92
60
0
Ride
'07 335i
Thanks for the suggestions for controlling boost control, I think I will at least combine that with adjusting load to IAT.

It seems the DME does at least correct IAT and ambient pressure to some extent.
Using the formula (IAT*0.00023+0.149)*Load_Request-Ambient_Pressure does match boost target in log much better than without corrections.

In case anybody is interested in the Excel sheet to create this mess, let me know...

Two example logs:

upload_2018-10-18_22-36-36.png


upload_2018-10-18_22-46-2.png
 

shushikiary

Sergeant
Jun 4, 2018
304
173
0
Ride
335xi
So for my self at least, I've found that the boost setpoint changes decently between the temperature changes, not just with ambient pressure.

Given this, I re-scaled my WGDC table to go up to 3.0 boost setpoint and 410 MAF. (I have a spread sheet I made that does the re-scaling for me... saves a lot of time). This then made it so that my WGDC base much more closely fallows boost requested when it shifts from 26.5 to 24 psi in the cold, etc.

Then to limit the requested boost, I just set the boost ceiling to 1.37 bar (which equates on an N20 map with a boost limit multiplier of 3.0 to about 26.5 PSI). From there, one can limit the max possible WGDC by not having too high a PID gain (already that way for pretty much everyone), not having too high of a base, and not having too high of a WGDC adder airflow (as well as WGDC ceiling adder).
 
  • Like
Reactions: Jeffman

P33P33

Specialist
Apr 3, 2017
57
21
0
Ride
BMW 335i n54 e93
I'm not here much but I'll share a few things I do to help. This is the 3-value I use (2-value is stock because it is ignored when using the 3-value):

View attachment 8182

I use different values than you guys seem to be, I recommend testing the N20 sensor to figure out your scale like I did. Targeting higher voltage and lower pressure helps correct the gauge some in theory (but be careful at the sensor limit so as not to overrun it), and moving the middle value left helps preserve sensor linearity, I graphed it a long time ago but looks like this (used to scale down to 1.6v but was a bit too far for some sensors/barometrics):

View attachment 8183

The values above were based on data-sheet values which I've found to be a bit misleading. For the N20 sensor the formula I use for absolute pressure is BOOST (ABSOLUTE) = 10.105*(VOLTAGE)+2.2758


I'll add, you can set the sensor 3rd value to like 4.2v / 36.6psi if you only want to target 30psi, and use the full 220 load range of the DME. I used to do this as it allows the DME to see the highest load, but it got annoying to set in every tune and required major changes again for people wanting to go over 30psi. But there's many ways you can set up the scaling once you understand what it's doing. I'll have to add this stuff the the spreadsheet I made I guess.

So I have made my own spreadsheet which looks pretty much identical with @V8bait. I tuned a z4 with DCT that had ije0s_is software and there was mysterious boost target limit. Eventually updating to INA0S resolved that issue.

But before that I tried the values above to change the map scaling so that with the new scaling ECU would see a little bit lower boost value so I would get more headroom for the boost target. At least that's how I understand the logic works and you can see it by just looking the graph above. Let say we watch the 3 Volt line and we can see that MHD scale is showing higher abs pressure than the modified scale @V8bait has been using. I figure this is helping also people with higher altitudes to get a bit more boost. And it's also showing less boost for the ECU. So basically if I'm hitting boost limit with DCT cars that scaling would give me a little bit headroom, right? So could @V8bait or @jyamona explain the logic? Is MHD basically calculating those same formulas above and from there calculating the conversion with given voltage the tmap is actually showing?

So going back on trying the values above the car wouldn't even start anymore. I also tried some different values but no go. only the generic values would work. So I would like to know what is causing that if you guys are saying that you can scale the tmap differently.
 

Jake@MHD

Major
Platinum Vendor
Nov 7, 2016
1,593
2,058
0
Philly
Warning, long post ahead :) If you just want updated proper scalings to plug and play, skip to the tl;dr at the end!

First, I would not use the sensor scaling to "limit" boost (you should use the other appropriate tables for this). You should use the sensor scaling to reflect the max that your given sensor can have, scaled to the max that your rom version / trans type can allow.

EDIT: For AT, 6MT, and DCT can set boost ceiling to 1.5 bar without issue now.

The initial N20 scaling (which was very slightly off since it was based on the numbers Cobb published for the N20 sensor, and not the sensor spec itself) was decided upon to report stock up to 10psi, and then scale from there up to 35psi as it gave a nice scaled boost of (X - 24.7)/2 + 24.7. 24.7 here is 10psi absolute, at sea level. If trying a scaling for yourself you should also use absolute numbers at sea level. 10psi was chosen as the middle breakpoint as it gave the nicer scaling equation, but you can go a few psi lower (I wouldn't go any lower than say 5-6psi), and certainly higher as well but then you lose scaled resolution.

Now comes setting the first two cells, and math for the third. You want to pick your first cell to be generally what the sensor spec publishes as it's min. For N20 it is 0.5V @ 7.30809 psi. For the common 4 bar, it is 0.4V @ 7.25189V. Do not worry about if this will set you under the voltage plausibility check for your altitude, as that should be disabled if need be the proper way with it's own byte. You DO NOT want to have scaled values in the first two cells, as it can effect idle, cruise, etc and hurt drivability.

For the second cell, you want to pick the psi you want to report stock up until, and add 14.7 to it. So we chose 10psi, which is then 24.7. You compute the voltage your sensor will have at this psi using y = mx + b. You can figure out variable M and B by using the equation for two points on a line from the sensor spec. For the N20 sensor, this is 2.15876V and for the 4 bar it is 1.861V.

Finally for the third cell. Setting the absolute psi in this cell is easier (and will never change!), so we'll start there. This value should be the max the DME will allow, in absolute psi. So this will be 2.56 bar absolute (hex max supported by DME, also seen in some places as 2559hPa). This comes out to 37.1x psi. However, to build a tiny margin in, we set it to 37.2psi. This absolute psi value will be the same no matter what sensor you are using, N20, 4bar, 5bar, etc.

Lastly, we need to figure out the voltage to go with our last psi values from above, 37.2. If you don't care about having a nice scaling divisor like mentioned above in our (X - 24.7)/2 + 24.7 example (the scaling divisor here is "2"), you can simply enter the upper voltage from the sensor data sheet. However, that can make rescaling all your load axis trickier and does not give any headroom at the top end of the sensor before it can start reading non-linearly. For the N20 sensor however and our scaling divisor of "2", here's how we picked that:

Stock sensor max: 22.5psi, scaling start: 10psi; N20 sensor max (that we want to scale to): 35psi, scaling start: 10psi;
stock: 22.5 - 10 = 12.5psi; N20: 35 - 10 = 25psi; 25 / 12.5 = 2;

Now to find your third cell voltage based on this, I setup two columns in excel and found first the real psi of the N20 sensor would give 37.2 scaled, using our formula of (X - 24.7) / DIVISOR + 24.7, here X is the real psi of the sensor, and 2 is our divisor. In this case it turns out to be 49.7psi gives a scaled 37.2. Now using y = mx + b again, we can get the voltage at 49.7psi, which is 4.543146V. And that would be our last voltage breakpoint!

---------------------------------------------------------------------------------------------------------------------

tl;dr:

Proper N20 scaling for all cars:

0.5V @ 7.30809 psi
2.15876V @ 24.7psi
4.543146V @ 37.2psi

Hope this helps. Again, follow the same process for other sensors like 4bar / 5bar etc. I will work on getting the ambient pressure to voltage check toggle added to the XDFs so you high altitude folks don't run into that issue when scaling a larger sensor.


JY - edited on 5/9/22 to remove separate DCT scaling which is no longer needed
 
Last edited: