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


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

[ign_table(rpm,kpa)]

130 0.02.06.010.014.0 18.022.0 26.030.0 31.032.032.0
120 0.03.07.011.015.0 19.023.0 27.031.0 32.033.033.0
110 0.04.08.012.016.0 20.024.0 28.032.0 33.034.034.0
100 0.06.010.014.018.0 22.026.0 30.036.0 36.036.036.0
90 0.08.011.015.019.0 23.030.0 33.035.0 36.036.036.0
kPa80 2.08.012.016.020.0 24.030.0 34.035.0 36.036.036.0
70 4.08.012.016.020.0 24.030.0 34.035.0 36.036.036.0
60 6.010.014.018.022.0 26.031.0 34.035.0 36.036.036.0
50 8.012.016.020.024.0 28.032.0 35.036.0 36.036.036.0
40 8.014.018.022.026.0 30.034.0 36.038.0 38.039.040.0
30 8.016.019.023.027.0 31.034.0 37.039.0 40.041.042.0
20 8.016.020.024.028.0 32.034.0 38.041.0 44.046.046.0
5007501000150020002500300035004000450050005500
RPM

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.