IntroductionThe Trigger Wheel mode is designed to support most
combinations of regular missing tooth wheels with or without a cam
signal. Other ignition modes are used to support irregular or OEM
specific wheel patterns.The table below lists all of the valid
combinations for trigger wheel. However some of the modes will
rarely be used.The most common are:36-1 on crank - many Fords36-1
on crank plus single tooth cam sensor - same60-2 on crank - many
vehicles with Bosch ECU, BMW, VW, Audi, Volvo, Vauxhall, Opel,
Peugeot etc.60-2 on crank plus single tooth cam sensor - same24
tooth on cam - many Japanese originated vehicles use the
Nippondenso 24 tooth CAS with differing numbers of 2nd trigger
teeth and sensors.Note - this table is for four-stroke piston
engines. Two stroke or rotaries only need 360 degrees of
information for full sequential and COP.Commonly used modes have
detailed sections on how to set them up. Unusual modes are not
documented in detail at this time.For initial setup and determining
tooth#1 angle on uncommon setups having timing marks or tape on
your crank pulley/damper covering the full 360 degrees will be
greatly helpful. Speed shops sell timing tape for a variety of
damper diameters. If your engine has no timing marks you do need to
add them. Just guessing at timing is a great way to damage an
engine.Running excessive timing under load will almost always cause
severe engine damage e.g. broken pistonsIt is essential that timing
is confirmed with a timing-light on EVERY install.Physical
wheelsSupportsSettings
Main wheelSecondary wheelSingle coilWasted
sparkWasted-COPCOPBatch/bank fireSemi-sequentialSequentialTrigger
wheel arrangementMain wheel speed2nd trig every rotation of
Missing tooth on crankNoneYYYNYYNSingle wheel with missing
toothCrankn/a
Missing tooth on camNoneYYYYYYYSingle wheel with missing
toothCamn/a
Missing tooth on crankSingle tooth on camYYYYYYYDual wheel with
missing toothCrankn/a
Missing tooth on crankLS2 4X, VW 2 wide/narrow or half-moon on
camYYYYYYYDual wheel with missing toothCrankn/a
Non-missing tooth on crankSingle tooth on crankYYYNYYNDual
wheelCrankCrank
Non-missing tooth on crankSingle tooth on camYYYYYYYDual
wheelCrankCam
Non-missing tooth on crankCam wheel with tooth per
cylinderYNNNYNNDual wheelCrankEvery Cylinder
Non-missing tooth on camSingle tooth on camYYYYYYYDual
wheelCamCam
Non-missing tooth on camSingle tooth on crankor two opposite
teeth on camYYYNYYNDual wheelCamCrank
Non-missing tooth on camCam wheel with tooth per
cylinderYNNNYNNDual wheelCamEvery Cylinder
Terminology notesMissing tooth- This is a regular wheel with a
group of "missing" teeth e.g. 12-1, 36-1, 36-2, 60-2on crank- the
wheel is rotating at crank speed, normally directly attached to the
crank pulley or flywheelon cam- the wheel is rotating at camshaft
or distributor speedSingle coil- a single coil and
distributorWasted spark- double ended coils (or a pair of coils)
that fire twice per cycleWasted-COP- a single coil per cylinder,
but firing twice per cycleCOP- a single coil per cylinder that
fires once per cycleBatch/bank fire- groups of injector fired at
once, not timed to a specific cylinder eventSemi-sequential-
injectors fired twice per cycle timed to cylinder eventsSequential-
each injector fires once per engine cycle timed to a specific
cylinder eventWheel namingThere does not appear to be universal
agreement on the way to name wheels, however in the Megasquirt
world, they will be named like the following examples.36-1. This
means a single wheel with place for 36 teeth and a single tooth
omitted. i.e. 35 teeth at 10 (360/36) degree spacing.36-2. This
means a single wheel with place for 36 teeth and a two adjacent
tooth omitted. i.e. 34 teeth at 10 (360/36) degree spacing.36-1-1.
This means a single wheel with place for 36 teeth and a two
non-adjacent single tooth omitted. This type of wheel is not
supported by this generic wheel decoder. It is supported as
Rover#136-2-2-2. This means a single wheel with place for 36 teeth
and a three sets of double missing teeth. This type of wheel is not
supported by this generic wheel decoder. It is supported as
36-2-2-2 with the specific OEM pattern required.24/1. This means 24
teeth (non-missing) on one wheel and a single tooth on a second
wheel.36-1/1. This means a one 36-1 wheel and a single tooth on a
second wheel.3+1. This means one wheel with 3 equally spaced teeth
and an additional tooth to indicate sync. (Supported somewhat as
Daihatsu 3cyl)
SettingsThe settings are inIgnition Options->Ignition
options/wheel decoder
Spark Mode- set to "Toothed Wheel"Trigger Angle/Offset- always
zeroAngle between main and return- n/aOddfire small angle- for
oddfire engines this specifies the smallest of the crank angles
between ignition eventsGM HEI/DIS options- n/a420A/NGC alternate
cam- n/aUse cam signal if available- n/aOddfire phasing- usually
"Alternate" but for Vmax use "Paired"Skip pulses- number of input
pulses at startup that are ignored before decoding begins. Safe to
leave at 3.Ignition Input Capture- see ignition pageSpark output-
see ignition pageNumber of coils- see ignition pageSpark hardware
in use- see ignition pageCam input- see ignition pageTrigger wheel
arrangement- see table above for correct settingsTrigger wheel
teeth- the number of effective teeth, counting the missing teeth as
if they existed. i.e. a 36-1 wheel has 35 physical teeth, but enter
36.Missing Teeth- the number of missing teeth. Common are1for 36-1,
or2for 60-2 or 36-2Tooth #1 angle- definition depends on whether
main wheel is missing or non-missing type. See sections below.Main
wheel speed- Does the main wheel rotate at crankshaft speed or
camshaft (distributor) speed.Second trigger active on- Like
ignition input capture above, specifies which voltage level is
considered "active"Level for phase 1- only applies in "Poll level"
mode. See Dual+Missing section.and every rotation of- how often are
second trigger input pulses received. See Dual Wheel sectionAll of
the settings on the right hand side of the page are general and
will be covered in the Ignition manual.
There are two main categories of install
-ExistingandRetrofit.ExistingIn this cases where you are fitting
Megasquirt to an engine already fitted with a trigger wheel, your
main task is to wire up the sensor(s), determine the tooth #1 angle
and wire up your coil(s). It should not normally be necessary to
alter the engine.RetrofitIf you have an engine that did not
originally come equipped with a trigger wheel (e.g. a distributor
based, pre-EFI engine) then you have to mount a wheel and sensor
and set the phasing correctly.For a typical car engine - go for a
36-1 wheel on the crank for non-sequential.or a 36-1 wheel on the
crank and a 50/50 cam tooth with gear-tooth hall sensor for full
sequential60-2 works great on most engines too, but is not advised
for very high rpms.For very high revving engines (such as
motorcycle engines) due to the number of teeth per second, 36-1,
24-1 or 12-1 are preferred.While the code can cope with any
sensor/tooth phasing, during cranking the rpms vary up and down
greatly as the engine rotates. It is desireable to place the
missing tooth such that it passes the sensor when the engine is
somewhat stable. The OEMs have found that certain tooth#1 angles
work well and it is worth following their lead.It is suggested to
align your wheel and sensor to arrive at the following tooth #1
angles. (See later for explanation of tooth#1.)4 cylinders ~90-120
deg6 cylinders ~50 deg8 cylinders ~40 degTake a look at the EDIS
pages for places to source used trigger wheels, sensors and
coilpacks. Note that you do NOT need the EDIS module, so later
('internal-EDIS') cars are useful donors too.Mounting the wheel is
quite critical in that itMUSTbe mounted so it rotates without
moving up, down, left or right as the sensor needs to see all of
the teeth with a gap of 0.75 - 1.0mm.Having mounted the wheel and
sensor, you can proceed for an existing install.
Sensors and wiringRefer to theignition pageandbuild manualfor
how to connect your crank and/or cam sensors.Spark outputsRefer to
theignition pagefor how to connect up your ignition module and
coils.
Missing tooth crank wheelThis is a very common configuration for
wasted spark with the most typical wheels being 36-1 (Ford) and
60-2 (Bosch.) Note that the missing teeth are in a single group -
if your wheel has multiple groups then you need a special wheel
decoder. Many custom decoders already exist e.g. 36-2-2-2 and the
one matching your wheel must be used instead of the 'generic'
trigger wheel mode.The Megasquirt-3 code benefits from a reasonable
number of teeth (hence 36 or 60) for best ignition timing accuracy.
Low tooth count wheels such as 4-1 are not advised.What is Tooth
#1Make sure you understand this!With the engine rotating in the
normal direction...
Tooth #1 is the first tooth to pass the sensor after the missing
tooth gap.We use the term "tooth#1" as it is consistent across
wheels with one, two, three or four missing teeth in the group.Once
the code knows the tooth#1 angle it automatically calculates other
needed information internally. (No need to manually enter trigger
teeth or delay teeth etc.)Clockwise rotation (normal) - method aSet
your engine at TDC, then count the number of GAPS to tooth#1 in the
direction of rotation (clockwise here) and multiply by the angular
size of the tooth.e.g. 8 teeth * 10 deg per tooth = 80 deg36-1
wheels are 10 deg per tooth (360 deg / 36 teeth)60-2 wheels are 6
deg per tooth (360 deg / 60 teeth)24-2 wheels are 15 deg per tooth
(360 deg / 24 teeth)
Clockwise rotation (normal) - method bA different way of looking
at the SAME phasing.Turn your engine so that tooth #1 aligns with
the sensor. Read off the tooth#1 angle from timing marks/tape on
the crank pulley.
Critical tuning software settings are inIgnition
Options->Ignition options/wheel decoder
Typical settings:Ford 4 cyl = 36-1, 80deg tooth #1Ford 6 cyl =
36-1, 50deg tooth #1Ford 8 cyl = 36-1, 40deg tooth #1Bosch 4 cyl
(Peugeot, Vauxhall) = 60-2, 114 deg tooth #1
Missing tooth cam wheelThis arrangement is not commonly used by
OEMs but does support full sequential with a single wheel and
sensor. Cam triggering is less accurate than crank triggering due
to timing belt or chain stretch.The Megasquirt-3 code benefits from
a reasonable number of teeth (hence 36 or 60) for best ignition
timing accuracy. Low tooth count wheels such as 8-1 are not
advised.The previous section on missing tooth crank wheel generally
applies when the wheel is mounted to the cam, but remember that one
rotation of the cam is 720 crank degrees. The settings are in crank
degrees. So a tooth#1 that is 8 gaps earlier than the sensor on a
36-1 wheel would give a 160deg tooth#1 angle (8 * 10 * 2 [for cam]
)Critical tuning software settings are inIgnition
Options->Ignition options/wheel decoder
Missing tooth crank wheel and single tooth cam wheelThis is an
very common arrangement that supports full sequential and coil on
plug. (For 50/50 half-moon or 4-window wide/narrow or other polled
cam wheels seethe next sub-section.)
The definition of tooth#1 is the same as the basic missing tooth
crank wheel and should be phased in the same way. Ensure you also
read thesection above. The cam input tells the code which engine
cycle/phase it is on. From the crank wheel alone the code knows
when cylinder one is at TDC, but it cannot distinguish TDC
compression or TDC exhaust. The cam sensor adds this information
which is why it needs to be one pulse only per engine cycle.The cam
signal is a single pulse usually generated by a narrow tooth, vane
or window. Technically it is edge triggered. For VR type sensors,
the edge setting will depend on the wiring you use (typically
Rising) as the signal is a very short pulse. For a hall type
sensors you need to ensure that the edge you choose matches up with
the phasing as below. (*Needs more explanation on how*)To confirm
correct cam sensor phasing proceed as follows.First, set your
engine at TDC compression #1
Now rotate the engine backwards to tooth#1The angle read off the
damper is the tooth#1 angle
Now rotate the engine backwards some more - this is the best
place for the cam tooth to pass the sensor.
The settings are inIgnition Options->Ignition options/wheel
decoder
Missing tooth crank wheel and polled (50/50 or half moon) cam
wheelThis is an fairly common arrangement that supports full
sequential and coil on plug. Here a missing tooth wheel is used on
the crank in the common way and a hall-effect or geartooth sensor
is used on the cam with a long tooth or window or vane. This gives
you the ability to have full sequential, but the engine syncs up as
fast as a regular missing tooth crank wheel.Different OEM
implementations exist - some engines use a 50/50 cam pattern,
Vauxhall red-top engines use a window in the distributor rotor that
spans the missing tooth region. Many newer engines with Bosch ECUs
utilise a 4 tooth wide/narrow cam trigger, this is used on some VW,
GM LS2 and some Mercedes. As far as the code is concerned these are
equivalent because it only 'looks at' (polls) the cam just after
the missing tooth.Typical polled cam triggers:4 tooth wide/narrow
type
e.g. GM LS2 4X / VW / Mercedes
Vane cup with single window
e.g. 1 window Bosch dizzy in Vauxhall red-top.
Half moon type
General arrangement
The missing tooth code uses the teeth of the missing tooth crank
wheel to create 'tach teeth'. That is, it creates a tach signal
from a particular tooth, then skips a number of teeth before
declaring another tooth a tach signal. This means that all the tach
teeth must correspond to real teeth. For a four stroke cycle
engine, this means that the total number of teeth, including
missing ones, must be evenly divisible by the number of cylinders
(or by the number of cylinders for a 2-stroke).In later versions of
the code (2.883+), the 'tach teeth' are still created for injection
events, etc., but instead of the ignition timing advance signal
being based entirely on the time after the last tach tooth (with
intervening teeth ignored), the timing is set by the counting
number of teeth, with only the amount between the last tooth and
the desired timing estimated.For example, if the engine had a 36-1
wheel, and 4 ignition events per revolution (i.e., a V8 with 90
intervals), then if this desired timing was 36 BTDC, the
calculation would look like:2.883+:timing calc=int*[(90-36)/90 (36
teeth/ 4 events)] + (mod**[(90-36)/90 9 teeth/event] last
individual tooth interval)***
=int[54/90 9 teeth/event] + (mod[54/90 9 teeth/event] last tooth
interval)
=int[5.4] + (0.4 teeth last tooth interval)
= 5 teeth + (0.4 last individual tooth interval)
old code:timing calc= [(90-36)/90] last tach tooth
interval***
= 54/90 last tach tooth interval
= 0.60 last tach tooth interval
*'int[...]' means truncate to in integer ("whole
number"),**'mod[...]' (short for 'modulus') means take the
remainder after dividing (i.e., the fractional portion),***interval
adjusted for , , prediction results.The net result is that the new
code estimates the timing interval over a much shorter period (1
tooth versus 9 teeth in the above example), making it more
accurate.
To set the Trigger wheel settings, go to 'Settings/Trigger Wheel
Settings' in MegaTune. There you will find: Trigger Wheel Teeth(M):
is the nominal (include missing) teeth for wheel decoding. (0=no
wheel decoding). Missing Teeth(N): Number of consecutive missing
teeth. Skip Teeth: Skip tooth is the number of teeth between "tach"
triggers. (It is the number of teeth skipped after the last tach
signal before MS-II calls a tooth a tach signal.) What you need to
have happen is for MegaSquirt-II to 'skip' a certain number of
teeth so the only the right number of teeth are counted as 'tach
signals' per revolution. In general, this is: 4-strokes:skip_teeth
= (2 M) / #cylinders 2-strokes:skip_teeth = (M) / #cylindersSome
permissible combinations are:Skip Teeth Setting
Wheel12-124-236-160-2
cylinders(4-stroke)
212243660
46121830
6481220
836915
10n/an/an/a12
1224610
n/a - cannot be used Delay Teeth: Number of teeth to delay after
1st tooth after the missing teeth before 1st tach synch declared.
You get synch as soon as you detect "first real tooth after the
missing tooth". If the piston for cylinder #1 is at TDC when that
'first' tooth is detected, then there is 0 delay. If TDC doesn't
occur until the next tooth is detected, then there is a delay of
one tooth, and so forth.
Thetrigger offsetis 0, if that tooth lies up perfectly with the
sensor at TDC.The best way to think about this is the delay teeth
is the 'coarse' setting, and the trigger offset is for fine
adjustment (less than one tooth) to account for minor sensor
misalignment. If the sensor is misaligned by more then one tooth,
the number of delay teeth should be changed, and the trigger offset
used to calibrate the advance as seen on a timing light with that
seen in MegaTune.For another example, with a 60-2 wheel, you would
have for settings: Trigger wheel teeth = 60, Missing teeth = 2,
Skip teeth = On a four cylinder four stroke engine, we want is two
tach events per revolution. Since we have determined the number of
tach signals we want is 2, we need to skip 60/2 = 30 teeth. For a
eight cylinder 60-2, we need 4 ignition events per revolution, so
we set skip teeth to 60/4 = 15. And for an eight cylinder 36-1
wheel, we would set skip teeth = 36/4 = 9. Delay teeth = depends on
the position of the sensor relative to the missing teeth at TDC for
cylinder #1.Note that you should change these parameters only with
the engine OFF (or the stim rpm at no more than 300 rpm).The
missing tooth wheel decoder has been tested up to at least 18000
rpm for 36-1 and 60-2 wheels (yes, 18 thousand rpm) on the bench,
and works fine.For testing the missing tooth decoder on the bench,
you may wish to use the crank wheel pulser. There is information on
that here:crank wheel pulser.Note that you must get the sensor
polarity correct for the missing tooth code. This is even more
important than with regular triggers, because if you get the signal
polarity reversed you will get two (n+1)*t missing tooth 'gaps',
instead of the desired one (n+1)*t gap (and the engine might not
run at all).
Theblue lineis the VR sensor output, thered lineis the output
from the VR input circuit to the processor.Note that the VR circuit
used in MicroSquirtand the MS-II/Sequencer controllers performs an
additional inversion on the VR signal before passing it to the
processor. The net result is that you have to use the opposite edge
to trigger off, compared to a MS-II controller with the V3 main
board. So where MS-II uses 'rising edge', you would use 'falling
edge' with MicroSquirtor the MS-II/Sequencer, and vice-versa.In
this case, an input capture setting of 'rising edge' is correct
('falling edge' for MicroSquirt/MS-II Sequencer).The proper
polarity will depend on the way you wire your VR sensor (swapping
the two leads to DB37 pin 24 and ground inverts the signal as seen
by the VR input circuit), as well as your input capture setting.
You may have to experiment to get them right if you don't have an
oscilloscope.In the code are two input variables to control the
interrupt masking to prevent false triggers:1. Time Mask,
(ICISR_tmask)time (msx10) after tach input capture during which
further interrupts are inhibited to mask coil ring or VR noise,
and2. Percentage Mask, (ICISR_pmask)percentage of the predicted
interval before the next tooth (dtpred) after tach input capture
during which further interrupts are inhibited to mask coil ring or
VR sensor noise.These are called thetime maskandpercentage mask,
respectively, in the ignition options dialog of MegaTune. For wheel
decoding you must use values close to 0.2 ms and 10%. However, to
not break any existing setups, the default values are 0 and 50%,
the same values hardwired into pre-v2.5 code.Be sure to adjust
these values when you set up for a trigger wheel(note that they are
in a separate dialog from the trigger wheel settings).In addition
to the above settings, you should set: Predictor Algorithmto last
interval, and Predictor Gainto zero.These are not needed because
the teeth are much closer together than 1 signal/cylinder, and
having them enabled only adds to the processor overhead.