0% found this document useful (0 votes)
54 views

MS3 Installation

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

MS3 Installation

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Revision 3: December 9, 2020

Setup and Installation instructions for the MS3 NA / NB


Preparing your miata
1. VERY IMPORTANT REMARK FOR ALL YEARS. This ecu uses 'going LOW'.
Do NOT use 'going HIGH' or you WILL blow up your coils!
AGAIN. USE GOING LOW AT ALL TIMES.
2. VERY IMPORTANT REMARK FOR 90-93 1.6
Remove the 10A "ST-SIGN" fuse from the fusebox under the hood.
If you dont do this, the MS3 will be damaged!

You must also disconnect the stock 1.6 TPS or install a variable TPS.
Again, this is not needed for the later cars, only for the 90-93 1.6 NA.
3. Remove the stock ECU, open it and remove the board.
4. Make a notch in the case for the USB connector, map sensor and Bluetooth / WiFi module.
5. Install the board in the case, close it and reinstall in the car.
6. Run a vacuum line from the intake manifold, just after the throttle body, to the ECU. The
MS3 will not work properly without a connected vacuum line.
7. For a turbo / SC, its best to install an open element IAT sensor because they react faster to
changing intake temperature. For normally aspirated engines, the stock sensor is just fine.
• On the US 90-93 1.6L (and European 94-97 1.6L), the IAT sensor replaces the sensor
that is inside the AFM (Air Flow Meter). Disconnect the AFM, and pull back the rubber
boot of the AFM's connector. You should see 7 wires on it. The IAT sensor connects to
the red/green and black/green wires. No polarity.
• On the 94-97 1.8L, the IAT sensor replaces the sensor that is inside the MAF (Mass Air
Flow) sensor. Disconnect the MAF, and pull back the rubber boot of the MAF's
connector. You should see 5 wires on it. The IAT connects to the red/black and
black/green wires. No polarity.

Preparing your PC
1. Download TunerStudio from tunerstudio.com and install. I advise getting the payed version
as the free version cannot autotune your fuel table.
2. The MS3s are supplied with firmware version 1.5.1 loaded and a tune (basemap) ready for
your engine. There is no need to reload new firmware, but if you ever need it again, you
can find it on https://www.msextra.com/downloads/.
3. I advise saving a backup of your basemap before changing anything in TunerStudio. This
will make it easier to restore a working setup in case you screw up.

1
Revision 3: December 9, 2020

Getting your PC to talk to your Megasquirt over USB

1. Turn on the ignition (but do not start just yet)


2. Connect your PC to the Megasquirt with a USB printer cable. Windows should detect and
install the USB driver automagically. If it doesnt download it from
http://www.ftdichip.com/Drivers/CDM/CDM%20v2.12.00%20WHQL%20Certified.exe or go
to the FTDI homepage http://www.ftdichip.com/Drivers/D2XX.htm
3. From the Start Screen select File → Vehicle Projects → New Project
4. In the Project Name box you can give your project a meaningful name - anything will do.
5. Click on Detect (For connection over WiFi see further down)
TunerStudio will now try to find your Megasquirt and its firmware version. If successful, it
will list your Megasquirt, firmware version and baud rate.
If your device is listed twice (D2XX and RS232), choose D2XX as it is preferred.
If you get No Controller Found, check your connection and try again.
6. Click Accept
7. In the Project Properties box:
• Oxygen Sensor: Wideband / AFR (default)
• Temperature display: Choose Celcius or Farenheit
• CAN_COMMANDS: Activated (default)
• INTERNAL_LOG_FIELDS: Activated
• PW_4X: Deactivated (default)
• CYL_12_16_SUPPORT: Deactivated (default)
• PORT_STATUS: Activated
• OUTMSG_EDITING: Deactivated (default)
8. Click OK
9. Click Next in the Communication box. Generally these settings are OK as Detect should
have set them already.
10. Select the gauge style you want
11. Click Finish
12. You should see the gauges and you should be in Online mode.

Getting your PC to talk to your Megasquirt over WiFi

1. Turn on the ignition (but do not start just yet)


2. Connect your laptop to the Megasquirt WiFi network. The pin code is 12345678
3. From the Start Screen select File → Vehicle Projects → New Project
4. In the Project Name box you can give your project a meaningful name - anything will do.
5. Check the box Show Advanced / Offline Setup
6. Under ECU Definition select MS3 Format 0566.05 (this is probably the last value in the
dropdown)
7. Click Next
8. In the Project Properties box:
• Oxygen Sensor: Wideband / AFR (default)
• Temperature display: Choose Celcius or Farenheit
• CAN_COMMANDS: Activated (default)
• INTERNAL_LOG_FIELDS: Activated
• PW_4X: Deactivated (default)
• CYL_12_16_SUPPORT: Deactivated (default)
2
Revision 3: December 9, 2020
• PORT_STATUS: Activated
• OUTMSG_EDITING: Deactivated (default)
9. Click Next
10. Under Connection Type select TCP/IP - WiFi driver
11. Enter Port 23 and IP address 192.168.4.1
12. Click Next
13. Select the gauge style you want
14. Click Finish
15. Open Communications – Settings and Click Accept.
The Test Port and Detect buttons do NOT work with WiFi!
16. You should see the gauges and you should be in Online mode.

Calibrating the sensors


1. Calibrate your throttle position sensor under Tools → Calibrate TPS.
• Dont touch the throttle and click Get Current next to Closed throttle ADC count.
• Fully open the throttle and click Get Current next to Full throttle ADC count.
Click Accept and your throttle sensor is calibrated.
2. Calibrate MAP/Baro under Tools → Calibrate MAP/Baro
• Under MAP Sensor – common MAP Sensors, select MPX4250
• Under Barometer Sensor, also select MPX4250
Click Burn and Close
3. Unlock Calibrations by clicking Tools → Un/Lock calibrations. Select Unlocked and Close.
4. Calibrate CLT and Air Temp sensors by clicking Tools → Calibrate Thermistor Tables
Use Bias Resistor Value 2490 and Click Celsius
• Select Coolant Temperature Sensor and use these values:
Temperature Resistance
-10 9250
22 2320
99 192
• Select Air Temperature Sensor and use these values:
Temperature Resistance
-20 28231
30 2280
100 180
• Click Write to Controller and Close
5. Calibrate your Wideband by clicking Tools → Calibrate AFR Table
• Choose Custom Linear WB in the dropdown and enter the data for your wideband.
• Click Write to Controller and Close
6. Lock Calibrations by clicking Tools → Un/Lock calibrations. Select Locked and Close.

3
Revision 3: December 9, 2020
Setting base timing
You must ABSOLUTELY set the base timing with a timing light.
It is not necessary to put a jumper in the diagnostics connector. That is only needed with the
stock ecu. The diagnostics connector no longer has a purpose with the Megasquirt.
• Open Ignition Settings → Ignition Options / Wheel Decoder
• Set Fixed Advance to Fixed Timing
• Set Timing for Fixed Advanced (degrees) to 10.
• Click Burn
• Turn off the ignition and restart the car.
• Go to Ignition Settings -> Trigger Wizard
• Press the - and + buttons until the crank pulley is on the 10° mark.
• Press Burn and Close.
• Go to Ignition Settings -> Ignition Options/Wheel Decoder
• Set Fixed Advance back to Use Table
• Click Burn
• Turn off the ignition

You are now ready to drive the car and tune!

I strongly advise reading the Setting Up manual and the TunerStudio Reference manual on
https://www.msextra.com/manuals/ms3manuals/

Air Temp Sensor / Fuel Pump / EBC solenoid

1.6 (NA) Air Flow Meter (AFM) Connector

Megasquirt does not use the AFM. It is OK to leave


it in place, but for maximum performance remove it.
With it removed, we can repurpose the wiring for the
air temp sensor and boost solenoid.
The stock air temp sensor is located inside the AFM.
If you remove the AFM, install a new air temp sensor.
Connect it to the RED/GRN and BLK/LT-GRN wires
(BLK/BLU on some cars).

The EBC solenoid must be connected to a switched


power supply inside the engine bay. The blue power
connector near the driver's headlight is the ideal
choice. Connect the other wire to the LT-GRN/RED
wire in the AFM connector.
For the EBC solenoid to function, you need to add a
wire inside the Megasquirt. Run it from the boost
output pin to 2K (see assembly manual).

Only install the fuel pump jumper if you are using the
active low driver (see assembly manual)

1.8 (NA) Mass Air Flow (MAF) Connector

4
Revision 3: December 9, 2020

Megasquirt does not use the MAF. It is OK to leave it in place, but for
maximum performance remove it. With it removed, we can repurpose
the wiring for the air temp sensor and boost solenoid.

The stock air temp sensor is located inside the MAF. If you remove
the AFM, install a new air temp sensor. Connect it to the RED/BLK
and BLK/BLU wires as shown.

Connect the EBC solenoid to the WHT/RED and the wire next to it
(1994:RED or 1996:RED/WHT).

For the EBC solenoid to function, you need to add a wire inside the
Megasquirt (see assembly manual).
1994-95: from the boost output pin to 2O
1996-97: from the boost output pin to 2B

99-05 (NB) Mass Air Flow (MAF) Connector

Only the EBC solenoid gets wired to the MAF connector.


Connect it to the WHT/RED and center wire (99-00: LT-GRN/BLK or 01-
05: PNK).

The stock air temp sensor is located just behind the MAF directly on the
intake pipe, unplug it and use that connector for the new air temp sensor.
There’s only 2 wires and polarity doesn’t matter.

5
Revision 3: December 9, 2020
Tuning Tips
Autotune (VE Analyze Live aka VEAL)
• Concentrate on one issue and make small changes. If you change a lot of different
things at once, you’ll constantly have issues.
• Get the car up to operating temperature.
• Lock out your idle cells. Idle should not be autotuned. Select the cells that you normally
idle in and everything below it, right click, and select Lock Selected Cells.
• Autotune doesn’t work well on overrun (= gas loslaten) so set your minimum fuel load
(Advanced Settings) to just above what you idle at. That way it will still tune low load
cruising, but not get confused with overrun. This works better than locking out your
lowest rows because it allows proper interpolation with the lowest row.
Actually autotuning the decel load cells (no overrun fuel cut) can give you an indication
of how close your dead-time is to the actual value. High numbers indicate too short, low
numbers indicate too long.
• For the first 15 minutes of autotuning, set Cell Change Resistance to Very Easy. Then
set it to Easy and continue. As you go along increase the setting to Normal and even
Hard. The darker green a cell gets in the Cell Weighting table, the better it is tuned.
• Drive very smooth for best results.
• Start from the first row above idle and tune every row. Try to stay in a single row by
modulating throttle and increase rpms to cover the entire rpm range. A steep uphill
helps to slow things down.
• If you notice while tuning that your fuel table is too rich (Autotune lowers all cells), it’s
easier to just lower req fuel a bit. This lowers the entire table at once.
• If you notice your table is too lean, raise req fuel. Having Autotune lower a rich fuel
table is OK, but relying on Autotune to raise a lean table is very dangerous. You’re
basically driving lean until Autotune has raised all values.
• Enable Update Controller and Save often
• Save regularly so you don’t lose anything should your laptop battery die.
• Finally, an autotuned fuel table is not a finished fuel table. Smooth it out, look for
patterns and interpolate where you can. Then make some pulls, and look at your logs.
Check that AFRs are correct and that it all looks good.
Tuning Idle
• Set all the gains to 0%. This is so that the effects of tuning the I-term in the next step are
not confused with the effects of any other setting.
• Tune the Integral (I) gain - The Integral gain is the only term that controls whether the
code actually reaches its target. Higher values for Integral gain will result in the code
being able to get closer to the commanded target; however, a value that is too high will
result in oscillation. The easiest way to determine a good value for the I term is to keep
increasing it until oscillation occurs, then slightly lower it. If this value is increased to
200% without reaching a point where oscillation occurs, then the RPM with valve
opened setting can be decreased as far as necessary, and the open duty/steps setting
and closed duty/steps setting can be made further apart to make the PID loop more
sensitive.
• Tune the Proportional (P) gain - After tuning the I gain so that the RPM reaches the
commanded target without oscillation, the P gain can be tuned. The best way to tune
this is to set it as high as possible without getting any oscillation. After setting this, try
turning on the air conditioning or other accessories that normally lower RPM or increase
load. When these accessories are turned on, the RPM should dip a bit then recover (the
valve position should increase significantly). Using longer PID ramp to target times can
6
Revision 3: December 9, 2020
also make it so that when the PID algorithm engages, a higher P gain can be set without
causing oscillation.
• Tune the Derivative (D) gain - For most users, use of the D gain should not be
necessary. It substantially dampens the response of the loop.

Tuning Engine States


• Slow acceleration threshold (Used by Closed-loop idle control, idle-VE and idle-advance)
It should be set as low as possible to catch all actual acceleration, but not set so low that
it catches RPM jitter.
Datalog idle and see what the highest RPMdot is during idle. Add and remove loads to
get rpm changes. Set to just above the highest RPMdot at idle.
• Slow deceleration threshold (Used by Closed-loop idle control, idle-VE and idle-advance,
idle-VE, idle-advance and overrun fuel-cut)
To set this, cruise in a high gear, then see what RPMdot value you get by lifting off the
throttle fully and decelerating. Set this value slightly above that RPMdot value.
Same as Slow acceleration threshold, but with negative RPMdot
• Overrun Map Threshold: should be set as high as possible, I usually use a MAP value
just under the lowest MAP I see on idle.

Tuning Lambda delay


At high RPM's the AFR signal responds much faster, typically within 40-60 ms, which is
around 1 record for MLV's lambda delay. On light throttle, it can slow significantly or even
more so under throttle off conditions, the variability between engines rises largely under
light/no load as well. The real key is to look through your log file at transient events. Those
are most likely to produce a noticeable shift in AFR.
For example, a rapid movement in Throttle that triggers an AE event with a jump in
pulsewidths, odds are there will be a noticeable shift in AFR, count how many records from
the AE PW change to the reaction by AFR.
As Lambda Delay is in records in MLV, the time of each record is dependent on the data rate
of the log file.
When using VE Analyze in MLV I often do it in 2 passes.
1st set a filter to not change anything over 75-80 kPa and use a Lambda Delay of 3 or 4, run
VE Analyze and Apply. Then run a 2nd pass of VE Analyze with the same log, this time
filtering below 80 and have a lambda delay of 1.

Tuning PID EGO


Make sure that your engine is quite well tuned. If there are other things (like screwed up AE
or whatever) that influence AFR massively, it may not get right.
Set "I" and "D" to zero.
Increase "P" until Ego control starts oscillating (watch ego corr. gauge). Reduce "P" to 50%
of this value.
Increase "I" until you get good response and good targeting of the loop.
Last but not least increase "D" to get rid of the last oscillations.
"P" is the "Proportional" component. Similar to the traditional EGO control. The lager the
deviation, the larger the "Force" of the controller against it.
"I" is related to Magnitude and duration of the error, i.e. the larger and/or longer the error, the
larger gets "I"-Force to get back to target.
"D" normally is used to limit the "overshoot" of "I" but also the "P" term.

7
Revision 3: December 9, 2020
With a pure "P" loop the controller will either act clumsy and never reach its target 100% (so
called droop), or -with more "P"- it will act unstable. That's what "I" is good for, as it mostly
detects large Jumps in the signal.
But you should keep controller authority in sensible range. In my case +/-15% is the max that
works under all circumstances. Something like +/-5% should be a good starting point.
Tuning via EGT vs Wideband Meter
There seems to be a lot of mystery and misinformation about using exhaust gas
temperatures to tune engines. Claims by many EGT gauge manufacturers about it being the
best way to tune an engine must be qualified. The BEST way to tune an engine is on an
engine dyno- PERIOD. What EGT is good for is a reference for where the engine made
maximum torque at wide open throttle. Once removed from the dyno, a similar air/fuel ratio
can be established at a later date by dialing in the mixture to achieve the target EGT. It is
really the AFR that is important, not the EGT. Most engines will make maximum power at an
AFR of between 12.0 and 13.5 to 1 however, the EGT may vary from 1250F to 1800F and is
dependent on many factors.
It should be mentioned that the target EGT is valid only on the same engine configuration as
was used on the dyno. If you change the ignition timing, cams, pistons, headers etc., the
optimum EGT may also change. Raising the compression ratio with no other changes will
drop the EGT at the same AFR. Retarding the ignition timing will generally raise the EGT at
the same AFR. One engine might make best power at 1350 degrees while a very similar
engine might be happier at 1500. You can't guess at this or you are simply wasting your
money on the instrumentation. Wankel engines have higher EGTs than comparable piston
engines due to their lower thermal efficiencies. 1800F is not uncommon here.
Some gauge manufacturers say you should tune to achieve maximum or peak EGT for
maximum performance. This is incorrect. Peak EGT generally occurs at an AFR of around
14.7- 15.0 to 1 on gasoline. This is far too lean for maximum power and is dangerous under
continuous WOT conditions. Many people think that the leaner you go, the higher the EGT
gets. This is also incorrect. Peak EGT occurs at stoichiometry- about 15 to 1 for our
purposes. If you go richer than 15 to 1, EGT will drop and if you go leaner than 15 to 1 EGT
will ALSO drop. It is VERY important to know which side of peak EGT you are on before
making adjustments. It is safe to say that peak power will occur at an EGT somewhat colder
than peak EGT.
You can sometimes feel a lean of peak condition as the mixture is hard to ignite and power
will be down a bit as well. Once the AFR gets close to 17 to 1 at WOT, generally the engine
will start to lean misfire. Most tuners always recommend to begin jetting or programming from
a known very rich initial setting and carefully leaning until torque falls off slightly, then going
back richer to the point of max torque. Note the EGT at this setting. Be aware that altitude,
barometric pressure and ambient air temperature may affect this optimal temperature to
some degree.
Are EGT gauges better than AFR meters? Conventional narrow band oxygen sensors and
digital LED meters are not the best devices to measure AFR in the richer ranges but they
certainly warn of a too lean condition immediately and obviously, without translation by the
driver and they are affordable. Meters combined with wide band sensors are supposed to be
highly accurate and everyone has jumped on the bandwagon with these lately. Unfortunately
the naive and impressionable often don't question the accuracy of these devices. We have
seen some dyno plots indicating best power was achieved at AFRs of 9.7 to 1 on gasoline.
This is PHYSICALLY AND CHEMICALLY IMPOSSIBLE and shows that either the sensor
was bad (leaded fuel used possibly) or the meter was not calibrated properly. Again, the wide
band sensors have the same limitations as the narrow band- leaded race gas quickly fouls
them. We have heard and read many stories now indicating that certain brands of wideband
meters differ as much as 2 points AFR in readings between each other. In other words, the
8
Revision 3: December 9, 2020
accuracy of some of these devices is highly questionable. Extensive testing with laboratory
quality instrumentation on aircraft engines universally indicates that best power is NEVER
made at AFRs richer than 12 to 1. Airflow and fuel flow rates are independently measured
and each cylinder is instrumented with EGT probes.
We recently dynoed a shop road racing Celica on a DynoJet equipped with a wide band
meter. The meter was saying that the engine was going super lean (17 to 1) at high rpm so
we kept upping the fuel there. The engine lost more and more power as we added fuel. The
dyno operator was convinced that the meter was right but logic told us with no serious dip in
power on the curve and the fact that the engine was still alive that the meter was not correct.
We started leaning the engine down more and the engine started gaining power. Finally,
when confronted with this information, the operator checked the water trap for the wide band
sensor. Once this was emptied, the AFRs looked reasonable again. We didn't need the wide
band to tell us this, only the torque curve from the dyno.
We have heard of several other instances with people using wide bands getting erroneous
readings and tuning their SDS based on these readings. Then they phone us saying that the
system is crap. Look at the dyno curve, when the engine makes its best power at a given
rpm, that's where it likes the AFR irregardless of what other instrumentation is telling you.
Remember, a bad sensor whether O2 or EGT equals bad information. When the engine
sounds crisp and makes great power, you're there.
I would suggest that mixture meters and EGT gauges are complimentary. EGT gauges have
the advantage of working long term with leaded fuel which will clog oxygen sensors. EGT
gauges are widely used to set mixture on engines used for steady state high power
applications where operation has been carefully documented such as in aircraft. The choice
would depend on the application. Both are better if you can afford them.

Tuning EAE
1. Tune VE, Warmup enrichments, and all other fuel-related features.
2. Turn off normal Acceleration enrichment by setting the TPSdot and MAPdot thresholds to
extremely high numbers.
3. Make sure that the VE table covers all the way down to Cranking RPM and to extremely
low kPa values.
4. Enable EAE in the Acceleration Enrichment dialog box.
5. With the engine at a steady RPM in a high gear, step on the throttle SLOWLY, and note
the response feel and the AFR.
6. At the same RPM, lift off the throttle, and note the response feel and the AFR.
7. Tune the EAE Adhere-to-walls curve and EAE Sucked-from-walls curve until AFR and
response are smooth and stable.
8. Make sure that the throttle movements used are small and slow, allowing the AFR to
reach steady-state before moving the throttle again. Make sure that the whole load range
is covered, and that every load seen during engine operation is covered by each of the
curves.
9. Choose a few other RPM ranges, and slowly step on and release the throttle. Tune the
EAE Adhere-to-walls RPM correction and EAE Sucked-from-walls RPM correction curves
until the response and AFR are correct at the RPMs chosen. Typically Idle and high cruise
RPMs should be chosen. High cruise RPMs for example are when speed is maintained
but the gear selection is reduced by one or two gears.
10. Shut off the engine, and allow it to cool completely. Start the engine; as the coolant
temperature increases, adjust the EAE Adhere-to-walls CLT correction and EAE Sucked-
from-walls CLT correction curves so that response and AFR are stable.
11. Once small, slow throttle movements are tuned, larger ones can be verified, as well as
9
Revision 3: December 9, 2020
normal driving with gear shifts
12. Finally, try to quickly blip the throttle while free-revving. If response is slower than desired,
a very small amount of TPSdot or MAPdot acceleration enrichment may be re-enabled.
Take care to only use it for high TPSdot values and use very little. Just enough to get EAE
to respond is all that is required.

The two tables (adhere-to-wall tables and the sucked-from-wall) form a balance, one tells
how much fuel adds to the walls per injection event, one tells how much gets pulled from the
walls per intake event.
There is no simple "this table works for accel and this table works for decel"
There is an equilibrium between the added to walls amount and the amount coming off the
walls. These tables don't adjust the amount of fuel added for a single accel event, or
subtracted for a single decel event, they define the percentages getting added and
subtracted to and from the walls, and thereby define things like how quickly or slowly the
equilibrium can be reached again when the state changes.
The algorithm constantly tracks how much fuel it thinks is stuck to the walls and uses that
and some other values to determine what to squirt. The code is constantly active, and
constantly adjusting, so there is no "accel event" anymore.
Adjusting the shape of each curve, along with the mins and maxes change the behavior
during transients by changing the way equilibrium is reached again.

The examples I gave were guidelines, but you will have to tinker...
As another example... If you stab the throttle, and you want more fuel to be added, you can
either increase the amount of fuel getting stuck to the walls, or decrease the amount coming
off at that part of the table. Either will have the effect of increasing the amount of extra fuel
injected during the transient, but changing the shape of one curve and not the other can have
other effects.

Another example is that on a quick stomp on the throttle, but without letting off again (while in
gear), you'll get a brief spike in pulse width (until equilibrium is reached again). In this case, if
you increase the amount being added to the walls, the spike will be higher, but if you
increase the amount being subtracted, it will last less time (because more is pulled off during
each intake event).

So, you just have to think about things in these terms:

1) What is the bad behavior you're trying to remove?


2) What are the starting and ending conditions (MAP) when the bad behavior occurs?
3) What can you do to correct it, keeping in mind what each curve does, and whether you
want more fuel added, more fuel pulled, more time before equilibrium is reached, etc...

Really the best thing to do is get it in the car, and tinker a little at a time until it is doing
something like what you want.

As for datalogging, I'm not using EAE1% or WallFuel1 at all. I simply look at the AFR vs
MAP. I drive at a constant MAP (let say 50 kPa) and constant RPM (let say 3000 RPM) in a
high gear (let say 5th). Then I increase the TP to raise the MAP to another constant level (let
say 70 kPa) and I stay at that level for about 3-4 seconds until the AFR is still stable. Do not
stay at that higher MAP too long because the RPM will start climbing and you the "constant
10
Revision 3: December 9, 2020
RPM" testing condition will not hold true anymore. After that 3-4 second delay, I decrease the
TP a bit to go back to the initial 50 kPa constant MAP and I wait again for the AFR to
stabilize.
• If you went rich on throttle increase, decrease Added to Wall in the 50 kPa range (you
could also increase Sucked From Wall and get the same result).
• If you went lean on throttle increase, increase Added to Wall in the 50 kPa range (you
could also decrease Sucked From Wall and get the same result).
• If you went rich on throttle decrease, increase Sucked From Wall in the 70 kPa range
(you could also decrease Added to Wall and get the same result).
• If you went lean on throttle decrease, decrease Sucked From Wall in the 70 kPa range
(you could also increase Added to Wall and get the same result).

Some tips :

• When you tune for throttle increase, play only with the Added to wall curve.
• When you tune for throttle decrease, play only with the Sucked From wall curve.
• The ratio of Sucked From Wall to Added-to-Wall should be in the 10% order. (in my
setup the Sucked from wall values range 0.6 to 1.6% and the Added to wall values
range from 6 to 16%).
• Always start tuning with RPM and CLT curves at 100%.
• Disable standard AE for initial tuning.
If you have EAE% oscillations at idle, set the Sucked From Wall and Added to wall vs RPM
curves at 0% in the idle region. Make the RPM curves go to 100% from about 1000 RPM to
2000 RPM to keep that nice crisp free-rev accel response.
When rolling on TP to change the MAP, do it with consistency and not too fast to able to see
something in the log. There is no real time factor in the EAE. It doesn't matter if you are
mashing the TP or simply rolling slowly on it. Tuning will still be valid with faster TP
movement. If you feel you need more enrichment or more enleanment at fast TP movement,
use the simple TPSdot/MAPdot style AE.

For the MAP based EAE curves, the % represent the fraction of the actual PW that is Sucked
from the walls or Added to the walls. So, if your actual PW is 6ms and at 40kPa you have 2%
Sucked from wall and 10% Added to wall, the code will do : calc_PW = 6ms + (6ms *10/100)
- (6ms * 2/100).

For the RPM based EAE curves, the % represent the factor that is applied to each "MAP
based EAE curve". So, if your Sucked from wall vs RPM is at 90% at 3000 RPM, the 2%
coming from the example above will now be 90%*2 = 1.8%. The same for the Added to wall
vs RPM. From the example above, the 10% will now be 90%*10= 9% (if your Added to wall
vs RPM curve is at 90% at 3000RPM).

The same apply to the CLT based EAE curves. I think this correction came after all the
others, but I'm not sure about it. Anyway, begin tuning EAE with RPM and CLT based curves
all at 100%. Then, tune the RPM based curves. Finally, tune the CLT based curves.

The relative difference between the added to walls and sucked from walls values controls the
decay. If sucked from walls is higher, the algorithm thinks the fuel is evaporating from the
walls faster per intake event and it decays faster.

11
Revision 3: December 9, 2020
Generally the procedure I follow for tuning EAE is first get the VE tuned. Proper VE is
essential to get this algorithm working.

Second, I turn on EAE, make sure the RPM and CLT curves are at 100% across the board,
and then tune 1 RPM or a small RPM range on cruise. I start by tuning slow throttle
movement, and work my way up to fast throttle movement. I make sure I'm in a high gear so I
don't really accelerate or decelerate that much while doing this.

Then almost invariably, I return to idle and I have oscillations and problems with bucking, off-
idle lean-spots, etc... So I tune the RPM correction curves until these go away. Then I do the
same thing for full-throttle redline runs with shifts.

Then I stop and let the engine cool off, and start it back up, and try to drive it around. Usually
it's OK but not perfect, and I use the CLT curves to get it right.

Finally, I try the "quick blip" behavior for revmatching downshifts. This has typically been the
hardest thing for me to get right, and I know why it does this, but have not had a chance to
write a lot of code to correct it. If you come to the MS meet this weekend, I'll gladly explain
what's going on there. In any case, for quick-blip behavior, I tweak the squirts per cycle, and
if necessary turn on lag compensation.

This method of tuning has worked for me every time. Only once or twice I had any trouble,
and adjusting ignition timing and other parameters fixed those problems (misfires on quick
blips wasn't an enrichment problem, it was a timing problem, etc..)

Essentially, the point of EAE (and X-tau) is to ensure that the amount of fuel specified by the
VE table actually gets into the engine at all times.

Really what is happening is that there is a certain amount of fuel getting stuck on the walls
with each squirt, and a certain amount getting sucked off the walls with each intake event.

a "puddle" builds up on the walls, which I keep track of in the WallFuel1 and WallFuel2
variables (can be seen in a datalog).

The added to walls curve tells the algorithm how much of each squirt is being added to the
walls (as a %) per squirt, while the Sucked from walls curve tells the algorithm how much fuel
is being pulled off the walls on each intake event.

During steady-state, the amount of fuel entering and leaving the puddle is roughly the same,
which gives you a 100% EAE correction %.

During a throttle position change, that equilibrium changes, and you get more fuel entering
the walls than leaving it, which means you have to squirt more fuel than normal (steady
state) to get the same actual amount of fuel to enter the engine. Once the equilibrium
returns, the correction reaches 100% again. During equilibrium, The WallFuel variables will
level off. While WallFuel is increasing or decreasing, you'll get more fuel squirted in, or less
respectively.

Granted the tuning guide for EAE is a little bit out of date and I need to update it, but the
12
Revision 3: December 9, 2020
basic steps there should still work.

I find that if you're having trouble tuning it, datalogs are your friend, as well as stim testing.

Tips:

1) Don't try to tune using the old MS method of light stab, heavier stab, heaviest stab, that
won't work.
2) Instead, pick an RPM and a gear, get to those conditions, and then move your foot
around. Don't get on and off the throttle quickly, get on the throttle, leave your foot in place,
wait a few seconds (10 seconds or so should be good) then get off the throttle, and do it
again. Make sure you cover your entire MAP operating range (off boost if you're running a
turbo). To make things easier, I usually only mess with the added-to-walls curve when I'm
looking at pressing the throttle.
3) Take a look at your datalog, in MAP ranges where you step on the throttle and you get a
lean spot, increase added to walls, or decrease sucked from walls... if you get a rich spot
when you push the throttle, adjust added to walls down, or sucked from walls up. Keep in
mind that small changes make a large difference. Adjust a few % at a time with added to
walls, and a few tenths of a % with sucked from walls.
4) Also check when you lift the throttle... if it goes lean when you lift, decrease sucked from
walls, or increase added to walls. If it goes rich when you lift, increase sucked from walls, or
decrease added to walls.
5) This is where stim experimentation comes in handy. Get yourself a syringe (a $3 cooking
syringe from the grocery store will usually work fine, though the more airtight the better). Set
the RPM on your stim to the same RPM you were tuning at in the datalog, and then
experiment with your curves. You should notice that the further apart Added to walls and
sucked from walls are, the slower the return to equilibrium. This is where you can spend
hours without spending money on fuel. This is where I learned to tune EAE, and learned
what to look for and how to fix it with tuning.
6) When you think you have it doing what you want on the bench, take it out for a quick drive,
and do the same sorts of things the first time you took it out. Notice how the engine responds
to throttle movement, and watch the AFR. Basically your new settings that you came up with
on the bench are your hypothesis, and driving is testing your hypothesis. If it doesn't do
exactly what you thought it should, go back to the bench and look at your datalog, making
smaller changes to get the behavior you wanted.
7) When you think you have things tuned correctly on cruise at that one RPM, repeat the
whole procedure off-idle, and at other RPMS, you should eventually be able to converge on
settings that work at all RPMS for slow to moderate speed throttle movements.
8) Do the same thing for CLT that you did above.

Keep in mind the following guidelines when experimenting/tuning:


1) On accel, increasing added to walls tells the algorithm that more fuel is getting stuck on
the walls (Wallfuel increases due to more getting added to it), and therefore to ensure that
the VE-specified amount of fuel gets into the engine, it has to squirt even more fuel.
Decreasing the amount of fuel leaving the puddle (Sucked from walls) has the same end
effect (but because less is being subtracted from WallFuel, instead of more being added).
2) On decel, increasing sucked from walls tells the algorithm that less fuel is getting stuck on
the walls, which means more of each squirt is getting into the engine, which means it doesn't
have to enrich as much to try to ensure that the VE-specified amount of fuel makes it into the
engine.
3) The difference between the two curves will affect how quickly the algorithm reacts to
13
Revision 3: December 9, 2020
changes, and how quickly it recovers.
4) Squirts per cycle has a huge effect on the effectiveness of this algorithm . You should run
as many squirts per cycle as possible while maintaining tunability and keeping the max duty
cycle down.

The problem with quick stabs is that with small manifolds (relative to engine displacement), a
quick change in MAP (and airflow into the plenum) makes it to the engine very quickly
compared to engines with large manifolds relative to the engine displacement. It will be
tempting to change your EAE curves to get rid of the lean spike that occurs on quick stabs
(for those with small manifolds/plenums relative to the engine size). Do not do that! The
problem is that for the entire accel event, measured MAP is just behind actual pressure in the
manifold, which is a little behind the throttle-position change. The net result is lag between
conditions changing, and the fuel changes for those conditions getting into the engine.

To help solve these issues, increasing the number of squirts usually helps. In addition, I have
added a TPS-dot/MAP-dot actuated lag compensation, which increases the number of
squirts during accel events over the specified threshold. The idea is that if you squirt more
often, then changes to fueling due to MAP change get into the engine sooner. For most
people using EAE, these two things will be enough to fix the "Quick-stab" problem.

For future codes, I'll be adding an idea that I came up with after reading some papers about
model-based engine management. The idea I came up with is that on those engines that
have problems, TPS movement always happens before MAP movement. Since the TPS
movement actually occurs AHEAD of the change in airflow actually getting to the engine, the
idea is to switch to alpha-n during a quick stab. From the VE there (with multiply MAP turned
off, and with Al's change to multiply AFR into the pulse-width equation), the VE should be
somewhat close to correct. We can use the VE in the alpha-n table to get that change in fuel
to the engine sooner, helping eliminate the lean-spike. In addition, since the VE should be
close to correct, we can do some math (with knowledge of engine displacement and manifold
displacement) to somewhat accurately predict MAP during the fast transient, and then use
the predicted MAP to feed EAE.

This will require some more extra tuning... you'll have to accurately tune both a speed-
density table and an Alpha-n table, and you'll have to tinker with the size of the manifold vs
engine displacement, but I think in the end, the result will be that even people with ITBs can
get good throttle response with little or no AFR spiking.

So hopefully now it is evident why EAE *must* always be active for it to work. It's not an
accel enrichment algorithm, it's a transient compensation algorithm, which requires keeping
constant track of the amount of fuel in the puddle.

Lean conditions on decel can be fixed by decreasing the amount of fuel sucked from the
walls. This causes the MS to inject more fuel during those conditions. Increasing sucked from
walls will make a lean condition worse because you're telling the algorithm that more fuel is
coming from the walls, so it doesn't have to inject as much. Most likely what you were seeing
was that your added to walls and subtracted from walls were too far apart, and increasing
added to walls gave you a better equilibrium. In that case, I would have decreased added to
walls instead of increasing sucked from walls.

14
Revision 3: December 9, 2020

There shouldn't be any real reason to need to enable normal AE with EAE on at the same
time.

If you've got slow to moderate throttle movements working, but shifts aren't working well,
then you might need to work on the RPM curves in the areas where the shifts are causing
you problems (RPM changes a lot during a shift, which means the wallwetting characteristics
change too).

Also, lag compensation, which increases the number of squirts during a quick stab or shift or
whatever (any TPSdot or MAPdot over the threshold) should be able to cure the quick-stab
behavior if the main curves and RPM curves are correct.

You should also make sure that your MAP lag-factor is set as high as possible (up to 100),
and you should try experimenting with the map sample time mask... you can tell it to sample
right after a trigger up to 50% of the time between the previous trigger and the next. I find
that if I set MAP lag to 100, then adjust the time mask until I get the smoothest MAP signal,
then slightly reduce the MAP lag factor (down to 90-95) I get good behavior.

The problem is that when you stop using TPS for accel enrichments, you have nothing to
compensate for lag on the MAP sensor. TPS accel enrichement compensates by injecting
more fuel than it should during a quick stab to compensate for the fact that the MAP-based
VE lookup is slow. This isn't possible with EAE, so you have to compensate by making sure
that MAP responds quickly, and by doing things like squirting more often (picking up the
changes in the commanded amount of fuel sooner) during an accel event.

Bottom line is that if you get everything to respond fast enough, there's no need for normal
AE.

15

You might also like