|
Megasquirt 3 - Ignition settings |
Ignition Options/Wheel decoder -
Dwell battery correction -
Dwell vs RPM -
Cold Advance -
MAT-based timing retard -
Noise Filtering -
Knock Sensor Settings -
Knock Sensor Parameters -
Knock Window Settings -
Knock Coolant Scaling -
Ignition tables 1-4 -
Rotary Settings -
Rotary Split Table -
Cyl x-x trim
Ignition Options/Wheel Decoder
The left hand side :
Spark mode - this sets the type of tach input pattern decoder to be used. For detail on the various modes see here
Trigger Angle/Offset - There are three different ways this setting is used:
The right hand side :
Fixed advance - When set to "Fixed Advance" the spark timing is locked to the value set below. This is used for confirming timing with a strobe timing light during setup. (See also Checking Timing.) For normal operation, this MUST be set to "Use table" so that the spark advance table is used.
Use Prediction - Normally set to "1st Deriv Prediction". Alters the way the internal spark timing calculation functions. With no prediction, spark retard may be observed during engine acceleration. With 1st Deriv, this is automatically compensated for.
Timing for Fixed Advance - only applies when "Fixed Timing" is set above. Timing is then locked to this specified value.
Cranking dwell - specifies the base coil dwell time during cranking before battery correction is applied.
Dwell type - Can be "Standard Dwell", "Fixed Duty", "Time after Spark", "Charge at Trigger"
Dwell Battery Correction (Adjustment)

The dwell battery correction/adjustment curve is a built-in curve to automatically apply greater spark dwell at lower battery voltages. This is required for inductive ignition systems - more time is required to charge the coil with less voltage. The default curve as shown is suitable for most application. Note that it is centred on 14.4V with 100% - at this voltage the actual dwell time matches the dwell entered on the ignition options page.
Dwell vs RPM

The Dwell vs. RPM curve is a feature intended to be used with Saab Tri-ionic ignitions only. These require "Time After Spark " to be enabled. The dwell vs. RPM curve must also be turned on.
Cold Advance

The cold advance feature can be used to run more (or less) advance on a cold engine. When cold an engine typically requires more advance for normal operation. Conversely though, many OEMs are reported to retard timing during warmup to more quickly bring the catalyst up to operating temperature.
Ensure that the advance figure in the final row is zero , this will allow the spark timing to follow the advance table.
MAT-based timing retard

High inlet air temperatures (MAT) can make an engine more prone to knock, this is especially the case on boosted engines where prolonged periods of hard driving or idling in high ambient air temperatures can have a significant impact on MAT.
This feature allows the timing to be retarded at higher MAT readings for greater engine safety.
Ensure that the retard figure at normal temperatures is zero, this will allow the spark timing to follow the advance table.
Noise Filtering

Noise filter period - this sets a minimum pulse time to ignore. It can filter out very short noise spikes.
Primary Tach
Noise filter enabled - enables noise filter curve on primary/crank tach input.
Tach period rejection - ignores pulses shorter than time/percentage
Tach interrupt masking - turns off input pin so pulses are not seen at all for time/percentage
Time(ms) - time period to ignore.
Percentage - percentage of "tach interval" to ignore.
Secondary Tach
Noise filter enabled - enables noise filter time on secondary/cam tach input.
Noise filter time period - pulses shorter than this are treated as noise
Tach period rejection - ignores pulses shorter than time/percentage
Tach interrupt masking - turns off input pin so pulses are not seen at all for time/percentage
Time(ms) - time period to ignore.
Percentage - percentage of "tach interval" to ignore.
Noise filter curve - the curve sets filter times at varying rpms.
Examples
Coil negative triggering for a fuel-only install. This requires noise filtering to eliminate the effects of coil ringing.
A typical setting would be to enable crank tach period masking at 2ms and 30%.
Distributor type pickup, HEI, TFI, EDIS. Noise filtering is often useful here. A typical setting would be crank tach period masking with 1ms and 30%.
Wheel decoder and other more advanced installs. Noise filtering may be useful on some installs. Due to the multi-toothed input signal the rejection time periods need to be set far smaller.
e.g. on a V8 with distributor at 6000rpm, the time between tach pulses is 5ms. A 36-1 wheel on the same engine gives a pulse every 0.6ms (600us). Using too large a filter time will filter out the real signal.
Note: the knock sensing feedback system can never offer foolproof protection against engine damage. Check your settings with care, take plug readings and use det-cans.
Spark knock is the sound of abnormal combustion
in an engine. Once combustion in a spark-ignition internal combustion
engine is initiated by a spark, the flame front is designed to spread
from the spark plug and travel across the combustion chamber rapidly
and smoothly. As the flame front propagates across the chamber, the
remaining unburnt air-fuel mixture can ignite spontaneously
(auto-ignites) before the flame front arrives, due to the increasing
pressure and temperature in the combustion chamber. When this occurs,
there is a sudden jump in the pressure in the cylinder. This causes
in the characteristic knocking or pinging sound. It is most common at low-mid rpms and high load, such as ascending a hill in too high a gear.
Prolonged heavy knock is likely to cause severe and permanent engine damage and must be avoided.
It is a common misconception that engines make most torque just before knock. Do not use the sound of knock as a guide for best timing, ideally set timing on a dyno to achieve maximum brake torque (MBT) timing.
Even with a well tuned engine, factors such as fuel octane, intake air temperature,
coolant temperature, engine age and condition, air/fuel ratios, air
density, altitude and humidity and others can push the engine from a safe condition to borderline knock or worse. The knock control system is a safety measure designed to retard timing under these conditions and safeguard the engine.
The Megasquirt knock control system supports the use:
Key to knock sensing is the knock sensor itself.
![]() |
|
| GM sensor | Bosch sensor |
There are two main types of knock sensor. Resonant and wideband sensors. The resonant sensor is tuned to a particular frequency and is only likely to work on an engine with a very similar bore size. (Bore size determines 'ping' frequency.) The wideband sensors give a lower voltage output but operate over a wider frequency range and can likely be applied to different engines.
The GM knock sensor is tuned to a specify frequency, like a tuning fork. When this frequency is applied to the sensor (through its connection to the engine), a piezoelectric crystal inside the sensor generates a small voltage (~1 volt), much like a microphone. As an example, some Corvette knock sensors (GM PN 1997562, 1997699, OR Standard Motor Products KS45, KS46, KS49, or KS117) have a design frequency of 5200 Hz, and they produce a signal between 4800 Hz and 5600 Hz.
The sensor should be mounted near the top of the engine block, as close to the center as practical. Do not mount it close to noisy components such as the fuel pump or cam shaft lifters. Mounting the knock sensor in the cylinder head is not a good idea because of valve train noise.
Finding a suitable location of the sensor is crucial. Wherever possible, use the location specified by the manufacturer for that engine family.
Ideally, you will be able to find a suitable threaded hole in your block to which you can mount the sensor. If not, an alternative is to drill and tap the block, or thread a steel adapter to accommodate the sensor on one end and a stub with the thread to match those in an existing pretapped boss in your block. Note that it may be necessary to change the sensor location if you cannot isolate engine noise while allowing MegaSquirt to identify knock.
If you choose to drill and tap your block, choose a thick area of the block with a boss that is at least ¾" (19 mm) thick. Drill a ½" (13mm) hole. The hole should be 0.500" to 0.625" (13 mm to 16 mm) deep. Make absolutely sure that it is safe to drill a hole this size - YOU CAN RUIN YOUR ENGINE'S BLOCK WITH A POORLY PLACED HOLE!
The GM knock sensors have a 3/8" NPT thread. Tap the hole with a 9/16" UNF starter tap. Go in 4 turns of the tap to begin with, clean out the chips and try the sensor for fit. Keep tapping one turn at a time until the sensor threads in 4 to 5 turns with hand pressure. Stop tapping when the sensor will screw into the hole 6 to 7 threads with a wrench. Note that the thread on the knock sensor is a tapered thread.
The Bosch sensor can be more simply attached by bolting it to the block. It uses a standard EV1 style injector connector.
Basic on/off mode - GM ESC module
Above approximately 5000 rpm, however, this knock may be masked by mechanical noise. MegaSquirt's tuning software allows you to set an upper rpm limit on the knock sensor feedback.
On the Corvette L83/L98/LT1/LT4 engines, this sensor is usually screwed (with a specified torque value) into the coolant drain hole near the center of the block side, just above the oil pan rail. This location has been chosen as optimum for this sensor and engine family. On the LS1 engine, the sensors (there are two) are located in the center valley on top of the engine.
A conditioning module is also required, such as GM's Electronic Spark Control (ESC) module (PN 16022621, 16052401), see above. These are also available as Standard Motor Products LXE6, LXE7, and LXE9. These are very common in recycling yards, they were used all virtually all GM vehicles from the mid-1980s to the late 1990s. You should match the sensor and module by application to ensure they will work together properly.
Note that you can get a KnockSenseMS kit designed to work with MegaSquirt from this site.
Wiring the Knock Sensor and Module
The ESC module sends a voltage signal (8 to 10 volts) when NO knock is detected by the knock sensor. If knock occurs, this signal is pulled low.
This signal is fed to the Megasquirt via a pin of your choice. "Launch", "Datalog", "Tableswitch" can be directly connected. On these inputs ensure the pull up/down is set to "none".

This internal module allows knock to be monitored over a specific crankshaft angle 'window', allows gain to be adjusted and knock level thresholds to be set depending on rpm. This allows far greater tunability and should help to distinguish between engine noise and knock.

Knock Control:
Disabled: do not use knock feedback for ignition advance control
Safe Mode: use knock retard, but keep the advance below that which caused knock. This backs the advance 1 small step back and leaves it at that until TPS or MAP changes - or knock comes back. This is "safe mode" scheme is the safest thing for a DIY set-up.
Aggressive Mode: use knock retard, but keep advance at threshold of knock occurring. That is, the program advances (up to the timing table value) if it doesn't see knock, and retards if does see knock. The difference from safe mode is that the timing can be advance all the way to the table value after knock, not just up to one step below knock. This may result in the knock returning, in which case the timing is retarded again, then advanced slowly, and so on.
Input type:
On/Off: basic on/off "knock" or "no-knock" external input.
Analogue: external analogue input proportional to knock signal level
Internal: internal knock module. (read more.)
Input pin (only for on/off) Which input pin the external module is connected to.
Knock Indicated By (only for On/off) The logic input level. i.e. when set to 'low' then a 0V signal means there is knock. This matches the GM module.
Pullup/down on input (only for On/off) Whether an internal pull-resistor should be applied. When using the suggestion Datalog/Tableswitch/Launch input pin set to "None"
Input pin (only for Analogue) Which analogue input pin the external module is connected to.
Window Sample Type (only for Analogue) Either read single analogue value at end knock window or peak detect.
Window Output (only for Analogue) Optional digital output for knock window signal.
DetectionKnock Count (knocks): number of knock events detected before control is started
Knock Ignored above MAP (kPa): no knock retard is implemented above this MAP
RPM window low (rpm): knock rcontrol is implemented above this rpm
RPM window high (rpm): knock control is implemented below this rpm. This upprt limit is desirable as valve train noise will typically mask out the knock sensor signal at higher rpms which could cause false reports of knock.
RetardingMaximum Retard (deg): maximum total retard when knock occurs. This can be useful to prevent timing from being excessively retarded (avoiding potential overheating issues) if the senor malfunctions or there are other problems with the knock sensing system.
Retard Check Time (sec): this is the time between knock retard corrections, allows short time step to quickly retard.
Retard Coarse Step Size (deg): ignition retard step size when 1st knock, make it large to quickly retard the timing and stop knock.
Retard Fine Step Size (deg): ignition retard step size when knock restarts after it had stopped.
RecoveryAdvance Check Time (sec): this is the time between knock advance corrections (I.e., timing return to 'normal')
Advance Step Size (deg): ignition advance step size after knock has stopped.
Recovery Advance (deg)): this is the change in table advance required to restart advance until knock or reach table value (0 knock retard) process. This only applies in 'Safe Mode'
For analogue and internal modes this sets a threshold level. If the measured knock signal exceeds the threshold then the control system is started. This allows different thresholds to be applied to match actual engine behaviour. The curve will need to be set empirically by examining datalogs of knock% when operating the engine under safe conditions.
(Only for 'Internal'.)
(Only for 'Analogue' and 'Internal'.)
>
Sets the start of the knock monitoring window and the size of the window in degrees.
It is typical (per Heywood) for the knock events to start around TDC and continue for many degrees afterwards.
(Only for Analogue and Internal.)
Allows up-scaling of knock sensor threshold depending on coolant. Many engines are noisy during cold operating due to increased clearances. This would result in false knock reports if the threshold was not raised at low temperatures.
Ensure that the final row is 100% for a warmed up engine.
Ignition Tables 1-4

Ignition table 1 is the main 3d table that control ignition timing. (Tables 2,3,4 are used with table-blending and table-switching.)
The numbers in the body of the table are the commanded ignition advance during run mode. i.e. 21 deg in the table will result in a commanded 21 deg timing.
The final commanded timing is also impacted by cold advance, MAT retard and knock retard. So if the Ignition Advance in TunerStudio is not matching the number under the 'moving dot' on the table check those first.
As a reminder, it is ESSENTIAL that the actual timing on the engine crank is checked with a strobe and that it matches the final commanded advance shown on the TunerStudio Ignition Advance gauge. See Check Timing.
The load axis is always shown as a %age value. For Speed-Density this means kPa. For Alpha-N this is TPS%. For %baro this is MAP/baro %.
The RPM axis is engine rpm.
Values in the table are interpolated. i.e. if a value falls between cells the in-between value is correctly calculated (some older non-Megasquirt ECUs were incapable of doing this and required huge tables to compensate.)
The axis values should be arranged to give you more rows/columns in areas of interest and less points where conditions are changing uniformly. Typically low load / cruise regions benefit from more points. Under boost the behaviour is smoother and the interpolation provides good control.
See Rotary Settings
Spark trim (Cyl x-x Trims)
This allows trimming of spark advance by cylinder. Each cylinder has a small 3d table permitting advance to be added or subtracted at given load/rpm points.
Spark trim can only be used if the Megasquirt knows which cylinder is firing. e.g. you must be running coil-on-plug ignition or sequential fuel.
It will not work with EDIS.
Having confirmed that your tach input system can support spark trim, it needs to be enabled.

The spark trim tables are grouped cylinders 1-4, 5-8 (and optionally 9-12, 13-16.) They all share the same load and rpm axes.

If you have a question, comment, or
suggestion for this FAQ please post it on the forum.
No part of this manual may be reproduced or changed without written permission from James Murray, Ken Culver and Philip Ringwood.