Megasquirt2 Setting Up-3.4
Megasquirt2 Setting Up-3.4
Megasquirt2 Setting Up-3.4
Dated: 2018-08-19
This version of the documentation applies to the Megasquirt-2 range of products which includes:
• MS2 on V3.0 or V3.57 mainboard;
• MicroSquirt;
• Products derived from the MicroSquirt Module (e.g., DIYPNP and MSPNP2).
and running firmware MS2/Extra 3.4.x. (See section 2.10.3 for more detail on version numbers.)
Not covered:
• Megasquirt-2 products running "Bowling and Grippo" firmware.
• Megasquirt-2 products on a V2.2 mainboard.
• MegaSquirt-1;
• EMS-Pro
• MegaSquirt-3;
• MS3-Pro or products using MS3-Pro module
• MS3-Gold
All parts are sold for OFF ROAD RACE-ONLY ground-vehicle use only - see section 1.1 for more details.
0: Contents
Table of Chapters
0: QuickStart Guide - in brief.................................................................................................2
0: Contents............................................................................................................................3
1: Introduction.......................................................................................................................9
2: QuickStart Guide - expanded..........................................................................................13
3: Tuning the engine............................................................................................................45
4: Advanced topics..............................................................................................................64
5: Troubleshooting...............................................................................................................85
6: Appendix A: Firmware upgrade notes.............................................................................96
7: Appendix B: Fuel calculations.......................................................................................103
8: Appendix C: Megasquirt Glossary of Terms..................................................................105
9: Appendix D: Text-based firmware loader......................................................................112
10: Revision history...........................................................................................................117
Contents
0: QuickStart Guide - in brief.................................................................................................2
0: Contents............................................................................................................................3
1: Introduction.......................................................................................................................9
1.1 Emissions and disclaimer...........................................................................................9
1.2 Required tools.............................................................................................................9
1.3 How to use the manuals.............................................................................................9
1.4 Products Covered.....................................................................................................10
1.4.1 MS2 on V2.2 mainboard....................................................................................10
1.4.2 MS2 on a V3.0 mainboard.................................................................................10
1.4.3 MS2 on a V3.57 mainboard...............................................................................11
1.4.4 Microsquirt.........................................................................................................11
1.4.5 Microsquirt-module............................................................................................12
1.5 Copyrights.................................................................................................................12
2: QuickStart Guide - expanded..........................................................................................13
2.1 Buy or build your Megasquirt!...................................................................................13
2.2 Select and assemble your fuel and ignition systems...............................................13
2.3 Setup your vehicle wiring harness (loom) ensuring it is fused.................................13
2.4 Connect MAP hose to full vacuum source................................................................13
2.5 Install TunerStudio and Megalogviewer....................................................................13
2.6 Power up your ECU..................................................................................................13
2.7 Get the serial comms set up.....................................................................................13
2.8 Turn off "Hide extensions for known files types" (Windows Only)............................16
2.9 Install the firmware if required..................................................................................17
2.10 Get your tuning computer to talk to the ECU..........................................................18
2.10.1 TunerStudio basics..........................................................................................23
2.10.2 Firmware, TunerStudio, tune files (MSQ) - what's all that?.............................24
2.10.3 Version numbers..............................................................................................24
2.10.3.1 Mainboard version.................................................................................................24
2.10.3.2 Firmware Version..................................................................................................24
2.10.3.3 TunerStudio Version..............................................................................................25
2.10.3.4 MegaLogViewer Version.......................................................................................25
2.10.3.5 Operating system version......................................................................................25
2.11 Setup sensor calibrations to match hardware........................................................25
2.11.1 Calibrate TPS...................................................................................................25
2.11.2 Calibrate MAP/Baro.........................................................................................26
2.11.3 Unlock calibrations...........................................................................................27
2.11.4 Calibrate CLT and MAT sensor........................................................................27
2.11.5 Calibrate AFR table (O2 sensor).....................................................................28
2.11.6 Lock calibrations..............................................................................................29
2.12 Check all sensor inputs are reading sensibly in TunerStudio.................................29
2.12.1 MAP sensor check...........................................................................................29
2.12.2 TPS check.......................................................................................................29
1: Introduction
This manual covers general setup and configuration information that applies to the whole Megasquirt-2
product range, it should be used in conjunction with the TunerStudio Reference Guide and the Hardware
Manual for your product.
Megasquirt-2 Setting Up
Microsquirt MS2/V3.0 MS2/V3.57 Microsquirt-Module Other ECU variants
Hardware Hardware Hardware Developers Hardware Manual from
Guide supplier
Megasquirt-2 TunerStudio Reference
MegaLogViewer Reference (Planned)
As an absolute minimum, ensure that you have followed all of the steps in the Quickstart Guide.
Customers new to EFI or less experienced with Megasquirt are strongly advised to read the manuals in
greater detail.
This guide includes a number of notes which are indicated as follows:
1.4.4 Microsquirt
The Microsquirt is a fully factory-assembled ECU and uses an automotive grade AMPSEAL connector. This
is aimed at the cost conscious customer that wants a Megasquirt-2 type product in a professional case.
There is no provision for internal modification and low impedance injectors are not directly supported.
External MAP sensor required for most installs.
Hardware and wiring are covered in the Microsquirt Hardware Manual.
1.4.5 Microsquirt-module
The Microsquirt-module is a component circuit board that allows manufacturers to create their own custom
ECUs such as DIYautotune's MSPNP2 range.
1.5 Copyrights
This manual contains content copyright 2014 James Murray, Bruce Bowling, Al Grippo, Ken Culver, Jerry
Hoffmann, Matt Cramer and Jean Belanger. You may share this file in its unaltered form or print out copies
for your own personal use.
Any unused sensor inputs (MAP, CLT, MAT, TPS, O2) should be connected to sensor ground to prevent the
signal 'floating'.
(Windows only) Having found your true serial port or plugged in your USB-serial adapter, it is desirable to
opening up Device Manager and identify the COM port number. The method to open Device Manager
changes with each Windows version, so will not be documented here.
The above is a screenshot from Windows XP, showing the Device Manager and the sub-panes showing that
this USB-serial adapter has been assigned COM1 - remember that number!
If you DO NOT see "Ports" listed in the devices then you do not have any ports setup. This would usually
indicate either you forgot to plug in your USB-serial cable or there is a driver problem. Usually the best
solution to the driver problem is to unplug the cable, uninstall the driver and then re-install the driver.
Take a note of the COM port number listed above. In this case it was COM1.
Should you encounter problems getting your serial connection working, refer to the fault finding section.
2.8 Turn off "Hide extensions for known files types" (Windows Only)
Windows has a feature to hide part of the filename. It is strongly advised that this is disabled to prevent
confusion.
Go to Folder Options (Use Search to find it if required.)
Ensure that "Hide extensions for known files types" is not ticked.
Open up this zip file to see the contents, it includes the firmware files and default tune files (i.e. the 'base
map' that you get when you reload the firmware.)
The ms2extra directory contains the sourcecode, this is only needed for advanced customers that want to
modify the operation of the ECU way beyond normal tuning. Most customers can safely ignore this.
In the Project Name box you can give the project a meaningful name if wish.
Double check that your Megasquirt is powered up and connected to your computer by serial.
iii. Click on Detect
When you click the “Detect” button a “Detect Device” screen will appear and TunerStudio will attempt to find
your Megasquirt and its firmware version. If successful it will list your Megasquirt, firmware version and baud
rate. Check to see that these appear to match your Megasquirt and then click “Accept” to continue. If the
“Detect Device” screen reports “No controller found” check the connection between your computer and your
Megasquirt and ensure that your Megasquirt has power and try again. If this still does not resolve the
problem move on to the “Other / Browse” method described below to set the firmware up manually.
Note that TunerStudio may find a connection as both a D2XX device and an RS232 device; the D2XX
connection is simply a newer driver version for USB adapters and is the preferred method if connecting over
USB.
If your Megasquirt is identified correctly, click “Accept”. Click Next on the 'Create New Project' screen and
you can now move on to step v.
If your Megasquirt is identified correctly but clicking “Accept” displays a message that reports “TunerStudio
does not have a configuration to support the found hardware” then you will need to use the “Other / Browse”
method described below to set up communications with your firmware manually.
On a first time install, you may get the following message that your ECU has no firmware loaded:
That's ok, but you will need to load firmware that you downloaded in section 2.9. Click Accept.
Click Yes.
See section 6.2 in the TunerStudio reference guide that covers the firmware loading process. When asked
for a firmware file, you should point at the ms2extra-release-3.4.2.zip (or later) file that you downloaded
earlier. Then return to section 2.10 when completed and re-start creating a project.
For information: the old text-based firmware loader is covered in section 9.
iv. Other / Browse
This method is recommended only if TunerStudio is not able to detect your Megasquirt, or if you are using a
beta version of the firmware.
The firmware on your Megasquirt may have been provided on a disk or downloaded as a .zip file from the
www.msextra.com website. If you have downloaded your firmware and haven't done so already extract the
contents of the .zip file to a directory of your choice.
Clicking in the box next to “Other / Browse” opens a screen which lets you browse to your firmware folder.
From here you should be able to select the .ini file that you want to use. It is essential that you use the .ini file
that is appropriate to your Megasquirt. There are four .ini files to choose from:
The settings available on this list may vary based on your firmware. Verify that what they are configured to
match your set up. If you are unsure, the default values are likely to work well. These settings can be
changed after your project has been created.
vi. Comms parameters
Click Finish.
The standard dash should display.
On most settings screens, you will also find a Help menu - click on this will open up the TunerStudio
Reference Guide at the appropriate page so you can read about all of the settings on this particular screen.
(You may need to be connected to the internet the first time you use this feature, so the PDF can be
downloaded.)
The title-bar in TunerStudio shows both the TunerStudio version and the firmware version.
The Common MAP Sensors gives a list of the commonly used MAP Sensors. If you are using one of these
sensors select it from the drop down list, otherwise select “Custom” and enter the required numbers.
Megasquirt kits are usually supplied with a MPX4250AP sensor.
Repeat for the Baro sensor settings.
Ensure that the calibrations are re-locked once you have made your calibrations.
Sensor Table
Select whether you are using a “Coolant Temperature Sensor” or an “Air Temperature Sensor”.
Table Input Solution
This value will normally be set to “3 Point Therm Generator”.
Common Sensor Values
From this option you can select your sensor type. You can select from a predefined list of common sensors
from the drop down list, or leave this option unselected if you are using custom settings specific to an
unlisted sensor.
Bias Resistor Value (Ohms)
This is 2490 ohms unless you or your vendor have changed the resistors inside the Megasquirt.
Temperature Settings (°C or °F)
Again, if you have selected one of the common sensors these values should be set for you. If you are using
a custom sensor enter the three measured temperature and resistance value pairs.
Write to Controller
Once you have completed the settings in this screen click the “Write to controller” button to burn these
settings to your Megasquirt.
From this screen you can set the AFR (air fuel ratio) calibration if needed. The options for these settings are
described below:
EGO Sensor
This option allows you to select an exhaust gas oxygen sensor. You can either select from the predefined
list, select “Custom Linear WB” (wideband) or select “Custom Inc File”.
Volts / AFR Values
If you have selected an EGO sensor from the predefined list these values will be set for you. If you have
selected “Custom Linear WB” then you will need to enter the voltage/AFR pairs from your sensor or
controller manual.
Write to Controller
Once you have completed the settings in this screen click the “Write to controller” button to burn these
settings to your MS2.
This means that you have no tune loaded. This is OK if you are just having a look, but do not try to start a
tune like this. TunerStudio will default to a table full of zeroed out values - or in some cases, the numbers will
be set to their lowest possible value. It’s not worth chasing down all the nonsense values to turn this “blank
file” into a real tune. Start with either the tune in the ECU or one of the sample tunes provided in the software
package.
We recommend that you do not have the ignition coils hooked up while doing a basic setup on the
Megasquirt. During the setup stage, you will define what type of ignition hardware that you are using, but if
the ignition you have doesn’t work with the default settings, you may overheat your ignition module and
damage it before you are done with your setup.
The following sections skim through some of the required setting screens - be sure to refer to the
TunerStudio Reference Manual which gives an expanded view of each and every setting.
The most critical settings are on the left. Complete the Control Algorithm through to Injector size settings. If
unsure, leave alone!
Then click on the "Required Fuel" button to calculate the "ReqFuel" number.
It is important to select the correct dead-time setting for your injectors and hardware.
Typical dead-times at 13.2 volts:
• High impedance injectors - dead-time = 0.8-1.0 ms
• Low impedance injectors with resistors - dead-time = 0.8-0.9 ms
• Low impedance injectors with PWM (MS2 only) - dead-time = 0.6-0.8 ms
• Low impedance injectors with external peak/hold - dead-time = 0.6-0.8 ms
Each setting needs to be reviewed and set appropriately, however, if unsure, leave alone!
Bypass-idle valves are unlikely to work well with Alpha-N because the airflow changes without the
TPS moving. Use a kicker-type valve or use a different fuel algorithm.
During initial startup it is strongly advised that the open-loop (warmup) algorithm is selected. Do not try to
use closed-loop until the engine can maintain a steady idle speed on its own.
Stepper idle users need to configure the number of homing steps - this is covered in the section on idle valve
testing - 2.14.4.1. For now, set the homing steps to 250 and ensure that all values in the warmup curve are
less than 180.
For both PWM idle and stepper idle, a larger duty or steps number means more air i.e. higher idle. The
warmup curve will start at larger numbers on a cold engine and smaller numbers on a hot engine.
Bosch rotary idle valves (two wire and three wire) often have a failsafe position (0% duty) that allows a high
idle. For these valves, the "off" or minimum duty % is 20-30%. Use the idle valve test mode to confirm this.
For predictable operation you must use the valve in the "more duty = more RPM" zone.
Changing these settings does not alter the behavior of your engine in any way, they ONLY change the limits
which can be displayed on the screen and set the threshold limits for your tune.
Once these settings have been changed it is necessary to close and restart TunerStudio for the
changes to be reflected in the gauge cluster.
Typically, you should complete the settings changes on that page and Burn. Then turn the power off (key off),
2.14 Use the test mode to confirm injectors and coil(s) are functioning
Output Test Mode (select it under the CAN bus / Test Modes menu) is used to check the outputs. The test
mode allows direct control of the coils and injectors. Used by accident, the test mode could cause flooding of
the engine and potential damage. Test mode should NOT be used on a running engine.
Full details are available in the TunerStudio Reference Guide.
The Enable Test Mode button is locked out unless the RPM reading is zero. Click this button to enter test
mode, and when you are done, click the Disable Test Mode to go back to normal operation.
• Click Start
With wasted spark or coil-on-plug installs, make sure that "Spark A" operates the spark plug for cyl#1.
Note that coil testing will not work with EDIS, TFI, HEI7/8 or GMDIS as the external module controls the coils
internally.
Idle Valve Homing Steps - This only applies to stepper idle valves. This setting determines how many steps
the motor should move during homing to ensure it has reached the home position. The number needs to be
large enough to close the valve from any unknown starting position. (This is because there is no position
feedback - in non-automotive control applications there is often a feedback encoder.)
• Idle Valve Step - the desired valve position - larger numbers should give a more open valve and
higher RPM. (For stepper motors)
• PWM idle duty% - the desired valve position - larger numbers should give a more open valve and
Here is an example of a fixture used to measure stepper operation on the bench, although very few users will
need one of these.
The steps number you have found is the number of steps from fully closed to fully open. Say it was 185. The
"homing steps" setting on the idle control page should be set around 10 steps higher than this - to ensure
that the idle valve always reaches the closed stop fully at key-on. Ensure that your warmup curve or closed-
loop idle settings are a maximum of around 10 steps less than this number.
If you mistakenly try to open the valve more steps than full open, the overrun clutch in the stepper idle valve
will prevent damage as the pintle hits the full open stop, but the ECU will lose track of where the valve is.
This would most likely result in random idle speeds depending on what temperature you first started the
engine.
This example includes a cam signal. If your install only uses a crank signal then the green trace will correctly
be missing.
If the turquoise "crank" signal is missing, you have a problem and need to fix it.
Next, repeat the process using the "Tooth Logger"
The screenshot here shows a real 60-2 crank pattern at cranking speed, the "missing tooth" is the single long
bar in the middle. The cyclic pattern is due to the compression effect as the spark plugs were in.
Here is an example of an incorrect pattern - the missing tooth shows as two long bars instead of one. This
won't work. Swap the +/- on the sensor or change the "Ignition Input Capture" from Rising to Falling or vice-
versa.
These are just a few examples or the patterns you might see. The Megasquirt product range supports a large
number of different trigger input patterns which all look different. Count the number of bars (including the long
one) in the repeating pattern on the tooth logger and see if it looks reasonable. 36-1 wheels will have 35
bars total, 60-2 will have 58 total.
type, make, model, ignition setup. The forum is global and we might not be familiar with your engine, so just
quoting an engine code is not sufficient. Don’t use the forum to vent your frustration, keep it calm...
If your engine does not start in spite of having a functioning fuel and ignition system and timing that appears
to be correct, here are several things we recommend checking that commonly will cause a no start condition.
• If you are running full sequential fuel and / or coil on plug ignition, try changing these settings to
semi-sequential fuel and wasted-COP ignition. This will rule out the possibility that the cam sensor
hasn’t been set up correctly, and you’re firing on the exhaust stroke instead of the intake stroke.
These changes will make it fire on both, which can be very useful for debugging startup problems.
• It may be refusing to start because the fuel isn’t quite right. If the engine does not go above start-up
cranking RPM, try adjusting the cranking pulse width (the Cranking Pulse menu under Startup /
Idle). If the engine catches but dies immediately, try adjusting the afterstart enrichment (ASE
Percentage under Startup / Idle). Both of these are temperature dependent, so be sure you’re
adjusting them at your actual coolant temperature. There’s a couple rules of thumb you can use
here:
• Start at what you think may be a lean value, then work your way up in small increments.
• Pull a spark plug after a failed start and check the electrode. If it’s wet with fuel, decrease the
amount of fueling. If it’s dry, increase it. And if the electrode is covered with crud, your
problem may just be that you need new spark plugs.
• If the engine responds better if you give it a bit of throttle, you probably have too much fuel (because
the extra air helps get your air/fuel ratio closer to what it should be). So you need less fueling.
Conversely, if giving it the throttle makes things worse, you probably need more fuel.
• Check for various physical problems. Some examples I’ve seen include coil packs or distributors
with one or two spark plug wires run to the wrong cylinders, a broken keyway on the crankshaft
pulley causing the timing marks to be 60 degrees off, and even a zip tie that got pinched in the
intake manifold gasket next to a coolant passage, which nearly hydrolocked the motor.
This locks the timing to the advance you specify in the "Timing for Fixed Advance" box. You do not need to
alter your spark table.
• Enter say 15 degrees (or another angle that your engine will idle easily at.)
• Using your timing light, confirm that the timing on the crank matches the fixed advance at low RPMs
• If it does not, then adjust your tooth#1 angle (trigger wheel) or trigger angle/offset (other spark
modes.)
• If the actual timing is more advanced than Megasquirt thinks, then increase the trigger angle/offset. If
adjustments of more than 10 degrees are required, make the change, click Burn, turn the key off,
and restart the engine.
• Once your idle timing is matching up with your fixed angle, increase the engine revs and confirm that
the timing does not drift.
If you get a large timing advance with increased rpms on a VR sensor distributor then it is likely that your
ignition input capture is backwards.
For a few ignition configurations, it is also possible that your spark output setting is wrong - however,
exercise caution in changing this, as the wrong setting can damage your coils or ignition module. Most
configurations should use "Going High" but this does depend on the product and coils.
If the timing retards a little as rpms increase you can make a correction by adjusting the Spark Hardware
Latency setting. The larger the number, the more compensation it will apply.
Do not proceed any further with your install if you cannot get stable timing. Note that “stable timing” is
a matter of degree - a small block Chevy with an HEI distributor and a worn timing chain, for example, may
have 2 or more degrees of timing jitter in normal operation. And many dial-back timing lights will have
problems keeping up with rapid changes in RPM. But if you are seeing the timing bouncing around by 10
degrees or more, stop and investigage what’s wrong.
When finished, be sure to turn off the Fixed Timing and return to Use Table and click Burn.
Sensor inputs:
• RPM input
• MAP sensor
• MAF sensor
• Throttle Position
• Air Temperature
• Coolant Temperature
• Flex fuel sensor
The exact tables and sensor inputs used varies depending on the selected fuel Algorithm and are covered in
the appropriate tuning section.
Of particular note is the AFR table. When 'incorporate AFR' is off, the AFR table is a reference table only and
is not used for fuel calculations. When 'incorporate AFR' is on, this table is included in the fuel calculation.
The Fuel Calculations Summary screen shows many of the factors that are used to arrive at the final
pulsewidth.
More detail on the way the fuel calculations work internally may be found in Appendix B.
The Spark Calculations Summary screen shows many of the factors that are used to arrive at the ignition
(spark) advance.
You’ll enter the AFR you want at each RPM and load point. Most sequential fire engines will run best at
14.7:1 at idle. Batch-fire engines will likely need to run richer. At cruising RPM and low load, you can run
14.7:1 or sometimes leaner depending on the engine. Most naturally aspirated engines tend to run best at
13.2 to 13.5 at full throttle, while engines running forced induction may need to run as rich as the mid 11’s
under boost.
If you set “Incorporate AFR Target” under the General Settings menu to “include AFRtarget,” this table is
used to scale the fueling. A table entry of 14.7:1 will mean no fuel scaling. Numbers less than that will
increase the fuel, and numbers higher will decrease the fuel. When using this mode, you’ll tune your VE table
to hit your AFR targets, then adjusting the AFR target table will directly adjust the fuel to the desired AFR
number.
Before having your engine dyno tuned - make sure the dyno operator is clear about your selection for
"Incorporate AFR Target" and whether the AFR table is being used. Otherwise the operator may aim for his
own AFR target and ignore the table causing later confusion.
In any mode that uses this table, the numbers in the VE table are a percentage. The fueling equation takes
the base pulse width from Required Fuel, scales it by the percentage in the VE table, and then applies any
other corrections, enrichments, and the like, such as air density correction and warmup enrichment. If you
have the tuning set to incorporate the AFR target, theoretically, the VE table will match the engine’s actual
volumetric efficiency. Don’t be alarmed if you need to enter numbers above 100, particularly in boost. The
maximum number is 255.
We recommend first setting up an appropriate AFR table, then adjust the numbers in the VE table (upwards
to add fuel, downwards to take it away) until your actual air/fuel ratio hits the target 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. See the next section on how to switch this off. 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. You’ll find this by going to the Fuel Settings menu -> Overrun fuel cut. The default tune has this turned
off.
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, VE
Analyze Live in TunerStudio, 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.
It is a good idea to set either a row of kPa bins in the VE Table to the idle MAP value. The engine may not
always idle at the same MAP value when under load, but it’s worth trying to set this up for unloaded idle.
Most of the time, an engine will idle best if you flatten out the cells above and below where it idles; it’s rare
for an engine to need large changes in VE at idle.
This curve is found on the Basic/Load Settings menu, once you have wired up and configured your MAF
sensor. See the TunerStudio Reference Guide.
You’ll enter the AFR you want at each RPM and load point. Most sequential fire engines will run best at
14.7:1 at idle. Batch-fire engines will likely need to run richer. At cruising RPM and low load, you can run
14.7:1 or sometimes leaner depending on the engine. Most naturally aspirated engines tend to run best at
13.2 to 13.5 at full throttle, while engines running forced induction may need to run as rich as the mid 11’s
under boost.
The table will apply a percent trim to the fueling calculated from the MAF sensor curve and AFR table.
Before enabling this table, make your best effort to dial-in the fuel with the MAF transfer curve.
3.4.4.4 MAFload
In MAF mode, the primary fuel load is set to "MAF" because fuel required is directly related to mass air flow.
However, ignition and other load based tables are not directly related in the same way. While it would be
possible to use MAF volts as the Y-axis on other tables, it would mean that only a very narrow band of the
table was used and tuning would suffer. So instead of that, the code calculates a synthesised load value
called MAFload. This behaves similarly to MAP in a speed density system and should give a repeatable load
value and allow tuning of those tables in the conventional manner. Do not be too concerned about the exact
values of MAFload, but do make sure the axes on the table are set to cover all MAFload values and RPMs.
When live tuning, the active cell will be highlighted.
A MAF only install will need to use "MAFload" for spark and AFR table lookups. But, if you have a MAP
sensor installed you could optionally choose to set "Speed Density" for spark and/or AFR which will then use
MAP as the Y-axis in the table.
On the left is the ITB Load TPS Switchpoint curve, on the right is the ITB load at TPS Switchpoint
When the throttle position is less than the value defined in the ITB load TPS switchpoint curve or the MAP
value is less than the %Baro switchpoint, the tuning algorithm will take the array of cells from the VE table
below the ITB load at TPS switchpoint curve and interpret this array within the context of 0% to %Baro
switchpoint load.
In all cases we take %Baro switchpoint = 90
If you have allocated the region between 0% ITB Load and 60% ITB Load on your VE table for use in Speed-
Density tuning and your %baro is 50% then the VE value for 30% ITB load will be used. In this same
example, a MAP value of 0kpa would use the 0% ITB load bin and a MAP value of just less than %Baro
switchpoint would use the VE value just below the 60% ITB Load value on the VE table.
For example, if you have allocated the region between 60% ITB Load and 100% ITB Load on your VE table
for use in Alpha-N tuning and also assigned a value of 10% TPS on your ITB load TPS switchpoint curve
then a TPS value of 55% would yield an ITB Load value of 80% and the VE bin for 80% ITB Load would be
used. In this same example, a TPS value of 10% would use the 60% ITB Load bin on the VE table and 100%
TPS would use the 100% ITB Load bin.
This menu allows wall-wetting accel enrichment to be optionally enabled and determines whether the %WOT
table is used with TPSdot.
The two curves are the primary tuning tools. They set the pulse width to add as a function of the rate of
change of MAP and TPS readings. The adder is the raw milliseconds pulsewidth adder. Under these charts,
you can set a percentaget to blend MAP and TPS driven acceleration enrichment. 100% is entirely TPS
driven, and 0% is entirely MAP driven. In between, the percentage will scale the MAP driven pulse width
adder down and the TPS driven pulse width adder up. Changing injector size will require the AE number to
be changed.
Once triggered, the acceleration enrichment will be active for a defined time period.
be the same. Before you start tuning the acceleration enrichment, make sure your VE tables are dialed in.
Adding a correctly tuned amount of acceleration enrichment to an incorrectly tuned fuel table is still going to
result in an incorrect amount of fuel. Since the acceleration enrichment is stacked on top of the fuel the ECU
is commanding based on the VE table, you’ll want to tune AE last, after you’ve got the solid foundation of a
well tuned VE table under you.
The standard AE can be thought of like the accelerator pump on a carb, which shoots in some extra fuel
when you suddenly hit the throttle to compensate for the massive influx of air when you open the throttle
blades. The goal is to compensate for this influx of air for an instant during that transient until the the
transient is over and the VE tables are again providing the proper amount of fueling. If your background is
tuning carburetors, you can think of this as a very powerful fully adjustable/tunable accelerator pump that lets
you compensate for more than one rate of throttle position change. Slow ’tip-in’ can be adjusted with a
certain PW adder, medium with another larger PW shot, mid-fast with another size PW squirt, and very fast
throttle movements with another.
MAP based or TPS based AE? If you have a variable Throttle Position Sensor, we’d recommend 100% TPS
based AE as a starting point. MAP based AE does the trick if you’re running an engine without a usable TPS,
but TPS based AE is generally easy to tune to the proper sensitivity level such that it activates when you
want it to, and not when you don’t.
Setting the TPSdot/MAPdot Threshold Levels First up, you need to determine what your TPSdot or
MAPdot threshold will need to be. Below the line graph charts, you’ll see a TPSdot threshold and a MAPdot
threshold. These are the minimum amount of change of TPS position or MAP pressure reading, respectively,
that are needed to trigger acceleration enrichment. Your goal is to set these high enough that the
acceleration enrichment won’t accidentally trigger at steady throttle, but low enough that it’s sensitive enough
to catch small or slow throttle movements as well. Setting it too high can mean the AE won’t kick in when you
need it.You want it as low as you can get it without it causing AE to trigger when it’s not supposed to, such as
during steady throttle.
Getting this dialed in can be done methodically, or by trial and error. Here’s the methodical method.
You’ll need to have a safe way to accelerate from the bottom to the top of a gear, preferably your 1:1 ratio
gear, and you’ll want to datalog your engine idling, as well as these WOT pulls with your Megasquirt-2 and
TunerStudio. Ideally this is done on a dyno. Two to three pulls is better than one, but there’s no need to get
carried away. Then you can stop the datalogging and load this log up into MegaLogViewer.
In MegaLogViewer, on the left using the drop-down boxes that let you select what data you are viewing in
your logs, set one of these to TPSdot, and/or MAPdot. You can set another to TPS to show you what throttle
position you were at as well. Additionally, monitoring injector pulsewidth (select PW in the log to view that
data) is helpful too, as you’ll be able to see the commanded injector pulsewidth including the extra fuel added
duing an AE event. Lastly, near the bottom right corner of MegaLogViewer you’ll see four indicators. TP AE,
TP DE, MAP AE and MAP DE. If either AE is active, that’s a Accel event and AE is adding fuel. If either DE is
active, that’s a Decel event and AE is pulling fuel if configured to do so.
Next, look at the datalog section of the car idling. The TPS signal should be rock solid, no movement. If it’s
jumping around, you have a noise issues on your TPS signal. This can be caused by ECU sensor signal
wiring that’s been routed too close to high voltage sources such as ignition coils, plug wires, the distributor,
etc. Re-routing those wires away from those high-voltage sources is always a good idea. Additional
possiblities for noise to get in the TPS signal could be a bad sensor ground (be sure you’ve grounded it the
Megasquirt-2 sensor return wire ONLY), or a faulty throttle position sensor. Similarly noise on the MAP signal
could be electrical, but is more likely to actually be real movement in the manifold pressure, at least at the
source you’re grabbing the vacuum signal from, meaning the port on your intake manifold that’s connected to
the MAP sensor.
If you’re seeing AE events at idle, your TPSdot or MAPdot threshold is set too sensitive (too low of a
number). You’ll see the pulse width bounce around when this happens as well; AE is just doing what you told
it to do.
Now look at the datalog sections for the WOT pulls, step through these in the logs and look for any time AE
activated (Accel or Decel). It shouldn’t be active at all on WOT pulls, because you’re at Wide Open Throttle,
you’re not moving the throttle around, so AE is not needed. Again, if you are seeing AE activate during WOT
pulls, your threshold is too sensitve.
In either case if you’re triggering AE when you shouldn’t be, you’ll want to increase the threshold value a bit
above the highest TPSdot (or MAPdot) value you see it reach in the logs. This is the lowest you can set your
threshold in order to be a sensitive as possible while not triggering at steady state throttle (or idle, which is
also steady state throttle, it’s the steady state of NO throttle).
Note this setting is also the same setting you should use for your lowest (slowest rate of change) TPSdot or
MAPdot field in the next section.
Tuning the tables Now that you have these, it’s time to tune the PW adder line graphs. To tune these, start
with the lowest speed throttle change position, and practice ’tipping in’ at that rate of speed. Use the real-time
line graph at the bottom of the page to see how fast you’re tipping in.
When you’ve become used to applying the throttle at the right rate of speed to be close to the TPSdot
number you’re using in the ’slow’ setting, watch your wideband O2 sensor readout. You want to be able to
determine what’s happening when you stab the throttle at that rate of speed. Is it going lean or rich? Note
that it’s hard to see this on a gauge, as often it will go one then the other really fast. You want the first
response; if it goes lean then rich you’ll usually see it hit 20:1 or maybe 22:1 for just an instant, and then as it
goes back to running purely the table it may go to 13:1 or whatever... you want to watch that initial response,
and if the first response is to go lean, then you want to add fuel; if the first response is to go rich, you want to
reduce fuel (pw).
A wideband O2 sensor is immensely helpful here, but don’t get too caught up in seeing perfect AFR numbers
through the whole transient event. Adjust it until it feels right, snappy and responsive with no hesitation. The
feel is more important than looking for perfect numbers. If you want perfect numbers, you may want to try the
model based acceleration enrichment. Setup basic AE first as described here. Next you’ll adjust the other set
points you’ve setup for faster throttle rate changes.
Repeat the process for the medium speed tip in, then the mid-fast, then the fast.
This table specifies the spark advance in absolute numbers in degrees BTDC (before top dead center) as a
function of RPM and load. The timing you see with a timing light should match the timing table, unless there
are spark trim tables in effect that make changes to it. We ordinarily recommend tuning the spark map on a
dyno, but here are a few general pointers for an initial setup.
The idea is that the idle and low speed areas are set to around 8-20deg. Usually idle will be around 8-15°,
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 this can help stabilize the
idle, 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, although many engines will benefit from even more
advance after the torque starts decreasing, something you can’t do with a mechanical advance.
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 on a large V8, 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°. This number won’t be 32 degrees for all engines; for
example, we’ve found that the new Chrysler Hemi can have problems at more than 22 degrees of timing at
full throttle, and many small bore engines with pent-roof combustion chambers run numbers in the mid 20
degree range.
When going into boost (above 100kPa), values will need to be lower than when out of boost. A common rule
of thumb is that 1 degree of advance should be removed for every 2 psi (13kPa) of boost; this is simply a
rough guide, and lots of things can depend on how much to remove. Advance below 100% load is often
simply the flip side of retarding the timing under boost; as cylinder filling decreases, you will need more
timing.
Tuning timing under boost is safest on the dyno where the operator can listen out for knock and dial in the
advance for best safe power.
3.7 Datalogging
Recording datalogs and reviewing them is a key part of ongoing tuning for most vehicles.
See section 4 in the TunerStudio Reference Guide and the (planned) MegaLogViewer Reference Guide.
This will prompt you to save a TunerStudio (.msl) file which will contain the data that is logged from your
Megasquirt. By default the file will be saved in the DataLogs directory within the current project directory,
although you can choose to browse and save it elsewhere if you prefer. As soon as you save the file the
software will start to log data from your Megasquirt into that file.
When data logging is running the “Data Logging” indicator label at the bottom of the Gauge Cluster will
turn green.
At this stage the “Data Logging” indicator label at the bottom of the Gauge Cluster will return to its usual
color.
4: Advanced topics
The settings for all topics here are covered in the TunerStudio Reference Guide, the aim here is to add some
background and tuning information beyond the basic settings description.
1 1 2 2 2
1 * 1 1 2 1
2 1 2 2 2
2 * 2 1 4 1
3 * 1 3 2 3
3 * 3 1 - -
4 - - 2 4
4 2 2 4 2
4 * 4 1 - -
5 * 1 5 2 5
6 1 6 2 6
6 * 2 3 4 3
6 3 2 - -
6 * 3 2 - -
8 - - 2 8
8 2 4 4 4
8 4 2 - -
10 1 10 2 10
12 2 6 4 6
12 3 4 - -
There are two injection modes specifically designed for siamese-port engines such as the A-series engine of
the classic Mini and the B-series engine of the MGB. Since these engines have 2 intake ports for a 4-cylinder
engine with the cylinders paired having 180 and 540 crankshaft degrees between the firing events, there is a
need to have injection timed in a very specific manner and two modes are provided to do semi-sequential
injection which does not require a cam sensor and full sequential injection which requires a cam sensor.
More information on the peculiarities of port injecting a siamese-port engine can be found via web searches.
4.1.1 Configuration
The menu items to configure the sequential injection are located on Basic/Load Settings -> Engine and
Sequential Settings. The settings on the right are used to configure all the general aspects of sequential
injection. The VE, trim and injection timing tables are available on the Fuel menu.
Negative values are for timing retarded from the 0 degree point with -360 degrees being TDC between the
exhaust and intake strokes and -180 degrees being BDC between the power and exhaust strokes.
Siamese-port Timing
The siamese-port modes use a different reference point in the cycle due to the position of the injection
window. The image on the right shows how the timing values relate to the engine cycle. The timing value of 0
degrees corresponds to TDC between the exhaust and intake strokes.
Positive values are for timing in advance of this point up to 360 degrees which corresponds to TDC between
the compression and power stokes with 180 degrees being BDC between the power and exhaust strokes.
Negatives values are for timing retarded from the 0 degree point with -360 degrees being TDC between the
compression and power strokes and -180 degrees being BDC between the intake and compression strokes.
The tach input and spark output will need configuring also, see the Hardware Manual for your product for
Rotary specific details.
The oil metering pump is not presently supported, use pre-mix.
• RPMdot threshold - Use this setting so that the code can tell the difference between decelerating
with closed throttle (engine braking) and sitting at one RPM. Set this as low as possible without
being below what is normal RPMdot jitter with the engine RPM not changing. Typical values will be
between 50 and 75 RPM/sec.
• Max decel load - The code assumes that if MAP is lower than this setting, the driver must be
decelerating, and not "locked out" of the PID loop. Set this to a value just under the load seen with
an idle slightly higher than the current target RPM + the Idle Activation RPM Adder. This can be done
with the idle test mode, and setting the valve position manually.
• PID delay - This should be set so that the RPM dropping on throttle lift can come to a rest slightly
higher than the target RPM, and become stable there. Between three and five seconds normally
works the best.
• Crank to Run Taper - This setting controls how long after starting the code will delay before entering
PID. Between three and five seconds works well for this setting.
• PID disable RPMdot - A good value for this setting will typically be in the 200-400 RPM/sec range. If
the engine speed suddenly accelerates with no throttle input (like if the clutch is engaged while the
car is rolling and in gear), it must accelerate at a rate greater than this setting before the PID code
will be disengaged. Setting this value too high can lead to stalls after engaging the clutch in this
manner.
To tell whether the code is entering PID idle control, the "CL Idle" indicator in TunerStudio must be used. If
the current gauge cluster in TunerStudio does not include this indicator, temporarily switch to a cluster that
does.
The idle speed control algorithm was designed to emulate OEM car idle speed regulation. The sequence of
events that the code was designed to follow are listed below:
1. Throttle Lift - On throttle lift, the code opens the valve to the value learned in the last iteration of the
PID loop + the dashpot adder. The logic here is that the last learned value should result in an RPM
close to the target RPM. The dashpot adder is added so that when RPM settles, it settles to an RPM
slightly higher than the target. This is in case the air conditioning was turned on or IAT increased or
anything else that might make RPM lower than the last time the PID code ran.
2. RPM settles - After throttle lift, eventually the clutch is pushed in and RPM drops to wherever it will
settle given the learned value + the dashpot adder. Hopefully the idle has settled to an RPM that is
less than the commanded target + the Idle Activation RPM adder. If so, then the code will wait for the
amount of time specified by the PID delay, and then enter PID control. If RPM settles above the
commanded target + Idle Activation RPM adder, the code then starts checking the PID lockout
detection conditions. Assuming those condtions are met, the code will still enter the PID loop after
the amount of time specified by the PID delay.
3. PID control activates, RPM starts dropping to target - After the PID delay expires, the PID code will
be activated. RPM will slowly drop to the target over the number of seconds specified by the PID
ramp to target time.
4. Normal idle speed reached - RPM reaches the commanded target. PID continues regulating RPM
until the throttle is pressed.
Once the code is reliably entering PID on every throttle lift, it is time to actually tune the PID code to reach
and hold the RPM target.
The settings that are associated with or affect the operation of the PID algorithm are listed below:
• Idle Open Duty/steps and Idle Valve closed duty/steps - These should be set to the minimum and
maximum values that should be used during PID loop and driving operation. In addition, having
these set further apart results in the PID loop being more sensitive (making changes to the output
given much smaller changes in input).
• Min duty/steps for PID - This is the lowest duty/number of steps that the PID loop is allowed to
command. Set this low enough to result in an RPM slightly lower than the lowest target RPM.
• RPM with valve open/closed - These should be set to the RPM with the valve closed and the RPM
with the valve opened respectively. If using these settings makes the code unresponsive to changes
in idle speed, the upper RPM value can be set lower.
• PID Control Interval - This controls how often the PID code runs. Setting this too high can result in
sluggish response to sudden changes in load, such as the Air Conditioning being turned on. Setting
it too low can result in the loop being overly sensitive to RPM changes. Typically 100ms works well.
• PID controller gains - These control the actual response of the code to changes in RPM, as well as
how well the code will reach the target. Tips for tuning these are listed below.
The following basic steps should be used for tuning the PID controller gains:
1. Zero all the gains - Set all the gains to 0%. This is so that the effects of tuning the I-term in the next
step are not confused with the effects of any other setting.
2. Tune the Integral (I) gain - The Integral gain is the only term that controls whether the code actually
reaches its target. Higher values for Integral gain will result in the code being able to get closer to the
commanded target; however, a value that is too high will result in oscillation. The easiest way to
determine a good value for the I term is to keep increasing it until oscillation occurs, then slightly
lower it. If this value is increased to 200% without reaching a point where oscillation occurs, then the
RPM with valve opened setting can be decreased as far as necessary, and the open duty/steps
setting and closed duty/steps setting can be made further apart to make the PID loop more sensitive.
3. Tune the Proportional (P) gain - After tuning the I gain so that the RPM reaches the commanded
target without oscillation, the P gain can be tuned. The best way to tune this is to set it as high as
possible without getting any oscillation. After setting this, try turning on the air conditioning or other
accessories that normally lower RPM or increase load. When these accessories are turned on, the
RPM should dip a bit then recover (the valve position should increase significantly). Using longer PID
ramp to target times can also make it so that when the PID algorithm engages, a higher P gain can
be set without causing oscillation.
4. Tune the Derivative (D) gain - For most users, use of the D gain should not be necessary. It
substantially dampens the response of the loop.
Some final tips:
• Idle Fuel Tuning - Before even attempting to tune Closed-loop Idle speed control, tune the area
around idle so that if RPM goes up or down or load goes up or down, the AFR stays close to the
same value. Changing AFR can affect idle speed, which can then cause the PID code to try to
correct, getting into an unrecoverable oscillation.
• Spark Advance - Ensure that the ignition timing around idle is fairly smooth. Large changes could
lead to oscillation.
normal fuel equations and VE table lookup) still enters the engine.
For reference, the accelerator-pump on a carburettor is a rudimentary method to cope with this same wall-
wetting issue.
The EAE algorithm tracks the various quantities and adjusts the amount of fuel injected accordingly, but does
so based on several adjustment curves and settings. These are detailed in the next section.
The EAE curves are described in the TunerStudio Reference Guide.
To tune the actual boost levels, just adjust the duty table so that boost reaches the desired level at each point
in the table.
• Open Duty - An open duty value of 100% is the default. This should be tuned to the value that fully
opens the wastegate, but typically 100% works well.
• Boost Control Lower Limit - Boost pressure must be within this many kPa of the target boost before
closed loop control will activate. Outside of this range the valve is held wide open (keeping the
wastegate shut) for fastest spooling.
NOTE: The output polarity setting only changes the actual duty on the output. Regardless of this setting, the
boost control algorithm is designed to operate on the assumption that more duty = more boost.
Tune the PID gains:
1. Set Integral and Differential Gains to 0% - To make tuning the Proportional gain easier, set the
Integral and Differential gains to 0%.
2. Set Proportional gain to 100% and slowly lower - While tuning Proportional gain, higher numbers
mean slower boost climb and lower final boost. For safety, start with a very high gain (100% should
be sufficient). Find the RPM that typically spools quickly, and fully and quickly depress the
accelerator. Note how much boost is reached. If boost overshoots the target dramatically, increase
the Proportional gain. Otherwise, reduce the Proportional gain and try again. Do this until boost
reaches the target with a small amount of overshoot.
3. Tune the Integral Gain - The next step after the target is reached consistently is to tune the Integral
gain. Starting from the RPM used to tune the P-gain, fully depress the accelerator and watch the
boost as the engine climbs through the RPM range. As the engine accelerates through the rev
range, the boost will probably creep away from the target. Keep increasing the I gain until the
controller adequately maintains the target with minimal oscillation. It may be necessary to increase
the P gain a bit after tuning the I gain since the two gains tend to counteract each other.
4. Tune the Derivative Gain - Increase the D gain until the overshoot is minimized. Care must be taken
when increasing the D gain as too much D gain can over-dampen the effects of the P and I gains.
With a dry system the additional fuel required for the nitrous is injected by increasing the pulsewidth on the
existing fuel injectors. In a port-injection system this minimises the fuel distribution problems. A dry system
can also have fewer system components as the pre-existing fuel system is utilised. However, because the
fuel and nitrous can be controlled independantly, the software settings are critical to getting the mixture
correct. (Less hardware, more tuning.)
On/Off
With On/Off control the nitrous/fuel solenoids are either On or Off. This is the standard operating mode.
Progressive / pulsed
Megasquirt-2 does not implement progressive control
Multi-stage
Note! - you are advised to always start with a simple system using small jets. Big hits with multiple stages are
significantly more difficult to install and tune correctly.
With a single on/off stage using fixed jetting the flow of nitrous (and fuel) is approximately constant under all
conditions. This means that if you are getting a claimed 100hp at 3000rpm when you activate the system, by
6000rpm the engine is turning twice as fast and each intake event will only receive half the nitrous/fuel so
you will get half the torque benefit.
One answer might be to use two stages based on rpm. The first stage is still jetted at 100hp, but at 4500rpm
you bring in a second stage of say 25hp. This will make up for some of the "lost" torque.
4.7.2 Connection
Wiring of the solenoids / relays is covered in the Hardware Manual for your product.
Fully variable VVT is not supported by Megasquirt-2. Most later OEM systems are fully variable. The ECU
monitors the position of the cam and operates the solenoid(s) to adjust the exact position. If your engine
uses one of these systems, you may be able to mechanically lockout the VVT to a fixed position, but
generally you are advised to upgrade to Megasquirt-3 for full control.
4.9.2 Device-to-device
In this mode two devices on the CAN network exchange data independent of the tuning computer.
e.g. A transmission controller fetching engine data from the Megasquirt, or the Megasquirt polling devices on
the network and datalogging the results.
Once configured the data transmission will happen as and when required with no user intervention.
4.9.3 Passthrough
In this mode messages from your tuning computer are relayed to remote devices over the CAN network.
e.g. tuning the remote device from your laptop.
This can be really useful when you have more than one Megasquirt device on your vehicle, with a single
connection point for your tuning computer you can "connect" to any of the devices on the network and view
data, tune etc. You could also use the computer to datalog from multiple devices concurrently. The logging
speed will be reduced the more devices you try to log from.
TunerStudio allows CAN devices to be added to the main project so you can view and tune multiple CAN
devices concurrently. Megasquirt-2 has limited CAN data capture options (compared to Megasquirt-3) so
mostly you will be datalogging data captured from remote expansion boards.
Step 1. Step 3.
Tuning computer sends USB/serial request to Remote device answers request and sends back data
Megasquirt (addressed to remote device.) over CAN.
Step 2. Step 4.
Megasquirt recognizes this as a passthrough Megasquirt receives data and forwards it on to tuning
request and relays it on to the remote device over computer by USB/serial.
CAN
4.9.5.4 CANADCs
Allows analogue data to be collected from an expansion device. The captured data can then be datalogged
as gpioadc0-7.
Refer to the Extender documentation on the JBPERF site for initial configuration.
ADC inputs
Up to 24 analog channels are available from the IO-Extender. Up to 8 can be collected by the MS2 and
recorded in a datalog as a raw ADC value. (MS3 can do more.)
NOTE: Be sure to set the Extender to 10bit ADC for compatibility with Megasquirt.
Digital ports
You can configure ports 1 and 2 as digital output ports (16 channels) and port 3 as a digital input with the
following settings.
CAN device = 5
Table = 7
Enable input port = Enable
Offset = 77
Enable output port = Two
Offset = 75
4.10.1 Wiring
Refer to the Hardware Manual for your product for details on how to wire in an additional analog sensor. The
processor requires a 0-5V signal.
The above example reads from the two spare analogue inputs:
adc6 = JS5 / SPAREADC
adc7 = JS4 / SPAREADC2
The variables 'adc6' and 'adc7' are already defined in the main 'ini' file and are equal to the raw ADC count
from the analogue inputs.
The [OutputChannels] section gives definitions of new variables. Here 'OilTemp' is defined as a table lookup
from a provided lookup table file "ntcbosch.inc". 'Oilpress' is a linear equation.
The [Datalog] section specifies what additional fields should be added to the datalog.
(Not shown) the [GaugeConfigurations] section defines addtional gauges that you can add to the
TunerStudio dash.
[GaugeConfigurations]
oiltempGauge = oilTemp, "Oil Temperature", "°F", -40, 110, -15, 0, 200, 300, 0, 0
Having created the file, File-> SaveAs custom.ini in the TunerStudioProjects/<your project>/projectCfg
directory.
1022 180.00
1023 180.00
For temperature tables such as this one, it is typical to have the very end points as a default tempertature
(180°F in this case) so that if the sensor wiring fails or shorts to ground, a known 'failsafe' value will be
displayed.
This '.inc' file needs to be saved to the 'inc' sub-directory under your project folder.
e.g. Documents/TunerStudioProjects/<your project>/inc/
These include (.inc) files can be created by editing a log file generated by the TunerStudio thermistor table
generator and stripping out un-needed rows and columns.
128 64 32 16 8 4 2 1
MAP decel MAP accel TPS decel TPS accel WUE active ASE active Cranking Ready
enrichment enrichment enleanment enrichment (active tach
signal and
pump
running)
If you are unfamiliar with bits, bytes and binary, then some background reading may be required.
For bitwise operations,
result = ((value & THRESHOLD) == HYST)
Say you wanted an output to activate when you are in WUE (warmup) mode, but not TPS accel.
TPS accel has a value of 16. WUE has a value of 8.
We want to check both of these bits, so need to set the "threshold" (bitmask) to 16 + 8 = 24.
We then want to check that TPS accel is clear and WUE is set, so set the "hyst" (match) = 8.
128 64 32 16 8 4 2 1
Field name MAP decel MAP accel TPS decel TPS accel WUE active ASE active Cranking Ready
enrichment enrichment enleanment enrichment
Example value 0 0 0 0 1 1 0 1
Bitmask 0 0 0 1 1 0 0 0
(threshold)
Answer 0 0 0 0 1 0 0 0
Match 0 0 0 0 1 0 0 0
(hysteresis)
In a given column (bit) a bitwise AND operation is performed - if the value and the mask are both '1', then the
answer is '1'. In this example,
TPS accel has 0 & 1 -> 0
WUE has 1 & 1 -> 1
All 8 bits of the answer row are then compared to the match value row. In the example it is equal, so the
on/off output is enabled.
5: Troubleshooting
5.1 Resets
A reset is when a disruption in power or a spike in voltage causes the processor to briefly shut down. This
will cause the engine to hiccup while running, and will display a couple other symptoms. The Megasquirt-2
will reset when it is powered up, and this is the right time for it to reset. Having it reset on a running engine,
however, is something you’ll want to fix right away.
• The Megasquirt-2 will briefly disconnect from the laptop or other devices on USB or RS232.
• Data logs will indicate a “Mark (number) - RESET”.
• The SecL count will drop to zero.
The last item is a key part for spotting true resets in a data log. If the engine hiccups, but the SecL count
does not drop back to zero, you’ve got something else, such as a fuel cut, loss of RPM signal, or other issue.
If it’s a real reset, here are the items we recommend checking first.
First, make sure the Megasquirt-2 has all ground wires used, and grounded to the engine block or cylinder
head. Chassis grounds can have issues caused by rust or points where current runs through nothing but a
thin spot weld.
Check where the Megasquirt-2 is getting power from a clean source - ideally, you’ll want it to be powered off
the battery, with no devices that draw significant current getting power from the same feed. Many resets
come not from EMI / RFI interference, but from something like an ignition coil, fuel pump or wideband
controller injecting voltage spikes into the power feed.
Make sure that you are using resistor type spark plugs, good spark plug wires (if you’re not running coil on
plug), and that the spark plug wires are not within one inch of any wires going to or from the Megasquirt-2.
The Megasquirt needs to be configured for rising edge in this instance as that matches the 'sharp' well
defined zero crossing of the input signal. We can now look at what the Megasquirt code will see.
This shows how the rising edge configuration results in what we'll call a 'single edged' signal. The Megasquirt
is only aware of that rising edge and pays no attention to the length or the high or low periods or the falling
edge.
Now, insert some noise.
The noise pulse creates a false trigger to the Megasquirt, this could cause an rpm blip on the fuel only install,
a misfire or a total loss of sync on the more advanced installs.
Having established what the noise signal might look like, how to get rid of it?
These are the main methods available to improve situations
• noise filter
• tach masking
• tach period rejection
• polarity check
If nothing is showing under "Ports" then you likely have a configuration or driver problem on your computer.
You need fix that first. Make sure the USB cable is securely inserted or try a different socket. If that doesn't
resolve it, try de-installing and then re-installing the device driver.
1 2 3 4 5
If nothing comes back in the lower pane, double check that pins 2&3 are shorted together. If they are, then
your USB-serial adapter or serial port may be faulty. Try on a different computer. Or try a different USB-serial
adapter (FTDI based are recommended.)
Make sure there are no short circuits or loose wires around, then turn on your Megasquirt (connect a fused
12V supply.)
As in section 5.4.3, open up TunerStudio and perform the loopback test in MiniTerminal.
If test 5.4.3 worked ok, but 5.4.4 does not work, it suggests there may be a problem on the Megasquirt
board. Either there is no power, a solder connection is faulty or the serial chip (U6) is damaged.
Carefully re-install the MS3 CPU card U1 after testing is complete.
The TPS bypass rev limit setting has been removed, the standard hard limit is now used in bypass mode to
reduce confusion.
3. A detailed list of changed features is provided in the TunerStudio Reference manual.
The PW adder values will need to be tuned to suit your injector size and engine behaviour.
See also the notes in section A.3
Whether you imported a VE table or not, you now must go through all settings to configure for your engine.
e.g. number of cylinders, ReqFuel, ignition triggering, spark and fuel hardware in use.
If you are swapping the Megasquirt-2 card in place of the Megasquirt-1 processor you may well want to add
the 12V feed to the chip. (Notes to be added.)
Setup Tunerstudio and create a new project for the Megasquirt 2.
Power up your Megasquirt 2 and open the tuning software.
Ensure that you see the default settings i.e. it isn't all blanks or zeros.
Open the Fuel VE table.
Import the VEX you previously saved.
Whether you imported a VE table or not, you now must go through all settings to configure for your engine.
e.g. number of cylinders, ReqFuel, ignition triggering, spark and fuel hardware in use.
7.5 %baro
The primary load input is the MAP sensor. The VE table lookup uses %baro = MAP/Baro.
With 'Multiply MAP', without 'Include AFR target'
PW = DT + (ReqFuel * MAP * VE[RPM,%baro] * AirDen * BaroCor * corrections)
With 'Multiply MAP', with 'Include AFR target'
PW = DT + (ReqFuel * MAP * Stoich/AFRtarget * VE[RPM,%baro] * AirDen * BaroCor * corrections)
7.6 MAF
The primary load input is the MAF sensor.
With 'Include AFR target'
PW = DT + (ReqFuel * Stoich/AFRtarget * (MAFload * AirDen) * corrections)
This is somewhat different to the other algorithms. As the MAF sensor is actually measuring airflow, the value
(ideally) includes the effect of VE, air density and baro.
There are a number of calculations to arrive at this point, the casual reader can skip these. For the full gory
details, see the source code. As the processor uses integer maths, many values are scaled *10, *100 etc to
preserve precision.
First the raw MAF reading is established from the flow calibration curve.
MAF = flowcurve[MAF volts] in 0.01g/s units
Then..
MAFCoef = 1010048999 / engine_size_cc
Then the flow-load value MAFload
MAFload = (MAFCoef / AirDen) * MAF) / RPM MAFload in 0.1 units, AirDen 1000 = 100%, RPM in 1
units.)
For code efficiency and to improve precision, instead of dividing by AirDen and then multiplying it back out
again, the code actually calculates a version of MAFload without the air density correction.
MAFload_no_air = (MAFCoef / 1000) * MAF) / RPM
So the equation becomes:
PW = DT + (ReqFuel * Stoich/AFRtarget * MAFload_no_air * corrections)
Comparing this to Speed Density, MAFload_no_air takes the place of (MAP * VE[RPM,MAP] * AirDen *
BaroCor)
CID – Cubic Inch Displacement. The imperial measure of the swept volume of the pistons. 61.02 cubic
inches = 1 litre.
Closed loop – refers to those times when an EFI computer is using feedback from a sensor to alter outputs
Closed loop boost – Megasquirt uses a PID to keep boost in line with a boost target table
Closed loop EGO – Megasquirt controls the EGO to the target table by varying the injected fuel amounts.
Closed loop idle – Megasquirt controls the idle rpm by opening or closing the idle valve as required.
CHT – Cylinder Head Temperature, used instead of coolant temperature (CLT) on air-cooled engines.
CKP – Crankshaft position sensor
CLT – Coolant Temperature sensor (aka. CTS). Usually the CLT sensor is an NTC (Negative Temperature
Coefficient) thermistor, or a resistor whose resistance varies with temperature (NTC means the resistance
goes down as the temperature goes up).
CMP – Camshaft position sensor
CNP – Coil Near Plug – See Coil on Plug
Coil On Plug – One ignition coil is installed per spark plug. Either directly on top of the plug e.g., a 'pencil'
coil. Or in close proximity with a short plug-lead (actually coil near plug.) This setup can give maximum spark
energy and can be the neatest install with least lost spark energy.
COP – Coil on Plug – See Coil on Plug
CPS – Possibly ambiguous Crankshaft or camshaft position sensor
CPU – Central Processing Unit, aka. "processor" or "microprocessor" the computational engine that performs
the calculations to operate the injection and ignition functions in MegaSquirt®. It has a number of support
circuits, like the power circuit, the clock circuit, the serial and CAN communications circuits, and various input
and output conditioning circuits.
CTS – Coolant Temperature Sensor (aka. CLT). Usually the CTS is an NTC (Negative Temperature
Coefficient) thermistor, or a resistor whose resistance varies with temperature (NTC means the resistance
goes down as the temperature goes up.
Diode – A two lead electrical device that allows current to flow in only one direction (see also Zener diodes).
DIY – Do-It-Yourself.
DMM – (digital multi meter) electronic current/resistance/potential measuring tool. (Required tool for any
Megasquirt install.) May also be referred to as DVM (digital volt meter.)
Dual table – A firmware feature allowing different injector outputs to have independent fuel tables. Can be
used as an awkward method to achieve per-bank trim. More commonly used (with external relays) to map for
regular fuel and LPG.
Duty Cycle – (DC)– A number indicating the amount of time that some signal is at full power. In the context
of MegaSquirt EFI Controller, duty cycle is used to describe the amount of time that the injectors are on, and
to describe the “hold” part of the peak and hold injector drivers (see Low Impedance Injectors, below).
ECU – (Electronic Control Unit) is the general term for a fuel injection controller, of which MegaSquirt is an
example.
EDIS – Electronic Distributorless Ignition System is Ford's wasted-spark computer-controlled ignition module,
which has a simple two wire hookup to MegaSquirt for full mapped ignition control.
EGO Sensor – Exhaust Gas Oxygen sensor, used to describe the sensor in the exhaust that measures the
lean/rich state of the intake mixture. Used to control the fuel via a feedback algorithm called “closed loop”.
EGR – Exhaust Gas Recirculation. Used by OEMs for emissions purposes. Not supported by Megasquirt.
EGT – (Exhaust Gas Temperature) is the temperature of the exhaust gases, typically measured with a K-type
thermocouple. Megasquirt does not have on-board hardware for a direct connection. An add-on board is
required.
FET – (field effect transistor) - In MegaSquirt EFI Controller, the transistors used to control the activation of
the injectors.
FIdle – Fast Idle. A device used to control idle speed with additional air supplied by a vacuum solenoid. More
commonly a fully variable PWM idle valve is used instead. This term is most frequently applied to a
connection from the Megasquirt ECU that can be used to drive an on/off valve or a PWM valve.
Gamma – Used to indicate the change in a fuel amount from the calculated amount.
GammaE – A collection of all enrichments and minor corrections to fuel (see speed density.) Now renamed
as 'totalcor'.
Gear tooth sensor – an "active", tooth presence sensor. It is based on the Hall effect. The Hall effect sensor
consists of semiconductor material which will conduct current when the material is subject to a magnetic
field. These types of sensors include a magnet within the sensor and will detect a steel tooth in close
proximity. No external magnets are required. Very simple to use.
Gego – Gego is short for 'Gamma – Exhaust Gas Oxygen'. It is the change applied to the fuelling equation
based on the EGO O2 sensor feedback. This feedback can (and is) done in a number of different ways,
depending on the type of sensor, etc. The important thing is that this is a result of an external measurement,
not a pure calculation, so it appears a bit mysteriously in the equation. Now renamed as 'egocor'.
Hall sensor – an "active", magnetic field presence sensor. It is based on the Hall effect. The Hall effect is the
change of resistance in a semiconductor in a magnetic field. The Hall effect sensor consists of
semiconductor material which will conduct current when the material is subject to a magnetic field. These
types of sensors require a "flying magnet", wheel. Instead of teeth on the wheel, as in a variable reluctor
sensor, you must have small magnet and a shutter wheel.
Hydrocarbon (HC): in an automotive context, generally refers to regulated unburned hydrocarbon tail pipe
emissions.
HEI – , the distributor based electronically controlled ignition system from General Motors. There are a
number of variants, identified by the module they use:
•4-Pin module: non-computer controlled electronic ignition,
•7-Pin module: computer controlled electronic ignition used in 'large cap' distributors,
•8-Pin module: computer controlled electronic ignition used in 'small cap' distributors.
High Impedance Injectors – (a.k.a. hi-Z or high ohm) Fuel injectors designed to work with a simple switch in
a 12 volt circuit, no special signal conditioning is required to drive them. The resistance of a high impedance
injector is about 10-15 ohms.
Hz – (Hertz) the measurement of the frequency of a cyclical event, it represent the number of times per
second the cycle is completed.
IAC – Idle Air Controller, though this term is sometimes used more generally, it usually refers to GM's 4 wire
stepper motor controller for additional idle air (and hence engine speed) during warm-up and for idle
regulation.
IAT sensor – Intake Air Temperature sensor, same as MAT, see below.
IGBT – Insulated Gate Bipolar Transistor a particular kind of transistor especially suitable for driving ignition
coils. e.g., VB921, BIP373
Incorporate AFR – An MS2 and MS3 feature where the AFR target table is included in the fuelling equation.
The Fuel VE table then becomes far closer to a true VE table. Enrichment or enleanment from stoichiometric
comes from the AFR table. Ideally this setting should be turned on before any tuning and the AFR table set to
your target AFRs. Then the VE table is tuned to achieve that AFR. Turning the setting on/off will require a
complete re-tune.
Interpolate – The dictionary meaning is to insert an intermediate value into a series by estimating or
calculating it from surrounding known values. On all tables and curves, when you are between points, the
Megasquirt interpolates the intermediate values. Some older other brands were unable to do this and
required monstrously large tables to overcome this limitation.
kPa (kiloPascals) – the measurement of air pressure used in MegaSquirt® computations. It ranges from 0
(vacuum) to 101.3 kPa (standard atmospheric pressure at sea level) to 250 kPa (21psi of boost) or higher.
Lambda – an alternative term to AFR where 1.0 is stoichiometric. Lambda numbering is fuel independent.
1.0 is always stoich.
Low Impedance Injectors – (a.k.a low-Z, low ohm) Fuel injectors that are designed to run at a much lower
current than would be supplied by a direct 12 volt connection. They require a special signal that is initially at
full current (4-6 amps, a.k.a. “peak current”) for about 1.0-1.5 ms, but then drops down to about 1 amp (“hold
current”) for the rest of the opening pulse. The resistance of a low-impedance injector is typically 1-3 ohms.
These may need a "peak and hold" board or a resistor pack.
LSU-4 – Bosch wide-band oxygen sensor.
MAF sensor – Mass Air Flow sensor. A sensor used to measure the mass of air flow through the intake tract
(which must be sealed at the senor and downstream).
MAP sensor – Manifold Absolute Pressure sensor. Measure of the absolute pressure in the intake manifold
(related to the engine vacuum), to determine the load on the engine and the consequent fueling
requirements. The standard MAP sensor in MegaSquirt® is the MPX4250 (2.50 BAR, or 15 psi (vacuum) +
21 psig (boost)). A basis of the "speed density" fuelling algorithm.
MAPdot – rate of change of MAP value. (dMAP/dt) Used mainly to trigger Accel enrichment.
MAT Sensor – Manifold Air Temperature sensor, the same as IAT. The MAT circuit is identical to the CLT
circuit, see CLT, above.
.MSL – file extension used by the MegaSquirt for storing datalogs (.XLS might also be used for datalogs with
older versions of tuning software).
MPX4250AP – the standard internal MAP sensor used in MegaSquirt.
MS – MegaSquirt, used in this document to refer to the MegaSquirt® fuel injection controller or its embedded
software. e.g., MS1 = Megasquirt-1, MS2 = Megasquirt-2, MS3 = Megasquirt-3
MS1/Extra – The most commonly used firmware on the Megasquirt-1 chip. Gives fuel and spark control.
Used to be called Megasquirt'n'spark-extra or MSnS-extra. The original basic MS1 code was fuel only.
MS2/Extra – Firmware for the MS2 chip and Microsquirt with multiple spark outputs, many wheel decoders,
closed loop idle, boost, nitrous, table switching and more
MS2/BG – More basic firmware for the MS2 chip and Microsquirt from Bowling and Grippo.
.MSQ – file extension used for saving MegaSquirt fuel injection controller user settings (aka. "parameters")
on a tuning computer. Since approximately 2005, these have been readable XML format, so you can open
these in Notepad or similar text editors. This format allows some exchange of tune data between different
code versions.
NB-EGO Sensor – Narrow Band EGO sensor, gives a switch at the stoichiometric ratio (the chemically
correct mixture of air and fuel), but unreliable for AFR other than stoichiometric.
Ohm's Law – A fundamental law of electricity, that states that the current flow (I) is equal to the voltage (V)
divided by the resistance (R), or:
I = V/R
Oxides of Nitrogen (NOx) – in an automotive context, generally refers to regulated 'mono-nitrogen oxides'
(NO and NO2) tail pipe emissions.
OEM – (original equipment manufacturer) - refers to parts produced for initial assembly of a new vehicle. (As
opposed to after market parts.)
Open Loop – refers to those times when MegaSquirt works entirely from its calculations with no feedback
from a sensor (compare Closed Loop.)
Open Loop Boost – there is no feedback from the map sensor – boost duty is controlled by the duty table
only.
Open Loop EGO – there is no feedback from the oxygen sensor – fuelling is from the VE table only.
Open Loop Idle – there is no feedback loop with rpm – idle valve position is set only from the table.
PCB – (printed circuit board) – the fiberglass board that has the MegaSquirt component layout and circuits
imprinted on it.
PID – (Proportional, Integral, Derivative) - a method of closed-loop feedback control
Pull-up Circuit – A very simple circuit consisting of a voltage supply and a current limiting resistor designed
to prevent a signal from floating, it forces the signal to either be high (equal to the pull up voltage) or low
(grounded).
P&H Injectors – Peak and hold injectors; see Low Impedance injectors.
PIP – Profile Ignition Pick-up is the term used for the signal sent from Ford's Electronic Distributorless
Ignition System (EDIS) to the electronic control unit. The EDIS module decodes the 36-1 wheel and sends 2,
3 or 4 PIP pulses per engine revolution depending on EDIS4,6,8. The PIP signal into the ECU is a square
wave switched at 12 volts. It provides information about both the engine speed and position.
PW – (Pulse Width) is the amount of time a signal is applied during each period. For example, is the amount
of time (in milliseconds) an injector is pulled low (grounded) to inject fuel.
Pulse Width Modulation (PWM) – A signal with a fixed pulse width (frequency), which is turned on for part
of the pulse. The percent of time that the signal is on is called its duty cycle. PWM is used to limit current to
low impedance fuel injectors, as well as for solenoids such as idle valves, boost solenoids and VVT
Realtime baro – a dedicated second pressure sensor is used to monitor ambient pressure. Required if your
vehicle will go on journeys at varying elevations.
Required Fuel – (Req_Fuel) The injector pulse width, in milliseconds, required to supply the fuel for a single
injection event at stoichiometric combustion, 100% volumetric efficiency and standard temperature.
RPM – Revs Per Minute. The term used to describe engine speed.
SAW – Spark Advance Word is the 'returning' signal to a Ford EDIS ignition unit from the ECU that sets the
amount of ignition advance requested. It is in the form of a 5 volt square wave.
Semi-sequential – Fuelling system where injection events are timed to each cylinder (like spark is) but occur
twice per cycle. Offers some of the benefits of full sequential without needing a cam wheel input.
(Fully) Sequential – Fuelling system where injection events are timed to each cylinder (like spark is) and
occur once per cycle. Do not confuse with direct injection. Sequential uses normal injectors of a normal size,
but their timing can give slight power and/or economy increases
Stim (MegaStimulator) – the original stimulator is a small board which plugs into the connector of the
MegaSquirt® controller. It simulates all the sensor the inputs the MegaSquirt® controller would normally see
(but the rpm signal is only suitable for use with distributor or EDIS configurations) and provides power to the
MegaSquirt® controller. The Stimulator also allows you to monitor the MegaSquirt® controller's injection
pulses [actual], fuel pump relay operation, and fast idle solenoid output with four LEDs. The JimStim is an
enhanced version that simulates many wheel patterns and has more LEDs for multiple spark outputs.
Speed Density – Fuel control algorithm that calculates fuelling based primarily on pressure, air temperature
and volumetric efficiency.
PW = dead time + (ReqFuel * MAP * VE(rpm,map) * GammaE)
All the corrections are included within GammaE.
Stoichiometric – the chemically ideal air:fuel mixture. Expressed as 1.0 Lambda for all fuels or 14.7 for
petroleum/gasoline.
SPOUT – Spark Out is the spark advance signal sent from MS-II™ to the Ford TFI module to set the timing
advance.
Table blending – A firmware feature that allows the user to combine two tables, usually using different
algorithms. e.g., one table could be a regular speed-density table and the other alpha-n. This could be useful
on an individual throttle body install or as a way of extending the table size.
Table switching – A firmware feature that allows the user to swap to a different fuel, spark, etc table. Can be
used in conjunction with dual fuels or nitrous or as a way of extending the table size.
TBI – Throttle Body Injection is a form of injection is which the fuel is injected above the throttle(s). It was
typically used on older engines since it can be a simpler system, but is also found on some very high output
racing engines because the vaporization time is longer than with port injection.
TPI – Tuned Port Injection is General Motors bank-fire port fuel injection system. It was widely used on 305
and 350 cid V8 in the mid to late 1980's.
TPS – Throttle Position Sensor, a voltage divider that gives information to a MegaSquirt® controller about
throttle opening, from which it computes rate of throttle opening for acceleration enrichment.
TPSdot – rate of change of TPS value. (dTPS/dt) Used mainly to trigger Accel enrichment.
Transistor – A solid-state (no moving parts) electronic device that uses a small voltage (on the base pin) to
control a larger current (across the emitter and collector pins). There are two basic types of transistors, PNP
and NPN. A PNP transistor allows current to flow if there is no signal on the base, and restricts the current as
the base current increases. An NPN transistor allows current to flow in proportion to the signal on the base,
and restricts the current as the base current decreases.
TS (TunerStudio MS) – The standard software for tuning MegaSquirt EFI controllers. (The previous, now
obsolete, software was called Megatune.)
Volatile Organic Compounds (VOC) – in an automotive context, generally refers to organic components or
precursors to smog formation. Organic compounds are all chemical compounds containing carbon-hydrogen
(C-H) bonds of covalent character. The U.S. Environmental Protection Agency defines a VOC as any organic
compound that participates in a photoreaction. An example of a VOC is PAN (peroxyacetyl nitrate),
CH3COOONO2.
Voltage divider – A simple circuit that uses two resistors in series to reduce the output voltage Vo
proportionally to the input voltage Vi. Two resistors, R1 and R2, are arranged in series, with one end
connected to the external signal, and the other to ground. The signal is taken from between the two resistors.
From Ohm's Law we can calculate that the total current will be I = Vi/(R1+R2). The same current flows in
each resistor because they are in series. The voltage drop across each resistor is: V1 = I*R1 and V2 = I*R2 =
Vo. V2 is output voltage Vo, which we can write as:
Vo = Vi* R2/(R1+R2)
V2.2 – The first mainstream circuit board used within Megasquirt. While still available for sale, it is largely
obsolete.
V3.0 – The current circuit board used within Megasquirt (accurate Nov 2010). This superceded the V2.2
adding better support for low-z injectors and a circuit for VR conditioning.
V3.57 – A surface mount circuit board, largely the same as the V3.0 board.
VB921 – a particular IGBT designed for use with automotive ignition coils. Now superceded by BIP373.
VE – Volumetric Efficiency. The actual amount of air being pumped by the engine as compared to its
theoretical maximum. A 2000 cc engine will theoretically move 2000 cc of air in one cycle at 100% efficiency.
If the engine is actually running at 75% VE, then it will move 1500 cc of air on each cycle.
Vref – a 5 Volt supply used to power the TPS (and sometimes other external components needing a 5 Volt
supply, like ignition modules or pull-ups).
VR sensor - Variable reluctor sensor – is an induction type sensor, it is "passive", i.e., it does not require a
power source, and has a small magnet built in. Needs to use a conditioning circuit – as provided on the V3.0
and V3.57 mainboard. Cannot be used directly on the V2.2 mainboard.
Wasted-COP – a method where individual coils are fitted per spark plug, but the coils are fired in a 'wasted'
manner twice per cycle. This is used during startup in some wheel modes and could also be used
temporarily by a user before full coil-on-plug is installed.
Wasted Spark – A method of firing spark plugs in which one 'double-ended' coil simultaneously fires two
coils on different cylinders. One of the cylinders is the intended 'target', and is near TDC on its compression
stroke, the other cylinder is offset by 360° in the firing order (of the 720° 4-stroke cycle), so it is near TDC on
its exhaust stroke. The second spark is said to be 'wasted' because it does not ignite a mixture. On the other
hand, the hot ionized exhaust gases require little energy to create a spark, so nearly all the energy goes to
the 'target' cylinder. An example of a wasted spark system is Ford's EDIS. The advantage is that while a
missing tooth crank wheel is required, no cam sync signal (and the corresponding wheel and sensor) are
needed.
WB-EGO Sensor – Wide Band EGO sensor, can be used to derive real AFR data with mixtures from 10:1 to
20:1, i.e., anything you are likely to be interested in. Allows for lean or rich tuning.
WOT – Wide open throttle.
WUE – Warm Up Enrichment, the enriched mixture applied when the coolant temperature is low.
Zener diode – A diode that allows current to flow in one direction, unless the reverse voltage is higher than
its rated avalanche voltage, in which case it will flow in the reverse direction. Often used to limit excessive
voltage to certain circuits by shunting it either to ground or the power supply.
You are looking for a file similar to ms2extra-release-3.4.2.zip (If you don't see the ".zip" on the end, re-
read section 2.8.)
iii. Right click on the file you saved and choose Extract All.
iv. The defaults are OK, and just click Extract. (Note that Windows adds a second level of directory when
extracting.)
v. You should now find the files have been extracted. Open up the folders until you see this:
Example:
If this takes longer than a minute then you likely need to adjust the port settings of your USB-serial adapter to
reduce the latency setting.
The first time you install firmware on an MS2 or Microsquirt-module it might be necessary to use the boot
jumper. On a Microsquirt the equivalent is to ground the BOOTLOAD wire.
2015-02-02 Idle homing steps setup procedure. Linux group note. Glossary from MS3. CAN config
from MS3. custom.ini. Apply similar edits from 'Laminar'. Minor staging typo.
2018-07-06 Move text-based firmware loader to appendix, main text refers to TS loader.