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

MegaMeet 2015 is coming on October 17th, 2015 in Mooresville, NC. Click this link for more information.

Ignition Control with MegaSquirtII

To provide improved engine performance, better fuel economy, and reduced exhaust emissions, MegaSquirtII can control spark advance (timing), and this advance is programmable by the user.

For MegaSquirtII (as for most other ignition systems), the total ignition advance is based on three factors:

Total advance = initial advance + RPM based advance + vacuum advance

In particular, MegaSquirtII uses three variables to determine the total advance (called adv_deg).

  1. The first is the relevant value from the engine speed and load table, called ign_table(rpm,kPa), combining the RPM based advance and vacuum advance in one 12x12 table.
  2. The second is the trigger offset (adv_offset in the code), which appears to be roughly equivalent to the initial timing, but is really the difference between the trigger and next TDC in degrees (it is frequently used as the base timing in 'bypass mode' when the module is not connected to the MegaSquirt-II, and also when 'trigger rise' is set as the cranking advance).
  3. And the final value is the cold_adv_deg, an enhancement not available in many ignition systems, which is a 1x10 table based on engine coolant temperature (clt).

Note that you specify the total advance in MegaTune. That is, you calibrate the trigger offset, then put the timing you want in the MegaTune advance table. So if you have calibrated your trigger offset (suppose it is 10°), and want 25° BTDC for the advance, you put 25° in the MegaTune table (not 15° or 35°).

In the code, these factors are in tenths of a degree (1/10°). These values must be positive, so adv_offset sets the minimum amount of advance possible.

In general:

The spark advance table is a 12 by 12 matrix (144 values) based on engine RPM and MAP sensor values. A further table of 10 values is used to make adjustments for engine coolant temperature.

Example Spark Advance Table


130 18.022.0 26.030.0
120 19.023.0 27.031.0
110 20.024.0 28.032.0
100 22.026.0 30.036.0
90 23.030.0 33.035.0
kPa80 24.030.0 34.035.0
70 24.030.0 34.035.0
60 26.031.0 34.035.0
50 28.032.0 35.036.0
40 30.034.0 36.038.0
30 31.034.0 37.039.0
20 32.034.0 38.041.0

Spark advance entries in the 12×12 MegaTune spark table are expressed in engine degrees, and can be specified in tenths of a degree (1/10°). Note that they are the actual timing before top dead center (BTDC), and include any trigger offset.

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