Lemmiwinks: Difference between revisions

From S4wiki
Jump to navigation Jump to search
 
(58 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==What is Lemmiwinks?==
==What is Lemmiwinks?==
[[Image:Lemmiwinks.jpg|400px|right]]
Named after an infamous Southpark character, lemmiwinks gives the average person access to a few parameters used by the Bosch Motronic ME7.1 to make engine management control decisions. While it does not allow the user to directly modify the internal boost/fueling/timing maps, let alone the control code responsible for interpreting those maps, it does allow quite a bit of customization.
Named after an infamous Southpark character, lemmiwinks gives the average person access to a few parameters used by the [[Bosch ME7.1]] to make engine management control decisions. While it does not allow the user to directly modify the internal boost/fueling/timing maps, let alone the control code responsible for interpreting those maps, it does allow quite a bit of customization.


Of most interest, it allows quite a bit of control over fueling, which, in the case of the B5 S4, is probably the single most important parameter when using a larger turbo than stock.
Of most interest, it allows quite a bit of control over fueling, which, in the case of the B5 S4, is probably the single most important parameter when using a larger turbo than stock.
Line 6: Line 7:
Of secondary interest is its ability to change the overall timing maps. However, ME7.1's built-in knock sensor control loop somewhat limits the usefulness of this feature.
Of secondary interest is its ability to change the overall timing maps. However, ME7.1's built-in knock sensor control loop somewhat limits the usefulness of this feature.


In addition, Lemmiwinks allows changes to the speed limiter, parameters governing engine idle characteristics, and "specified load" scaling. This last function is unfortunately also of limited use. Even though target load is directly related to specified boost, the default value is 100%, so target load (and therefore boost) can only be scaled downwards, not upwards. However, reducing overall boost can help prevent excessive negative boost deviation which can cause [[throttle cut]].
In addition, Lemmiwinks allows changes to the speed limiter, parameters governing engine idle characteristics, and "specified load" scaling. This last function is unfortunately also of limited use. Even though target load is directly related to specified boost, the default value is 100%, so target load (and therefore boost) can only be scaled downwards, not upwards. However, reducing overall boost can help prevent boost deviation which can cause [[throttle cut]].


==Channel summary==
==Channel summary==
{| class="wikitable"
{| class="wikitable"
! Ch. || Name || Function || Increase/decreasing value result
! Ch. || Name || Function || M-Box Address || FR Designation
|-
|-
| 01 || Idle Speed Offset
| 01 || Idle Speed Offset
| %LLRNS adjustment LL target speed
| Adjust idle RPM level
| 0x380C6D byte x10
| Increase/decrease idle (RPM)
| vstnls
|-
|-
| 02 || Fuel Tweak (Accel Pump) - Increasing Loads
| 02 || Fuel Tweak (Accel Pump) - Increasing Loads
| %ESUK adjustment factor BA
| Fuel trim tweak while load is rapidly increasing
| 0x380C65 byte
| Add/remove fuel (%)
| vstfba
|-
|-
| 03 || Fuel Tweak (Accel Pump) - Decreasing Loads
| 03 || Fuel Tweak (Accel Pump) - Decreasing Loads
| %ESUK adjustment factor VA
| Fuel trim tweak while load is rapidly decreasing
| 0x380C69 byte
| Add/remove fuel (%)
| vstfva
|-
|-
| 04 || Start Up Fuel Enrich
| 04 || Start Up Fuel Enrich
| Fuel trim during engine start
| %ESNST adjustment factor after start
| 0x380C66 byte
| Add/remove fuel (%)
| vstfns
|-
|-
| 05 || Warm Up fuel Enrich
| 05 || Warm Up fuel Enrich
| %ESWL Adjustment factor warm-up
| Fuel trim during engine warmup
| 0x380C6A byte
| Add/remove fuel (%)
| vstfwl
|-
|-
| 06 || Lambda Regulation
| 06 || Lambda Regulation -NB O2 cycle time
| %LR adjustment factor lambda control TV offset
| Controls narrow band 02 cycle time
| 0x380C6B byte
| Increase/decrease cycle time
| vstlr
|-
|-
| 07 || Additive Offset To Speed Limiter
| 07 || Additive Offset To Speed Limiter
| %VMAXMD V-lock adjustment
| Speed limiter
| 0x380C6F byte -128
| Increase/decrease speed limiter (km/hr)
| vstvvr
|-
|-
| 08 || Secondary Fuel Tweak
| 08 || Secondary Fuel Tweak
| %ESSTT Adjustment factor start
| Additive fuel term
| 0x380C68 byte x0.0078125
| Increase/decrease additive term (offset)
| vstfst
|-
|-
| 09 || Ignition Timing Offset
| 09 || Ignition Timing Offset
| %ZUE Additive ignition angle adjustment
| Adjust overall timing
| 0x380C64 byte x0.75
| Advance/retard timing (degrees)
| vstdzw
|-
|-
| 10 || Primary Fuel Tweak
| 10 || Primary Fuel Tweak
| %ESGRU adjustment factor basic adjustment
| Multiplicative fuel term
| 0x380C64 byte x0.75
| Increase/decrease multiplicative term (%)
| vstfrk
|-
|-
| 11 || Unused
| 11 || EGR Adjustment (Unused)
| %AGR EGR rate adjustment
| Unused
| 0x380C62 byte
|
| vstagr
|-
|-
| 12 || SEL Scaling (Turbo Cars Only)
| 12 || SEL Scaling (Turbo Cars Only)
| %LDRLMX Adjustment of maximum charge pressure
| Scale specified load
| 0x380C6E byte x0.392156863
| Increase/decrease requested boost (%)
| vstrlx
|-
|-
| 13 || Control Bits
| 13 || Control Bits (Unused ?)
| %LLRNS Adaptation of code word LL setpoint speed changeover
| Unused
| 0x380C63 byte
|
| vstcns
|-
|-
| 14 || Idle Torque Additive Offset
| 14 || Idle Torque Additive Offset
| Controls engine load at idle
| %LLRMR Adjustment torque reserve idle control
| 0x380C63 byte
| Increase/decrease spec load at idle
| vstmdr
|}
|}
Data from Setzi62 and Tony > [http://nefariousmotorsports.com/forum/index.php?topic=937.0]


==Bosch Motronic ME7.1, load, and you==
==[[Bosch ME7.1]], [[load]], and you==
So, how does the ECU decide on injector duty cycle, boost, and timing? One word: load. The ME7.1 is a "requested torque" based control system, which basically means that all decisions it makes is based on what it thinks the driver is asking for in terms of torque. The B5S4 is completely [[drive by wire]], which means there is no direct connection between the accelerator pedal and the [[throttle valve]]. All the accelerator pedal does is tell the ECU how much the driver wishes to "accelerate". Based on that input, the ECU calculates a "target torque" that the user seems to be requesting. This, in turn generates a "load" percentage - 100% meaning [[wide open throttle]] (WOT), or, to put it another way "give me all you got Scotty."
So, how does the ECU decide on injector on time, boost, and timing? One word: [[load]]. The [[ME7.1]] is a "requested torque" based control system, which basically means that all decisions it makes is based on what it thinks the driver is asking for in terms of torque. The B5S4 is completely [[drive by wire]] (a.k.a [[Electronic Throttle Control]] or ETC), which means there is no direct connection between the accelerator pedal and the [[throttle valve]]. All the accelerator pedal does is tell the ECU how much the driver wishes to "accelerate".


See also the [[Bosch ME7.1]] article.
Once the ECU decides it needs a target load of 100+% (i.e. the requested torque is greater or equal to what the ECU thinks the engine can deliver), its fueling control system goes [[open loop]]. In the ME7.1 [[asynchronous path]], this means that all fueling decisions are going to be made almost soley based on [[Mass air flow| mass air flow sensor]] readings. Those [[Mass air flow]] readings also go into the boost map as a "specified load" and, along with RPM, determine specified boost. In the ME7.1 [[synchronous path]], the timing maps determine the timing at every cycle of every cylinder, and should the knock sensor for a given cylinder reach a certain threshold, the timing will be cut down for the next cycle for that cylinder. If the knock sensor activity subsides, the timing will be restored, one step at a time, until another knock event occurs on that cylinder.

==Fueling curve==

===Primary and secondary fuel tweak===
To simplify things, from here on out will we assume the injector on time is ONLY a function of [[mass air flow | MAF]] readings. At its simplest, the fueling vs MAF value curve is a straight line with two terms. For those of you who know geometry and algebra, call it <math>y=a*x+b</math>, where ''x'' is the MAF, ''y'' is the injector on time, ''a'' is the "multiplicative" term and ''b'' is the "additive" term. There are additional terms based on the slope of the MAF, but that will wait for later.

To "enrich" the fueling across the board by a fixed percentage, one would increase the ''a'' (multiplicative) term, so the fueling is increased proportionally for every MAF value.

For example adding 10% to 10 yields 11, for an increase of 1, but adding 10% to 100 yields 110, for an increase of 10.

The "additive" value ''b'' does not have as much an effect near the top of the curve, because it is additive. In other words, ''adding'' a small amount everywhere means that the percentage increase of fueling for "high" MAF values is much lower than the percentage increase for "low" MAF values.

For example, adding 1 to 10 (to 11) is a 10% increase, whereas adding 1 to 100 (to 101) is only a 1% increase!

What does this mean for lemmiwinks? It means that the primary (multiplicative) fuel tweak (channel 10) increases fuel across the board, whereas the secondary (additive) fuel tweak (channel 08) has almost ''no'' effect on fueling for high MAF readings!

You can see what the ECU's own base additive and multiplicative "tweaks" are by examining the long term ([[LTFT]]) and short term fuel trims ([[STFT]]) with [[VAGCOM]] (blocks 32 and 33 respectively) or ECUx. However, the ECU will only update these based on O2 sensor readings, and only during [[closed loop]] operation.

===Fuel tweak increasing loads and fuel tweak decreasing loads===
Now, lets talk about those other terms - channels 02 and 03: Increasing and decreasing loads. Basically, those terms "tweak" the basic ''y=a*x+b'' by multiplying the overall result by a term that is dependant on the slope (or derivative ''dx/dt'' where x is load and t is time) of the load. That means the faster the load is increasing (or decreasing) the more this term affects the fueling. So the faster the load is going up, the more the "increasing load" term will adjust fueling. Similarly, the faster the load is dropping, the more the "decreasing load" term will change fueling.

Note that load is rougly proportional to MAF/RPM. This means that load is "increasing" when MAF is increasing more than RPM, and that load is "decreasing" when the MAF signal is decreasing, or is increasing slower than RPM.

In real life terms, load is "increasing" during turbo spool up. Once max boost is met, RPM is generally increasing faster than MAF. In this region, load is actually ''decreasing''!

===EGT effects on fueling===
[[EGT]] can effect the overall fueling. If EGTs are over approximately 980&deg;C (1796&deg;F) the ECU will add fueling (and possibly pull timing?) to bring the EGT temperatures down. This effect can be seen in [[VAG-COM]] block 112.

The functional range of the EGT sensor is 950&deg;C to 1025&deg;C ([http://nyet.org/cars/info/Audi_S4_engine_english.pdf S4 2.7t Self Study Programme, page 47]).

Block 034 does NOT measure real [[EGT]]s, it is only a calculated value based on maps using load/RPM as inputs.

Obviously, care must be taken when tuning the car under high EGT conditions, as the behavior of the ECU is radically different under "normal" conditions. A good rule of thumb is to try to get as much tuning as possible done under cool conditions and to make sure the intercoolers are not heatsoaked. Having an accurate picture of fueling and timing is critical to getting good results. Tuning your car under "artificially" enriched or pulled timing conditions simply means you run the risk of running lean or having too much timing under "good" conditions. The ECU will compensate using the knock sensor function, but it is better to get your car in the correct ball park for "normal" conditions.

==Tuning with Lemmiwinks==
More to come here. For now, check out [[User:Edy_Jun | Edy Jun]]'s excellent [http://homepage.mac.com/edyjun1/S4/logging%20stuff/Lemmiwinks-Tuning%20Notes.htm Lemmiwinks Tuning Notes]


==How lemmiwinks works==
==How lemmiwinks works==

[[Image:Lemmiwinks.jpg|400px|right]]
According to Revo (the makers of Lemmiwinks):

<blockquote>
Directly transferring the new adaptation channel values into the ECU
Directly transferring the new adaptation channel values into the ECU
works by finding the RAM memory location where the ECU stores the
works by finding the RAM memory location where the ECU stores the
Line 84: Line 139:
is required because memory writes directly to the serial eeprom are
is required because memory writes directly to the serial eeprom are
blocked.
blocked.
</blockquote>

<blockquote>
Interestingly, this method will not work using the VAG mode protocol.
Interestingly, this method will not work using the VAG mode protocol.
Write access is allowed to any ECU RAM location except those locations
Write access is allowed to any ECU RAM location except those locations
that store the serial eeprom data. Someone at Bosch clearly knew about
that store the serial eeprom data. Someone at Bosch clearly knew about
this vulnerability and took measures to close this loophole. But for
this vulnerability and took measures to close this loophole. But for
some reason this loophole was left in the KWP2000 routines.
some reason this loophole was left in the [[KWP2000]] routines.
</blockquote>

<blockquote>
Each ECU code stores this adaptation channel data in different RAM
Each ECU code stores this adaptation channel data in different RAM
locations. To make this method work with any ECU one runs through the
locations. To make this method work with any ECU one runs through the
following steps:
following steps:
# Establish communications with the ECU using KWP2000 mode
# Establish communications with the ECU using [[KWP2000]] mode
# Read data directly from serial eeprom (since read access is allowed)
# Read data directly from serial eeprom (since read access is allowed)
# Search for this data in the ECU's RAM
# Search for this data in the ECU's RAM
# Write the new adaptation channel settings to the RAM location
# Write the new adaptation channel settings to the RAM location
# Cycle ignition key to have ECU transfer the new settings into the serial eeprom.
# Cycle ignition key to have ECU transfer the new settings into the serial eeprom.
</blockquote>

<blockquote>
The KWP2000 protocol is not as reliable as the VAG protocol. Some cars
The [[KWP2000]] protocol is not as reliable as the VAG protocol. Some cars
will have communications problems which often can be worked around by
will have communications problems which often can be worked around by
pulling the instrument cluster fuse (make sure VAG-COM will be able to
pulling the instrument cluster fuse (make sure VAG-COM will be able to
clear your air bag DTC light before doing this!).[http://forums.vwvortex.com/zerothread?id=1191064]
clear your air bag DTC light before doing this!).[http://forums.vwvortex.com/zerothread?id=1191064]</blockquote>


[[Category:Tuning]]

Latest revision as of 21:55, 6 December 2022

What is Lemmiwinks?

Lemmiwinks.jpg

Named after an infamous Southpark character, lemmiwinks gives the average person access to a few parameters used by the Bosch ME7.1 to make engine management control decisions. While it does not allow the user to directly modify the internal boost/fueling/timing maps, let alone the control code responsible for interpreting those maps, it does allow quite a bit of customization.

Of most interest, it allows quite a bit of control over fueling, which, in the case of the B5 S4, is probably the single most important parameter when using a larger turbo than stock.

Of secondary interest is its ability to change the overall timing maps. However, ME7.1's built-in knock sensor control loop somewhat limits the usefulness of this feature.

In addition, Lemmiwinks allows changes to the speed limiter, parameters governing engine idle characteristics, and "specified load" scaling. This last function is unfortunately also of limited use. Even though target load is directly related to specified boost, the default value is 100%, so target load (and therefore boost) can only be scaled downwards, not upwards. However, reducing overall boost can help prevent boost deviation which can cause throttle cut.

Channel summary

Ch. Name Function M-Box Address FR Designation
01 Idle Speed Offset %LLRNS adjustment LL target speed 0x380C6D byte x10 vstnls
02 Fuel Tweak (Accel Pump) - Increasing Loads %ESUK adjustment factor BA 0x380C65 byte vstfba
03 Fuel Tweak (Accel Pump) - Decreasing Loads %ESUK adjustment factor VA 0x380C69 byte vstfva
04 Start Up Fuel Enrich %ESNST adjustment factor after start 0x380C66 byte vstfns
05 Warm Up fuel Enrich %ESWL Adjustment factor warm-up 0x380C6A byte vstfwl
06 Lambda Regulation -NB O2 cycle time %LR adjustment factor lambda control TV offset 0x380C6B byte vstlr
07 Additive Offset To Speed Limiter %VMAXMD V-lock adjustment 0x380C6F byte -128 vstvvr
08 Secondary Fuel Tweak %ESSTT Adjustment factor start 0x380C68 byte x0.0078125 vstfst
09 Ignition Timing Offset %ZUE Additive ignition angle adjustment 0x380C64 byte x0.75 vstdzw
10 Primary Fuel Tweak %ESGRU adjustment factor basic adjustment 0x380C64 byte x0.75 vstfrk
11 EGR Adjustment (Unused) %AGR EGR rate adjustment 0x380C62 byte vstagr
12 SEL Scaling (Turbo Cars Only) %LDRLMX Adjustment of maximum charge pressure 0x380C6E byte x0.392156863 vstrlx
13 Control Bits (Unused ?) %LLRNS Adaptation of code word LL setpoint speed changeover 0x380C63 byte vstcns
14 Idle Torque Additive Offset %LLRMR Adjustment torque reserve idle control 0x380C63 byte vstmdr

Data from Setzi62 and Tony > [1]

Bosch ME7.1, load, and you

So, how does the ECU decide on injector on time, boost, and timing? One word: load. The ME7.1 is a "requested torque" based control system, which basically means that all decisions it makes is based on what it thinks the driver is asking for in terms of torque. The B5S4 is completely drive by wire (a.k.a Electronic Throttle Control or ETC), which means there is no direct connection between the accelerator pedal and the throttle valve. All the accelerator pedal does is tell the ECU how much the driver wishes to "accelerate".

See also the Bosch ME7.1 article.

Fueling curve

Primary and secondary fuel tweak

To simplify things, from here on out will we assume the injector on time is ONLY a function of MAF readings. At its simplest, the fueling vs MAF value curve is a straight line with two terms. For those of you who know geometry and algebra, call it , where x is the MAF, y is the injector on time, a is the "multiplicative" term and b is the "additive" term. There are additional terms based on the slope of the MAF, but that will wait for later.

To "enrich" the fueling across the board by a fixed percentage, one would increase the a (multiplicative) term, so the fueling is increased proportionally for every MAF value.

For example adding 10% to 10 yields 11, for an increase of 1, but adding 10% to 100 yields 110, for an increase of 10.

The "additive" value b does not have as much an effect near the top of the curve, because it is additive. In other words, adding a small amount everywhere means that the percentage increase of fueling for "high" MAF values is much lower than the percentage increase for "low" MAF values.

For example, adding 1 to 10 (to 11) is a 10% increase, whereas adding 1 to 100 (to 101) is only a 1% increase!

What does this mean for lemmiwinks? It means that the primary (multiplicative) fuel tweak (channel 10) increases fuel across the board, whereas the secondary (additive) fuel tweak (channel 08) has almost no effect on fueling for high MAF readings!

You can see what the ECU's own base additive and multiplicative "tweaks" are by examining the long term (LTFT) and short term fuel trims (STFT) with VAGCOM (blocks 32 and 33 respectively) or ECUx. However, the ECU will only update these based on O2 sensor readings, and only during closed loop operation.

Fuel tweak increasing loads and fuel tweak decreasing loads

Now, lets talk about those other terms - channels 02 and 03: Increasing and decreasing loads. Basically, those terms "tweak" the basic y=a*x+b by multiplying the overall result by a term that is dependant on the slope (or derivative dx/dt where x is load and t is time) of the load. That means the faster the load is increasing (or decreasing) the more this term affects the fueling. So the faster the load is going up, the more the "increasing load" term will adjust fueling. Similarly, the faster the load is dropping, the more the "decreasing load" term will change fueling.

Note that load is rougly proportional to MAF/RPM. This means that load is "increasing" when MAF is increasing more than RPM, and that load is "decreasing" when the MAF signal is decreasing, or is increasing slower than RPM.

In real life terms, load is "increasing" during turbo spool up. Once max boost is met, RPM is generally increasing faster than MAF. In this region, load is actually decreasing!

EGT effects on fueling

EGT can effect the overall fueling. If EGTs are over approximately 980°C (1796°F) the ECU will add fueling (and possibly pull timing?) to bring the EGT temperatures down. This effect can be seen in VAG-COM block 112.

The functional range of the EGT sensor is 950°C to 1025°C (S4 2.7t Self Study Programme, page 47).

Block 034 does NOT measure real EGTs, it is only a calculated value based on maps using load/RPM as inputs.

Obviously, care must be taken when tuning the car under high EGT conditions, as the behavior of the ECU is radically different under "normal" conditions. A good rule of thumb is to try to get as much tuning as possible done under cool conditions and to make sure the intercoolers are not heatsoaked. Having an accurate picture of fueling and timing is critical to getting good results. Tuning your car under "artificially" enriched or pulled timing conditions simply means you run the risk of running lean or having too much timing under "good" conditions. The ECU will compensate using the knock sensor function, but it is better to get your car in the correct ball park for "normal" conditions.

Tuning with Lemmiwinks

More to come here. For now, check out Edy Jun's excellent Lemmiwinks Tuning Notes

How lemmiwinks works

According to Revo (the makers of Lemmiwinks):

Directly transferring the new adaptation channel values into the ECU works by finding the RAM memory location where the ECU stores the adaptation channel data and directly writing the changes to those RAM memory locations. When the ignition key is turned off the ECU enters a housekeeping mode where among other tasks the modified adaptation channel data is written into the serial eeprom. This roundabout method is required because memory writes directly to the serial eeprom are blocked.

Interestingly, this method will not work using the VAG mode protocol. Write access is allowed to any ECU RAM location except those locations that store the serial eeprom data. Someone at Bosch clearly knew about this vulnerability and took measures to close this loophole. But for some reason this loophole was left in the KWP2000 routines.

Each ECU code stores this adaptation channel data in different RAM locations. To make this method work with any ECU one runs through the following steps:

  1. Establish communications with the ECU using KWP2000 mode
  2. Read data directly from serial eeprom (since read access is allowed)
  3. Search for this data in the ECU's RAM
  4. Write the new adaptation channel settings to the RAM location
  5. Cycle ignition key to have ECU transfer the new settings into the serial eeprom.

The KWP2000 protocol is not as reliable as the VAG protocol. Some cars will have communications problems which often can be worked around by pulling the instrument cluster fuse (make sure VAG-COM will be able to

clear your air bag DTC light before doing this!).[2]