Click on our menu buttons immediately below to find MegaSquirt® information quickly:




Click here for MegaSquirt® MegaManual™ Information, Guides, and Links

Configuring your MegaSquirt-II™ (or MicroSquirt®) controller

Tuning Software

The software application you use to tune and configure your MegaSquirt-II™ (or MicroSquirt®) controller is called TunerStudioMS by Phil Tobin.

You also need Windows 9X/ME/XP and a conventional serial port to communicate with your MegaSquirt-II™ (or MicroSquirt®) controller. USB will may work, and many people have reported that they have been successful using a USB-serial adapter. Just about any computer that is capable of booting Windows 95 (or better) will be fast enough, but get the fastest laptop computer you think is reasonably priced.

To tune all the parameters of your MegaSquirt-II™ (or MicroSquirt®) controller so that your engine runs the best it can, you will need to do the following:

  1. First, install and learn to use TunerStudioMS,
  2. Next, set the constants,
  3. Get the engine started and idling,
  4. Then tune the PWM criteria,
  5. Then tune the cold start and warm-up enrichments,
  6. Then tune the VE table, the AFR table, and the spark advance table,
  7. Finally, set the acceleration enrichments,

This section of the manual covers the first two items. the remainder are covered in the Tuning MegaSquirt-II™ (or MicroSquirt®) section. Before starting this section, be sure you have read and understood the information on the MegaSquirt-II™ (or MicroSquirt®) Installation page.

Using TunerStudioMS

General Advice and Operation

Some general principles to follow when setting the configuration parameters are:

Some Warnings

Note that it is possible to damage your engine and/or MegaSquirt® by choosing inappropriate tuning or set-up parameters in TunerStudioMS. Be sure to read this document, and all associated tuning documents that apply to your engine, vehicle, and tuning circumstances. In particular, read the safety precautions.

Installing TunerStudioMS

TunerStudioMS has an 'automated' install package, similar to most other modern Java software. You download the set-up file (see below), click on it, and the package installs itself. You may have to select some options, or you may chose to select all the defaults.

When MegaSquirt® is loaded and communicating with your MegaSquirt-II™ (or MicroSquirt®) controller, the first thing you will see is the front page, which shows eight of the more useful gauges.

A number of the sensor readings are displayed, as well as some outputs. For example, the injector pulse width is the measure in milliseconds 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.

Setting the General Parameters

Note that as the code develops, some advanced options may not be documented here. To find information on these advanced options, see the TunerStudioMS help file.

Some general principles to follow when setting the configuration parameters are:

Now we are ready to start configuring your MegaSquirt-II™ (or MicroSquirt®) controller!

On the main TunerStudioMS menu is an item called 'Settings/General'.

You can set these as follows:

If you are using a knock sensor, separate baro sensor, or non-standard MAP sensor, you can configure your MegaSquirt-II™ (or MicroSquirt®) controller to work with them using the 'Sensor Calibration' dialog under 'Tools'.

The MegaSquirt-II™ code is set up for the standard General Motors temperature sensors. If you are using other sensors, you can use the 'Calibrate Thermistor Tables' dialog under 'Tools'. You enter the bias resistor value and three temperature/resistance points, and the table is created and downloaded to your MegaSquirt-II™ (or MicroSquirt®) controller for you.

IMPORTANT NOTE: Do NOT burn tables ('Calibrate AFR Table' or 'Calibrate Thermistor Tables') on a running engine. Even idle is NOT allowed, because these tables ONLY exist in flash, so once a table is erased, there is nothing but garbage in there until it is re-programmed, one word at a time. Until that reprogramming is complete, operating the engine is unsafe.

MegaSquirt uses coolant and air temperature sensors to determine the warm-up characteristics of the engine and the density of the intake air. They are essential to proper functioning of a MegaSquirt® controller. Both sensors are Negative Temperature Coefficient (NTC) thermistors. This means that they are resistors whose resistance decreases as their temperature goes up.

MegaSquirt® uses the temperature sensor as one leg of a voltage divider. The 'supply voltage' of 5.00 Volts (we will call this Vs) is fed to a resistor with a default resistance of 2,490 Ohms (2.49K Ohm) (this is called a "bias resistor", and we will denote it as Rb) and this resistor is connected to the temperature sensor (denoted here by Rs) which in turn is connected to ground.

The voltage at a point in the circuit between the two resistors is used by the ECU to determine the resistance of the sensor, and thus its temperature. The voltage (V) at that point of the circuit is:

V = Vs * (Rs/(Rb+Rs)) = 5.00 * (Rs/(Rs+2490))

Resistor Rp does not affect the voltage divider, it simply limits the current to the processor pin (there should be very little current anyhow, the input is "high impedance").

MegaSquirt-II reads this voltage as a series of voltage steps: 1023 0.005 Volt steps. The conversion from volts to steps is done by the analog-to-digital converter (ADC).

To use a MegaSquirt® controller with an air cooled engine, you will have to decide where the best place is for the coolant sensor: in the oil, or on the cylinder head (CHT). There are various arguments for and against using either CHT or oil temperature as the 'coolant' temperature input on air cooled motors. A lot depends on whether the motor is substantially oil cooled or not. Since the CTS input is used for warmup enrichment, you want something that responds fairly rapidly, so this is highly engine-dependent.

For high temperature applications (i.e. air cooled engines with a CHT), in MS-II you can set the #unset EXPANDED_CLT_TEMP by changing:

#unset EXPANDED_CLT_TEMP

to

# set EXPANDED_CLT_TEMP:

Then the upper temperature limit should be 600 degrees F. This is from the INI notes:

; FAHRENHEIT (Expanded/Normal):
;     Low Limit: -40F/-40F
;     High limit: 600F/300F
;     Low danger: 150F/50F
;     Low warning: 200F/150F
;     High warning: 325F/200F
;     High danger: 350F/220F
However, you have to calibrate the thermistor table(s) appropriately.

However, note that the tuning software limits the temperature range. The thinking is that if you are at an extreme it is probably a bad or missing sensor, so it goes to a default value. This isn't a big deal in TunerStudio though, you can change these limits in the ms2ReferenceTables.ini file. You can adjust these limits if EXPANDED_CLT_TEMP is set. Currently only the CLT sensor respects EXPANDED_CLT_TEMP, the IAT does not.

IAT min = -40, max=350 if outside that range it goes to 70 CLT min = -40, max=350 if outside that range it goes to 180 CLT with EXTENDED_CLT_TEMP min = -40, max=400 if outside that range it goes to 350 default

Here is the section of the ms2ReferenceTables.ini file that controls that:

; tableLimits (optional) = intentifier, min, max, defaultVal
; will set the default value if value is outside the min and max limits.
tableLimits = 001, -40, 350, 70
#if EXPANDED_CLT_TEMP
tableLimits = 000, -40, 400, 350
#else
tableLimits = 000, -40, 350, 180
#endif"
So the user can just edit the one line in ms2ReferenceTables.ini using notepad.exe or something similar to change it from:

tableLimits = 000, -40, 400, 350

to something like:

tableLimits = 000, -40, 600, 350

or similar, and it should work once the user re-burns the table.

The additional problem with very high temperatures is that the difference in voltage gets very small (and MegaSquirt can only read discrete voltage steps, about 5 milliVolts for each of the 1023 steps from 0.00 to 5.00). Also, if the volts at the processor pin gets very near 5.00 (~4.98) the values defaults to a safe value because it assumes there is an open circuit.

The ADC count result from the voltage divider circuit (above) is:

ADC Count = V/Vs = ADC max count * (Rs/(Rb+Rs))
      = 1023 * (Rs/(Rs+2490)) for a MS-II (10-bit ADC)

One thing you can do is use a lower bias resistor (R7 for the CLT circuit) - this will give you more resolution at the high end of the temperature scale (but loose it at the cold end). The default value is 2.49K Ohms, and if that is what is in there you might try 2.2K Ohms or less (down as low as 1.0K). Note that you have to re-calibrate the thermistor tables when you change resistor values.

Here is a simple ADC count calculator that shows the number ADC steps for a given bias resistor and sensor resistance. If the ADC count values are very high or very low at your sensor's resistance (at a given temperature), the temperature range may be restricted:

Bias resistor:
Ωhms
Voltage supply:
Volts
Sensor resistance: Ωhms ADC resolution:
ADC Count:

For air-cooled use, one side of the argument says to use the CHT over the oil, as the oil takes over twice as long to get to operating temperature than water in a water-cooled car does. The engine does not need to run rich for long periods, only enough to keep the car driveable while it is warming up. Once the cylinder head is up to temperature, the car is usually quite driveable. For an air cooled engine you can drill and tap into a fin in the head for the CHT sensor.

The other side says that it does not matter if the oil warms more slowly, you can just set the warm-up enrichment to come off at a lower temperature. In that case, the GM coolant sensor fitted in the oil (sump) will work nicely. Search the archives for extensive discussions on these points. It is your decision.

Idle Control Settings

The basic idea of IAC is that the motor or PWM solenoid starts out with a large opening of the air valve at cold startup, then gradually closes as the coolant temperature rises. The basic motor position at any given time is determined from the input table of step position versus coolant temperature. To this basic control algorithm, several features have been added as described below. You need to set your MegaSquirt-II™ (or MicroSquirt®) controller to tell it if you have a fast idle "solenoid type" valve or a stepper motor IAC, or neither. These are selected under Settings/Idle Control in TunerStudioMS.

If you have an IAC stepper motor, you will have to choose between 'moving only' and 'always active'. If you set your stepper to 'always on' for 15 min or so and it doesn't feel too hot to you, then you can leave it that way. Apparently this is what General Motors does. But if you want to be safe you can test it on the bench for 15 min or so. It will get right warm, but it shouldn't burn your fingers just touching it. If it gets too hot, use 'moving only' instead.

Setting the Injector Criteria

Before attempting to start your your MegaSquirt-II™ (or MicroSquirt®) controller 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. For the most part, these are very similar to those from MegaSquirt.

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

On the Settings/Injector Characteristics page:

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. If you are running high-impedance injectors (greater than 10 Ohms), then set the PWM time to a number like 25.4, in essence you are disabling the PWM mode. This allows full voltage to the injectors throughout the pulse width.

For low-impedance injectors (less than 3 Ohms), you need to limit the current to avoid overheating the injectors. To do this, there is a period of time that you apply full battery voltage [peak] current, then switch over to a lower current-averaged [hold] current, i.e. peak and hold. Alternatively, you can add resistors in series with the injectors. See the Injectors and Fuel Supply section of the MegaSquirt® manual for more details.

To run low-impedance injectors with the PWM current limit mode, you need to set two parameters - the "PWM Current Limit %" and the "Time Threshold for PWM Mode" - 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.

High impedance injectors can run on 12 Volts without problems. Low-impedance injectors require some form of current limiting. MegaSquirt® has pulse width modulation to limit the current. You need to set the PWM parameters to match your injectors:

Note that most distributors are shipping the V3 main board with the flyback circuit installed. If you are not sure, look for the presence of Q3 and Q11 on the heat sink (3rd and 7th from the left), or ask the distributor.

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

On the 'Settings/Injector Control' page:

Note that for release 1.000, odd-fire is only in the code as a placeholder, there is no code supporting it at this time.

On the 'EGO Control' page:

Note that after you select your EGO sensor type, you should go to the 'Tools/Calibrate AFR Table' dialog and select the sensor output curve.

For example, if you have a narrow band sensor, select that; or if you have a DIY-WB controller select that, etc. Then click on the 'OK' button and a file will be create and downloaded to your MegaSquirt-II™ (or MicroSquirt®) controller that indicates the corresponding air/fuel ratio for various sensor/controller output voltages.

You can also create your own custom table by entering two point on the output curve.

There is more information on how to use these settings while tuning in the Tuning section.

IMPORTANT NOTE: Do NOT burn tables ('Calibrate AFR Table' or 'Calibrate Thermistor Tables') on a running engine. Even idle is NOT allowed, because these tables ONLY exist in flash, so once a table is erased, there is nothing but garbage in there until it is re-programmed, one word at a time. Until that reprogramming is complete, operating the engine is unsafe.

Setting the Tables:

Before starting your engine, you need to populate three types of tables: the VE table(s), the AFR table(s), and the ignition advance table.

Advance numbers can be specified in tenths of a degree (1/10°)

Setting the Ignition Options

If you are not entirely sure about your ignition settings, check the supported list for the settings you should use:

If your module isn't on the 'officially supported' list yet, you'll need to understand the relationship between the trigger offset, the input capture (falling or rising edge), and the spark out (going high or going low). There are some tip on setting these parameters in the tuning section of the MS-II manual.

In the 'Settings/Ignition Options' dialog you can select the:

Dwell Setting

Dwell is the length of time the coil charges to make each spark. It has to be long enough to make a decent spark, but too long heats the coil unnecessarily. It is in milliseconds, since the time between spark is typically a few dozen or less milliseconds. For example, for a V8 at 600 rpm, the time between sparks is 25 milliseconds. At 6000 rpm the time is just 2.5 milliseconds.

In general, use the default options and values unless you have a reason to do otherwise. You can calculate the appropriate times using the formula above and substituting different values for E.

MAP Sensor

If you have a non-standard MAP sensor (i.e., not the default MPX4250AP), then you need to do a calibration under 'Tools/Sensor Calibration'. You need to set both the MAP and barometer sensor to match the sensor(s) you are using. Press F1 while in the sensor calibration dialog to see values for some common sensors. Do NOT change the barometric correction, just the MAP and barometer sensor. You may need to edit the TunerStudioMS ini files to show the full range of your sensor.



MegaSquirt® and MicroSquirt® controllers are experimental devices intended for educational purposes.
MegaSquirt® and MicroSquirt® controllers are not for sale or use on pollution controlled vehicles. Check the laws that apply in your locality to determine if using a MegaSquirt® or MicroSquirt® controller is legal for your application.
©2004, 2011 Bruce Bowling and Al Grippo. All rights reserved. MegaSquirt® and MicroSquirt® are registered trademarks. This document is solely for the support of MegaSquirt® boards from Bowling and Grippo.