Tuning

Getting Started
Things you need


 * 1) KWP2000+ OBD cable
 * 2) KWP2000+ flashing software
 * 3) TunerPro
 * 4) XDF file for the revision of ECU you are using. If you wish to use a different version software than your car came with, read  this carefully.
 * 5) * XDF for M-box.
 * 6) ECUFix (required, the KWP2000 flashing software does not always get all the checksums right.)
 * 7) VCDS (aka VAG-COM) and/or ECUx
 * 8) 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.

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.


 * MLHFM - compensate for MAF housing diameter. 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 may hit the hard limit of load, and you'll go lean at high loads because the ECU can't tell how much air the motor is ingesting. That's obviously very bad. If that's the case, you'll definitely want to scale back the MAF readings some. Even if you don't ride the hard limit, you'll also run off the end of the load axis in the timing tables. Some say this isn't so much of an issue.
 * KRKTE - primary fueling. Start with this to get your WOT AFR to roughly match your requested AFR. If you are using stock injectors and fuel pump, you should not have to touch this.

The main tables that determine requested AFR:


 * LAMFA - requested lambda while calculated EGT is below TABGBTS. Not very useful for fine tuning high load fueling.

Instead, use:


 * KFLBTS_0_A - requested lambda for component protection when calculated EGT is above TABGBTS, scaled by FBSTABGM. Note that LambdaBTS also modified by KFDLBTS and KFFDLBTS: LambdaBTS = KFLBTS + (KFDLBTS * KFFDLBTS). Setting KFLBTS to 1 where you don't need it won't disable bts, you also have to set KFFDLBTS = 0 to disable it.


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


 * FBSTABGM - 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 of all this is "lambts" which, if lower, overrides "lamfa".

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.

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)

Boost
ME7.1 doesn't really have a "boost" table. It does everything based on "specified load". Requested boost is roughly 10*(spec load)+300mbar.

First, make sure the 100% pedal position 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.

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. 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

Boost PID
If your actual boost is not meeting requested boost, you may have to increase the PID I limit between 2250 and 5000 RPM for 850 and 1000mBar:
 * KFLDIMX - LDR I-Regulator limit

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 zero 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.
 * LDRQ0S - LDR PID Q0 in static operation (proportional term)
 * LDRQ1ST - LDR PID Q1 in static operation (integral term)
 * KFLDRQ2 - LDR PID Q2 (differential term)

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.

Torque limits
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
 * KFMIOP - Optimal engine torque map

Timing
When running elevated boost on pump gas, you will 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 knock voltages when tuning your timing.


 * 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 correct your MAF, you can probably leave most of the timing table alone, except at very high load.

Speed limiter

 * VAVMX/VMAX - Speed limiter

Rev limiter

 * NMAX - RPM limit
 * NLLM - idle RPM

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

Knock control
'''Adjust these maps with care. Abusing any of them can cause severe ping/knock/detonation and probable motor damage'''
 * KRFKLN - Ignition retard per knock event.
 * KRALH - Load hysteresis. This adjusts how quickly timing will be restored as load changes.
 * KRANH - Engine speed hysteresis. This adjusts how quickly timing will be restored as RPM changes.

Requested load cut on knock detection

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

Fuel enrichment on knock detection

 * KFLAMKRL - Enrichment on ignition retard

Launch control
You may be able to lower NMAX and raise this:
 * NMAXOG - Raised max engine speed

There are various tables that govern whether to use NMAX or NMAXOG. There may be a way to use both to set a lower RPM limiter while the car is not moving.

Emissions

 * CDKAT - Cat diagnosis in OBDII-Mode. Set to zero to disable rear cat DTC

Additional Reading

 * Motronic abbreviations
 * VCDS
 * Lemmiwinks