MS1-Extra Tuning manual
(TunerStudio version)

Only for use with the MS1 Extra code (MS1 - 68H908 based microprocessors)

By Philip Ringwood (daxtojeiro), James Murray (jsmcortina) and Ken Culver (muythaibxr)


Before you start any hardware mods please read this entire manual and the Software Manual, available HERE.

For other MS1 Extra Manuals please see HERE

Warning for
E-Bay buyers!!
Please see the Official Suppliers list before buying through E-Bay.
This is there for your protection.

Please Note:

All of these instructions / diagrams are to be used at your own risk, like most things there is more than one way to do the same thing, what we have tried to do is to offer a method that we have tested or that others have tested for us. No warranty expressed or implied.

Use at your own risk.

Note if your TunerStudio dialogs do not match the examples in this document then you need to updated your setup file.
Please use this link to take you to the page with instructions on how to update your setup file.


FUEL TUNING

Tuning Software -- Wideband Lambda Sensors -- Tuning Theory -- Using TunerStudio -- Original Equipment Sensors -- Setting the Constants

Re-Scaling the VE and Req_Fuel -- Before Starting Your Engine -- Resets

Idle Pulse Width -- Get the Engine Started and Idling -- Setting the PWM Criteria -- Setting the Cold Start and Warm-Up Enrichments -- Setting the VE Table

Setting the KPa, RPM or TPS in the VE Table -- AutoTune -- Tuning with Alpha-N Table -- Datalogging -- MSTweak3000 -- VEXME -- Datalog Viewers

Setting the Acceleration Enrichments -- RPM Based Acceleration Enrichment -- Tuning Issues -- Tuning for Economy -- Tuning for Emissions


IGNITION TUNING

Spark Map Tuning Basics


 

Tuning Your MegaSquirt

Now that you have installed your MegaSquirt, you need to get your engine started and tuned. This is not too difficult if you work methodically, and do not let your enthusiasm prod you into a premature full-throttle meltdown. If anything feels odd get off the throttle and veiw the datalogs. It does help if the engine was running before the conversion, and does not need a pile of tune-up/rebuild parts.

Read the entire Software Manual first, before attempting to start or tune your car. There may be some later passages that will help you in earlier steps, depending on your installation details. You will get the 'big picture', and the tuning process should make more sense to you. Reread this section several times.

When you do your conversion, it helps if you can hook the fuel injection up (sitting on the fender) except for the actual injectors, while still running the engine on its original fuel system. This allows you to start the engine and verify that the temperature sensors, TPS sensor, the O2 sensor, fuel pump, etc., work as expected. It will ease your mind when you proceed to running on MegaSquirt. If you have a running engine, it is something you might consider.

You need Windows, Mac or Linux to use the TunerStudio software. A conventional serial port is the best type of comms port to use to communicate with MegaSquirt, a USB will NOT work directly, however, using a USB-serial adapter will work in most cases, it seems that some adaptors work and others won't, it is simply a matter of trying one or getting a recommended one. You do not need a fast computer to tune MegaSquirt, just about any computer that is capable of booting Windows 95 (or better) will be fast enough, but get the fastest machine you think is reasonably priced. The main thing to bear in mind is that datalogs can be rather large and it’s handy to be able to transfer these to the internet or to other PC’s via a CD ROM. So getting a laptop with a CD ROM or that’s capable of connecting to another computer would be handy. If using a USB adaptor and you are finding communications is intermittent try setting the Received Buffer and Transmitted Buffer values lower (these can be found in Device Manager – Ports), I have found setting them as low as they will go can help cure problems.

Tuning Software

Download these programs by clicking on their links above.

To tune all the parameters of MegaSquirt so that your engine runs the best it can, you will need to do the following:

  1. First, learn to use TunerStudio,
  2. Next, set the constants.
  3. Set the Codebase and output functions.
  4. Get the engine started and idling
  5. Then set the PWM criteria
  6. Then set the cold start and warm-up enrichments
  7. Then set the VE table
  8. Set the acceleration enrichments

Wideband Lambda Sensors

Before we start tuning you should ensure that the lambda sensor that is installed is correctly set in TunerStudio. If you have a normal lambda then this is simply called a Narrow band lambda sensor, it gives 0-1V output. The voltage at14.7:1 AFR (Lambda1.0) is usually 0.5V, anything lower is lean, anything higher than 0.5 is rich. These can only be used to tell you that your lean or rich of 14.7, they are not accurate at any other value other than 14.7:1AFR (0.5V output)

A wideband lambda sensor can tell you accurately the AFR from around 10-20:1. These usually have a voltage output range of 0-5V and some can be programed to give a straight line output with respects to the AFR. e.g. Innovates LC-1 can be set up for 0V = 10:1AFR and 5V = 20:1AFR, so 2.5V output would be 15:1AFR, etc. The WideBand Lambda sensors will need a control circuit/box to run them, the MS ECU can NOT simply plug into the sensor like a narrow band sensor.

In order for the TunerStudio software to be able to distinguse between what wideband sensor you are using, and therefore tell what the output voltage means,  selecting what wideband sensor you are using is do when you are first  creating a project however if you did not select your wideband sensor when your project was being created you can still change sensor types by going to your project properties dialog. To get to the project properties dialog go to the "File" drop down menu > "Project" and you will see the menu option "Project Proprties" or you can use Ctrl + p. There is currently 17 different sensor options available to select from.

Now select your WideBand / Lambda sensor from the list highlighted in RED. Then click ok to save your changes and exit the project properties dialog. Upon exiting your project will reload automaticly with the changes you have made.

Tuning Theory

Tuning involves setting all the parameters that MegaSquirt uses to be optimal for your engine, injection, and driving. These include things like cold start pulse widths and acceleration enrichments. The most fundamental parameters are in the 12×12 volumetric efficiency table.

In general, this is all much easier to understand when you are working on a running engine. Trying to estimate what your engine will specifically need beforehand can be more confusing than productive. It is worthwhile exercise to understand the requirements, but always remember that ultimately you will rely on your “seat of the pants” and O2 sensor (as well as drag strip times, exhaust gas temperature sensors, etc. etc., if you have them available) to tune your engine.

Remember that people tuned engines for maximum performance and efficiency for many years with carburettors without any quantitative feedback at all. They often got very good results. The O2 sensor makes tuning much easier. By the time you have had a few sessions with MegaLog Veiwer, you will have a better idea of how to tune the remaining areas.

When tuning:

If you have a settings file from someone else's similar configuration, by all means use it as a guide. Using other people's settings and tables is a reasonable starting point for tuning. However, no one should ever assume another person's table is totally right for their engine, even if it is seemingly identical. The reason is that the tolerance build-up of variables makes things different. Small changes (within acceptable tolerances) in injector flow rates, regulated fuel pressure, MAP sensor output, regulated pressures, etc., etc., etc., can add up to needing quite different settings and tables. This is especially true of the more subjective parameters, like accel enrichment, and those that interact, like afterstart enrichment and warm-up enrichment.

Also when transferring configuration files (msq files) from others or from the Internet or simply changing settings in TunerStudio please ensure that the Outputs are setup for your ECU before downloading it to your MS ECU.
To check this open TunerStudio without the ECU connected and open the msq file you are going to use. Ensure that the following settings are correct!! (Spark Settings and Codebase and output functions) Please see the Basic Configuration Manual or the Software Manual for more info!!!

Note that in this manual we assume you are running gasoline. Other fuels have different Air/Fuel Ratio (AFR) requirements. Below is a chart of the equivalent air/fuel ratios for several popular fuels:

Air/Fuel Ratio Equivalents

Lambda

Gasoline

Propane

Methanol

Ethanol

Diesel

0.70

10.3

11.0

4.5

6.3

10.2

0.75

11.0

11.8

4.9

6.8

10.9

0.80

11.8

12.5

5.2

7.2

11.6

0.85

12.5

13.3

5.5

7.7

12.3

0.90

13.2

14.1

5.8

8.1

13.1

0.95

14.0

14.9

6.1

8.6

13.8

1.00

14.7

15.7

6.5

9.0

14.5

1.05

15.4

16.5

6.8

9.5

15.2

1.10

16.2

17.2

7.1

9.9

16.0

1.15

16.9

18.0

7.4

10.4

16.7

1.20

17.6

18.8

7.8

10.8

17.4

1.25

18.4

19.6

8.1

11.3

18.1

1.30

19.1

20.4

8.4

11.7

18.9

Lambda is the ratio of a given AFR (air/fuel ratio) to the stoichiometric AFR for that fuel. So if a gasoline engine is rich, say 12.5:1, lambda is:

12.5:1 ÷ 14.7:1 = 0.85

Using TunerStudio

Downloads and install TunerStudio from the Downloads page

If you are using temperature sensors that are NOT MS SENSORS (e.g. your original equipment sensors) then you will need to generate 3 inc files so that TunerStudio displays them correctly. Download a desription on how to do this here: WORD FILE - TEXT FILE

TunerStudio allows all of the parameters to be modified and has a real-time VE table editor, which allows a vehicle passenger to tune the engine while driving.

On the Communications/Settings page:

Port - The communications port number should correspond to the port to which the MegaSquirt controller is attached.

Timer Interval (ms) - The timer interval dictates how frequently the runtime and tuning displays are updated. An interrupt is generated at the specified interval, and the real time data is pulled down from the MegaSquirt controller. Use 100-200 ms to start; you can try to smaller values (ex. 50 ms) if your computer is fast enough.

Verify ECU Communications - Click this button to attempt communications with the MegaSquirt controller. Success will be reported.

Pulse width is the measure in milliseconds (1/1000 of a second) of how long the injector is opened for each pulse, regardless of how many times it is opened in a cycle. Duty cycle gives the percentage of time the injector is open irrespective of individual pulse duration. 50% means open for 360deg of the 720deg (One engine cycle 4 stroke)

The bar gauge across the bottom of the window shows the oxygen sensor reading. The scale is determined by egoGauge value in the Tuning section of the TunerStudio.ini file. This same setting controls the analogue and bar gauges on the tuning page.

The bottom of the front page contains a status bar. The current file name (used for Save operations) is displayed in the left part of the status bar, followed by “saved” status. When the memory image has been modified since the last Open or Save operation, this entry shows “SAVED” in bold face.

TunerStudio allows you to save and restore configurations as files (**.msq or commonly known as msq's).
Use the "File" - "Open", "Save" and "Save As" menu items to do this.

Pressing 'F1' in any of the setting boxes will show some Help files and some suggested values.

You should check that TunerStudio reads approximately the correct barometric pressure when no vacuum is applied (i.e. the engine isn't running), also check that the air temperature, coolant temperature and throttle position sensor value are reading correctly. Below is a chart of the 'normal' barometric pressures for various geographic elevations. MegaSquirt should generally be within 4 or 5 kPa of the value below for your elevation. If it is significantly different, check that you have the correct ".inc" files loaded for TunerStudio. See the TunerStudio help file for more details.

 

Barometric Pressure vs. Elevation

(Map reading with motor NOT running)

 

Elevation Above Sea Level

Atmospheric Pressure

 

Feet

Meters

Kilopascals
(kPa)

Example

0

0

101.33

New York, Vancouver, Washington

500

153

99.49

Dallas (435 feet), Detroit (585 feet)

1000

305

97.63

Geneva (1230 feet), Kelowna (1129 feet)

1500

458

95.91

Helena (1404 feet), Wichita (1290 feet),

2000

610

94.19

Canberra (1886 feet), Las Vegas (2030 feet), Regina (1893 feet)

2500

763

92.46

 

3000

915

90.81

Red Deer (2968 feet)

3500

1068

89.15

Brasilia (3480 feet), Calgary (3750 feet)

4000

1220

87.49

 

4500

1373

85.91

Banff (4500 feet)

5000

1526

84.33

Albuquerque (4945 feet), Denver (5280 feet)

6000

1831

81.22

Colorado Springs (5890 feet)

7000

2136

78.19

Mexico City (~7200 feet)

8000

2441

75.22

 

9000

2746

72.40

 

10,000

3050

69.64

 

15,000

4577

57.16

La Paz (13,169 feet), Mauna Kea (~14,000 feet)

Note that weather reports usually report the barometric pressure 'corrected' to read as if 101.3 kPa was the 'normal' for your elevation. Do not expect these reports to correspond to what you get on MegaSquirt unless you are at sea level.

Setting the Constants

Before attempting to start your MegaSquirt equipped engine, you will need to set a number of parameters that determine how MegaSquirt injects fuel. These include the injector open time, Req_Fuel, injector control criteria, PWM criteria, EGO characteristics, etc. These constants are either calculated, or based on the configuration of your system.

Note that for a Wankel rotary engine (Mazda 13B, etc.); see the MegaSquirt & Rotary Engines document for settings and other advice.

On the Settings/Constants page:

If you are running high-impedance injectors (greater than 10 Ohms), then set the:

If you have low impedance injectors (less than 4 Ohms), set the:

You will tune these after getting the engine running. See “Setting the PWM Criteria” in this section. Failure to perform these steps can result in damage to your injectors. If you have high-impedance injectors, set these values to 25.5 ms and 100%, and you do not need to tune them further.

Control Algorithm” lets you choose between Speed Density (MAP) and Alpha-N (TPS). In almost all cases, you should choose speed density unless you have a good reason to do otherwise, and understand how this will change your tuning efforts. Alpha-N uses the throttle position (alpha) and RPM (N) to calculate the amount of fuel to inject as opposed to using the manifold absolute pressure (MAP) and RPM to calculate the amount of fuel to inject. Alpha-N is useful for long duration cams where the resolution of manifold air pressure (map) would be small. It is also useful to get a smoother idle on engines that have erratic map values. MegaSquirt can be converted from its default speed-density calculations to Alpha-N, which uses RPM, temperature and TPS only. Start up the tuning software, go to the Constants dialog and change Speed Density to Alpha-N. Re-map your VE table. You will no longer use the MAP sensor for estimating the load on the engine -- the throttle position and rpm are used instead. This can help with cams with long duration and/or a lot of overlap, as they have low and unstable vacuum at idle, making tuning very difficult. Please also see Hybrid_Alpha_N for turbo applications running Alpha_N. You will need to change the "Settings.ini" file in TunerStudio before you can proceed.

 Selecting what Control Algorithm you are using is do when you are first creating a project however if need to change your Control Algorithm this can be done by going to your project properties dialog. If you are changing the Control Algorithm from the default you need to make sure that you also change the Control Algorithm setting in the "Standard Constants - Page 1" dialog to match EXCEPT when you select the option "Air Flow Meter" in the project propirties dialog. To get to the project properties dialog go to the "File" drop down menu > "Project" and you will see the menu option "Project Proprties" or you can use Ctrl + p.

             

To change the Control Algorithm select a option from the Fueling Algorithms drop down menu (highlighted RED), then click ok to save your changes and exit the project properties dialog. Upon exiting your project will reload automaticly with the changes you have made. Notice the Control Algorithm setting in the "Standard Constants - Page 1" dialog (highlighted RED) this most match the setting in your project properties EXCEPT when you select the option "Air Flow Meter" in the project propirties dialog.

Required Fuel – (Req_Fuel) this is top field of the Constants window. It has a calculation dialog to help you find an appropriate value. It should contain the injector pulse width, in milliseconds, required to supply the fuel for a single injection event at stoichiometric combustion and 100% volumetric efficiency.

Ensure that the NUMBER of CYLINDERS has been set before using the wizard!

In order to come up with this value, TunerStudio provides a calculator that will suffice for 99% of applications (those for which it will not work generally require changes to the MegaSquirt controller code itself, and that is beyond the scope of this manual). To use the wizard, click on the Required Fuel button, and fill in the fields (Engine Displacement, Number of cylinders, Injector flow, and Air:Fuel ratio(14.7), then click 'Okay').

For a 4-stroke, a complete stroke cycle is 720 degrees of crankshaft rotation (i.e. two revolutions); for a 2-stroke, it is 360 degrees (this is also factored in the REQ_FUEL value down loaded to MegaSquirt).

In the tuning software, the upper REQ_FUEL box is the amount per cylinder, as noted above. The lower REQ_FUEL box is the value down loaded to MegaSquirt. It is the REQ_FUEL number on top, but scaled by your selected injection mode (number of squirts and alternate/simultaneous), this can be ignored as it is the upper number thats the important value.

For example, if you inject simultaneous and one injection, and have the same number of injectors as cylinders [i.e. port injection], then REQ_FUEL on the bottom is the same as REQ_FUEL on top. Same with alternate and two squirts. If you put in simultaneous and two squirts, then REQ_FUEL is divided in half - because you squirt twice, you need to inject 1/2 the fuel on each shot.

Note: if you choose alternating for port injection, make sure your number of squirts is an even number (2,4,...) and evenly divisible into the number of cylinders. For example, with an eight cylinder engine, you could use alternating and 2, 4, or 8 squirts/cycle. With a six cylinder, if you choose alternating, you MUST use 2 or 6 squirts/cycle. Also, the only possible combinations for an odd-cylinder count engine are either 1 squirt/simultaneous or N squirt/simultaneous combination, where N is the number of cylinders."

Permissable Combinations:

Number of Cylinders

 

 

1

2

3

4

5

6

8

10

12

 

1

OK

Simultaneous only

Simultaneous only

Simultaneous only

simultaneous only

simultaneous only

simultaneous only

simultaneous only

simultaneous only

 

2

no

OK

no

OK

no

OK

OK

OK

OK

 

3

no

no

simultaneous only

no

no

simultaneous only

no

no

simultaneous only

 

4

no

no

no

OK

no

no

OK

no

OK

 

5

no

no

no

no

simultaneous only

no

no

simultaneous only

no

Number

6

no

no

no

no

no

OK

no

no

OK

of

7

no

no

no

no

no

no

no

no

no

squirts

8

no

no

no

no

no

no

OK

no

no

 

9

no

no

no

no

no

no

no

no

no

 

10

no

no

no

no

no

no

no

OK

no

 

11

no

no

no

no

no

no

no

no

no

 

12

no

no

no

no

no

no

no

no

OK

"OK" means the combination will work with either simultaneous or alternating. "no" means it will not work with either, i.e., not at all. Virtually all installs will use 2 (4 is ok for lower RPM engines like V8's) Values of 7 and above would most certainly not be used.

Dont get too hung up with the Req_Fuel value, as it is a multiplier in the final Pulse Width (PW) calculations. If you have absolutley no idea what size injectors you have then use the table below to figure out what HP engine the injectors came from and work backwards to figure out the approximate flow rate.

Injectors Rating Required for Specified Horsepower
in lbs/hr and (cc/min)

Number of Injectors

Horsepower

1

2

4

5

6

8

100

59 (620)

29 (305)

15 (158)

12 (126)

10 (105)

-

150

88 (924)

44 (462)

22 (231)

18 (189)

15 (158)

11 (116)

200

-

59 (620)

29 (305)

24 (252)

20 (210)

15 (158)

250

-

74 (777)

37 (389)

29 (305)

25 (263)

18 (189)

300

-

88 (924)

44 (462)

35 (368)

29 (305)

22 (231)

350

-

-

51 (534)

41 (431)

34 (357)

26 (273)

400

-

-

59 (620)

47 (494)

39 (410)

29 (305)

450

-

-

66 (693)

53 (557)

44 (462)

33 (347)

500

-

-

74 (777)

59 (620)

49 (515)

37 (389)

550

-

-

81 (851)

65 (683)

54 (567)

40 (420)

600

-

-

88 (924)

71 (746)

59 (620)

44 (462)

based on 0.50 BSFC and 85% duty cycle
Turbo/supercharged engines should add 10% to listed minimum injector size


Injectors are usually rated in either lbs/hour or cc/min. The accepted conversion factor between these depends somewhat on fuel density, which changes with formulation (i.e., by season), but the generally used conversion for gasoline is:

1 lb/hr ~ 10.5 cc/min

If the Req_fuel is too small all it means is the VE table will be full of large numbers and if its too big the VE table will be full of small numbers. The max VE value is 255, try to keep the value around 200 as a absolute maximum so you have some head room, generally 150 is the max value you would expect to see for a NA setup and an idle value of around 30. If your idle VE table value is around 80-100 then your req_fuel is too low, if its around 5 - 15 then its probably too big. As can be seen from the fueling equation, to get the same fuel PW you can increase the Req_Fuel and decrease the VE table values by the same percentage.

PW = REQ_FUEL * VE * MAP * E + accel + Injector_open_time

Re-Scaling the VE Table and Required Fuel - If you have already started tuning but feel your Required fuel is making the VE table too big or small then you can change the Required Fuel but you will need to re-scale the VE Table too or the whole table will be out by the percentage of the change in Required Fuel. To change the Required Fuel go to the engine constants dialog then change the required fuel to the new value. Now you will need to calculate the percentage change between the original value and the new value. To calculate the percent to adjust the Ve Table by use the formulas below.

Increasing the Required fuel:  take the original value 12.2 / 14.7  = .82
By increasing the Required fuel you will need to lower the Ve Table values to match.

Decreasing the Required fuel:  take the original value 14.7 / 12.2  =  1.20
By Decreasing the Required fuel you will need to raise the Ve Table values to match.

e.g. VE table full of very low numbers (idle is around 15 and WOT is around 60-70) but drives well and AFR's are correct, then try decreasing the required fuel value.
In this example we have dropped the req fuel from 14.7 to 12.2, this is a 17% decrease in size, so the whole VE table will be increased by 17% to compensate.

Now that the new value has been entered for the Required Fuel the Ve Table needs to be scaled to match. To scale the Ve Table left click and hold the button down with the cursor in cell at the bottom left corner of the Ve Table then drag the cursor diagonally to select the whole table. Now click on the asterisk icon and the dialog to enter the percent to scale the table by will open. To scale the Ve Table enter the calculated % difference value in the dialog and click OK. If you are not sure you have adjusted the Ve Table by the correct amount and you need to go back you can use the history buttons to return the Ve Table values.

                 

Injector Opening Time (ms) is the amount of time required for the injector to go from a fully closed state to a fully opened state when a 13.2 volt signal is applied. Since fuel injectors are electro-mechanical devices with mass, they have latency between the time a signal is applied and the time they are in steady-state spraying mode. Typically, this value is very close to 1.0 milliseconds.

The MegaSquirt code assumes that NO fuel is injected during the opening (and closing) phases. However, it is very likely that a small amount actually is injected. Thus making this value larger will enrich the mix and will have a much greater effect at low pulse widths. MegaSquirt also uses this value as an additive constant in pulse width calculation, thus making this the lower limit for pulse width.

Injections per Engine Cycle is set the number of squirts you want per engine cycle. You want this to be set so that your idle pulse width is no less than 2.0 ms, if possible, and your Req_Fuel is less than 12-15 milliseconds, but more than 8 milliseconds. These values allow proper tuning of the idle mixture while maintaining the ability to apply enrichments (acceleration, warm-up, etc.) under full throttle. This is the total injector events that you wish to occur for every engine cycle (360 degrees for two stroke engines and 720° for four strokes).

Injector Staging values for injector staging are simultaneous or alternating. If you want all your injectors to fire at once, select simultaneous. If you want half your injectors to fire at each injection event, and the other half on the next event, select alternating.

Note that with port injection, you must choose at least 2 squirts per cycle with alternating injection, otherwise every other cycle for each cylinder will get NO fuel! The engine will run very badly.

There is some benefit to choosing 2 squirts/alternating for port injection, since only half of the injectors fire at once, the pressure drop in the fuel rails is reduced and the fuelling is more consistent.

With throttle body injection, the number of injection/cycle you can set will depend on your number of cylinders, plenum size, Req_Fuel, etc. You have to experiment to see what works best for your combination.

Engine Stroke values for engine stroke type are two-stroke or four-stroke. MegaSquirt uses engine stroke to determine how many degrees are in an engine cycle.

Number of Cylinders is the count of the cylinders on your engine. If you are unsure how many cylinders your engine has, you should not be installing MegaSquirt on it.

Injector Port Type This is not used in MSnS_Extra, so no settings needed for this, it should be greyed out.

Number of Injectors is the total number of injectors MegaSquirt is controlling, whether port or throttle body injection. (this is used in the Required Fuel calculation)

MAP Type this should be set to 250KPa type even if you have a 300 or 400Kpa sensor, unless you have an older V1 pcb that could have a 110KPa sensor

Before Starting Your Engine

If your engine is newly assembled, consider running it on a known good carburettor before attempting to run it on MegaSquirt. This way you wont have to worry about proper run-in for the cam shaft, proper ignition timing, etc., while trying to get a reasonable initial tune into MegaSquirt.

The cranking pulse width at -40°F should be about 3 to 5 times the 170°F value. To begin, set the -40°F cranking pulse width to about 88% of your "upper" req_fuel value, and the 170°F cranking pulse width to about 23% of your req_fuel. Those should get you 'in the ball park' for starting. (Once you have the engine running, you can tune the cranking pulse widths with small changes, moving them up or down together, and check it over a few days worth of starts before deciding which direction to go next.

Before starting, make sure to:

 

Resets - A reset can be seen in TunerStudio in the bottom right hand corner. Some resets can be the USB adaptor (if being used) simply overflowing. If the engine runs smoothly but you are seeing resets and your using a USB adaptor try setting the Received and Transmitted buffers as low as they will go. If the engine is stumbling and there are resets on the TunerStudio screen (bottom right corner) then these are probably real resets, but to confirm this unplug the laptop if using a USB adaptor and see it if cures it. In datalogs you can see them as massive spikes in all of the logged variables.

NOTE: First, be sure that all the grounds from your engine, alternator, and frame are in good shape and tight.

If you have coil packs driven directly from the MS ECU then you should try fitting resistive spark plugs and new resistive plug leads. Even cleaning the plugs if the engine has been going through a tuning stage, can cure reset problems. If this still doesn't fix it fit a 20-25uF capacitor between the +12V feed that's on the coil pack and a good chassis ground. Get the capacitor as close to the coil pack as possible. These are fitted to Ford coil packs in the engine bay and should be easy to get from a scrap yard. They are also fitted to Peugeot engines, bolted to the coil pack in a small black package, I would think virtually all coil packs will have them fitted somewhere near by if you can't find a Ford or a Peugeot. See the 2 pictures below:

Another suggestion is to swap over the VR sensor cables. I have had an engine that simply reset all the time during cranking, swapping the VR sensor cables cured it. On the Ford 2 pinned sensors pin1 is the signal, pin2 is the ground.

It should be noted that your wiring for the VR sensor should be a screened cable back to the ECU to sheild it from any noise, earthed only at the ECU end to an earthing pin on the 37 pin plug (e.g. pin8). The main ground wire from the ECU should really connect to 2 or 3 pins of the 37 pin plug (e.g. pins 9 and 10) and be around 3-4mm thick if possible, especially when using direct drive coils! Something like this cable HERE.

 

Position of Caps on Vehicles:

 

Get the Engine Started and Idling

Procedure for tuning:

1 - Get engine starting using Cranking PW only! (Starting is cranking untill it picks up naturally usually <300RPM)
2 - Once it starts keep engine running with req_fuel adjustments or VE table adjustments.
3 - Once engine up to operating temperature reset req_fuel (if altered) to it's original value and re-scale VE table as shown below.
4 - Ensure Idle is clean and stable by tuning VE table values around idle position. (It is important to get a good idle before driving the car)
5 - Next time you start the engine cold DO NOT adjust VE table to get it running well untill its warm, only adjust Warm Up Enrichment at correct temperature bin.
6 - Try starting engine at different temperatures from cold to hot and adjust Cranking PW and Afterstart, again, do NOT adjust fuel map untill warm.

You start, naturally enough, by getting your engine started.

If you are running ignition control and fuel then you should read the ignition setup pages from your relevant system on the MSnS_Extra Ignition Hardware Manual there are more details HERE too on starting up and ignition control.

If you are running fuel only then be sure to set your base timing before starting your car (if it hasn't previously been set).

Typically, the first time someone tries to start their engine with MegaSquirt, it starts after about 5 minutes of alternating various cranking pulse widths numbers to get started (on the Crank/Warmup page), and REQ_FUEL to keep it from stalling but only once it has started (on the tuning page). It may take a bit of cranking, so you might need to keep a battery charger on hand. Remember that the only fuel added during cranking is the Cranking PW in the Crank/Warmup page. The fuel map has nothing to do with initially starting the engine, so don't mess with the fuel table untill its running, in fact your better off only messing with the fuel table once the engine is warm.

Start with the default values in the Cranking PW if you have no idea where to begin.

During cranking the RPM gauge in TunerStudio should read somewhere around 50-300rpm, if it isnt reading then the chances are it will not start. The reasons are likely to be the lack of a trigger signal on pin 24 of the 37pin connector. If using a VR sensor ensure the gap is 0.75-1.0mm from the teeth. Another gauge to look at is the PW in TunerStudio, if this is showing zero during cranking and the RPM is between 50-300 then the chances are the Flood Clear value is set too high, see the flood clear section HERE.

Once you have it started and running, allow the engine to warm up and tune the idle VE values in the TUNING -- VE Table1 screen. Only once the engine is warm will the VE table have a reliable value, before it is warm you should either adjust the req_fuel or the VE table. Then you can reset the REQ_FUEL value back to its original number. It is very easy to change without having to re-enter the VE numbers. Go to VETable1 then Tools->Scale VE Table, and enter your original and new REQ_FUEL values. This adjusts the VE table. Once you have a running engine when warm don't alter the VE table again on a cold start untill the enigne is again warm.

Remember that when you start to drive the car be gentle on the throttle and keep an eye on your O2 readings. Pull over, if it is too lean and adjust the table manually where it was too lean if necassary. It is really helpfull to have someone with you holding or tuning with the laptop whilst you drive.

Then go to Settings->Constants and change the REQ_FUEL from the value you used to start the engine to the value calculated in TunerStudio. The injector pulse widths will be the same, but the VE numbers will more accurately reflect your actual volumetric efficiencies.

If you have been trying to start your engine for more than 10-15 minutes, you ought to investigate other sources of problems before continuing to try to start the engine.

Properly tuned, MegaSquirt will start your engine quickly and reliably. If you have trouble with starting, either hot or cold starts (or both):

You start tuning by just getting it to idle properly by adjusting the speed [with the throttle stop and/or FIdle solenoid], and mixture [with the VE table or REQ_FUEL]. There is little danger of harming anything, as there is not enough load on the engine to build the heat that would melt anything. The engine will idle on a very wide range of mixtures, so it is not too hard to get it started, you just play around with the REQ_FUEL until it fires. After you have the engine idling, note the pulse widths at idle. Then you can reset your REQ_FUEL to the calculated value as described above.

Once you can start the engine and have it idle, proceed by tuning your idle AFR. At idle, the exhaust gases may not be hot enough for a one wire O2 sensor to read correctly, even though the engine is fully warmed up. In that case it will read lean all the time. Header wrap helps get the O2 up to temperature. This is especially true if you have:

In any case, unless you are tuning for minimum emissions, the best strategy is to tune your idle for a minimum MAP reading at your chosen idle speed (by altering the VE values around the idle point). This will give you the smoothest idle, and best off idle response. You may have to reset the idle stop a few times as your adjust the mixture.

Just watch the MAP reading as you adjust the VE table. It should move up or down if you adjust the VE table enough.

If it is cold out, you may need to adjust the warm-up enrichments before you can get the engine warmed-up so that you can adjust the idle mixture, etc. The easiest way to do this is to use TunerStudio’s Warmup Wizard ("Runtime/Warmup Wizard"). There are more details here.

Later, when you have the engine started and idling well, you can fine tune the cranking pulse widths. General Motors uses stoichiometric mixtures for both idle and cranking pulse widths at full coolant temperature, and a 1.5:1 cranking AFR at -30°F or so. For example, to establish out some starting point pulse widths, lets assume a 4-cylinder engine, with the injector staging set to 2-squirts/alternating. The injector pulses look like this (0 = injector pulse, - = no injector pulse):

 

o---o---o---...   Bank 1
--o---o---o-...   Bank 2

The picture when cranking is much easier, since it fires every injector on every ignition event:

 

oooooooo...   Bank 1
oooooooo...   Bank 2

So what we have is four times as many injection events when cranking compared to running. Now let's assume we have tuned:

Then we get our "best idle" fuel delivery amount of:

 

2.2 - 1.0 = 1.2 milliseconds fuel deliver per injector pulse

Split this up into the 4 times as many injector events we see during cranking, add in the Open/Close time and get our hot cranking PW.

 

(1.2/4) + 1.0 = 1.3 ms

Now for cold we want 1.5:1, which is close to ten times as rich as 14.7:1, so just multiply that first part by 10 and we get our cold cranking PW.

 

(1.2/4)*10 + 1.0 = 4.0 ms

This calculation requires:

  1. Good idle tuning to get that initial pulse width, and
  2. Good tuning of the open/close time so that the actual fuel delivery number from the first equation is correct.

 

 

Setting the PWM Criteria

To tune the PWM [pulse width modulation] values for your engine, you need to know what kind of injectors you have: low impedance or high impedance.

In essence you are disabling the PWM mode. This allows full voltage to the injectors throughout the pulse widths.

To run low-impedance injectors with the PWM current limit mode, you need to set two parameters - the "PWM Current Limit (%)" and the "PWM Time Threshold (ms)" - both are on the “Constants” page. The current limit % is the percent duty cycle when the current limit is invoked. The time threshold is the amount of time from when the injector is first opened until the current limit is activated.

 

1.    Start with:

2.    Once you get your engine idling, then first adjust the PWM duty cycle down in 1% increments until you notice a change in idle quality (be sure to hit the "send to ECU" button each time you change the value). This is the point where the current limit is too much and the injectors are not being held fully open.

3.    Then move the value back up 3 - 5% (for example, if the idle falters at 45%, then put in a number of 48% to 50%).

4.    Move on to adjusting the time threshold. Lower the time threshold by 0.1 milliseconds at a time until the idle quality deteriorates.

5.    Then increase it 0.3 ms.

6.    Now, repeat these steps (starting at #2). Adjust the duty cycle and time threshold alternately to get the optimum values for your set-up. You will converge on a set of numbers that work well for your set-up.

The injector opening time and PWM time threshold should be set to the same value. So adjust the PWM time threshold, and the opening time together. However, once you start to tune the 'fine tune' the idle, if you have to revisit the PWM parameters, change the PWM time threshold, not the opening time.

The reason for this is that changing the opening time also changes the AFR, especially at low rpms, so it forces you to also retune the VE table. So unless they get to be different by more than about 0.5 milliseconds, leave the opening time alone after tuning the idle and cruise VEs (unless your are willing to retune those areas).

On the car, setting the PWM parameters is very easy to do and only takes a few minutes. At idle the overall injector pulse widths are small compared to their close time, so this will allow you to adjust the values. In other words, adjust the PWM current limit before taking the car out on the street where injector pulse widths become high, increasing the possibility of overheating your injectors.

You may find that you can idle at a very low PWM%, but the engine will stumble or cough if given any throttle. This can be due to a too low PWM% especially if your injectors are large and the idle pulse width is approximately equal to the PWM Time Threshold. In that case you may be idling almost entirely on the PWM Time Threshold. So rev the engine occasionally as you are tuning the PWM parameters, to ensure that you haven't gone too low.

Also, for some setups, an initial PWM Current Limit of 75% may be too low, so they will need to increase this value - same for the time threshold. Use PWM time threshold values greater than about 1.5 to 1.7 milliseconds only with great caution – it is possible to burn out your injectors!

Note that if you are running the flyback board and need PWM% of 70% or more to run properly, your flyback board isn't working properly! Troubleshoot it carefully to find out why.

Setting the Cold Start and Warm-Up Enrichments

If it is cold out, you have to figure out the cold start enrichments/warm up enrichments right away to keep the engine running as it warms up. Otherwise you can leave this until you experience some cold weather. During cranking mode (defined when RPM is less than around 300 RPM, this can be set in "More Cranking Stuff", but 300RPM is around the normal setting), MegaSquirt shoots out cranking pulse widths depending on the settings in "Cranking Settings". Please note that the fuel map is completely ignored during cranking, so don't alter it if it doesn't start, only alter the PW on the Cranking settings.

A typical setting for a Chevrolet small block V8 with a Tuned Port Injection set-up and 30 lb/hr injectors is 2 milliseconds at 170°F and 10 milliseconds at -40°F. The values for your combination are likely different, though generally should follow a similar pattern. During cranking, MegaSquirt injects one pulse for every ignition event, so for an 8-cylinder it shoots out 8 times for 720 degrees crankshaft, with all injectors squirting. So with the above values, at 170°F, the effective amount of fuel per cylinder is 8 * 2 = 16 milliseconds. For -40°F it is 10 * 8 = 80 milliseconds.

Once the engine fires up (defined by engine RPM greater than the setting in "More Cranking Settings" typically 300RPM), the engine starts to use the VE Table's fuel map and if the coolant is under 71C (170F) it goes into afterstart enrichment. The afterstart enrichment is generally set to increase the percentage of the fueling map it will run at for a pre-determined amount of time or ignition pulses so the engine has a chance to start and smoothen out. This can be set to a different value depending on the coolant temperature in "After Start Enrichment Settings" Start out at a user-defined percentage enrichment value (typically around 25%), and then it ramps down to 0% after so many ignition trigger events, which is user-defined (use about 200 for this number to start). This is an enrichment above the normal warm-up enrichment, which is temperature dependent. Please note that 0% means that it will run exactly what the VE table values are and 50% would mean 50% increase over the VE table.

It's been found that during winter the cranking and after start enrichments need tweaking in order to get the engine to start and run without restarting it several times from cold. The reason is felt that the after start and cranking enrichments don't necessarily follow temperature in a linear format. You can therefore select CLT - MAT or an average of the two for the Cranking PW to reference.

After Start Enrich Counter is the length of time in Seconds or engine cycles that the after start enrich runs for. The percentage added is decayed down to zero as the time expires

Set ASE Mode to FIXED for a timed period of ASE that does not decay, after the timer the ASE will then decay as usual during the TOTAL ASE time period that’s left. This has a temp setpoint as it should only be needed when the coolant temperatures are fairly low.


Setting MAP to a fixed value helps to maintain a constant PW during the initial start where the map drops quickly from around 100KPa to the tickover KPa. This is held during the FIXED time period. The FIXED period is a period of time at the start of the TOTAL ASE time. FIXED must be less than TOTAL.

If the engine starts and runs for a few seconds, then stalls, this is usually a sign that the afterstart enrichment isn't quite right. Leave everything else the same, and adjust the afterstart % and number of cycles. 20% to 30% and 200 cycles are reasonable starting points for most engines, but yours may run better with more or less. There should be a point at which it works without stalling.

If the engine starts and runs for more than 20 seconds or so, then stalls, you need to adjust your warm-up enrichment bins. As you adjust your warm-up bins, you may need to re-adjust the afterstart, since these interact (i.e., a larger warm-up value may require a shorter or smaller afterstart enrichment).

To set the Warm-Up Enrichments, use the "Warmup Wizard" under "Crank/Warmup" on the main menu. This lets you adjust the warm-up bins while indicating which bin(s) are currently active. The engine needs to sit for several hours, before trying to adjust the warm-up enrichments after running the engine. Please note that the Warmup Enrichment is an additional fuel added to the base VE table, it is best to have a good tuned idle when warm then adjust the warmup when next cold without tuning the VE table.

With the above numbers tuned properly, nearly any engine can be tuned to fire immediately, every time, just like any OEM fuel injected car. It takes a while to converge on the best numbers, especially the after start enrichment, which needs to be just right, or the engine will run rough or stall immediately after starting.

You can do this as the engine warms by adjusting the warm-up bins, loading it to the ECU, and noting the effect on idle quality. It will take several starts {from a cold soak} to get this close. Then you can play around with revving the engine in neutral and adjusting the mix to stoichiometric. Up to here it easy enough to do without an O2 sensor by adjusting for maximum vacuum (lowest MAP kPa) ant any given rpm.

Setting the VE Table

To set up the fuel curves for the engine with MegaSquirt, you have a number of parameters to work with. The most important of these are the Req_Fuel value and the VE table (12x12 volumetric efficiency table). You are aiming to achieve 12.5-13.1:1 air/fuel ratios under full throttle, and 15-17:1 under light loads for a naturally aspirated engine. Boosted engine may require a richer mixture under power.

The VE table represents the volumetric efficiency and air/fuel ratio at each rpm and kPa (0=total vacuum, 100=atmosphere, etc.).

Volumetric efficiency is the ratio of the amount of air actually fills the cylinder to the amount that would fill the cylinder in a static situation. The VE is used in the 'fuelling equation'.

There are a number of ways to specify VE. MegaSquirt specifies it relative to the manifold absolute pressure and includes the AFR in the VE table.

That is:

VE = (actual air mass)/(theoretical air mass)*AFRstoich/AFRactual

So for MegaSquirt, entering a larger VE in the table makes that point richer, and a smaller number makes that point leaner.

The registered version of TunerStudio includes a VE table generator. Users of the Lite version should start from the default VE table.

 

Before starting to tune the VE Table it is recommended that you turn the Acceleration Enrichment (AE) off so you can see whats happening to the mixture as a direct result of the table rather than having fuel added from Acel Enrichment. To do this set the thresholds to 30V/S or 5000KPa/S see HERE for more details on AE. You may find that you’ll need to be light on the throttle as the AE is needed to fill 'holes' that occur when the throttle opens quickly. Remember to tune the AE when you have a tuned VE Table.

Another item to turn off during tuning is the Overrun settings as the PW may drop to 0.0mS causing lean spots. See HERE for more details

Tuning the VE table involves richening (by increasing the VE) or leaning (be decreasing VE) at each point in the VE table. Most of your driving will occur in a diagonal strip of the VE table, from low rpm, low kPa (i.e. idle) to high rpm, high kPa (i.e. WOT). You can adjust these values using the O2 sensor, data logs and MSTweak, and/or the seat of your pants. Low rpm and low kPa (say less than half of the max rpm and max kPa) might be able to use stoichiometric or leaner. Richer mixtures would be used at high rpm and high kPa.

However, the low rpm/high kPa and high rpm/low kPa are not seen as often driving your vehicle. Basically, if the engine never runs in certain parts of the MAP, then the numbers there should not matter. However, since you may not be able to guess where you will run under every possible set of conditions, you put estimated VE numbers that make sense into the little used areas.

From this frequently used diagonal strip of the VE table, you will be able to see how much the VE rises from one rpm bin to the next, and use these differences to estimate the low rpm, very high kPa numbers and the high rpm, very low kPa numbers. Since you rarely (if ever) run in these parts of the table, the actual numbers will not make much difference, but they will be there "just in case". You are looking to create a smooth VE map wherever possible.

To set the VE table entries near idle, you should try to achieve the lowest MAP (in kPa) that you possibly can, at your chosen idle speed. This will give the highest idle vacuum and the most efficient idle. Don't try to get to a target idle mixture (stoichiometric, or some other number), instead adjust the VE table entries around your idle rpm and kPa to achieve the lowest MAP reading as seen in TunerStudio. As you work to lower the MAP, the rpm will likely rise, and you'll have to reset the throttle stop to lower the rpm to your desired idle speed. When you have it set so that either raising or lowering the VE table entries increases the MAP, then you have the best idle mixture for your engine (it will require the smallest throttle opening).

To alter the VE table values using TunerStudio, go into Tuning - VE Table 1. Here you will see a blue ball floating around the 3D map, this is the current area of the map that the engine is running in. Use the arrow keys on your keyboard to take the red square to the area of the blue ball. You will find that the blue ball will stay ontop and the red square, that means youll need to alter the 4 areas around the blue ball to tune that area. Adjust them all by the same amount by pressing "W" to weaken (reduces the VE table value at that point by 1) or "Q" to Richen (adds 1 to that VE value), simply go to all 4 points and press W or Q once or twice and see what the reaction is on the O2 meter. Press "F1" for more help on this screen.

The 4 points to alter when between cells.

Once the engine idles smoothly, keeping in the Tuning VE Table screen, go to File - BURN TO ECU (or Alt and B) this will ensure the settings are kept in the ECU or the settings will be lost once the power is turned off.

Setting the KPa values in the Table
It is a good idea to set either the second or third row of KPa bins in the VE Table to the idle MAP value. So for example, if you idle at 35KPa set the first to say 20KPa (this can be used for fuel saving during over run, the second can then either be 35KPa or a value between 20 and 35 then the next could be 35. The reason is it is always easier to tune idle if the point of idle is on a cross hatch, then theres only really 2 points that influence it rather than 4, this may not be possible with a varying idle map, but its worth trying if you can.
The rest of the KPa values will depend on where your engine cruises and what boost pressure you run, remember 1PSI of boost is aproximately 7KPa (6.8), so for 8psi of boost your max KPa value will be 8psi x 7KPa = 56KPa above atmosphere, so 100KPa (atmosphere) + 56KPa of boost = 156KPa (round that off too 160KPa)
Lets take a NA engine into concideration; Idle is 30KPa and cruise is also around 30-50KPa. At cruising KPa there will need to be more rows than at any other to get the engine to maintain a nice smooth AFR through out that area. In a race engine this section wont matter so that rule doesn't apply. Wide open throttle on a NA will be 100KPa (depending on where you live but 100KPa should be fine) I would set this engine up like this:

KPa Scale for VE Table

100
95
85
70
60
55
50
45
40
35
30
20

100-95 will be wide open throttle (depending on atmosphere and intake restrictions)
------------------------------------------------------------------
60-85 would be for light to mid acceleration areas.
-----------------------------------------------------------------

30 - 60 will be tuned for crusing, this needs quite a few rows to get a good smooth, economic cruise.

------------------------------------------------------------------
Lower than idle would be tuned for over run and cruise

  500 700 1000 1300 1500 2000 2500 3000 ----- ----- ----- ----- -----

 

Setting the RPM values in the Table
It is a good idea to set the first RPM row so it is lower than idle, this allows you to set a richer area than at idle so if the engine starts to stall or slow then it picks up a little when it goes to the richer area. So, for example, if you idle at 800RPM then set the first row to 500 and the next to 700. The 700 RPM row will be the one that tunes the idle AFR, if it drops below 700 it will be richened by the 500RPM row, but only if it drops below 700, which is 100 below your idle speed. The next few rows should be around your cruiseing area, this again, allows for better tuning of the AFR at cruise allowing a smoother, more efficient drive and a better ride around town where slow engine speeds are necassary.

Setting the TPS values in the Table for Alpha_N setup
If running Alpha_N you will need lots of bins set around your cruising area and two around the idle (foot off the throttle). In order to find the scale of your TPS, go to Tools, Calibrate TPS, and with your foot completely OFF the throttle hit Get Current. Remember this value(e.g. 33). Put your foot flat to the floor on the accelerator (engine not running!!) and hit Get Current on the Calibrate TPS dialog, remember this value too (e.g. 225). The first entry in the TPS scale should be just below your TPS value for the foot off the throttle test, so our example was 33, so set it to 31. This allows for any slight variations.

Please note: Later versions of TunerStudio (+ 30th Oct 2007) I have changed the screen so it shows the RAW ADC value in the bottom left gauge when you have set TunerStudio to Alpha_N mode..

The next few values should be very close to each other up to around 25% opening as this is the area that will need more tuning at low RPM. One thing you have to always remember with alpha-N is that you don't actually know where the effective WOT is anymore (i.e., when you have enough throttle that opening it further doesn't affect the amount of air being ingested). At low RPM WOT could be only 20% throttle. It is worth setting 5-8 of the total TPS bins (load on the VE Table) to cover the first 20% - 30% of the throttle opening to make tuning easier. This will help you end up with a driveable car, as most driving on the road is done in the first 30% of the throttle. The rest of the bins can fill in the gaps between 30% and WOT. (Wide Open Throttle).

TPS Scale for VE Table

215
180
130
85
60
55
50
45
40
38
35
31

>85 will be wide open throttle (depending on engine speed)
------------------------------------------------------------------
60-85 would be for light to mid acceleration areas.
-----------------------------------------------------------------

30 - 60 will be tuned for crusing, this needs quite a few rows to get a good smooth, economic cruise.

 

  500 700 1000 1300 1500 2000 2500 3000 ----- ----- ----- ----- -----

 

At non idle areas of the VE table, you will generally run lean (low loads and speeds) or rich (high loads and speeds). High loads are associated with high kPa MAP values. Deciding exactly when (and how much) you should run rich is mostly a "seat of the pants" thing. When tuning, you will find the engine will surge (at low loads) and "coughs" at higher loads if it is run lean. Adjust the VE at the point where this happens so the this does not occur. Check the plugs for detonation (tiny black and white flecks) when tuning at high loads and rpms if you suspect detonation at all. A narrow band should read at least 0.8 volts under full throttle, at least for a starting point in tuning WOT. There are more details later in this section.

Volumetric Efficiency (VE) entries in 12x12 MegaSquirt VE table actually are VE * gamma, where gamma is the (stoichiometric AFR)/(actual AFR), and VE is expressed as a percent (i.e. 65 represents 65% volumetric efficiency at 14.7:1 AFR).

Note: If you do not use the “correct” REQ_FUEL value, the VE numbers in the VE table will be skewed by the amount REQ_FUEL is “incorrect”.

For MegaSquirt (and most MAP based EFI controllers), VE is based not on the percentage of cylinder filling relative to atmospheric pressure, instead it is based on the percentage of filling relative to the intake manifold pressure. So even with a highly “boosted” engine, VEs may not be much above 100%, except to richen the mixture.

You can tune your engine to a stoichiometric mixture with NB O2 sensor, but not at high loads/rpms. You can then use a little math to “correct the mixtures”. For example, if you get a stoichiometric mixture with 65% VE at a certain RPM and kPa, then to lean the mix to 16.0:1 you need:

65% * (14.7 / 16.0) = 60%

To richen an 80% VE entry to 12.5:1 from stoichiometric:

80% * (14.7 / 12.5) = 94%

Generally, VE table numbers above 100% are used only to richen mixtures. Even a turbocharged engine capable of 20 lbs/in of boost will generally not have extremely large VE numbers. The addition of fuel for boost comes through the MAP term in the fuel equation:

PW = REQ_FUEL * VE(kpa,rpm) * MAP * E + accel + Injector_open_time

Thus increasing the VE at higher boosts makes the mixture richer, but it would not have run leaner simply because of the higher boost.

In essence, the mass of the air is computed using the ideal gas law (PV=NRT), where the pressure p is a function of VE and MAP, the volume v = cylinder displacement, the air temperature t is a function of E,r is the gas constant. We are looking for n, the mass of inducted air) and then that result is combined with a characteristic number for a given injector.

If you get the injector opening time correct, and the REQ_FUEL accurately represents the flow rate of your injectors, then the VE entries will be close to the VE*gamma noted above. However, if your opening time is not right, or your REQ_FUEL is not, then the numbers will be skewed by the percentage the values are in error. In general, except for when you are first trying to get your engine started, use the calculated value for REQ_FUEL and do not change it.

Here is a table showing you what AFR to run within your engines working range. Note that the engine rpm range is from 600 rpm to 6000 rpm, and the MAP values range from 15 to 100 kPa (telling us that this is a naturally aspirated engine). Beyond these values, MegaSquirt will use the last value from the “edge” of the table. (It does not “shut down” by substituting zero values.) In theory, at stoichiometric mixtures, the values at 100kPa would reflect the torque curve of the engine at WOT, assuming a constant AFR level.

idle and cruise - lean

~stoichiometric - 14.7:1 AFR

WOT and acceleration - rich 12.5:1 -13.5:1 AFR

not normally seen

Idle can vary, but its usually a little richer than 14.7:1 AFR

 

 

100

 

 

 

 

 

 

 

 

 

 

 

 

 

95

 

 

 

 

 

 

 

 

 

 

 

 

 

90

 

 

 

 

 

 

 

 

 

 

 

 

 

80

 

 

 

 

 

 

 

 

 

 

 

 

 

75

 

 

 

 

 

 

 

 

 

 

 

 

 

65

 

 

 

 

 

 

 

 

 

 

 

 

KPA

55

 

 

 

 

 

 

 

 

 

 

 

 

or

45

 

 

 

 

 

 

 

 

 

 

 

 

TPS

35

 

 

 

 

 

 

 

 

 

 

 

 

 

30

 

 

 

 

 

 

 

 

 

 

 

 

 

25

 

 

 

 

 

 

 

 

 

 

 

 

 

15

 

 

 

 

 

 

 

 

 

 

 

 

 

 

600

900

1500

2000

2500

3000

3500

4000

4500

5000

5500

6000

 

 

 

 

 

 

RPM

 

 

 

 

 

 

 

 

Having an O2 sensor makes the driving part of the setting up much easier, as you can datalog and use MSLVV or VEXME to get the VE table set up with a few easy drives up and down the street, a bit more tuning, and you are ready to go a bit harder. You do not go harder if there are any problems [typically a back fire means too lean, sluggish revving means too [rich]. Read the “Datalog” section for more information.

Have someone ride with you and bring up the VE table1 tuning page. Drive at a sensible speed and start with low rpm and low KPa areas (crusing, etc) See where the " Blue dot" hangs around when you are under load - this is where you need to focus on tuning. Use the Q and W keys to richen / weaken the VE values - enrich (with increased VE number) the four corners around where the dot is - give each corner (section) two to five Q button presses (W for weakening) , and see if this helps. Turn off the O2 closed-loop mode by setting the step size to zero in Exhaust Gas Settings. Watch the Air:Fuel gauge on the tuning page and use this as feedback for rich and lean. The AFR (02) gauge may move too fast from rich to lean to be able to tune. Another strategy that works is to turn on EGO correction, and then tune using the EGO correction gauge rather than the EGO voltage gauge. (ensure you have ego correction turned on by setting at least a 1 in the step size in Exhaust Gas Settings) If correction is below 100%, then lower the VE ("W" button) if its higher than 100% then increase the VE values (Q button) around the area the green dot is, and so on. Remember to burn the values every so often (Alt and B).It is also a good idea to save the file every so often too, try numbering them as you go so you can recall where you were, e.g. Drive1 Drive2, etc.

  

You can also use Ve Analyze Live to help tune your VE table. (Requires registered TunerStudio.)

Ve Analyze Live  is an algorithm built into TunerStudio that automatically tunes your VE table based on EGO feedback. Ve Analyze Live operates in real-time and without a datalog. .

Ve Analyze Live is best used once you have a close map and a drivable car, don't expect it to do all the work for you as it will not. The closer your map is the better it will work.

With a narrow band sensor, you can use Ve Analyze Live with any algorithm and any sensor to tune the low-power part of the table, it will get you to stoich (or AFR targets) quite nicely, which will give you a starting point from which to extrapolate the high-power part.

You don't need a dynamometer to get the high output regions of the VE table done, but you definitely should NOT use Ve Analyze Live with a narrow band sensor for that part of the table, you'll end up with broken or melted pistons. In order to use Ve Analyze Live for WOT tuning, you must be running a wide band lambda system (sensor and controller), with an appropriate EGO correction algorithm that allows you to set specific AFR targets (i.e., MS1-Extra or MS-II). If one of these requirements is missing, then you must rely on seat-of-the-pants and experience.

Beware that if you go so rich that you start to see misfires, the lambda sensor will read the unburned mixture as dead lean (since unburned oxygen is present) and the closed loop algorithm will attempt to add fuel, which the Ve Analyze Live algorithm will detect and adjust the VE bin richer, thus making a bad situation worse. Use with caution, Ve Analyze Live will not perform magic!

The EGO control algorithms all turn off correction (i.e., set the correction factor to 100%) whenever AE, decel, warmup or any number of other enrichment types come active. The 100% EGO value in turn has the effect of turning off the Ve Analyze Live.

All the data TunerStudio displays in dialogs for you to edit is stored somewhere inside your MegaSquirt; the tuning parameters for Ve Analyze Live are just TunerStudio specific data and really have nothing to do with MegaSquirt.

For more information on setting up and using Ve Analyze live please see the help documentation in TunerStudios help section. 

If you have a "strip-only" vehicle, an EGO feebdack is less useful. Some tuning hints are:

Tuning with Alpha-N (TPS rather than MAP)

MegaSquirt can be converted from speed-density (map sensor) to use RPM, temperature and TPS only. This is called "Alpha-N". Alpha-N uses only the throttle position and RPM to calculate the amount of fuel to inject as opposed to using the manifold absolute pressure and RPM to calculate the amount of fuel to inject. Before attempting to start the car in Alpha-n ensure you have set the "settings.ini" file up for Alpha-n, see here or that you selected Alpha_N when you installed the MS1/Extra software.

With a boosted engine using Alpha_N, you MUST use the Hybrid_Alpha_N setting (See Advanced Settings) with Megasquirt, because the throttle position bears little relationship to the amount of air going into the engine. Alpha-N is for naturally aspirated engines ONLY, the Hybrid Alpha-N adds the MAP value into the fueling algorithm, (obviously the map sensor will need to be connected to the inlet manifold, engine side of the throttle plate) so fueling is increased with boost pressure.
Please Note: There is no extra table or any other settings other than selecting the option in Advanced Settings. It is simply used to add the MAP value to the equation.

To use Hybrid Alpha_N simply set your Constants - Control Algorithm as Alpha_N and set the ini file in TunerStudio as Alpha_N, see HERE.
Hybrid can then be used if it's set in Advanced settings, see
HERE.

Hybid Alpha-N =

PW = REQ_FUEL * VE * TPS * MAP * E + accel + Injector_open_time

Normal Alpha-N =

PW = REQ_FUEL * VE * TPS * E + accel + Injector_open_time

 

Alpha-N is useful for long duration cams where the resolution of manifold air pressure (map) would be small. It is also useful to get smother idle on engines that have erratic map values. It can also be helpfull for ITB setups when atmosphere is reached very quickly under light throttle openings.

For example: On a flat part of the torque curve, going from half to ¾ throttle might not require the value to change in the VE map on speed-density if the air/fuel ratio is the same for the 2 loads as the change in MAP will do this. On the alpha-N system the map bins will be different as this is the only way the MegaSquirt can find out about the higher fuel demand.

In Alpha-N mode MS still makes 02 corrections (i.e. runs 'closed loop'), if you have it enabled.

One thing you have to always remember with alpha-N that you don't actually know where the effective WOT is anymore (i.e., when you have enough throttle that opening it further doesn't affect the amount of air being ingested). At low RPM WOT could be only 20% throttle.

As an aside in the MSnS_Extra embedded code the fuel equation (minus the enrichments and open/close time) looks like:

PW = Req_Fuel * VE(tps,rpm)

as opposed to the MS B+G V3..xxx codes, which looked like this:

PW = Req_Fuel * tps*VE(tps,rpm)

Note the extra factor of TPS (in red) is not in the MSnS_Extra code.

Tuning with alpha-N is much the same as speed-density, except you no longer have an input for load. What this means is that you don't really know what full throttle is at the low and mid RPM ranges. For example, at 2000 RPM, 20% throttle might flow all the air the engine needs. So the usable area of the table will end up looking a bit like a triangle. The table itself will be actual fuel rather than a VE multiplier.

Please Note: In TunerStudio the TPS scale is the RAW data from the TPS, so it's scale is 0 to 255 (0-5V). In order to find the scale of your TPS, go to Tools, Calibrate TPS, and with your foot completely OFF the throttle hit Get Current. Remember this value(e.g. 33). Put your foot flat to the floor on the accelerator (engine not running!!) and hit Get Current on the Calibrate TPS dialog, remember this value too (e.g. 225). This is the scale of your TPS and should be the first and last entry in the load scale of the VE table.

Please note: Later versions of TunerStudio (+ 30th Oct 2007) I have changed the screen so it shows the RAW ADC value in the bottom left gauge when you have set TunerStudio to Alpha_N mode.

The tricky part with tuning alpha-N is working out where the effective WOT is. It is a very non-linear relationship and depends critically on the sizing of the throttle body.

Also, with alpha-N, the final fuel pulse is a simple product of the VE table entry and enrichments, so your VE table is far more critical than in speed-density mode.

If you are running alpha-N, disable closed loop operation until you have a good handle on where the effective WOT is. If you still have a MAP line connected you can (and should) log map to give you an idea of where full throttle is across the rev range.

If you are going to have varying loads, or are going to tow with your MegaSquirted vehicle, and you have good vacuum at idle and a good vacuum range, then go with speed-density because it reacts to changes in load a lot better than Alpha-N.

Alpha-N does have legitimate uses, and one would be an engine with a small intake vacuum range and a poor vacuum at idle. A strip/drag vehicle where there will be small changes in load and it'll see most of its use at WOT might benefit from alpha-N.

In alpha-N, if you use barometric correction, it will look at the pressure at first power up and set the offset from that value. Otherwise if baro correction is off it does not use the map sensor at all.

Alpha-N still uses the temperature sensor to increase or decrease the fueling based on the ambient air temperature.

Even if you only plan to use alpha-N in your MegaSquirt, it is a good idea to build up the complete board. Use all the sensors. If you do not use liquid cooling and do not want cold start enrichment, hang the sensor in the air. Set the warm up bins to 100% across the board. Place the intake air temperature sensor in the intake or as close to the incoming air as possible. That way you have all the hardware and the board will operate properly. You can turn off almost any thing in MegaSquirt by placing the key values out of range.

 

Idle Pulse Width

You have to select your injectors based on the maximum horsepower your engine can produce to prevent the engine from running lean at wide open throttle. But why not just pick the biggest ones you can find?

The answer has to do with idle and cruise pulse widths. If you use very large injectors, your idle pulse widths get very short. This can drastically reduce the mixture ratio control that you have during idle and cruise situations, and lead to very poor driveability and seemingly strange tuning behaviour.

To illustrate, suppose you have established that your engine produces the lowest MAP reading at an idle pulse widths of 1.2 milliseconds, and your opening time is 1.0 milliseconds (considered the 'standard opening time'). Recall that MegaSquirt can only change fuel by 0.1 milliseconds at a time.

And also recall that MegaSquirt assumes NO fuel is injected during opening (which is close to true, since the injectors remain closed until the coils charge, then they snap open at the end of the opening time). Now if the net effect of the enrichments change by 2%, the pulse widths don't change at all. Even if they change by 49%, nothing changes. But once they change by 50%, the pulse widths suddenly changes to 1.3 seconds.

So the next leaner possibility is 1.1 seconds, and the next richer is 1.3 seconds. However 1.3 milliseconds is not 1.3/1.2x100% = 8.3% richer, instead it is (1.3-1.0)/(1.2-1.0) = 50% richer! The mixture becomes very, very rich, and the engine runs poorly.

To confuse your tuning efforts further, it may be that you are already near a threshold, so that a small change in one parameter makes a very big change in the air/fuel ratio in one direction, but no difference at all in the other direction!

But doesn't the EGO correct? Actually, it can't. Even if you set the step size to 1%, nothing happens until the 50% (i.e. 1.3 milliseconds) threshold is reached. That is, the step size only takes effect once the 0.1 threshold of PW is reached. And if the number of ignition events between steps is large, the engine may stumble and die before it recovers and leans out. So in fact you may be better to set the O2 step high (50%), and the number of ignition events low (say 2) so that the average over just a few injections is correct. It is a band-aid approach, however, and likely to induce ignition related problems.

Obviously the converse is true if the engine goes lean. It has to go at least (1.1-1.0/(1.2-1.0)=50% lean before anything happens. If does go lean, it may back fire and die before it gets a chance to become richer.

You might think you can get around this by decreasing the injector opening time (to get a larger "adjustable time") and increasing the VE (or req_fuel), but that doesn't work because the 'ideal' injection time is still 1.2 seconds, and the permissible step is still 0.1msec, regardless of the way you add the components of the pulse width up.

And making matters worse is the fact that many high-performance engines will want even lower pulse widths at cruise than at idle, compounding the tuning problems and introducing more driveability issues. A system with a very short pulse widths like this will be difficult to tune. It will appear not to respond at all to enrichments over a certain range of a parameter (say IAT), then suddenly it will seem to change so drastically that you seem to require an entire new set tuning values.

Now even if your engines idles perfectly at a very low pulse widths, changing load, speed, and other variable (EGO, IAT, etc.) will demand slightly different air/fuel ratios. However, none of them are likely to need exactly the +50% you have to choose from!

This is why several aftermarket ECU manufacturers recommend an idle pulse widths of not lower than 1.7 milliseconds. If yours is lower than this, you need to address it before you will be able to tune your engine for all operating conditions. Ultimately the best solutions are appropriately sized injectors or staged injectors.

Datalogging

Datalogging allows you to create a running record of the MegaSquirt real-time variables. Once you have enabled datalogging (by clicking on the Datalog menu item on the File list), TunerStudio polls the MegaSquirt controller when any of the front page, runtime display or tuning page are active, and writes this data to a file. The file has a comma-separated value format and defaults to having an extension of “.msl”The data logs can be opened in MegaLogViewer

When datalogging is enabled, the second status box (bottom right corner) contains a bold “LOGGING” indicator. The rightmost indicator contains either greyed-out “CONNECTED”, meaning that TunerStudio is not communicating with MegaSquirt, dark “CONNECTED”, indicating that TunerStudio and MegaSquirt communications is working properly, or dark “RESET n”, indicating that the MegaSquirt controller has been erroneously re-booted n times since TunerStudio started talking to it.

Note: the Logging option under the Communications menu is a different function, and does not need to be selected to enable datalogging of the real time variables. See the TunerStudio help menu for details on the Comm. Logging function. If you can drive the car at all, start datalogging. Look through the log and MAP-RPM pairs that are near grid points in your VE map, when they O2 sensor reading is significantly below 0.500 (say 0.014), jack up the VE at that point by 10%. When the O2 sensor is significantly above 0.500 (say 0.825) then drop it down by 10%. A couple runs around the block should get things running pretty well.

The critical settings are O2 step% and ignition events per step.

For fine tuning, keep the O2 adjustments per second between 3 and 5. For roughing in VE maps, set the O2adjustments between 5 and 10 per second (depending on how good the O2 sensor is, if it is old, go lower).

Once the map is tuned in, set the:

You can calculate your:

O2 adjustments per second = ((rpm/120) * cylinders) / ignition events per step

Note that the datalog includes an 'EngineBit' field. This bit will tell you if the engine was accelerating, warming-up, etc., and can be used to sort unsuitable data lines (because O2 correction is not active under acceleration, warm-up, etc.) from the file.

The engine bit has 6 binary bits. The rightmost bit represents running. It is 1 if running, zero if not running, so 000001 = 1 or 000000 = 0. The next rightmost value is for cranking, 000010 = 2 if cranking. Note that and engine is never both running and cranking, so you should never see 000011 = 3. The fields are:

 

Binary Bit

Decimal

Meaning

00000X

1

Running

0000X0

2

Cranking

000X00

4

Start-Up enrich

00X000

8

Warm-Up enrich

0X0000

16

TPS accel enrich

X00000

32

TPS decel enlean

Note that the only suitable value for reading O2sensor values is when the engine bit is equal to 1 (i.e. running and no enrichments).

You can view your datalog files in graphical form using Megalog Viewer by Phil Tobin. This can be set for either narrow-band or wide-band oxygen sensor readings. Megalog Viewer is very configurable so it is highly recommended for the MS1-Extra code. Using this viewer, you can see the trends in your datalog, and spot trouble areas more easily than viewing the numbers in a spreadsheet or punching the log through VEXME or MSTweak. When using Megalog Viewer the VE table and the spark table can be loaded into the screen, this makes tuning and reviewing the log much easier, as the running area of the log that your looking at is highlighted in the tables, (see the yellow highlights) so it is easy to see where you need to adjust the maps. Adjustment of the tables is easy too, as there are buttons to increment / decrement the values directly. The file can then be saved ready to be loaded into the ECU via TunerStudio. This program is well worth a look and is highly recommended for all to try, as it can make tuning a lot easier!

Using Datalogs for Tuning and Troubleshooting

Below are some screen shots of MSLVV showing datalogs with various diagnostic conditions, these can be seen in a similar fashion using Megalog Viewer too.

Above is an example of a good datalog. The sensors are all responding, and the MAP and RPM go up when the throttle is pressed, and not otherwise.

 

Above is an example of what happens when the TPS Averaging Lag Factor parameter is set too high (above ~ 70  is considered high). The usual amount of 'noise' in most TPS signals can trigger the accel enrichment, and greatly increases the pulse width. The result is a very rich mixture and a poorly running engine that doesn't respond well to tuning. The solution is to decrease the TPS Averaging Lag Factor parameter to below 50. If you enter a value of 100 you are getting 100% of the live TPS signal with no averaging! 

 

Setting the Acceleration Enrichments

After you have the VE table dialed in, or if you have driveability problems initially, then start adjusting the acceleration enrichment. A need for Acceleration Enrichment can be felt by the driver as a sudden total drop in power after application of the throttle. Too much or too little AE can have the same feel. Turning on the AE Driven Pct Gauge nd watch for bout 150% at low rpm and about 5% at higher rpm. The goal is a consistant AFR as the throttle is applied.

The first thing to do is to ensure RPM Based Accel is not on, as this is for highly strung engines. Go into "RPM BASED ACCEL" and set it to Normal Based AE*^ . The next thing to set is your TPSdot threshold (V/s) or MAPdot threshold (KPa/S), try setting it to MAPdot first then if your not happy try TPSdot, this is in the Acceleration Wizard.

The TPS/MAPdot threshold setting determines the rate at which acceleration enrichment begins. If you set it too high, no accel enrichments will be applied, and the engine may respond poorly, backfiring or coughing under sudden throttle movements. If you set it too low, however, you may have inadvertent enrichment triggered by noise on the TPS signal. In general, use a setting between 0.5 and 2.00 (TunerStudio may round these number slightly) - start with 1.00 unless you have a reason to do otherwise (it will be rounded to 0.977, which is fine). If using MAPdot then try 50-80KPa/S. I usually find 0.5V/S or 30-40KPa/S end up being the best settings for the dot threshold once everything is tuned.

The value (mS) is the additional fuel added in mS.

The Rate is the speed of throttle application.

Be careful when setting the MAPdot or TPSdot Threshold, that the Enrichment doesn't cut in when the engine is idling or cruising due to setting the threshold being set too small. If AE cuts in during cruise or idle or at any time other than when your accelerating then the engine will feel sluggish and bog down, at idle the engine can stall or hunt due to AE cutting in. This can be checked by looking at the datalogs in one of the veiwer programs.

Other settings for Acceleration Enrichment can be found under "Accel Decel Mode"

The Accel Timer can be changed from Seconds to Engine Cycle counts. Note that a value of 0.3 could mean 0.3 seconds or 3 ignition pulses. The Cycles option is useful because the enrichment will reduce at higher rpms

By setting Decay Accel Enrichment to Decay the code will start by adding the usual amount of additional fuel set in the Value mS then it will linearly decrease this amount untill the added fuel is the same as the Accel value at end of Accel Time. The Accel value at end of Accel Time value is reached by the end of the Accle Time. This gives it a more realistic fueling characteristic that should follow the requirments that the engine needs. (0.0 - 0.5mS is the normal setting here.)

If in MAPdot mode then you can turn off the accel/decel enrichment when the engine goes into boost.

You can also turn just the Decel off in either mode when in Boost, this is to prevent the ECU cutting fuel down (using the Decel) by you simply easing off the accelerator a little when in boost.

One of the reasons that there isn't a "magic formula" for accel tuning is that it really is a "feel" and "driving style" sort of thing. And it depends critically on your state of tune for the VE table, warm-up enrichments, manifolding, idle and cruise speed and AFR, TBI vs. port, injector flow rate, and a million other things.

In a nutshell, too much accel enrichment produces a sluggish throttle, too little accel enrichment produces backfires in the intake manifold. Way too much AE feels just like too little.

The best way to get a rough accel tune is to "blip" the throttle with no load (at different rates, but you have to guess which bin was active), and adjust the accel bins for the best throttle response (and this will also depend on the decel amount).

The more rapidly you can get the engine to rev and recover, the better your accel/decel enrichments. If they are really tuned in, you should be able to rev the engine repeatedly, with the engine responding 'crisply' every time.

You may want to try a short Accel Time (like 0.2 ms) and jack up the accel enrichment bins.

A Decel Fuel Amount (%) setting of 100% means no cut. 1% means reduce the pulse width by 99%, to 1% of what it normally would be. Start with 100% and tune this by watching the O2 sensors reading. (generally a value of 70-90% is best here) The low MAP part of your VE table is probably a touch lean, so the NB sensor drops below stoichiometric. If the car does not buck too hard, you are close to correct settings. If it bucks and stumbles, then it is going too lean and you need to richen that part of the table.

Before tuning decel [or accel], try to make sure you have your VE table close to correct first. To get the VE table set up, set the TPSdot / MAPdot setting very high (30v/s or 3000KPa/S or something like that) so that enrich/enlean never kicks in. Then, (in steady state) set up VE table. If the vehicle is undriveable without tuning the accel enrichments, by all means do it, but be sure to revisit the accel tuning as you tune your VE table.

To adjust the bins, start with something like:

TPSdot Bin

MAPdot Bin

Start tuning at (ms)

15 Volt/second
(idle to WOT in 2.5 seconds)

800KPa/second

5.1

8 V/S

300KPa/S

2.5

4 V/S

100KPa/S

1.1

1 V/S (idle to WOT in 3/10 sec.)

40KPa/S

0.3

Some more Accel Enrichment Details

There is a lot of confusion regarding the tuning of Acceleration Enrichment in the MegaSquirt family of programs. It is far easier to tune AE if you understand the underling causes and effects. For more info see this text file HERE.

 

RPM Based Acceleration Enrichment

THIS OPTION IS USED FOR A VERY SPECIALISED INSTALL!! 90% of installs will not need this option.
This is triggered via a rate of change of TPS or MAP as the usual Accel Stuff, BUT the enrichment is based on how fast the engine is running.
The MAP and TPS based Accel enrichment bins in the Accel Wizard will be ignored in this mode. This is often required with high strung small displacement MOTORS and race motors. The Trigger threshold values will still be current as this is still when the AE cuts in. The Threshold values and Accel time are doubled up on this setting box and are the same as on the AE Wizard.

Tuning the RPM Based AE

Tuning is a fairly simple procedure. As with all MS installs, the very first thing to do is sort out ALL input signals to the Squirt. IAT, CLT, RPM, MAF if installed, TPS and MAP signals must be all very stable. The goal of all of these AE methods is to have a very flat AFR during all transitions of the throttle. Once perfected, the motor will be very smooth throughout the entire power band including throttle stabs, shifts and throttle roll-ons. I always try to run MAPDot if I have a reasonable idle MAP to work with.

This all assumes that you have a tuned VE map. If using RPM based AE, start by setting the lowest of the four bins close to the RPM that your motor idles at. Say 800 RPM. The next cell to set is the highest RPM bin. This is the highest that you are likely to ever activate AE, say 80% of your redline. This should be close to the RPM that your motor drops to after a 3-4 shift. The two other RPM settings should be evenly spaced from the two extremes. For our example 800, 2000, 3000 and 4500 RPM. The second RPM number is where your motor will most likely need the greatest amount of AE in terms of total ms and percent on the AE Driven Fuel Percent gauge. I normally tune the base AE settings by getting on a stim and temporarily set the AE time to 2 sec and the decay to No Decay. Note that you will need to guess the MAP at say 85 KPA for this test. I use a syringe to apply 85 KPA to the Squirt. Play with the ms of AE numbers until from the lowest RPM thru the second RPM setting get close to a flat 150% AE through this range. The 150% is just a guess on my part but it is a place to start. Now go to the third RPM with the stim and set the third ms of AE to get about 115% Next go to the highest RPM and set the highest ms to get about 103% on the gauge. Set the AE time to .7 sec and the decay back on. If you do not own a stim then the numbers can be guessed at. Now start data logging, drive the car locked in second gear and put the motor at 2000 RPM, stab the throttle and have a friend watch the o2 gauge and the AE driven Fuel Percent. Play with the time and ms of the second RPM cell till you get good throttle response and most likely the best response will be when the o2 remains close to about stoich or a little richer. Lean holes are never the correct answer. Now try applying the throttle with a lighter stab. This ends up a compromise. Once a balance is set go to the third RPM and play with just the ms of the third cell to get good response. The highest RPM cell will be for high RPM (redline) shifts. Last go to idle and tune the ms of the lowest cell to get a reasonable off idle response from the motor. Note that as the RPM climbs, the AE will get stepped down by either the timer and the decay function or slammed down by the rising RPM.

 

Tuning Issues

If you have a very long duration cam in your motor, and it idles poorly, you might be able to get it to idle better through careful tuning with MegaSquirt. Often a rough idle may be caused by lean air/fuel ratios. This is really is more of a cam issue than a fueling issue. The exhaust valve is held open later into the intake stroke and the intake opens earlier near the end of the exhaust stroke. At low speeds and relatively high intake vacuum you get more exhaust contamination of the fresh air/fuel charge. As you get more contamination of the air/fuel charge you typically need a richer mixture to get it to ignite and burn properly.

This means you probably cannot run a stoichiometric [chemically correct] mixture of 14.7:1 with your long duration cam. You need to run richer. So you tune your idle by ear rather than with a narrow band EGO [oxygen] sensor. And make sure you are not allowing EGO correction at idle if you have a rowdy cam! It will be trying to “correct” your mixture back to a lousy idle. If your engine will not idle well at stoichiometric mixtures, set the EGO Active Above RPM to a few hundred RPM above your idle speed. This will ensure that MegaSquirt does not try to lean the mixture back to stoichiometric to compensate for your adjustments.Remember that O2 sensors give wrong readings on a missfiring engine, big cams drive O2's nuts at idle too, so dont rely on their readings at idle.

Another tip you can try if you have a large overlap cam is to pinch off the MAP hose slightly while the engine is idling, and see if the idle quality improves. If so, then try a restriction in the MAP vacuum line. This has the effect of damping the vacuum pulses that the MAP sensor sees. Start with a ~0.040" (1.0mm) hole in the line. You may have to experiment with restrictor sizes to see what works best for your system.

 

A few more things to try:

1) Check your VE table entries near the idle point - if the RPM or MAP fluctuate, then you can get rolling idles, etc. You may have to move some of the bins around to bracket the idle RPM/MAP region, and keep flat VE values within this.

2) If you run low-impedance injectors, you need to tune your PWM current limit. Start with 75% PWM and 1.0 millisecond time threshold. Once you get idling, then first adjust the PWM duty cycle down until you notice a change in idle quality, then move the value back up 3 - 5%. Do the same with the time threshold. On the car it is very easy to do and only takes a few minutes. And, at idle, the overall injector pulse widths are small compared to their close time, so this will allow you to adjust the values. In other words, adjust the PWM current limit before taking the car out on the street where injector pulse widths become high.

Your engine will idle at a certain vacuum. It might help on a street use motor on the VE map to use a lower point for starting MAP than idle vacuum. For example you can have yours set at 20 even though you idle at 27 or so. This allows you to run less fuel on overrun deceleration and coast events (not just for a second like the TPS will do). This allows you a saving of 3-4 MPG on average driving and you might be able to run more advanced timing under this vacuum.

On the other hand, you may want to do the opposite. You can increase the VE values just to the left and above idle. You can make them really rich [say double the idle VE value, to keep the car from stalling. This seems to work really well, if the engine starts to stumble, the pulse width goes up and it recovers.

By working with the RPM and MAP bins, you should be able to work out a set of values that lets you run lean at cruise and decel [where the RPM is above idle, and MAP below idle], but rich when stalling [RPM below idle].

On the warm up enrichments page, the warm up enrichment only goes to 160º F. The 160º F bin value of the enrichment (which should ideally be 100%) is used at all temperatures above 160º F, so it is important to ensure that 100% is entered in there.

The system compensates automatically for any amount of idle solenoid bypass air because of the effect it has on the MAP value [i.e. the vacuum in the manifold is lowered by the bypass air, this is sensed by the Manifold Absolute Pressure sensor, and the processor decides to inject more fuel. The effect is exactly the same as if you had cracked open the throttle a bit. The fuel goes around the throttle plates, which are never truly closed. They are set at the opening required for the slowest throttle speed desired for the engine under optimal conditions, which leave plenty of room for the fuel to get by. The fast idle air then adds to this baseline amount of air to raise the idle speed. In some circumstances, you may want to run without oxygen sensor feedback, called “open loop”. The best way of forcing MegaSquirt to run open loop is to change the O2 sensor step to 0 [zero] on the enrichments page. It will still log the O2 voltage, but not do anything about it.

The MegaSquirt Fuel Pump output is programmed with a priming pulse option to shut off the unit in case of an engine stall, etc. It can turn on the pump immediately when the power is applied and shuts it off 2 seconds later if the engine is not running. Go into "Cranking Settings" you’ll find

PRIME PUMP WHEN - Values for this item are either Prime Pulse > 0 or Always. If you select the first option, the pump will only be primed if the priming pulsewidth setting is greater than zero. If you select the latter option, Always, the pump will be primed regardless of your priming pulsewidth. You will most likely want to use Always as it will get your fuel pressure up before cranking, but you don't necessarily have to inject any fuel. The priming period is two seconds.

FIRE PRIMING PULSE - The Fire Priming Pulse option allows you to select when a priming pulse is fired. If you select Power Up, a priming pulse will be fired immediately upon turning on the ignition. If you select Twice, one priming pulse will be fired when you first key the ignition on and the second pulse will be fired after a second has passed. If you select After 2 Secs, there will be one priming pulse two seconds after turning on the ignition.
The first option was in the original stock code, however, it will not necessarily work for a cold-start because there may not already be fuel pressure in the rail when you turn the ignition on. The other two options are just different methods of firing the priming pulse. If you select Twice, then there will most likely be no fuel injected on the first pulse, unless there is already fuel pressure in the fuel rail, and then there should be fuel injected on the next pulse. If you select the After 2 Secs option, it will give the fuel pump time to build up pressure. With that option, however, remember that if you try and start the car before allowing two seconds to elapse, no priming pulse will ever be injected.

When you start cranking, the pump comes on, and times out two seconds after the last pulse on the tach signal.

If your TunerStudio displays bizarre values for the barometer on the runtime display, 76 kPa, for example, you may be resetting while running. TunerStudio has a check that detects most resets by watching the seconds value. If the seconds goes to zero from any value other than 255, then it signals a reset with an audible “beep” and sets a counter visible on the lower right corner of the screen, where it normally says "connected".

As well, you can check the datalog seconds count - make sure it counts up to 255, and then rolls over to zero and continues again and again. If you get shorter counts (like say 56 then a roll over) then the processor is resetting. Note that most of the time on the car you will not notice that the reset has occurred because it happens so fast. What happens when the engine has a running reset (when the engine is running and the processor resets), then it grabs the barometer near the beginning of the MegaSquirt processor boot procedure. If the engine is running, then it will grab engine vacuum and use this for barometer. See HERE for ways to get around this problem in the settings.

For normal operation the processor comes up so fast that it has grabbed the MAP value before the engine has a chance to start cranking, much less running.

Tuning for Economy

To get maximum fuel economy, you want the engine to run as slowly as you can (hence the proliferation of overdrive transmissions in the last 15 years), and to run an Air/Fuel ratio (AFR) of about 14.7:1 to 17:1.

To tune for economy with a wide band oxygen sensor is relatively easy. Look up the sensor output at ~16.5:1 for your sensor (~2.65 volts for the DIY-WBO2, for example). Put that value as your EGO trigger point in TunerStudio, and if your EGO ± Limit (%) is sufficient (given the state of tune of your VE table), you should be getting good economy.

You can try mixtures leaner than 16.5:1, however you may get a lean 'surge' that feels like someone is pushing the car forwards, then pulling it backwards. Generally, this is a sign that you are too lean.

With a narrow band, it's a bit tougher to set it for maximum economy. You can adjust the VE table, but the EGO correction tries to bring it back to a stoichiometric AFR.

You could raise your EGO_RPM_limit to just above your cruise rpm, but depending on where that is, it might not be all that workable. A better method, if you have a narrow band oxygen sensor, is:

new VE = {56% × (14.7 ÷ 16.5)} - 5% = 45%

Do this for all the values in the VE table you actually cruise at, but not the higher rpm, higher load areas of the VE table.

That keeps the EGO at 16.5:1 at cruise, but lets you set it anywhere else in the rest of the table.

Tuning for Emissions

To tune your engine for minimal emissions using MegaSquirt properly requires expensive test equipment. However, as a start, you can:

Here is an example of how a few changes affected one engine:

 

Baseline

Timing
Retarded 10°

Timing
Advanced 10°

Mixture
richened

Mixture
leaned

HC

1.00

0.78

1.14

1.39

0.88

CO

14.5

11.6

13.0

81.0

9.8

NOx

2.91

1.89

5.18

0.71

3.03

O2
Not usually tested

22.3

19.8

23.8

17.4

25.4

CO2
Not usually tested

305

307

298

246

310

You can see that retarding the timing and leaning the mixture slightly gives the best possible compromise, increasing only the NOx slightly among the regulated emissions. (The above was without a catalytic converter. With a converter, emissions would have been best at stoichiometric mixtures and the timing retarded somewhat.)

Spark Map Tuning

Before tuning the spark table ensure the Trigger Angle has been checked and set using a timing strobe, see HERE

Tuning the spark map may not seem the easiest thing in the world to do and it can be difficult to know where to start. Here is a base map that is for a Boosted engine (>100KPa = Boost)

Spark Map Tuning Basics - The idea is that the idle and low speed area's are retarded to around 8-20deg, usually idle will be around 8-12deg, but this depends on your engine's design. If you set the first row in the RPM range as a little under your usual idle (e.g.600 if your engine idles at 800ish) and add some advance here, so if the engine stumbles into this area the slight increase in advance will help it to speed up a little so it doesn't stall. The cruising area of the map should have a reasonably high advance, (low to high 30's) as the mixture will be reasonably lean and therefore will give a slower burn. The overrun area can have an even greater advance, this will allow you to run lean in that section. At Wide Open Throttle (WOT) the spark map needs to be RPM based (analogous to centrifugal advance on an old style distributor) coming in at the right rate relative to engine RPM. Typically, you want it "all in" by about 2800-3200 RPMs for a street performance motor.

Note the the optimum amount of total advance is not necessarily the most that doesn't cause detonation. For example, with a modern cylinder head design, you might get maximum power at 32°BTDC, but might not experience any detonation until 38°- 40°. However you will still want the advance to come in as quickly as possible (without knocking) up to 32°. For example, my Rover based V8 produces max power around 30°BTDC at WOT, but even at 36° at WOT, I have no detonation.
As the Kpa increases (load increase) the spark map should retard as the mixture will be richer and the chances of detonation will also increase with the load. When going into boost the advance table values will need to be lower than when out of boost (>100KPa = boost) and as the boost level increases the advance will need to decrease with it, as detonation is more likely. It has been said that 1deg of advance should be removed for every 2PSI of boost; this is simply a rough guide and lots of things can depend on how much to remove including compression ratio. Detonation Cans are a great option for tuning in boost, use a piece of copper pipe flattened at one end with a flexible tube connected to it. Bolt the flattened end to the cylinder head. Get an old set of ear defenders and drill a hole into the side of them, push the other end or the tube into the hole youve just drilled in the defenders and you should be able to hear any detonation as it occurs.

Crusing is probably the hardest part of the spark map to tune, so this will need several rows set up around that area, see setting the KPa and RPM rows for fuel HERE as it follows the same theory. Shunting in the crusing area is usually down to too much advance, or too weak a mixture. If the mixture is correct (14.7 to 13.5 depending on your cam) then it may be worth removing advance untill the shunting subsides. Too little advance will reduce throttle responce so don't go too far, too little advance can also create higher exhaust gas temperatures. Go back and check the AFR after tuning this area, as the spark angle will effect the AFR readings.

There is a thread on the MSExtra forum discussing spark tuning further that can be found HERE.

One thing to bear in mind is that altering the spark table WILL effect the AFR. So you will have to re-visit the VE table after tuning the spark table.

If you experience detonation in your engine, then either:

* Your mixture is too lean. Increase the numbers in the VE table at the point the engine detonates (or increase the Req_Fuel if the detonation occurs at all points). Also make sure your fuel pump is operating well. It may be supplying enough fuel at idle, but not supplying enough when the demand rises. Use the oxygen sensor readings to determine if you are lean,
* You have oil leakage into the combustion chamber (check the plugs for signs of oil). This could come past the rings or seals (possibly worn, or from something that was forgotten during assembly, or there are blocked drain back passages in the head, or the rings have been damaged by detonation or over-revving), a 'leaky' PVC system, or from a poor intake manifold gasket seal allowing oil into the runners (on push rod V-engines),
* Your spark advance may come in too far and/or too fast. Edit the spark advance table to lower the rate at which advance is added. You may also need to limit the total advance. Most engines will not require more than ~36° at WOT (possibly more for a flathead design, or a large open chamber, large piston dome design). Newer cylinder head designs and 4 valve/cylinders heads generally don't require a lot of advance,
* You have spark plugs that are too hot (get a range or two colder), or they are incorrectly torqued (if they are loose, they over-heat because of poor thermal contact with the head),
* Your thermostat is too hot (you can try as low as a 160°F thermostat for street use),


If you have a question, comment, or suggestion for this FAQ, e-mail Phil or James or post it on the forum.

No part of this manual may be reproduced or changed without written permission from Philip Ringwood, James Murray, Ken Culver and Lance.

Many thanks to Lance for giving us permission to edit and adapt his MS Manual for MS1-Extra use.


©2004, 2005 Bruce Bowling and Al Grippo. All rights reserved.