Tuning

=Getting Started=

ME7 Documentation

 * http://nefariousmotorsports.com/forum/index.php?topic=400
 * http://nefariousmotorsports.com/forum/index.php?topic=1882

Flashing utilities
You need some way to read and write files to the ECU. Some options are:
 * eBay USB VAG KKL cable and the Nefmoto Free ECU Flashing Software - The easiest and best supported method. Does not rely on boot mode, but will not flash bricked ECUs. You can also use (recent) VCDS (Ross-tech) cables with Nefmoto, but you may have to disable "intelligent mode" in the VCDS setup dialog (intelligent mode causes the VCDS driver software to constantly poll the cable in the background, which may interfere with non VCDS apps). For more information, see the Nefmoto Flashing Guide.


 * Galletto 1260 cable and software - Useful in an emergency to recover a bricked ECU. You may have to flash your ECU using boot mode for it to work if your ECU is bricked. However, it may also work w/o bootmode (unlike Galletto 1250).

The most popular combination is a cheap eBay USB VAG KKL cable used with the Nefmoto Free ECU Flashing Software. However, it is good to have Galletto software and cable handy to rescue a "bricked" ECU using boot mode. It is possible to make most (non-Galletto bundled) FTDI USB based cables work with the Galletto software, but it requires hex editing the executable to disable serial number checking. Alternately (and less usefully), you can edit the serial number that the software looks for or alter the serial number stored in the cable using MProg.

One downside to using a boot mode flasher is that it cannot clear the "Error is P0601- Internal Control Module - Memory Checksum error." DTC. You MUST use flashing software that uses the VAG programming protocol, such as the Nefmoto flashing software, to clear this code. HOWEVER, if you don't currently have this code, bootmode flashing will not cause it, it just won't remove it.

If you plan on doing any flashing, it is strongly recommended to always have a bootmode setup available in case you brick your ECU.

Tuning your ECU
You will need:
 * 1) A map editor
 * 2) * TunerPro
 * 3) An XDF definition file so that the map editor can locate maps.
 * 4) * You'll need one specific to the ECU you are using. If you wish to use a different version software than your car came with, read this carefully.
 * 5) * XDF (right click save as) for M-box (most popular).
 * 6) Checksum correction
 * 7) * Modifying data in the ECU file will invalidate the internal checksum values. These will need to be updated or your car will not start. More info.
 * 8) * MTX Electronics sells a €10 checksum correction plugin for TunerPro.
 * 9) * ME7Check is a free executable that will tell you whether the checksums in a file are valid or not. It does not correct them, but if you aren't using WinOLS, you should always use it to check files before flashing them to your ECU.
 * 10) * ECUFix - $150 - Stand alone checksums correction utility
 * 11) * ME7Sum - Open source ME7.x checker/corrector. Currently under development!

Logging utilities

 * 1) setzi's ME7 Logger (pure awesome) and a VisualME7Logger front end (optional)
 * 2) * Complete guide on how to take and graph logs using ME7Logger - note that this refers to the old "GUI" front end, not the newer "VisualME7Logger" frontend linked above.
 * 3) Nefmoto logger
 * 4) Ross-Tech's VCDS (aka VAG-COM)
 * 5) APR's ECUx (No longer actively supported by APR. Avoid if at all possible)
 * 6) A wide-band O2 sensor if you are not using stock fueling. A tailpipe sniffer is fine, as long as you have test-pipes and no pre-cats in your downpipes.
 * 7) ECUxPlot to graph logs. Also has a HP/TQ calculator and various other tools.

=Terminology= The acronyms are Bosch's Motronic map names from the Funktionsrahmen. If noted, map locations are for the S4 M-box and L-box (8D0907551M and 8D0907551L)

=Fueling=

Always start with this first. If you get fueling wrong, you will likely break something. Get this right, and do not try pushing the envelope in any tables until you are confident your fueling is where you want it. Always use a wideband sensor. Do not skimp on this. The stock narrow bands do not provide you with accurate enough readings. For stage 1-2+, adjusting fueling isn't technically necessary; however, a bit of extra fuel via KFLBTS isn't such a bad idea if you are running pump gas and a bunch of extra boost.

Primary

 * KRKTE - primary fueling

A good ballpark starting value for KRKTE is 34.125/(injector flow in cc/min). If you are using stock injectors and fuel pump, you should not have to touch this. Note that the factor is wrong (should be 0.000111) on many of my old .XDF map packs. For those, you will need to fix the factor so it is 0.000111 and not 0.000167.

Now, scale your MAF:
 * MLHFM - compensate for MAF housing diameter
 * MLOFS - MAF offset. For Bosch MAFs, it should be 200. For Hitachi, 0.

Scale MLHFM (constant throughout scale vs stock!) to get your idle and partial short term fuel trims (STFT) near zero and your WOT AFR to roughly match your requested AFR.

If your MLOFS is non-zero (e.g. most Bosch MAF files), you cannot do a simple arithmetic scaling of MFHFM; you must offset it by MLOFS, then scale it, then offset it back. Alternately, you can set MLOFS to zero and shift MLHFM down accordingly, after which you can scale MLHFM arithmetically as usual. Note that MLOFS takes effect after the CPU takes a moving window average of the output of MLHFM, so technically this operation does not yield a completely identical result as stock.

Note: when you are tuning according to STFT, *make sure* you regularly clear your DTCs to reset the LTFTs to zero, or disable LTFTs altogether using VCDS:


 * 099 -> switch basic settings ON -> LR off

Some argue that using a different MAF housing (to extend the functional metered flow range) requires you to fix this so that measured load is "correct". The upside is that all of Motronic's tables that are based on load are probably still good. The downside is that you can't do any fine tuning of regions that are past the end of the axis data, so even if you don't ride the hard MAF limit, you'll run off the end of the load axis in the timing tables (and everywhere else). Some say this isn't so much of an issue. By and large, keeping your max load (at torque peak) under 191 is probably a good idea unless you are prepared to do a lot of remapping to compensate for changing the axis data, or you are ok with not being able to fine tune >191 load regions.

If you do scale your MAF, you may throw a "MAF too high" code. You'll have to increase:
 * KFMLDMX - HFM threshhold for B_maxflr diagnosis
 * MLMAX - maximum airflow

Finally:
 * KFKHFM, KFLF - fix up individual rich/lean areas, and WOT fueling issues.

The downside to attempting to add fueling via KFKHFM is that ps_w might cap out, and further additions to KFKHFM will have no effect. Even worse, if you are running a very high power setup, and your MAF is properly scaled, even a stock KFKHFM might result in a ps_w cap (in addition to maxing out load). One possible workaround is to underscale KFKHFM in those regions, and make approprate balancing changes in KFLF. Of course, to make KFLF's changes line up proplery with KFKHFM, you will have to make sure both maps have the same axis data in the applicable regions.

'''Note that KFLF's description as "lambda" is a misnomer. It is not lambda at all. It is an injector on time scaling table where larger numbers are richer, smaller numbers are leaner.'''

Idle LTFT and idle misfires
If you have idle problems (and/or idle LTFTs you can't seem to zero out), you may have to investigate tuning for your injector latency and/or idle injection period.
 * TVUB - Injection time offset
 * FKKVS - Correction factor for fuel supply system

IMPORTANT: If you decide to tune TVUB empirically via idle STFTs, make sure your partial throttle STFTs and WOT fueling is right first, or you'll just have to start all over again once you have KRKTE and your MAF scaling set up right.

According to Bosch documentation, FKKVS is for compensating for pulses in returnless fuel system. However, it can also be used when TVUB isn't enough to correct for non-linear injectors (or other non-linearity in the fuel system).

If you are running really big injectors, and you are running rich no matter how much you turn down KRKTE, you may need to reduce the minimum injector on time. Some injectors run best with a slightly higher TEMIN (e.g. EV14 ).
 * TEMIN/TEMINVA - minimum injector on time

If you did not properly scale your MAF, and you are getting a rough idle but aren't seeing idle misfires, it could be because your load at idle is too low, inhibiting misfire detection. Scale your MAF properly, or decrease your misfire recognition load threshold.
 * RLSALUN - Load threshold for shear detection for suppression of misfire detection
 * RLSALULL - Load threshold for shear detection for suppression of misfire detection during idle

Finally, if none of this works, you may have to increase your idle RPM and/or idle torque reserve (alters idle timing)
 * NLLM - idle RPM
 * NFSM - idle RPM while in gear
 * KFMRES - idle torque reserve
 * KFMRESK - idle torque reserve while transmission decoupled (clutch in)

If your car runs poorly while it is warming up (engine temps less than 85C-90C), you will want to tweak the warm up enrichment tables according to your STFTs:
 * KFFWL_0_A
 * KFFWL_1_A

You can bump the idle/cold start RPM as well:
 * KFNLLKHM - Elevated idle RPM until motor is warm
 * KFNLLNST - Start RPM (momentary)

Open loop AFR
When requested lambda is <1 (richer than stoichiometric), the fueling system will go "open loop". This means that the ECU will no longer use the narrow band O2 sensors to regulate fueling in closed loop (feedback). It will use ONLY the MAF signal to guess how much fuel should be added to the mix based on how much airmass is being detected in the intake.

There are three ways to adjust WOT (open loop) requested AFR


 * 1) LAMFAW: enrichment based on pedal position
 * 2) LAMFAWKR: enrichment based on knock recognition
 * 3) LAMBTS: enrichment triggered by calculated EGTS passing a threshold

Final requested AFR will follow the richest set point of the three components.

LAMFAW
Driver requested AFR:


 * LAMFA - requested lambda. Not very flexible for high load enrichment, uses requested load instead of actual load. Also, the stock LAMFA load axis is (incorrectly) restricted to 0.5%-1.0% on 2.7t ECUs. You will have to change it to full range (50%-100%) to use LAMFA, otherwise, the 1% column will be used at ALL requested load points!
 * ZKLAMFAW/ZKWLAFWL (0x1C3EE) - time constant for driver requested lambda filtering. This filter smooths LAMFA. Unfortunately, the smoothing has the side effect of delaying the effects of LAMFA. You may want to bring in LAMFA fairly aggressively and/or increase ZKLAMFAW significantly to compensate.
 * TLAFA - time delay before driver requested lambda active. Already set to 0 on many files. On others, you may have to reduce it to get LAMFA to take effect in a timely manner.

The result is "lamfaw"

LAMFAWKR
Knock recognition based enrichment:


 * CWLAMFAW - when bit zero is set to 0, don't allow dzwwl to advance dzwlamfaw. If you leave bit zero set to 1, dzwlamfaw will likely stay near zero at IAT's below 39C (102F) (since DZWWL can counteract WKRMA), and you won't get much knock based enrichment, since dzwlamfaw is the timing input to KFLAMKRL.

If you leave CWLAMFAW stock, you may need to adjust a few tables to prevent dzwwl from counteracting wkrma.

$$dzwwl = KFZWWLRL + (KFZWWLNM * FZWWLRLN)$$


 * KFZWWLRL - inputs are: nmot, tmot (coolant temp)
 * FZWWLRLN - inputs are: rl, nmot
 * KFZWWLNM - inputs are: nmot, tans (iat)

The output of these tables is dzwwl:

$$dzwwl = KFZWWLRL + (KFZWWLNM * FZWWLRLN)$$

dzlamfaw is then

dzwlamfaw is then fed into:
 * KFLAMKRL - enrichment based on load and dzwlamfaw
 * DLAMTANS - additive correction to KFLAMKRL based on intake temp
 * KFLAMKR - enrichment correction factor based on rpm and load

They are combined like this:

$$1 - (( 1 - (KFLAMKRL + DLAMTANS)) * KFLAMKR)$$

The result is "lamfawkr"

LAMBTS
EGT enrichment tables:


 * KFLBTS_0_A - requested lambda for component protection when calculated EGT is above TABGBTS, scaled by FBSTABGM. Note that lambts also modified by [KF]DLBTS and KFFDLBTS: lambts = KFLBTS + ([KF]DLBTS * KFFDLBTS). Therefore, setting KFLBTS to 1 where you don't need it won't disable bts, you also have to set KFFDLBTS = 0 to disable bts completely. Note that Mbox has DLBTS (2D), not KFDLBTS (3D).


 * TABGBTS - Threshold for KFLBTS. Unless calculated EGTs are above this threshold, KFLBTS is ignored. You may have to lower TABGBTS if you have a scaled MAF, since calculated EGTs will be artificially low.


 * FBSTABGM (0x150C2) - KFLBTS multiplier. Make sure you change the axis properly to represent your lowered TABGBTS. Again, not necessary if you have a properly scaled MAF.

The result is "lambts"

Result
The lowest value of the three (lamfaw, lamfawkr, lambts) become your requested AFR.

Thus, you can use the combination of LAMFA, BTS, and KFLAMKR to tailor your AFR. In particular, pre-emptive rich fueling at low actual loads (but high requested load) may inhibit knock sooner than the KR approach. You can use BTS to do further enrichment when EGTs get dangerously high, unless you have BTS activate at very low actual loads (and/or calculated EGTs). The latter may be undesirable for fuel economy reasons; it is more fuel efficient to have BTS activate much later, let LAMFA handle pre-emptive, high load request (but low actual load) enrichment, and let KR handle real time knock inhibition.

Note that on tunes for low octane gasoline, it is likely that your target AFR is so low (to prevent knock) that additional BTS fueling is unlikely to protect against anything, unless your fuel system is severely under-delivering fuel do to injector/fpr/fuel pump malfunction.

Part throttle LTFT
Once you get your WOT AFR right, you may notice that your LTFTs are way out of whack. If they get too far out, you'll throw a code and possibly go into limp mode.


 * KFKHFM - Correction map for MAF. Log STFTs at various part throttle positions, RPMs, inclines, and gears to determine where the MAF readings need tweaking. If you are using the stock MAF and intake system, you should not have to touch this.

You can also do fueling corrections in both FKKVS and KFLF, depending on preference.

Once you have got both partial throttle and WOT exactly where you want them, go back and clean up TVUB according to your idle STFTs/LTFTs as needed.

You may also simply want to disable LTFTs while you are fine tuning part/idle throttle.


 * NOLRA - set to 5

Consumption
Now that you have your fueling set up, you'll probably notice that your MPG readings in your cluster are totally wrong. Fill up a with a tank of gas, and reset your trip odometer and average MPG. When you are done with the tank, fill up your tank, see how much gas you used and how far you went, and check it against the new average MPG. Get a calculator out, and correct it here:


 * KVB - fuel consumption (MPG in cluster)

Standard KVB value can go only up to 776cc injector size due to reaching the maximum value it accepts.

To accommodate injectors larger than that you have to also change


 * FKVA (0x1A4D5) - Constant conversion factor for consumption display

This is a multiplier for KVB.

For reference, you may be able to derive the right value using this (although some find trial and error tweaking is much easier):

$$TKVAG = \frac{\sum_{t=0}^{TMAIN} (rk_w+ rkte_w) \times KRKTE [ms] \times FKVA \times KVB [cm^3/min] \times 1000}{Kd [mm^3/s] \times 0.0512 [ms] \times 60000}$$

=Boost=

Foreword

ME7.1 doesn't really have a "boost" table. It does everything based on "specified load".

That isn't to say it's not possible to get a rough approximation of the boost you'll see based on your chosen LDRXN. To determine boost pressure a little math is involved. First, you need to understand the difference between absolute pressure and what people commonly refer to as boost. Absolute pressure is the pressure of the air charge including barometric pressure.

Absolute pressure=10*(LDRXN)+300mbar.

EXAMPLE:

LDRXN=195

10*195=1950 1950+300=2250 2250=absolute pressure in millibars.

To determine manifold pressure subtract the barometric pressure. Sealevel=1bar=1000mb.

2250-1000=1250mb. 1250mb=1.25bar

1bar=14.7psi 1.25bar*14.7psi=18.375psi manifold pressure.

Keep in mind, this is a ROUGH approximation. It is dependent on a large number of factors including air density, temperature, elevation, and the alignment of the stars and the moon. Use the above formula to get close, then adjust based on real world observations.

Adjusting boost:

First, make sure the 100% torque request (rtlsol) row requests enough load:
 * KFMIRL - specified load

Specified load/boost will never exceed these limits:
 * LDRXN - maximum specified load
 * KFLDHBN - maximum requested pressure ratio

Specifically, on a full throttle pull, your boost profile will follow LDRXN. K03s and K04s have some severe flow limitations, so unlike big turbos, you will want your boost to taper (not ramp up) to redline. ECUxPlot has a pressure ratio/flow plotter that you can use to compare against your turbo's compressor map.

You will throw a 17963 Charge pressure: Maximum limit exceeded code if your boost deviation is too high:
 * KFDLULS - Delta pressure for overboost protection

If you are running significantly more boost than stock, or you have made changes to the boost PID, you may have to increase these limits. The most unsophisticated way is to simply max the entire table. Obviously, you will get better results if you spend a bit more time tuning this table to something appropriate. It is generally not a good idea to disable too many safety features, particularly when it comes to boost.

If you screw up, it is possible that specified boost is higher than the maximum possible measured boost. For obvious reasons, the PID will not like this. To prevent this, set this to zero:


 * DSLOFS - MAP pressure sensor offset

Absolute maximum measured boost is 0xffff/25.6 = 2559.96 mBar (assuming DSLOFS = 0)

Maximum spec boost is 0xff*10 = 2550 mBar

These are both hard ECU limits, and cannot be increased by simply changing sensors or internal ECU MAP scaling.

''If you plan to run closed loop boost (PID control), set DSLOFS to 0. If you are planning to run open loop boost (locked WGDC via KFLDRL) keep it stock!''

IAT effect on requested boost
ME7.1 will adjust the specified load limit depending on IATs. As IAT's go up, ME7.1 brings the max boost up a bit so that the driver can't tell that the car is slow in hot weather. It can do this because the stock boost curve is relatively conservative, and there is plenty of headroom. Also, at some point, if IATs go high enough, max specified load is pulled to prevent knock.


 * KFTARX - IAT correction for maximum specified load

However, if you are running a lot of boost, and always want maximum performance, there is no point in increasing boost when it is hot, let alone reducing boost when it is cold. Also, as IATs rise, even with a perfectly flat KFTARX and LDIATA (see below), you will see more requested boost because the ECU knows that a higher P/R is required for a given cylinder fill (PV=nRT for you thermodynamics nerds out there). It is unknown if there is a table for that calculation. To compensate, you may want to taper KFTARX across the board as IATs rise to keep your requested boost sane. In particular, be aware that the maximum requested boost is slightly above the maximum MAP reading. Readers who understand PIDs should recognize that really bad things happen when the measured output cannot reach the setpoint...

Cam changeover effect on requested boost
Motronic likes to change requested boost depending on cam position. While it may seem like a good idea in theory, in practice, abrupt changes in requested boost near the MAP limit can make the boost PID unhappy. When logging, you may see an odd notch in requested boost between 3000 and 4000 RPM. These maps are what is causing that notch
 * KFPBRK - Correction factor for combustion chamber pressure
 * KFPBRKNWS - Correction factor for combustion chamber pressure when NWS active
 * KFPRG - Internal exhaust partial pressure dependent on cam adjustment when sumode=0
 * KFURL - Conversion constant for ps->rl dependent on cam adjustment when sumode=0

Base Boost
With aftermarket and/or tighter wastegates, you may experience bucking and choppy throttle response in part throttle. The throttle angle desired is dependent on the boost pressure in a turbo car since after a certain angle, throttling losses are negligible and it is better to hold the throttle wide open. To correctly determine how much throttle opening is required to produce the amount of torque requested and prevent the ECU from going WOT unnecessarily, a few maps have to be tweaked in the module LDRPLS to set the base boost pressure in the ECU. The maps that set base boost are:
 * KFVPDKSD - Target pressure ratio in dynamic operation
 * KFVPDKSE - Target pressure ratio in steady state operation

The axes of these maps are nmot (engine speed) and vpssplg_w (requested pressure ratio) and the Z-values are pressure ratio across the throttle body. Look for the values in the table that start to exceed the threshold of PSPVDKUG, and trace up to the vpssplg_w axis. The pressure ratio minus 1 bar at this column should be your stock wastegate pressure (3-6psi). Take the ratio of this pressure to your new wastegate pressure, and multiply it by the vpssplg_w axis. This roughly sets base boost for proper throttle control. You can further tune this table by making sure areas below the spring pressure of the wastegates stays below the value in PSPVDKUG.

LDRPLS works in conjunction with FUEDK to determine throttle plate angle. After getting base boost situated in LDRPLS, FUEDK determines throttle plate angle via a map that utilizes airflow and throttle plate angle. This map is
 * KFWDKMSN - Mapping for throttle target angle

and needs to be massaged for proper throttle control. This is accomplished by logging RPM, throttle plate angle, and mass air flow. Populate this table using real world logged values and part throttle response will be much smoother. You will be able to reach 0-wastegate pressure using the throttle.

Along with tuning KFWDKMSN, its inverse
 * KFMSNWDK - Normalized airflow over throttle plate

should be tuned as well. This has the added benefit of being able to drive without worry (to your local shop, lol) if your MAF sensor fails.

See here for the discussion regarding tuning these maps.

Boost PID
If your actual boost is not meeting requested boost, you may have to increase the PID I limit for 850 and 1000mBar. In general, you want KFLDIMX to follow what you expect your WGDC to be in the steady state, so after peak boost, you should set this to where you want the WGDC to settle. Note that PID trims (I-Regulation adaptation) may alter this limit.
 * KFLDIMX - LDR I-Regulator limit. The x-axis input is "ground" pressure in hPa (same as mBar), which, in the M-Box, is "actual absolute pressure" - "ambient pressure".

To go along with KFTARX above, there is another IAT correction that ME7.1 uses to allow the PID to add waste-gate duty cycle at elevated IATs. You may want to flatten it all out:
 * LDIATA - LDR I-Regulator limit as a function of IAT

If you aren't using K03s, you may have to tweak the PID response. Note: this is not used to adjust requested boost. It is used to compensate for different waste-gate responses.
 * KFLDRL - Map for linearization of boost pressure = f(TV). This is the post-PID waste-gate duty correction table. Calibrating this correctly is time consuming, but worth the effort.
 * LDRQ0S - LDR PID Q0 in static operation (proportional term) - you may have to increase this, especially if you are running a tightened wastegate.
 * LDRQ1ST - LDR PID Q1 in static operation (integral term)
 * KFLDRQ2 - LDR PID Q2 (differential term) - adjust this to compensate for overshoot when your boost ramp meets requested. Increase it if you see a lot of overshoot. If you have undershoot, try increasing KFLDIMX first. Only decrease Q2 as a last resort.

The x-axis input to the PID terms are all lde ("actual absolute pressure" - "requested pressure")

KFLDRL can also be used to get open-loop type behavior for operation past the MAP and requested boost limit by making the output duty cycle unresponsive (flat) to uncorrected duty cycle (from the PID) at various RPM/DC points. Again, if you do this, make sure to leave DSLOFS at the stock value. This way, requested boost will always be higher than measured boost, and you will stay in open loop control.

One undesirable side effect to leaving DSLOFS stock (and requesting more boost than the MAP can read) is that the ECU will continuously trim the I-limiter upwards to try to get actual to meet requested. This means you cannot rely on KFLDIMX to limit WGDC; you MUST limit duty via KFLDRL, or numb the positive I adaptation.

I-Regulation adaptation
If you are seeing your WOT boost start to slowly creep up run to run as you drive your car around after a long period of time, you may be seeing undesired I-Regulation adaptation. This is the most common (software) reason for unexpected overboosting. You can confirm this by logging ldimxa_1 through _5.

You can numb positive I-Regulation adaptation via increasing LDEIAP and/or shifting TLDIAPN upwards RPM wise (which you might want to do regardless, if you are running turbos that spool slower than K03s).


 * LDEIAP - Regulation deviation threshold for positive I-Regulation adaptation
 * TLDIAPN - Debounce time for adjustment of positive I-Regulation adaptation

Calibrating KFLDRL
CWMDAPP (0x181BD) = 8 along with KFLDRAPP

Throttle cut
If you don't get all of this just right, and your actual boost goes too far above requested boost (by ~200mBar), you may experience overboost throttle cut due to negative deviation, which is ME attempting to get boost back under control by temporarily closing the throttle plate.

Positive deviation
Alternately, if your requested boost is far too high for a given load/rpm point, you may experience positive deviation (underboost) limp mode. This occurs if actual boost is too far under requested boost for too long. The result will be the P1557 Positive Deviation code, and from then on out, WGDC restricted to 10%.


 * If your MAF scaling is too aggressive, your load may be reading high, which might enable positive deviation diagnosis too early during a pull. Fix this by scaling back MLHFM


 * If your requested boost ramp is too aggressive for your turbos, you may be requesting far more boost than your turbo can possibly make at low rpms. In particular, the stock K03 LDRXN is VERY aggressive. K04s (let alone bigger turbos) will never spool that fast. Make sure LDRXN does not allow too much spec load too soon!


 * If none of the above helps, consider tweaking NDLDRAPU and SDLDRA.

If you are running K04s, you probably want to use the RS4 maps for all of these areas as a starting point, rather than the stock K03 maps.

PID vs ME7 boost limitations
All pressure values in ME7 have a fixed (internal) limit of 2559.96 mBar (0xffff/25.6). This makes it difficult to run the PID properly at boost levels near or above 22psi. It is possible to scale all references to boost in the ECU so that you can use a larger MAP sensor, but it is fairly complex and time consuming.

Currently, doing this is a work in progress. You can track the progress here.

=Timing=

When running elevated boost on pump gas, you may have to significantly cut requested timing to prevent timing retard. Keep your worst case correction factors in the single digits, and always carefully monitor your timing retard (KR).

If you are running rich enough, or are running race gas or water/meth, odds are you can increase timing significantly at the last load line and after peak boost. You may even be able to bump timing at peak boost as well.


 * KFZW/KFZW2 - primary timing maps. ME7.1 has a two point variable cam timing system; there is a table for each cam timing state.

If you did not fully "correct" your MAF using KFKHFM, make sure you do a lot of logging to see where the various load points are and how much timing ME7.1 is pulling due to knock activity. Most likely, you will have to adjust the entire map. If you did properly correct your MAF, you can probably leave most of the timing table alone, except at high load/rpm.

Torque monitoring
Torque monitoring may interfere with your timing, or even go into limp. To mitigate this, you will need to look at
 * KFMIOP - Optimal engine torque map
 * KFZWOP/KFMDS - Re-interpolate if you alter the KFMIOP load axis
 * KFMIZUOF
 * TMNSMN
 * TANSMN

... or disable it entirely (not recommended).

Tuning KFMIOP and KFMIZUFIL
The purpose of the torque monitor is to ensure that the actual torque never exceeds the requested torque and never exceeds "safe" maximums. Torque values are required to calculate timing intervention, since timing efficiency calculations are all torque based.

Since ME7 can only measure load, and not torque, but driver's requests are all torque based, ME7 needs to be able to convert back and forth to implement the torque monitor.

KFMIRL converts torque to load (requested, in this case), and KFMIOP converts load to torque (max requested and actual)

Specifically, KFMIOP is used to generate both  and , both of which are compared against the torque limit,.


 * Current torque is based on the current load
 * Max torque and requested torque ( / ) are based on the driver's pedal position

The goal is to keep /  below   and   below.


 * KFMIRL translates torque request (, based on ) to spec load
 * KFMIOP translates max load to max torque (, which caps  , which results in  )
 * KFMIOP translates actual load to current torque
 * KFMIZUFIL translates  to allowed torque limit

Some rough guidelines for tuning KFMIOP:


 * Any part of KFMIOP (load/RPM range) that can only be reached above ~60%  is unrestricted and can be raised to keep   high


 * The load input to KFMIOP for  is   which means   will always be calculated from the portions of the map with loads higher than the minimum   from LDRXN. This means   will typically be safely high enough to never limit the torque request, and will always be naturally much higher than  /.


 * Ensure that  remains below   to avoid intervention (which you will see in  ) by lowering KFMIOP. This mainly becomes a concern in the middle of KFMIOP.


 * (from actual load) must not exceed the allowed torque limit allowed for a given request from driver's pedal to avoid torque intervention. Simply raising KFMIZUFIL to avoid level 1 torque intervention will only cause level 2 torque intervention, so it is critical to tune KFMIOP correctly.

To verify you have done things correctly, log  (or  ), ,  ,   and.

You will see  (specified torque) drop from following   (actual torque) to following   (requested torque) if there is intervention. The less actual torque exceeds requested torque the milder the intervention. Note that MAF calibration has a large effect on the difference between requested torque and actual torque. An underscaled MAF may result in actual torque reading very low.

A note to help non-German speakers


 * is short for "Motormoment indiziertes", meaning "indicated torque", or just plain "torque"
 * is short for "Fahrer", or "driver", so  is "driver requested torque"
 * is short for "soll" or "should", meaning "requested", so  means "requested torque value"
 * is the same as "sol" but the leading "z" indicates that it is for "Zundungwinkel Eingriff", or "timing intervention", so  means "requested torque value post timing intervention"
 * is the same as "sol" but the leading "l" indicates load, so  means "torque request for requested load"
 * is short for "zulassig", which means "allowed limit", so  means "torque request allowed limit" (where the "s" is short for "soll").

Anti judder
The anti-judder system (ARMD) may also interfere with your timing if your car is very fast, very light, or on a dyno with very little load. You can disable it under WOT by setting the last row of KFDMDARO to 50 (or 100), and (optionally) copying over a few RS4 values for KFDMDARO/KFDMDADP/KIFZGHG


 * KFDMDARO (0x1DE7C)
 * KFDMDAROS (0x1DEDC)
 * KFDMDADP (0x1DE1C)
 * SMK08MDSW (mkar_w axis) (0x1DF8E)
 * DMARMX (0x19B9D) - tmot axis @0x19B97
 * KIFZGHG

It is also possible for a faulty or failing crank position sensor to cause RPM readings to fluctuate, which may result in (inappropriate) ARMD intervention.

Tiptronic torque monitoring
On tiptronic cars, you may get Engine Torque Monitor: Control Limit Exceeded codes. This is probably for protecting the torque converter. To get around it, you will have to look at:
 * RAMPASR
 * KFMIZUFIL/KFMIZUNS
 * KFMPED_/KFMPNS_
 * RLVMXN/RLVSMXN - Maximum relative indicated torque under open throttle body (not used if SY_TURBO=1?)

Adjust all of these with caution! Disabling or tampering with torque monitoring may prevent ME7 from protecting your motor and transmission from excessive torque in high boost applications.

Logging the various torque intervention variables may help you diagnose what is causing undesired torque intervention.

Knock recognition
'''Adjust these maps with care. Abusing any of them can cause severe ping/knock/detonation and probable motor damage'''

Knock effect on short term retard

 * KRFKLN - Ignition retard per knock event.
 * KRALH - Load hysteresis. This adjusts how quickly timing will be restored as load changes.
 * KRANH - See note below.
 * DWKRMSN - Delta angle offset for average retard

Requested load cut on knock detection

 * KFFLLDE - Factor for slow LDR intervention on rlmax via KR

Long term knock control adaptation
If you want your long term knock control to add timing back quicker if knock activity subsides, you may want to lower KRDWA
 * KRDWA - Knock control adaptation to differential current ZW map

KRANH was incorrectly described in earlier versions of this page. Recommend leaving stock unless you know what you are doing:
 * KRANH - Engine speed hysteresis for detection of speed range

Fuel enrichment on knock detection

 * KFLAMKRL - Enrichment on ignition retard; see LAMFAWKR discussion.

=Other niceties=

Speed limiter

 * VAVMX/VMAX - Speed limiter

Rev limiter

 * NMAX - RPM limit
 * NLLM - idle RPM
 * NFSM - idle RPM while in gear

Left foot braking
Set either of these to maximum to prevent throttle cut when left foot braking:


 * NWPMBBR - Minimum RPM for acc pedal value lockout on brake operation
 * VWPMBBR - Minimum speed for acc pedal value lockout on brake operation

Soft Limiter
Very rudimentary "launch" control can be added via using two RPM limits


 * VNMX (1157E) - The vehicle speed for activating the raised (normal) rev limit. Set this as low at it goes (1.25 km/h) so the launch control shuts off as soon as you start moving off the line.
 * DNMAXH (16304) - This is the RPM above rev limit when the fuel cut comes on. Tweaking this helps make more boost on the limiter. 50 RPM is a good start.
 * ITNMXH (16308) - Dwell time under lower limit before activating the upper limit. Set to 0.
 * NMAX (1630A) - Ends up being the launch RPM. 4500 is a good start.
 * NMAXOG (16312) - This is the raised RPM limit which becomes the standard limit. Set to your desired redline.
 * TMOTNMX (16316) - Coolant temp for activating raised (normal) rev limit. Set this at -48 so that you can rev past the low limit while car is warming up.
 * TNMXH (1631A) - This is the time duration of the raised (normal) rev limit. Set this to its maximum value of 655.3500 seconds. In theory, this may trigger at some point, but nobody has reported such a thing yet.

Some ECU's need:
 * CWNMAXMD (CWDNMAX?) (8-bit) - Codeword Drehzahlbegrenzung (Codeword for RPM limiter). Change from 0 to 1

Example bin based on stock binary.

Hard Limiter
Unfortunately, the soft limiter is useless for building boost, since it uses throttle plate control/fuel cut rather than a hard limiter (cutting spark). ME7 has a hard limiter, but it cannot be implemented for AL/NLS (anti-lag/no lift shift) by simply altering maps. In order to build (and hold) boost properly, custom code has to be added to ME7.

While this (more invasive) method has been used with some success (and has been ported to other ME7 ecus ), there are still some features missing from the AL/NLS code floating around Nefmoto. In particular


 * 1) AL/NLS should be disabled if the motor is not up to temp
 * 2) Misfire detection should be disabled during AL/NLS (to prevent possible DTC/limp from misfires)
 * 3) Knock detection should be disabled during AL/NLS (to prevent timing from being trimmed out)

Wheel speed sensor
If you have different wheel rolling diameters from stock, and you want to log the correct speed:
 * AIMVM (0x12A56) - Number of speed pulses per m for signal normalization v

Gear detection
The ecu computes the gear (gangi) from the quotient N/V out of nmot_w and vfzg_w. To find the current gear, the ecu uses for each possible gear a min and a max quotient to compare the actual N/v against.

You have to update these quotients in order to map with the present gearbox/wheels. The thresholds are named NVQUOT1O (upper quotient for 1st gear), NVQUOT1U (lower quotient for 1st gear) up to NVQUOT6O, NVQUOT6U for 6th gear.


 * NVQUOT1O (0x013BC2)
 * NVQUOT1U (0x013BC4)
 * NVQUOT2O (0x013BC6)
 * NVQUOT2U (0x013BC8)
 * NVQUOT3O (0x013BCA)
 * NVQUOT3U (0x013BCC)
 * NVQUOT4O (0x013BCE)
 * NVQUOT4U (0x013BD0)
 * NVQUOT5O (0x013BD2)
 * NVQUOT5U (0x013BD4)
 * NVQUOT6O (0x013BD6)
 * NVQUOT6U (0x013BD8)

Mono O2 sensor
Define these as 16 bit (do not designate LoHi or LSB), output type will be Hex digits. Still under development - may not work properly

Delete B1

 * 0x3C8BE
 * 0x3C8D0
 * 0x3E832

Original value will be 1A91, to replace with B2 input change to 1891.

Delete B2

 * 0x3C8F0
 * 0x3C902
 * 0x3EA90

Original value will be 1891, to replace with B1 input change to 1A91.

Larger displacement

 * KUMSRL - Conversion constant from MAF to relative charge

KUMSRL is roughly Vh/2578, where Vh is displacement in liters. Note that in WinOLS (and most likely all XDFs that define this map location), the precision of the "factor" attribute of the map is insufficient to properly describe KUMSRL, which is why the stock value appears to be off.

=DTC disables=

Missing Message from Instrument Cluster
If you see "18058 - Powertrain Data Bus: Missing Message from Instrument Cluster", and adjusting cluster adaptation channel 60 doesn't fix it:
 * CW_CAN_R (0x12C7A and 0x12C7C) - CAN receive enable

For the M-box:


 * 12C7A (applicable for softcoding 06611) 32--->0
 * 12C7C (applicable for softcoding 06711) 36--->4 (Don't just 0 this or you remove ABS/ESP module reception from the ecu)

For the L-box you can't 0 these or you'll kill CAN reception/timeout monitoring for the TCU as well. Instead:


 * 12C7A (applicable for softcoding 06651) 35--->3
 * 12C7C (applicable for softcoding 06751) 37--->7

This will ensure CAN monitoring is still active for the TCU and ABS, but kill P1650 when running M or L-box software in the earlier Bosch equipped cars

You should only need this for older clusters that can't be fixed by recoding them.

ESKONF
ESKONF or Endstuffen Konfig (Power stage configuration) refers to a group of 7 bytes in the 1.8t, and 13 bytes in the 2.7 flash. In short, these bytes tell the ecu which options are configured in that particular file. Typically, it's located right above KFKHFM. When removing a component ESKONF is required to disable circuit diagnosis. Without properly configuring the relevant bit pairs you will get DTCs (Malfunction in circuit, internal resistance too high, etc) due to the missing hardware. Leaving dead hardware attached may prevent these, but isn't necessary when properly coded out.

For those of you not versed in hex, a byte is comprised of 8 bits. A bit can be either a 0, or a 1. A bit pair is two bits. When put together large numbers can be conveyed much more concisely than writing them out in the traditional manner. A byte can have a value between 00, and FF. The corresponding Binary is expressed as follows:

00 00 00 00=00

11 11 11 11=FF

Now, back to ESKONF. The ESKONF configuration for 4B0906018CH is shown below. For the rest of this section, this configuration is the one being referenced.

AA FF 00 30 FF F8 30

First thing, we break this down into the corresponding bit pairs.


 * Byte 0 AA= 10 10 10 10
 * Byte 1 FF= 11 11 11 11
 * Byte 2 00= 00 00 00 00
 * Byte 3 30= 00 11 00 00
 * Byte 4 FF= 11 11 11 11
 * Byte 5 F8= 11 11 10 00
 * Byte 6 30= 00 11 00 00

Bit pair legend:


 * 11=SKIP, as in that component is not installed.
 * 10=SPECIAL TREATMENT. For all intents and purposes, we're going to ignore this.
 * 00=INSTALLED

Now each of the bit pairs represents an available component configuration. The legend for and layout of these components is available in the DEKON module of the FR, but I have broken it down for you here as well:

Bit pairs: (4B0906018CH ONLY! Every ECU ESKONF is different.)


 * Byte 0= ZUE4  ZUE3   ZUE2   ZUE1
 * Byte 1= NC    NC     NC     NC
 * Byte 2= EV4   EV3    EV2    EV1
 * Byte 3= LSHHK EFLA   LDR    TEV
 * Byte 4= BKV   NC     AAV    MIL
 * Byte 5= NC    NC     EKP    SLP
 * Byte 6= ULT   UAGR   SLV    NWS

Abbreviations:


 * ZUE=COIL
 * NC=NOT CONFIGURED
 * EV=INJECTOR
 * LSHHK=REAR O2'S
 * EFLA=(Error lamp non OBD compliant?)
 * LDR/E=N75
 * TEV=N80 TANK VENT VALVE
 * BKV=BRAKE BOOSTER PUMP
 * AAV=(shut off valve, Absperrventil vorhanden)
 * MIL=(Malfunction indicator lamp, OBD)
 * EKP=FUEL PUMP
 * SLP=J299 SAI PUMP RELAY
 * ULT/LDUVS=N249 Schubumluftventil
 * UAGR=(EGR valve power amplifier)
 * SLV=N112 SAI RELAY
 * NWS=n205 CAMSHAFT CONTROL/VVT
 * EPC - EPC light
 * SLP - J299 SAI pump relay
 * LDP - leak detection pump
 * BKP - brake booster pump

So, back to our example. Byte 3:

30 Hex= 00 11 00 00

Each bit pair represents a component. Being 00 means that particular component is installed, while 11 means it isn't.

The bit pairs for Byte 3 are as follows:

LSHHK EFLA LDR TEV

This translates into the following configuration:


 * LSHHK=Rear 02 sensor
 * EFLA=Not installed
 * LDR=N75
 * TEV=N80

If we wanted to remove any of these, we'd change the corresponding bit pair from 00 to 11 and recalculate the total of the bits in order to convey the data as hex. Best bet, use a hex calculator for this part.

Example: You want to remove rear oxygen sensor diagnosis:

OLD Bit pair arrangement:

00 11 00 00= 30

NEW Bit pair arrangement:

11 11 00 00= F0

So, to remove the rear 02 sensor ESKONF is changed from:

AA FF 00 30 FF F8 30

to

AA FF 00 F0 FF F8 30

Rear O2 Sensors
If you have removed precats and relocated your rear O2s, and you want to keep the sensors in place and working, you may throw an efficiency code. You can numb ME7's sensitivity using and possibly
 * AHKATMN (0x18672)
 * AHKATMX (0x18673)
 * AHKATS (0x18674)


 * AHKATSB (0x18675)

Set these to zero to disable rear cat DTC entirely (but you may not pass emissions if you do this):
 * CDKAT - Cat diagnosis in OBDII-Mode. (ME7.5 vehicles containing CDKATSP AND SPF should 0 these as well).
 * CWDLSAHK (0x18663) - Code word for probe aging after KAT

If you want to remove your rear O2s entirely, also set these to zero:
 * CDHSH - Post cat O2 heater diagnosis
 * CDHSHE - Post cat O2 heater amplifier diagnosis
 * CDLATV - Lambda sensor aging diagnosis (tv) in OBDII-Mode (inverse: EURO-Mode)
 * CDLASH - Lambda sensor aging diagnosis (SHK) in OBDII-Mode (inverse: EURO-Mode)
 * CDLSH - Post cat O2 sensor diagnosis
 * CDLSHV - Lambda sensor sensor interchange recognition (N/A for vehicles equipped with a single post cat sensor, IE 1.8t and certain vr6)
 * CWKONLS - Vehicles with 4 installed sensors (default value 51 dec), set to 17 Vehicles with 2 installed sensors (default value 3), set to 1. When setting CWKONLS CDLSH must also be configured to prevent malfunction in circuit DTC's.

Change these to disable rear O2 lambda control: Wideband vehicles use CLRSHK. In these the default value is typically 16. Set bit 0 to disable (Increment value shown by 1)
 * CLRHK (0x11A87) - Code word for Lambda - Control post cat on/off: set to 5 (00000101b) or set to 73 (0x49/01001001b)? (original value 72 0x48/01001000b)
 * CLRKA (0x11A72) - set to 0

Finally if you intend to disconnect the sensors, configure ESKONF (13 bytes starting at 0x10C75):. If you intend to leave the sensors installed and connected, there is no need to disable circuit diagnosis.


 * ESKONF[5] (0x10C7A) - set to 0xC0 (set bits 6 and 7)
 * ESKONF[6] (0x10C7B) - set from 0xF3 to 0xFF (M-box) (set bits 2 and 3)
 * ESKONF[6] (0x10C7B) - set to 0xC3 to 0xCF (L-box) (set bits 2 and 3)

You can test readiness by using VCDS/VAGCOM

To fix up the EGT model:

ATM: (above maps can be skipped IF diagnostic functions DLSH, DLSAHK, DHLSHK, DSLSLRS, DKATLRS are disabled AND LAMBTS, LRSKA, BBSAWE, LRSHK are fixed as shown further down. But personally I would set these maps anyway to do a *proper fix*, so even me7 logger would log tkatm_w = tikatm_w = tabgm)
 * ZATMIKML = 1
 * ZATMIKKML = 1
 * TABGMEX = F(max)
 * TIKATMOE = 0
 * ZATMKML = 1
 * ZATMKKML = 1
 * TKATMOE = 0


 * CWKONABG.0 = 0
 * TKATW = F(max)

LAMBTS (1. use temperature in exhaust manifold for BTS enrichment instead of precat 2. Enable LAMBTS only on high exhaust manifold temperatures - ignore cat/precat temperatures):
 * CWLAMBTS.2 = 1
 * DTBTS = 0
 * TKATBTS = F(max)
 * TIKATBTS = F(max)

LRSHK (to disable postcat o2 correction):
 * CLRSHK.0 = 1
 * CLRSHK.1 = 1

LRSKA (to disable "cat cleaning" function):
 * CLRSKA.0 = 0

BBSAWE (1. disable unneeded cat related cut-off latency 2. Do not disable cut-off based on cat temp) You should not have to touch these, but are are included for completeness:
 * KFTVSAKAT = 0
 * TKATSA = F(max)
 * CLAHSH - Error Class: Bank 1 post cat O2 sensor heater
 * CLAHSH2 - Error Class: Bank 2 post cat O2 sensor heater
 * CLAHSHE - Error Class: Bank 1 post cat O2 sensor heater amplifier
 * CLAHSHE2 - Error Class: Bank 2 post cat O2 sensor heater amplifier
 * CLALSH (0x10717) - Error Class: Lambda Probe post Kat Bank 1: set to 0
 * CLALSH2 (0x10718) - Error Class: Lambda Probe Post Kat Bank 2: set to 0
 * CLRHKA (0x19FCF) - Code word for Lambda - Control post cat: set to 1? (original value 0)

Removal
If you want to disable your EGT sensors: (Note that my old M-box xdf is wrong for CDATR/ATS. Please use these offsets.)


 * CDATR (0x18196) - Configuration byte diagnosis exhaust gas temperature regulation
 * CDATS (0x18197) - Configuration byte diagnosis exhaust gas temperature sensor

There is anecdotal evidence that this will not allow you to completely remove the EGT sensors; keeping dead ones connected might be necessary, or:


 * CATR (0x192CA) - Configuration byte exhaust gas temperature regulation

Alternately, setting both of these to their maximum (1229) may help:


 * TABGSS (0x1C514) and TABGSS2 (0x1C516) - Desired exhaust gas temperature for EGT regulation

You shouldn't have to touch these, but are included here for completeness:
 * CLAATR - Error class exhaust gas temperature regulation
 * CLAATR2 - Error class exhaust gas temperature regulation bank 2
 * CLAATS - Error class exhaust gas temperature sensor
 * CLAATS2 - Error class exhaust gas temperature sensor bank 2

Wideband EGT sensor swap
You can also swap to RS6 sensors to read an extended range (-40C to 1110C), in which case you will have to change:


 * TABGTA (0x1C4DE)
 * DTPATS (0x192F0)
 * TATSMN
 * TATSMX

Part numbers are
 * Bank one - 077 919 529E
 * Bank two - 077 919 529D
 * Both - 077 998 124

Secondary Air Injection
There are 2 generally accepted ways to disable SAI, both of which are outlined below.

The first, and most popular sets the monitor to unsupported (falsely shown as PASSED in VCDS) by setting both of the following codewords to 0:


 * CDSLS
 * CWKONABG

Another method, which allows the SAI readiness tests to actually run and pass:


 * MSLUB (0x1A698) - Note: only applies to L-Box

The values in this table are calculated airflow for a given battery voltage and are displayed in kg/h. To disable (or rather fool the ecu into accepting no flow as normal) you must set these values to 0.

However, if your pump still functions and you set MSLUB to 0, you should unplug it electronically in order to prevent insufficient flow DTC's. Alternatively, if you wish to remove the relay you must disable circuit diagnosis in ESKONF by setting the appropriate bitpairs SLV (N119) and SLP (J229)

Evaporation

 * CDLDP - Eurobyte - LDP Diagnosis
 * CDTES - Eurobyte - EVAP diagnosis
 * CLATEVE - EVAP plug
 * CLALDPE - LDP plug

Catalyst Heating

 * FKHABMN (0x1937D) - set to 0 if you do not have cats.

=Additional Reading=
 * Tony@NefMoto's website - one stop shopping for real tuning discussions, without the glass bead trading game and secret handshakes.
 * Motronic abbreviations
 * VCDS
 * Lemmiwinks
 * Basic tuning guide - caution: this is only an example

=References=