MS2-Extra

General Documentation

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 standard 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.

Please Note:

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.
If you do have any suggestions or settings that work please let me know
Philip.Ringwood(at)ntlworld.com

 


What is MS2-Extra -- So whats the difference? -- Feature Comparison Table -- MS2-Extra Input Output Usage -- Spare Ports --


What is MS2/Extra and how do I Upgrade to the this code?

The MS2-Extra code is a version of firmware that has been developed by James Murray and Ken Culver. This code can be run on any version of B+G Megasquirt PCB (V1.0, 2.2 or 3.0) using the MS2 Daughterboard (HC9S12C64) microprocessor. It is based on the B+G's original MS2 code. It has many of the features currently enjoyed by the MS1-Extra code but it has greater accuracy, it can control stepper motor idle valves and can run many more different stock ignition setups than MS1-Extra or the standard MS2 mode can.

So whats the main difference between MS1-Extra and MS2-Extra?

While MS1/Extra built a wheel decoder on top of a distributor based control algorithm, MS2/Extra starts with an every tooth wheel decoder and adapts this behavior to work with distributors in addition to distributorless ignition systems. Here's what makes this different, and why this can improve your timing control. [I was tempted to write "Here's what makes this different, and why you should care." But that sounded a little too silly...]
The earliest OEM electronic distributor systems in the 1970s used mechanical timing controls. The Chrysler Electronic Control Unit, GM HEI, and Ford Duraspark all used a trigger wheel mounted to the distributor shaft with one tooth for each cylinder in the engine, all equally spaced. A variable reluctor (VR) sensor sitting detected when the tooth passed the sensor and triggered an ignition module to fire the coil. These systems lacked electronic timing control; instead, a mechanical system adjusted the spark advance in the distributor.
When manufacturers applied computerized control to their ignition timing, they kept many elements of the earlier distributor systems. The trigger wheel with a trigger per cylinder remained, although by this time these triggers might be holes in a disc to activate an optical sensor or vanes that passed through a Hall Effect sensor. Only this time, there was no centrifugal or vacuum advance.
These early computer controlled ignitions used a simple method for determining timing. The ECU would first calculate the necessary advance amount. Then it would wait for a trigger to pass under the sensor in the distributor. After getting the trigger signal, the ECU started a countdown to fire the coil after a pre-calculated time interval. A similar algorithm told the coil when to begin charging to control dwell time. The earliest version of MSnS used this same algorithm.
This timing method does not necessarily need a distributor trigger. A crank trigger with equally spaced teeth, using half as many teeth as the number of cylinders, could work just as well.
However, it wasn't long before manufacturers started coming up with other trigger mechanisms for electronic timing control. 1980s era Bosch Motronic systems, for example, use a 60 tooth crank trigger with two missing teeth.
MS1/Extra handles these types of distributor based ignitions with a wheel decoder that works as a front end to the distributor. The wheel decoder identifies which teeth on the wheel are functionally equivalent to distributor trigger points, and tells the distributor timing algorithm when to start its countdown. So on a six cylinder engine, the distributor timing algorithm would get triggered three times per crankshaft revolution. The distributor timing algorithm does not take the other teeth into account, as the wheel decoder could effectively make a 60-2 wheel look like a three tooth crank trigger as far as the distributor timing algorithm is concerned.
When MS1/Extra added support for direct coil control on distributorless ignitions, it treated each coil output like its own distributor. The wheel decoder would find the trigger tooth and start a countdown for each ignition output.
This system works well, but it's possible for the engine to change its RPM during the countdown enough to throw the timing off if the RPM changes rapidly. This can be a particularly bad problem during cranking. MS1/Extra added trigger return mode to handle cranking, where it would trigger off a particular tooth at cranking, with no countdown.
With enough processing power, it's possible to come up with a better wheel decoder: the every tooth wheel decoder. This is what MS2/Extra uses. Instead of triggering off the same tooth each time, an every tooth wheel decoder can pick which tooth will pass the sensor just before the spark must fire for any given amount of spark advance. It then can wait for that tooth and start a much shorter countdown, making for far more accurate ignition timing.
The every tooth wheel decoder has one other advantage if you are using a Hall Effect or optical sensor. It can detect both when the trigger tooth or window appears under the sensor, and when the tooth moves away from the sensor. This gives it an extra trigger point it can use if it has detailed measurements of the trigger width.

See HERE on how to install the MS2-Extra Code onto your MS2. Please read the MS2-Extra manuals to see how to setup the rest of the hardware needed to run your setup.



Feature comparison table

This is intended to be an accurate and fair comparison between codes, please advise if there are any errors.
MS2/Extra was based on MS2 2.6.

Feature

MS1

MS1/Extra

MS2/Microsquirt B&G

MS2/Extra 1.0

MS2/Extra 2.0

MS2/Extra 2.1

Fuel table size

8x8

12x12

12x12

12x12

12x12 or 16x16

12x12 or 16x16

PW resolution

100us

100us *

0.67us

0.67us

0.67us

0.67us

Injector control method

bit bang

bit bang*

hardware timer

hardware timer

hardware timer

hardware timer

rpm resolution

100 rpm

100 rpm

1 rpm

1 rpm

1 rpm

1 rpm

Accel enrichment

TPS based

TPS, MAP, RPM

Simple (TPS,MAP), X-Tau

Simple (TPS,MAP), EAE

Simple (TPS,MAP), EAE

Simple (TPS,MAP), EAE

Advance table size

No spark control

12x12

12x12

12x12

12x12

12x12

Advance resolution

N/A

0.3 deg

0.1 deg

0.1 deg

0.1 deg

0.1 deg

Spark control method

N/A

bit bang

hardware timer

bit bang*

bit bang*

bit bang*

EDIS

N

Y

Y

Y

Y

Y

Distributor spark

N

Y

Y

Y

Y

Y

Trigger return dizzy

N

Y

Y

N

Y

Y

Simple wheel decoding

N

Y

Y

Y

Y

Y

Every tooth wheel decoding

N

N

Y*

Y

Y*

Y*

Wasted spark

N

Y

N / Y*

Y

Y

Y

Coil on plug

N

Y

N / Y*

Y

Y

Y

Dual dizzy

N

Y

N

Y

Y

Y

Cam / 2nd tach input

N

Y

Y*

Y

Y

Y

Number of spark outputs

Nil

6

1 / 2*

4

4

6

Rotary trailing

N

Y

N

Y

Y

Y

HEI7, GMDIS

N

Y (with bypass control)

Y

Y

Y (with bypass control)

Y (with bypass control)

TFI

N

Y

Y (requires ini mods)

Y

Y

Y

Oddfire wheel decoder

N

Y

Y

N

N

Y

Oddfire dizzy

N

N

N

N

Y

Y

Neon/420A

N

Y

N

N

Y

Y

36-1+1

N

N

N

N

Y

Y

36-2-2-2

N

N

N

N

Y

Y

Subaru 6/7

N

N

N

N

Y

Y

IAW Weber-Marelli

N

N

N

N

Y (Untested!)

Y

Mitsubushi 6g72

N

N

N

N

Y

Y

4/1 CAS

N

Y

Probably

N

Y

Y

4G63 (Miata)

N

Y

N

N

Y

Y

99-00 Miata

N

N

N

N

Y

Y

Renix 44-2-2

N

Y

N

N

Y

Y

Twin trigger (aka. dual spark)

N

N

Y*

N

Y

Y

Suzuki Swift

N

Not with std code

N

N

Y

Y

Suzuki Vitara

N

N

N

N

Y (Untested!)

Y (Untested!)

Daihatsu 3 cyl

N

N

N

N

Y (Unproven)

Y (Unproven)

Daihatsu 4cyl

N

N

N

N

Y (Untested!)

Y (Untested!)

Rover K Series 36-1-1

N

N

N

N

Y (Untested!)

Y

Rover K Series 36-1-1-1-1

N

N

N

N

Y (Untested!)

Y

Rover K Series 36-2-2

N

N

N

N

Y (Untested!)

Y (Untested!)

Honda VTR1000 12-3

N

N

N

N

Y (Untested!)

Y

Chrysler 2.2/2.5

N

N

N

N

N

Y

GM 7X native

N

N

N

N

N

Y (Untested!)

Nissan 360 tooth CAS

N

N

N

N

N

Alpha code

Load methods

SD, AN

SD, AN, MAF

SD, AN, MAF, map/baro

SD, AN, map/baro (load%)

SD, AN, map/baro (load%)

SD, AN, map/baro (load%)

Load blending

N

Y?

Y

Y

Y

Y

Load tables

1

1

1

2

2

2

Staged injection (Like RX7 with single table and independant control over bank 1 and 2)

N

Y

N

Y

Y

Y

Over-run fuel cut

N

Y

N

Y

Y

Y

Tachometer output

N

Y

Y

Y

Y

Y

Launch Control/flat shift

N

Y

N

Y

Y

Y

Spark cut rev limit

N

Y

N

Y

Y

Y

Dwell duty%

N

Y

N

Y

Y

Y

Dwell battery correction

N

built-in

table of values

table of values

table of %ages

table of %ages

Cranking pulsewidth

2 point

table

table + corrections

table of %ages

table of %ages

table of %ages

Alternate cranking injection

N

N

N

Y

Y

Y

Specific cranking advance, dwell

N

Y

N

Y

Y

Y

Fixed timing for setup

N

Y

N

Y

Y

Y

Test mode

N

N

Injectors

Pump, Inj, Coils

Pump, Inj, Coils

Pump, Inj, Coils, Idle

Idle valve control

On/Off

On/Off, PWM

On/Off, PWM, Stepper

On/Off, PWM, Stepper

On/Off, PWM, Stepper

On/Off, PWM, Stepper

Closed loop idle control

N

Y (experimental)

N

N

Y

Y

Boost control

N

Open loop, experimental closed loop

N

N

Y

Y (open or closed loop with PID control)

Nitrous control

N

Y

Y (on/off only)

N

Y (2 stage)

Y (2 stage)

Knock sensor

N

Y

Y

Y

Y

Y

Realtime baro

N

Y

Y

Y

Y

Y

Water Injection

N

Y

N

N

N

N

Table Switching

N

Y

N

N

Y

Y

Shift lights

N

Y

Generic ports

Generic ports

Generic ports

Generic ports

Configurable outputs

N

Y

Y

Y

Y

Y

AFR target tables

N

Y

Y

Y

Y

Y

Automatic Mixture Control

N

N

Y

N

N

N

Dual fuel tables (per bank)

N

Y

Y

Y

Y

Y

Synchronous sensor sampling

N

N

Y

N

Y

Y

CAN communications

N

N

Y

Y (untested)

Y (untested)

Y

Crank based injection points

N

N

Y

N

Y

Y

Alpha-beta-gamma tracking filter

N

N

Y

N

N

N

Global ignition timing base control

N

N

Y

N

N

N

Built in tooth/trigger loggers

N

Y (tooth and trigger)

N

Partial

Partial

Y (tooth, trigger, composite)


* = see notes below

Explanation of the terms in the table

Fuel Table Size: The number of cells in the fuel tuning table. Note that because the rpm and load values are adjustable a good tuner is unlikely to need more than 12x12.

PW resolution: The step size of increments of fuel pulsewidth. In theory the smaller the step, the finer the control available. Whether this translates into better engine performance is largely impacted by how well the engine is tuned and operating factors. MS1/Extra hi-res allows better injector resolution by using a timer for injector control but loses injector PWM control in the process. Note that the fuel calcs will often have a lot of inbuilt fuzziness, so the 0.67us hardware precision may not be useful.

Injector control method: How the code technically controls the injector outputs. Hardware timer is better, but see the PW resolution comment.

RPM resolution: The MS1 codes only use rpm in steps of 100 internally, so this means you can only tune in 100rpm steps. Not a big deal.

Accel enrichment: There are various methods of responding to acceleration transients for best engine driveability.

Advance table size: All present Megasquirt versions with spark control use a 12x12 table for setting the advance at different loads and rpms.

Spark control method: How the code technically controls the spark output. The bit-bang spark outputs on MS2/Extra have been coded to have around 10us latency. So while this seems "worse" than MS2 on the face of it, the calculations that lead up to the commanded advance time may well have more error than the pure hardware accuracy, so the latency is not likely to be an issue. Also, while the code works to a 0.1deg resolution the resulting accuracy will depend on the wheel mode used, weight of flywheel, accuracy of engine acceleration and many other factors. There is also the ability of the tuner and tuning methods

EDIS: Ford's standalone ignition control system

Distributor spark: Simple spark control using a single coil and typically a distributor mounted pickup, crank mounted pickups can also be used.

Trigger return dizzy: Some distributors with hall effect sensors have a shutter wheel that provides “cranking” and “running” signals on each edge. This can give improved starting ability and also better running precision.

Simple wheel decoding: The MS1/Extra wheel decoder can decode regular wheel patterns (36-1, 24/2, 60-2, 24/1) but gains no timing improvement from the additional teeth. The early MS2 wheel decoder worked in a similar way.

Every tooth wheel decoding: The MS2/Extra code samples the time between each tooth for speed data and sets the advance/dwell as a tooth number plus a time offset. Unsure what MS2 base does.

Wasted spark: i.e. multiple spark outputs. Without modifications to the MS2 card, MS2 base code can only do single spark output. The modifications also remove the ability to control low-Z injectors using PWM - resistor packs would be required.

Coil on plug: As above, but additional code is required to decode the trigger wheel.

Dual Dizzy: For engines like the Lexus V8 where a trigger wheel and two coils and distributors are used.

Cam / 2nd tach input: For any coil on plug install a phase sensor is required. Any engine with a non-missing tooth main wheel also requires a 2nd tach input. MS2 can do this with modifications to the card. Microsquirt has it as standard.

Number of spark outputs: This determines how many coils you can drive.

Rotary trailing: Specific code to drive the trailing coils with programable split angles.

HEI7/GMDIS: An ignition system from GM. The bypass output controls inbuilt timing or controlled timing. A dedicated output alleviates the need for an external relay.

TFI: An ignition system from Ford.

Oddfire wheel decoder: Using a regular trigger wheel to drive coils on an oddfire engine that requires an angular offset between the outputs.

Oddfire dizzy: Some engines such as GM V6 use an oddfire pattern and a distributor. This code detects and works with the uneven pattern.

Neon/420A, 36-1+1, 36-2-2-2, Subaru 6/7, IAW Weber-Marelli, Mitsubushi 6G72, 99-00 Miata, Suzuki Swift, Suzuki Vitara, Daihatsu 3cyl, Daihatsu 4cyl: These are all special wheel decoders for these specific engine and trigger wheel patterns. See the main page for links to pages about these wheels.

CAS 4/1: This is handled as part of the wheel decoder.

Twin trigger / Dual spark: This is often used on 4 cylinder bike engines. A single lobe is mounted on the crank shaft and two pickup coils detect it passing. MS2 and MS2/Extra support this with different code implementations.

Load methods: SD = speed density, standard MAP sensor input. AN = alpha-N - TPS and RPM. MAF = using a Mass Air Flow sensor. Map/baro = a variant on speed density that better allows for altitude changes.

Load blending: Combining multiple load methods for smoother transition from idle to full load.

Load tables: How many load tables operate at one time.

Staged injection: Inspired by RX7 and similar. For use where two banks of dissimilar injectors are used. e.g. you can have a bank of small injectors for idling and low load and a second bank of large injectors for full load operation. The code automatically enables the second bank as and when required. This can greatly improve the fuel regulation under low load.

Over-run fuel cut: A standard feature in most fuel injection systems since the 1980s. Fuel can be cut off totally under heavy deceleration conditions to conserve fuel.

Tachometer output: When using a complex trigger wheel or wasted spark a special output is often required to drive the tachometer.

Launch control/flat shift: A “two step” rev limiter primarily used for racing.

Spark cut rev limiter: A method of limiting revs. It is far harsher than a simple engine-preserving fuel cut, but works very well for launch/flat shift.

Dwell duty%: For some ignition systems like TFI or MSD a percentage dwell output is required instead of a coil charge dwell. This allows various percentages to be set in software.

Dwell battery correction: As the supply voltage varies, the required dwell time also changes. Different methods for achieving this.

Cranking pulsewidth: How the fuel injected during cranking is controlled. A percentage table is supposed to allow first time setup as the number is scaled based on the injector size. The latest MS2 codes also take X-Tau, air density and flex fuel into account.

Alternate cranking injection: The standard scheme is to inject fuel once per ignition event. On large cylinder counts this can result in low precision and difficult start. This option allows the number of injections to be halved to allow better control.

Specific cranking advance, dwell: A specific setting for the cranking advance and dwell instead of a table lookup.

Fixed timing: A setting to lock the timing for easier first time setup and confirmation that the ignition system is working correctly.

Test mode: Various modes for testing system components without running the engine.

Idle valve control: Options for different types of fast idle valve.

Boost control: Mode to control the wastegate on a turbo to vary boost levels.

Nitrous control: Control system to only allow nitrous when certain conditions are met, add more fuel, retard the timing etc. also delay nitrous after launch.

Knock sensor: Take feedback from a knock sensor and retard the timing

Realtime baro: Input from a second map (pressure) sensor for continual barometric adjustment. Useful in mountainous regions. Not much use in the Netherlands.

Water injection: Specific system to control water injection solenoids and pumps.

Table Switching: An external switch input swaps the fuel or spark tables being used. Note - this is not for “economy vs race” that is a common misunderstanding of fuel injection systems and that is what your right foot is for. Valid examples are nitrous or swapped fuel.

Shift lights: MS1/Extra supports sequential shift lights. The MS2 based codes allow an on/off light.

Configurable outputs: Various on/off outputs for fans and warning lights etc.

AFR target tables: Using your wideband to target different mixtures and different rpm/loads.

Automatic Mixture Control: The ECU responds to the wideband input and adjusts the fuel VE table automatically. As an alternative use “VE Analyse Live” in the registered version of TunerStudio.

Dual Fuel tables (per bank): Another name is Dual table. Originally written for mapped water injection. Can also be used on V engines for different tuning on each bank. Do not confuse with staged injection.

Synchronous sensor sampling: The sensors are sampled at a particular crank angle. This gives far more repeatable response on the MAP sensor signal on most engines.

CAN communications: The MS2 and Microsquirt have CAN communications built in which allow communications with addon boards. ( See also here. )

Crank based injection points: Not entirely sure what this means. MS2/Extra 2.0 can do a semi-sequential which has improved the idle on 4G63 engines for sure.

Alpha-beta-gamma tracking filter: An advance method of predicting engine speed. Particularly of use on systems with low tooth counts such as distributors.

Global ignition timing base control: (This description may be inaccurate) A single control over all timing with no per-cylinder trim. If this is correct it applies to all existing Megasquirt.



MS2/Extra input/output pins usage and CPU/DIP40/DB37 cross reference - see here

 

If you have a question, comment, or suggestion for this FAQ please post it on the forum.
Last Updated: 03/11/2007 12:19:04

No part of this manual may be reproduced or changed without written permission from James Murray, Ken Culver and Philip Ringwood.