General Ignition Manual
Only for use with the MS2-Extra code (HC9S12C64 based microprocessor - MS2 Daughter Board)
This page has now been superceded, please click here
NOTE: Please ensure you have one of these daughter boards inside your ECU before continuing. If you have a black microprocessor, then you have an MS1 and these manuals are NOT for MS1 see here for MS1-Extra Manuals
Warning for E-Bay buyers!!
Please see the Official Suppliers list before buying through E-Bay.
This is there for your protection.
All of these instructions / diagrams are to be used at your own risk, like most things there is more than one way to do the same thing, what we have tried to do is to offer a method that we have tested or that others have tested for us. No warranty expressed or implied.
Use at your own risk.
Tacho Input/Ignition Settings -- More Ignition Options -- Tacho Output
Cold Ignition Advance -- MAT Based Timing Retard -- Dwell Battery Correction -- Advanced Ignition Option -- Noise Filter Settings
Tacho Input/Ignition Settings
Spark mode(Dizzy, EDIS, wheel) these settings are dependant on what setup your running on your vehicle. For more information on these settings see :
MS2-Extra Specific Ignition Manual
Please note :
When using Toothed Wheel mode the Trigger Angle/Offset (deg) is NOT used. The Tooth #1 Angle (deg) is used instead (this is in Trigger Wheel Settings).
Trigger Angle/Offset (deg) (adv_offset in the code) is the advance before (or after) top dead center (BTDC) that the engine gets in it's signal from the engine's variable reluctor or Hall sensor. In many cases, this will be used as the 'base timing' for cranking as well as if the module loses it's connection the the ECU.
For example, with the 7/8-pin HEI or Bosch 0 227 100 124 modules, the 'trigger offset' in TunerStudio is:
This tells MS2-Extra where the crankshaft is positioned so that timing advance can be calculated appropriately. (Note that since the optoisolator (U4) inverts the trigger signal, you specify 'Falling edge' for the 'Input Capture' in TunerStudio, which refers to the signal at the processor.) Positive trigger offsets are used to specify the number of degrees before top dead center (BTDC), negative numbers are used for triggers that occur after top dead center (ATDC).
Angle between Main and Return(deg) When running a distibutor based setup with a hall sensor or similar and a vane, it is sometimes possible to set up the vane so we can use the leading and trailing edge of it for more accurate timing. For correct operation it is critical that the input capture edge, trigger angle and "angle between main and return" are specified correctly. For assistance in setting this up, attach crank timing tape to your damper and disconnect the coil, then enable "Middle LED Indicator" on the More Ignition page. (This means the middle LED will now show the state of the trigger input) Now rotate the engine with someone watching the middle LED. Expect it to light around 60BTDC and go out around 10BTDC. From the timing tape you can determine the trigger angle and in particular the number of degrees the LED is lit. Once we have some experience we will be able to list standard numbers here.
Ignition Input Capture (ICIgnOption Bits 0-3) is the ignition input signal event that should signal the base timing (Advance Offset) has been achieved.
It is important to note that this is the input signal as seen by the processor. In typical applications, you will be running the input signal from pin 24 through the optoisolator (4N25, U4) which inverts this signal, so you need to use the opposite of what the sensor/module puts out.
For example, the GM 7-pin HEI module takes the variable reluctor signal, and generates a positive going pulse when the base advance point is reached. In this case, the 'Falling Edge' is chosen, as the positive going transition is used as a trigger, but this is inverted by the 4N25 optoisolator, becoming the falling edge of the square wave at the processor.
If your are using the VR sensor circuit on the V3.0 main board:
Please note that most MS1-Extra installs using a crank
VR sensor (Ford, Vauxhall, etc,) would have been wired for TSEL to VROUTINV,
it is advisable to re-wire the link so it is TSEL to VROUT for an MS2,
then use RISING EDGE, if you don't re-wire it then use FALLING EDGE when
using a VR sensor.
Skip Pulses is the number of ignition pulses at startup that MegaSquirt-II (or MicroSquirt) uses to calculate the rpm before sending calculated advance signals. If the number is too small, you may see an RPM spike while cranking. Larger numbers of skip pulses will filter out RPM spikes, but increasing this number will cause the ECU to take a longer time before it gets an RPM reading and before it attempts to run.
Spark Output (spkout_hi_lo) 0 equals spark when low (ground).
Production MegaSquirt-II's do NOT have a transistor for ignition control on
the daughter card. This transistor inverted the processor output on the BETA
units. As a result, if you are using a production MegaSquirt-II and NO transistor
(99% of users) , the Spark Output needs to be Going High (reversed)
if using the VB921 driver (U16) for driving a coil directly!
See the relevant ignition option for your setup for more details on this setting, failure to set this correctly WILL damage your ECU!
Number of Coils is for selecting the type of ignition
style your engine has.
Single Coil is for applications which use a distributor and a single ignition coil
Wasted Spark is for a setup that fires 2 cylinders at the same time using a single coil, e.g. Ford Zetec.
Coil On Plug (COP) is for setups that have a separate coil for each cylinder.
Dual Dizzy is for setups with 2 distributors and 2 Coils (1 per dizzy) e.g. Lexus
Spark A Output Pin was originally set as JS10 in the B+G MS2 code, but in MS1-Extra we configured Spark A output for LED D14 (V3.0 or LED17 on a V2.2) so in MS2-Extra you can use either JS10 or the same as MS1-Extra (D14), it is recommended to use D14 for new installs incase JS10 becomes used for something else in the future.
More Ignition Options
Fixed Advance is used to hold the ignition timing that MS2-Extra controls to a fixed value. This is helpful for setting up your installation using a timing light. If you enter 10deg in the Timing for Fixed Angle and the timing as see on the crank with a strobe is out then you can alter the Trigger Angle or Angle for Tooth 1 depending on the setup until the timing is actually at 10deg. Once this has been set simply switch back to Use Table
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.
Maximum Dwell is the length of time the coil charges to make each spark. It has to be long enough to make a decent spark, but too long heats the coil unnecessarily. It is in milliseconds, since the time between spark is typically a few dozen or less milliseconds. For example, for a V8 at 600 rpm, the time between sparks is 25 milliseconds. At 6000 rpm the time is just 2.5 milliseconds.
Maximum Dwell Duration (ms) (max_coil_dur) is the longest period the coil is allowed to charge.
Please note that in some modes (e.g. EDIS) this sould be set to Fixed Duty as it is not charging the coil directly, it is simply sending a signal to the ignition module.
The coil charges when a current creates a magnetic filed in the coil (when the current stops and the field collapses, we get our spark). Our goal is to maximize the magnetic field energy, while minimizing the heat buildup. If you charge for too long you can burn out your coil, too short and the spark may be weak. Normally this value is between 2.0 and 4.0 milliseconds. For the GM HEI 'in-cap' coil, a value of 3.5 milliseconds is typical.
A couple of points are that few automotive coils are designed for more than about 6-6.5 Amps, and reduced coil resistance has been used to shorten dwell times as engine rpm limits have risen over the years (shorter dwells means higher rpms before the dwell is cut back), so as a result most coils are between 2.0 and 4.0 milliseconds, with a general trend towards shorter times for more recent designs and longer times for older designs (wasted spark and coil on plug can be different, of course, as they fire less often and thus don't get cut back until a much higher rpm).
For example, the older 7-pin HEI coil uses 3.5 milliseconds dwell, the newer 8-pin HEI external coil uses 2.5 milliseconds of dwell. Note that times longer than 4.0 milliseconds would mean the dwell is being reduced at as little as 2500 rpm, meaning longer dwell settings won't make the spark 'hotter'.
MegaSquirt-II attempts to set up a charge/ discharge cycle that charges the coil for the specified charge time, discharges it for at least the specified spark duration time, and then remains in the discharge state until it is time to start charging for the next cylinder. At high rpm, there may not be time to fit in the specified charge + discharge times. In this case, MegaSquirt-II (or MicroSquirt) scales down both the charge (max. dwell duration) and discharge (max. spark duration) times proportionally so they just fit within the time between tach pulses.
Note that this is all to do with physics and the properties of inductors, and not related to the VB921 (which does have a current limit of ~6.5 Amps as well)
There are four ways to set the dwell:
T = (-L/R) * ln( 1 - (R * I / E))
T = time (seconds)
L = inductance (Henrys)
R = resistance (Ohms)
E = voltage (Volts)
(ln is the 'natural logarithm, often available as 'LN' on calculators)
The current creates a magnetic field ("charging the coil"), and a change in magnetic field creates a current (we use that to make the spark). In order for the current to increase, it must increase the magnetic field. But if the magnetic filed is already saturated, the current can't increase (without wasting the same amount of energy as heat), so the current increases more slowly (and makes the coil hot). So typically you see a quick rise while the field builds, then a fairly suddenly change in the rate of rise (but still rising) when the field is saturated.
If the current was left to build, it would eventually reach the full DC value - if the coil didn't burn up first, of course. Note that the approach to 30 Amps is 'asymptotic', meaning it never quite gets there and you can't enter 30 Amps in the above example, you will get an error trying to find the natural logarithm. The magnetic field strength would not increase significantly though, and the spark would not be stronger.
2. Oscilloscope: If you have access to an oscilloscope and have installed R43 on a V3 main board (and you are using the VB921 direct coil driver), you can use the voltage drop across this 0.01 Ohm resistor to monitor the current flow through the coil. You are aiming to keep the dwell down to the point of where it just starts current limiting, which you will see as a 'bend' from a rising voltage towards a flat line in the voltage trace on the scope..The time at which that bend occurs should be the dwell point (though this is subjective). That tells you what the max dwell is for the VB921, but this isn't necessarily optimal for the coil.
To set the proper current limit for the coil, you can measure the voltage across R43 (with a scope, measuring the peak voltage at the top of the rise = peak current) and divide by R43's resistance (.01 Ohm) that's the current. For example, on an in-cap HEI coil and a dwell of 3.5 milliseconds, you would get:
1.9 division * 0.020 Volt/div / 0.01 = 3.8 Amps
This works well in the car. (It takes about 5.5 milliseconds dwell to reach the current limiting of the VB921 with this coil.) The way to set the dwell is to measure this current and set the dwell to the point at which the current reaches the 'proper value' for the coil (from the spec sheet, etc.). Now the hard part is knowing what the 'proper' value for the coil is. Some coils will have this listed as a spec (try googling). For others, you might assume the correct coil current is between 3 and 5 Amps, though there's often little evidence to choose a figure like this. If you don't know the 'proper value' then you can use trial and error to determine it (next).
There is a good article on dwell settings, with 'scope shots, here: www.tonyfoale.com/Articles/Ignition/Ignition.htm.
3. Trial and Error on the Vehicle: To set the dwell, you want to set it as low as you can without misfiring at idle. Generally this is between 2.0 and 4.0 milliseconds. If you start at 3.0 and have no misfires, try reducing it a bit (0.1 milliseconds) at a time until you get misfires, then raise it 0.2 milliseconds. If you get misfires at 3.0, raise it a bit at a time until the misfires are gone (then add 0.2 milliseconds). If this seems familiar, it is very similar to the process of setting the PWM% for low impedance injectors.
Do not use misfiring and high engine speeds and loads to set the dwell - misfires under those conditions will likely be caused by other factors, and will lead to you setting very long and damaging dwell periods. Recall that the dwell is shortened with higher rpm in any cases, so increasing the maximum dwell setting doesn't help at higher rpms. For example, with a 3.5 millisecond dwell time, and a 2.0 maximum spark duration, the rpm at which the dwell begins to be reduced is just 2727 rpm on a V8.
Do not increase the dwell to create a 'hotter' spark. Increasing the dwell above the 'saturation point' does not make a hotter spark, it only makes a hotter coil. For example, for a 2.5 millisecond saturation time, the current is increasing to it's maximum for 2.5 milliseconds. If this is 6 Amps, then the average current during this time is about 3 Amps. During this time, much of the energy being supplied is building the magnetic field. However, after 2.5 milliseconds (once saturation of the magnetic field is achieved), the current is a constant 6 Amps, all of which is heating the coil, so it presents a much larger load on the coil. So leaving the dwell too long is a problem. As well, the VB921 goes into current limiting mode if the current gets high (6.5 to 7.5 Amps). If the current is kept below the current limit, the VB921 should not heat up much at all. However, if run with a significant amount of current limiting, it heats up pretty fast (which can ruin it). That's why you should lower it as much as possible without misfires under normal operating conditions. If you need a hotter spark, you need another coil.
4. Other sources of information: Ask someone on the forums, look in a factory service manual, or google to see what might be reasonable dwell values for your coil. For example, the GM 7-pin HEI large cap coil should be 3.5 milliseconds, the GM 8-pin HEI external coil should be 2.5 milliseconds.
Note that you can not set dwell times with EDIS, the EDIS module does all the dwell control internally.
Acceleration Compensation (ms) is the amount of time added to the dwell duration when the accel enrichment is activated. Typical values are 0 - 1mS
Maximum Spark Duration (ms) (max_spk_dur) is the amount
of time MS2-Extra, MegaSquirt-II (or MicroSquirt) tries to wait before starting
another charging cycle. MS-II tries to fit the dwell time + max. spark duration
into the time between sparks. If it can fit them, then the full dwell time
is used. If the time is too short (because the rpm is high) to fit both the
dwell and the max.spark duration, then both are shortened proportionally.
If the max spark duration is too long, however, then the actual dwell value gets shortened at a lower rpm, limiting the spark energy at higher rpms. Typical values are between 1.5 and 2.0 milliseconds.
When using coil packs or COP's, in most cases, the ECU has to drive the tacho. The MS ECU can provided a simple pulsed output (50% Duty Cycle) that can be used to drive a transistor which in turn can be used to drive the tacho feed of some vehicles. The configuration of the hardware will depend on your rev counter. See the hardware section
Cold Ignition Advance
When an engine is cold, advancing the timing a little above the base map, can help the engine run smoother and idle faster, this can also aid warm-up times a little. The MS2-Extra code has a Cold Ignition Advance table for entering the advance you want added to the spark map when the engine is cold. This is an additional angle on top of the base spark map. So if your engine is running at 20deg BTDC then in the example below, at -18C there would be 4deg advance added to the spark angle, thus giving a total advance of 24deg. It is recommended that the final bin (the highest temp) have zero in it so above that temperature the base spark map is followed.
MAT Based Timing Retard
The inlet air temperature has a massive effect on how much advance you can safely run (especially on a boosted engine), if the temperature increases too much, due to sitting in traffic, long/hard runs in boost, etc, the amount of ignition advance can be retarded proportionately with the temp increase to help prevent detonation. The MS2-Extra code has a MAT Based Timing Retard table. This works in much the same way as the Cold Ignition Advance but it RETARDS the ignition from the base map to keep away from detonation. So in the example below, if the engine is running at 20deg on the base map, then at 93C the engine would be retarded to 18deg BTDC
Dwell Battery Correction
The amount of time (dwell) needed to charge the ignition coil(s), and thus maintain a good clean spark, changes depending on the voltage supply level present on the coil. Basically the more voltage present, the less time needed to charge the coil and visa-versa. This factor is compensated for by using the correction table. For 99% of uses the default settings are more than adaquate:
Advanced Ignition Option
Need help here :o)
you have a question, comment, or suggestion for these manuals please post it
on the forum
No part of this manual may be reproduced or changed without written permission from Philip Ringwood, James Murray, Ken Culver and Lance.