Megasquirting the 4.0

Megasquirting the 4.0

An introductory guide

I've been meaning to do a small write up on this subject for a while, since it is tedious to write the same things over and over again to people who have questions, and I figured this is a good place to link them. Some of you may know me from my build thread for my turbo Cherokee, which uses a Megasquirt MS3x. All the information here is based on my personal knowledge and experience, feel free to add or correct me if I have made a mistake.

Why Megasquirt?

It's cheap, supports a ton of OEM sensors, allows full control of your engine, gives you the ability to run different hardware with ease, has a large diy-oriented community, and has an enormous and detailed manual.
I will share my experience with MS2/Microsquirt and MS3, i have not used MS1, in my eyes it is outdated and there is no reason why you should choose it over MS2.
For starters there are 3 different factory ECUs used in XJs over the course of its production
  1. Renix 1987-1990
  2. SBEC2 1991-1995
  3. JTEC 1996-2001(used until 2004 on other models)
Megasquirt can replace all of these ECU's fairly easily, but some modifications must be done depending on which Megasquirt you plan on using in place of each of these factory ECUs.

Crankshaft and Camshaft Position Sensor

Out of all the sensor inputs in an EFI engine, the crankshaft position sensor (abbreviated CPS or CKP) is the most critical. An engine can run without any of the other sensors except for the CPS, though it will do so poorly without MAP, TPS, IAT etc.
There are three different types of crankshaft position sensors, but only two different types were used on the 4.0. A variable reluctance (VR) sensor is used on Renix 4.0s, while a hall-effect sensor is used on SBEC2/JTEC 4.0s. VR sensors output an analog AC sine wave signal, while hall sensors output a digital square wave signal. Sensors can be identified by the number of wires they have; VR sensors have two wires and hall sensors have three wires. Both sensor types will work with Megasquirt, but hall sensors are easier to configure. All factory hall sensors used on 4.0s need a pull-up resistor to work with Megasquirt. Camshaft position sensors are hall-effect for all years.
The crankshaft position sensor reads a pattern of teeth, vanes, or slots, which is fixed to the crankshaft in some way. These patterns differ based on engine and manufacturer, ranging from simple to complex depending on engine layout, ignition setup, misfire detection etc.
Through the crank trigger the ECU can to determine both engine speed and position. Some patterns are radially symmetrical and thus do not give the ECU the ability to decode engine position. In this case the camshaft position sensor (CMP) is used to decipher engine position, which is necessary for controlling ignition timing. The camshaft position sensor does allow the ECU to also determine which cycle cylinder 1 is on, allowing sequential injection and ignition.
Both the RENIX and SBEC2/JTEC patterns fall into this category and need the camshaft position sensors to operate.
A 'missing tooth' crank trigger is a common aftermarket option often used in high performance engines and EFI retrofits, and since there is a distinct irregularity in its pattern, the ECU can calculate speed and position, giving you the option to ditch the cam sensor or use it simply as a sync signal to allow sequential operation.
MS2/Microsquirt supports the Renix crank trigger pattern, SBEC2 and JTEC crank trigger pattern (they are the same) is not supported. You have the option of either using an aftermarket crank trigger setup with a generic pattern like 36-1, or you can swap to a Renix flex plate. The Renix flex plate will bolt up and work with with your starter and torque converter. I am unsure if the Hall sensor will work Renix flex plate, but you can use the Renix VR sensor, it also bolts in with no modifications.
MS3 works with both Renix and SBEC2/JTEC patterns, no modifications required.
In the tuning software Renix is labled 'Renix' and SBEC2/JTEC is labled 'Jeep2000'.
My custom 36-1 crank trigger, used with MS3x

MAP Sensor

The factory MAP sensor will work with any Megasquirt. Both MS2 and MS3 have their own built in map sensor, so you can eliminate the factory map sensor and run a vacuum line to the Megasquirt. The built in map sensor is a 2.5bar sensor capable of reading up to 21psi of boost. a 4 bar internal map sensor is an option capable of reading up to 44psi of boost. You have the option of running any external map sensor if those do not suit your needs. The Microsquirt does not come with a built in map sensor, so you can either run the factory map sensor, if you are staying N/A, or you can use an aftermarket MAP sensor. The GM style 2 and 3 bar are popular options with calibrations included in the tuning software.

Throttle Position Sensor

Any throttle position sensor is easily calibrated in the tuning software.

Temperature Sensors

Temperature sensor calibrations are included in the tuning software, under 'thermistor tables'. The correct calibrations for our Jeeps is 'Chrysler 85 up'. Other common sensor types are also pre-configured, such as GM, Ford, Toyota etc. You can also specify custom values for odd sensors.

Oxygen Sensors

All 4.0 Jeeps are equipped with a narrowband O2 sensor that measures the air fuel ratio (AFR) for closed loop fueling. California Emissions 4.0s have 2 O2 sensors that measure AFR. The downstream O2 sensors are only for emissions testing for OBD equipped factory ECUs, they are not necessary for performance builds with aftermarket ECUs. Narrowband sensors are only able to read rich or lean in regards to stoichiometric AFR, they cannot give you a numerical value. A wideband O2 sensor is much more useful for tuning, because it is able to tell you exactly what your AFR is within a certain range, typically 9:1 up to 20:1 AFR for gasoline.
Narrowband sensors can be wired directly to the megasquirt. Wideband sensors must have their own controller which outputs a 0-5v analog signal which can be read by the megasquirt.

Extra inputs

After wiring up the factory equipped sensors, you may have some leftover analog and digital inputs which can be used to log other parameters. This is especially true for the higher end MS3x and MS3Pro line of ECUs. Other things you may want to log are oil pressure, oil temp, fuel pressure, fuel compostion (flex fuel), trans temp, gear position, wheel speed, suspension travel etc. The possibilities are endless.

Ignition Outputs

From 1987-1999 the 4.0 was equipped with a single coil and a distributor. Only a single ignition output output is needed to operate this setup. 2000 and up 4.0s have a coil pack which sits directly on top of the spark plugs. This coil pack consists of three coils firing two plugs each. The coils are paired with cylinders which operate 360 degrees apart so the plugs fire once on the compression stroke and once on the exhaust stroke; this is known as a wasted spark ignition. Since there is only 3 coils, only 3 ignition outputs are needed. MS2, Microsquirt, and the base MS3 are only equipped with two ignition outputs by default. Two additional outputs can be repurposed as ignition outputs on Microsquirt for a total of four outputs. Four additional outputs are available on MS2 and MS3 with the addition of internal jumpers in the ECU, for a total of six outputs. MS3x and MS3Pro have 8 ignition output outputs, which allow you to run six individual coil packs in sequential operation. Both the factory ignition setups use standard “dumb” coils, which require full current to be delivered by the ignition driver. None of the Megasquirt ECUs can drive these coils directly without modification. The solution is to use an ignition module also known as an ignition amplifier. There are many OEM type solutions and a few aftermarket options. If you wish to use individual coil packs, GM LS round coils have their own built in ignition modules and can be driven directly by the Megasquirt. Coils with built in ignitors are known as “smart coils”. Renix 4.0s use a separate ignition module to drive the coil, so no modifications are required.

Injector outputs

The 4.0 uses sequential multi port fuel injection, at least for 91-06. This means each Injector has its own driver in the ECU and fires on its own, in sequence of the ignition firing order. MS2, Microsquirt and the base MS3 are equipped with only two injection outputs, with no option of using another output as an additional injection output. Each output is capable of driving up to six high impedance injectors each. Typically, for six injectors, you will divide the injectors over both outputs. On a microsquirt install I grouped the injectors for 1,3, and 5 together on output one and injectors 2,4, and 6 on output two. Grouping injectors together is called “batch firing”. MS3x and MS3pro ECUs have ten injector outputs, eight outputs are able to be used in sequence, while the other two are able to be used as an additional injection stage (able to run 6 injectors each), or to be repurposed as generic digital outputs. For example you can run 6 injectors sequentially like normal, and then you can have an additional injector or set of injectors if you have intense fueling demands.
SBEC2 and JTEC ECUs fire each injector by grounding the output. The injectors share a common power source. Renix ECUs work backwards, where all the injectors share a common ground and the ECU triggers them by supplying power. Megasquirt ECUs (and most other ECUs) work by grounding the signal, so the circuit must be modified for Jeeps originally equipped with Renix ECUs.
*High impedance vs low impedance injectors
All 4.0s are equipped with high impedance injectors from the factory. Low impedance injectors are uncommon, but do exist. The difference is the current required to fire them. High impedance injectors take a low current to fire and can be driven directly by Megasquirt. Low impedance injectors require a relatively high current to fire, and must be used with either an inline resistor, or a “peak and hold” driver module. Trying to directly drive low impedance injectors directly with a Megasquirt ECU (except MS3pro Ultimate) or a factory ECU can damage the injector drivers. You can check if an injector is high or low impedance by measuring the resistance between the two electrical contacts on the injector. High impedance injectors range from 10-14 ohms and low impedance injectors range from 2-4 ohms.

Idle Air Control Valve (IAC)

All 4.0s from 1987-2006 use a stepper idle control valve. This is a special type of motor which is able to move in very precise steps, allowing the ECU to know exactly how far open it is from its starting point. This gives the ECU the ability to control idle speed precisely and target a specific idle speed based on a set of conditions. The motor is powered by four wires, two of which drive the valve closed and the other two which drive the valve open. All Megasquirt ECUs, with the exception of microsquirt, support stepper idle control valves. Microsquirt requires a separate add on module to control stepper idle valves. MS2 and base MS3 require internal jumper wires to be added from the PCB to the connector to utilize the stepper motor outputs. MS3x and MS3pro come configured to drive stepper motors with no internal modifications. Wiring is simple, IAC1a and IAC1b get connected to one of the motor’s coils and IAC2a and IAC2b get connected to the other coil. You can check which pins are connected by testing continuity between them. It doesn’t matter which IAC output goes to which coil, this will simply change the polarity of the IAC, which is re-definable in the software anyway. If you don’t want to make internal modifications to your Megasquirt, or you have a Microsquirt, you can delete or block off the stepper idle valve and run a fast idle valve in its place. The fast idle valve has the disadvantage of only allowing two idle speeds, a high speed for warm up and a base idle which must be set by the idle screw.

Fuel pump output

This gets wired to your fuel pump relay, and it turns your fuel pump on when you turn the ignition on. You are able to specify how long your pump primes for, useful for lazy pumps.

Other Digital Outputs

If you end up with some leftover outputs, such as an ignition output if you are only running a single coil, you can re-purpose it. For example an output can be assigned to turn on your electric fan relay at a certain temperature, then turn it off again at another temperature. MS3x and MS3pro ECUs give you a ton of extra outputs which can be used for additional fuel pumps, intercooler pumps, fans, or any other on-off type outputs. All of these outputs can be activated automatically by any conditions that the ECU has access to, like RPM, MAP, TPS, wheel speed, temperature, duty cycle etc.

Alternator

On the Chrysler 4.0s (not sure about Renix) the alternator voltage was regulated by the ECU. Removing the ECU and neglecting the regulator will cause the alternator to overcharge which can result in damage to any of the electrical components in the system. Only MS3 ECUs are capable of regulating the alternator output voltage, with some added circuitry. In my opinion, it is easier to wire in an older Chrysler voltage regulator, which is simple and proven to work. This is sometimes done when the original ECU’s voltage regulator dies. Here is a link to a guide to wiring the external voltage regulator.

Gauges

When running the megasquirt as a standalone you have a few options for gauges. You can run standard aftermarket gauges, a digital dash, such as a racepak, or a diy dash, such as a Pi-dash or dash-kitten (funny name, I know). 97+ Jeep instrument clusters get most of their information via a Chrysler proprietary serial communication called CCD. This is not compatable with the CANBUS communication protocol used by megasquirt and many newer vehicles. As far as I know, there is no translator available.

Transmission

On all the AW4 equipped Cherokees, transmission control is done via a separate transmission control module. The transmission will shift normally without the factory ECU in place.
Well, that's my quick synopsis of Megasquirting the 4.0, If anyone thinks i should clarify or add anything let me know. I will add to this post as i see fit.

Back to blog

Leave a comment