Daytona Shelby Zone
Calgary, Alberta, Canada

September 11, 2001
Mind Reader
Music

June 2003 Update
Daytona Pictures
X91 Concept Car
Vehicle Details

ECM / Chem / Computers
Modifications
More Power
Maintenance / Diagnostics

Damaged Parts
Timeslips

Send E-mail

Main Site

 

A Basic Primer on ChEM

I’m going to start out as basic as possible, so excuse me if this seems painfully simplistic.

In the “old days”, car engines were pretty basic. In addition to the pistons moving in the cylinders, and the valves opening and closing with the camshaft, they had carburetors to mix air and fuel, and mechanical distributors and points.

Well, we still have many mechanical devices, but several things have changed. The changes began in the late 70’s and early 80’s. There were several reasons to change, but the primary ones were the biggest issues in the 70’s: fuel economy and emissions.

A carburetor has a simple function, but is a bit of a complex device. Its job is to meter fuel into the air that the engine is sucking in. Carbs came in different sizes to reflect different engine intake needs. Over the years, some extra things were attached to the carb so that eventually it was insanely complex. Things like the high idle on cold start, the kickdown for that, the heater that took high idle off quicker, feedback control, various vacuum nipples, it got complex.

Likewise the ignition system. A coil charges up when power is connected to it, when power is disconnected it discharges the power in what is hopefully a controlled spark. This used to be done with “points”, a mechanical switch inside the distributor. A mechanical advance uses centrifugal force in the distributor to change the advance, and a vacuum line to the intake manifold adjusted that. The distributor itself is a spinning rotor that makes an electrical connection from the coil to the spark plug that needs to be fired.

The whole entire equation of delivering fuel and spark were controlled mechanically, and mechanical things have a nasty habit of getting loose, or breaking, or bending. Cars used to need a “tune-up” every few thousand miles to adjust all of these things back to where the factory intended them to be.

But emissions controls and decent fuel economy require better control of the spark and fuel delivery, and computers were getting small and cheap through the 70’s and early 80’s. All vehicle manufacturers began using computers for the job.

The computer is able to run significantly more flexible programs than the mechanical parts, while reducing the actual number of parts. This computer, called the ECM or Engine Controller Module, is in charge of many functions in most cars, but the big two are delivery of fuel and spark.

Instead of a carburetor pouring fuel into the passing air, we have fuel injectors that squirt fuel directly into the cylinder. Instead of points, we have solid state Hall Effect pickups to tell the computer exactly where the crankshaft is relative to the engine. The computer uses the input from various sensors to determine when to allow fuel in through the injectors, and for how long to get the right amount. It also determines when to fire the spark plug.

Computers are only as good as the data that goes into them. The sensors that the computer relies on are critical. And we all want to modify our cars, so one way is to trick the computer. This means we can fool some of the sensors. An example of this is the zener diode trick, which allows the computer to use the MAP sensor normally to determine intake manifold pressure, but not “see” anything over a preset amount of boost. And some people remove their coolant temp sensors so the computer “thinks” the engine is cold, running it a slight bit richer.

With ChEM, however, we can change more fundamental aspects of the ECM.

From this point on, when I refer to “the ECM”, I mean the engine control computer from an 85-92 Chrysler turbo car.

Our ECM’s are different from the Ford and GM ones of the same era. GM and Ford used huge tables, big lists of numbers that the computer would look up a value from. For example, if the MAP sensor is reading 65, get the 65th number from the table and use it for the fuel flow. The Chrysler ones do it differently. Instead of an actual list of numbers, there are only a very few, and they say this: if the map sensor is reading higher than 40 but lower than 80, calculate the number from this “slope”. That means that a table that could take 1024 bytes on a GM computer might take 21 on a Chrysler ECM. Even though it is not technically a “table”, it’s a simple formula, we still call them tables for historical reasons.

The obvious application for this clever wizardry is more tables! Today we are totally spoiled by the low cost of data storage. Back in the 80s a 16K ROM was expensive, and the support circuitry required to address a huge ROM would have been pricey too.

So a Mopar ECM uses many tables, for almost everything. It has a table for the amount of advance to apply given the current MAP sensor value, it also has a table for the amount of advance based on RPM (mechanical advance). It has several different tables for each thing, sometimes. There is a different table for advance for a hot or cold engine, and for full throttle or part throttle.

Once we were able to figure out how the tables worked, we were able to display them graphically. ChEM allows you to view the tables from a ROM, and even view it side-by-side with a different calibration so you can see the changes.

Here’s an example of an ultra-simple table. For a given table, let’s say the return value from an input of 40 is 40, and the return value for an input of 80 is 80. If the input is 60, the ECM calculates that the intersection of the line from 40,40 to 80,80 is 60,60, so the return value should be 60. Stored in the ROM is the “slope” (mathematical term) of the line that goes from 40,40 to 80,80. All the ECM has to do is subtract 40 (start point) from 60 (desired value) to get 20. It then multiplies 20 by the “slope” of the line and adds the 40 return value that we started with. The end result is 60.

The sample table below contains 4 control points. Each has an "x" coordinate, a "y" coordinate, and a 2-byte value that indicates the angle from it to the next point. This entire table is stored in 15 bytes, and yet it can return the proper value for any of 256 different input values.

It is possible to move the “control points” anywhere we want, as long as we also recalculate the “slope” needed to get values that lie between the points. It’s tedious by hand, but ChEM does it automatically.

Changing the contents of a table by moving the control points is easy for a computer. ChEM will allow you to grab these control points with the mouse, and move them to where you want them.

The people who designed the ECMs created tables that, when displayed graphically, make sense. For example, this is a table that returns the desired amount of advance given the value of the MAP sensor. Viewing this table, you will see that the MAP input is the “x axis”, or left to right. The return value is above the center for advance, below the center for retard. You would be able to adjust the advance in a manner that makes sense... more advance is higher, less advance or more retard is lower, less manifold pressure (vacuum) is to the left, full boost is to the right.

The ECM has 3 different tables that determine the amount of advance to provide based on the MAP sensor. One is used on a cold motor, one is used on a warm motor with part throttle, and one is used for a warm motor at full throttle.

There are also 3 different tables used for the main fuel values. One is no throttle, one is part throttle, and one is full throttle. The ECM reads the MAP sensor and uses the table to get a number for the amount of TIME to turn the injectors on for. The higher the value on the chart, the longer the injector will be held open. It does other things with the data it retrieves from the tables before using them, though. For example, you know if you have an AF gauge that the display is always moving. That’s because the computer takes the number it gets from the table and adjusts it by a constantly changing variable to average the same amount of time running slightly rich and slightly lean.

We want our cars to go faster, and we already have the turbo ready to shove more air into the engine. But in order to take advantage of that in-rushing pressurized air, we need to provide more fuel. The injectors and programming included with the vehicle are usually just enough to reach the desired amount of boost. The computer is designed to manage a known constant: injector flow rate. The more an injector flows at a given fuel pressure, the less time it has to be held open to get the right amount of fuel in.

Prior to having tools like ChEM, the only ways to add more fuel for higher boost were:

  1. Increase fuel pressure (risky, requires a stronger fuel pump to maintain enough fuel pressure).

  2. Add extra injectors, switched on at various boost levels

  3. Install larger injectors, then reduce fuel pressure. Eventually it would be low enough so that the higher flow injectors matched what the ECM was expecting. Then, another fuel pressure regulator could be added that increased fuel available at higher boosts. The cost for this is already a few hundred dollars.

With ChEM, you can simply type in the size of the injectors you are about to install. ChEM calculates the changes to the fuel tables to provide the same amount, or within a few percent of the same amount (since the ECM is capable of adapting within a few percent, “close” is good enough for this). Or, you can view the table and deliberately scale the fuel tables “down” by a certain percentage.

Using ChEM to design a new calibration is great, but what do you do with it? Well, ChEM creates a .bin file, short for binary. Before you can customize your ECM, you need to replace the built-in EPROM (Erasable Programmable Read Only Memory) chip with a socket. Then you can have the binary image burned onto a new EPROM and plug it in.

The majority of electronics parts suppliers who can get blank EPROMs for you can also burn them, usually for a small fee. You can also buy a burner, or build one from a kit or one of several designs available on the Internet. Many electronics shops can also replace your EPROM with a socket, again for a small fee (this is labor intensive work).

There are also two other options being developed.

Flash ROM chips, just like in your computer’s motherboard, can be installed in the ECM. A custom program allows changes to be “flashed” into the ECM in twenty or thirty seconds. This is a great option for those who make the occasional change, or are tweaking their calibration. The estimated cost to modify an ECM to enable flashing is about $150 US.

The really exciting alteration uses either battery-backed RAM or FRAM. These are memory chips that can be plugged in and used exactly like EPROMs, but can also be written to, one byte at a time. ChEM will be able to modify table data instantly, even on a running engine. This would be an excellent option for tuners, since they can optimize a calibration for a specific vehicle, then create a slightly more permanent EPROM or Flash image. Both battery-backed RAM and FRAM chips are designed to be good for ten years or more. The estimated cost to modify an ECM to enable this capability is about $300 US.

ECMs and Model Years

The ECMs used over the various production years used different processors, ran at different speeds, and had support chip changes. But generally, they are running the same program. The table data looks and operates exactly the same, and tables can actually be copied or compared from one year to another.

1985 and 1986 used a 6803 processor, and had two 8K ROM chips. The apparent attempt of the designers was to have one “code” chip with all the code, and one “data” chip which could be modified.

1987 moved to a single 16K ROM, and added a hardware timer for such things as injector firing times.

1988 changed to the SMEC, or single-module engine controller. This year saw the logic module moved from the passenger compartment to the engine compartment, and sandwiched in with the power module. The processor was changed from a 6803 to a 6811, although it runs the same code. Several changes were made to the program to handle the difference in hardware. For example, the code instructions used to turn an injector on or off is changed, but the result is the same.

1988 is also the year that the logic board changed from a relatively simple hand-drawn printed circuit board to a more complex computer designed board, with surface mount chips. This makes it more difficult to modify, however the EPROM chip is still accessible.

More importantly, 1988 is the year that they began “potting” the logic module. This means that once the board had passed its testing, it was encased in a clear compound that looks like silicon seal. In order to access the components, you need to remove some of this layer of goo. It becomes difficult when you realize that it has all been sitting for at least 13 years now, some has hardened, some has crumbled, most is still flexible and pliant. You have to be extremely careful not to damage the board by using any sharp tools, too. And the potting is there for a reason, so you need to replace much of it after modifying the board.

1989 marked the last major change. The logic and power modules were placed on the same board, making it a SBEC (Single Board Engine Controller). Although it makes more sense from a mass-production and warranty issue point of view, to us it becomes a hassle. Again, the entire package is potted, and it is difficult to get access to the board.

So, there are actually four distinctly different ECMs in use that we are concerned about (we can ignore the non-turbo ones for now, although they are very similar). 85-86 was the “2-ROM 2-piece”, 87 was the “Single-ROM 2-piece”, 1988 was the SMEC, and 1989 and later were the SBEC.

Other differences between the years are not an issue. For example, an 87 T1 uses a 2 wire AIS motor, the T2 used 4-wire. But the logic module itself is totally unchanged. The difference is strictly the wires connected to the logic module, and the software on the EPROM.

To emphasize: a 1987 Turbo ECM is the same for T1 or T2, the ONLY difference is in the car, and the software. This means there is absolutely nothing wrong with using a T1 logic module to control a T2 engine (with the ROM chip changed, of course).

Also, the communications protocols between the years are identical. This is because Chrysler didn’t want to have to develop a different diagnostic tool for each year. The locations of the important data in the ECM are different, but ChEM is able to communicate with all years of 2.2 and 2.5 turbos. Remember this: even the 1992 SBECs have “Copyright 1985” embedded in them.

How the ECM works

This is a very simple overview of just how the software in the ECMs actually works.

First, there is the sensing loop. This is the main code that is running all the time that the ignition switch is turned on. Mostly, all it does is constantly monitor the sensor inputs, and store the values in memory. Sometimes, this requires a little effort. For example, the coolant temp sensor has two distinct “ranges”, and determining the actual temperature requires that the ECM use two different tables to calculate it. Sometimes, when monitoring the voltage, it turns the alternator on or off to keep the voltage stable. And sometimes, it adjusts the wastegate door position to control boost. Also the idle speed is tracked here.

The target idle speed is based on engine temperature over time, which is why when you first start the engine it idles at 1500 RPM, then gradually decreases down to the warm speed of about 950 RPM. To increase the idle speed a tad, the AIS motor is energized to open the bypass hole a single step at a time. Likewise, to decrease speed the AIS motor closes the hole a single step.

Every once in a while, this monitoring loop is interrupted. This is a hardware interrupt, which means that no matter what the ECM happens to be doing, the code for the interrupt IS executed (previously, someone who ought to know better claimed that these ECMs were not interrupt driven). Every time the Hall Effect pickup crosses the zero-degree mark, it interrupts the processor to tell it so. The ECM counts the time taken between these interrupts, which tells it the exact speed of the engine. The speed of each engine rotation is used as the basis for timing events during the next revolution.

From here, it’s all basic arithmetic. The processor works at an exact number of operations per second (one million per second up to 1987), which means it can calculate when it needs to do something with tremendous accuracy compared to the old mechanical engine controls. After determining the amount of fuel needed for each cylinder and the amount of advance for each cylinder, it simply idles around sampling sensors until it is time to turn an injector on or off, or fire the coil to create a spark.

By today’s computer standards, this is rather pathetic. After all, there are 192 bytes of RAM (compared to 512 million bytes in my PC), and the clock speed is one million per second (compared to 866 million in my PC). The Operating System all fits into 16K of ROM (compared to my PC, which has almost a billion bytes of Operating System... thanks, Microsoft).

But: the ECM was about as optimized as it is possible to be. It was all written in machine language, and no doubt it was optimized by hand. Every bit and byte has meaning, there is virtually no waste of any sort. Since I am a computer programmer myself, I can verify that since we have all this power, we do tend to waste a large amount of it. Waste was not allowed in these ECMs. To put this in perspective, we all know that Windows programs (exe files) are usually at least a few hundred thousand bytes long. But there is at least one product on the market that is all hand-optimized machine language, and his complete programs are around thirty thousand bytes, including graphics and text.

In addition to the duration of time required to fire an injector to get the correct amount of fuel into each cylinder, the designers also had to measure and account for how long it takes an injector to open and close. These times are extremely brief, but they make a difference. This is why some different brands of injectors will require more changes than simply altering the fuel tables.

Future Trends

Current vehicles use a vastly more complex computer. It is actually a piece of hardware rivaling your PC for power and speed. More data flows in and out of it, using industry-standard protocols and security “anti-tamper” programs on the ROMs. Presumably, this is to prevent people from doing exactly what we are doing: altering the program. In fact, most actually have Flash ROMs in them, and they do a lot more than simply running the engine. In a modern Mopar product, the computer controls almost every aspect of the vehicle, and can be reprogrammed to enable or disable such features as automatic door locks or alarm codes.

At the risk of sounding like an advocate of techo-geekdom, we have only begun the revolution that computers will bring to vehicles. Eventually, every sensor, actuator, and even light bulb will be connected to the computer using a single wire. They will all operate the same as a network. When you press the brake pedal, the computer will send a message to the proper bulb sockets to turn on. Unlike today where there is a brake light switch turning the lights on directly, in the future there will be just one wire to all things. This will eliminate the bulky harness that is currently an extremely expensive part of building a vehicle.

Also in the future, engine valves will be electrically actuated. This will allow the computer to control valve timing, and will contribute greatly to making a LOT more power out of less fuel and smaller displacement engines. It will also eliminate the timing belt (with its associated pulleys, tensioners, and potential for breakage).

Compared to what is shipping now, and what will appear in the next twenty years, our ECMs are stone-age, only a slight improvement over the old mechanical systems. Most of the components, including the processor, several support chips, even the 16K EPROMs, are discontinued and gone. However, these cars are our hobbies, and we will maintain their original methods of operation. If we need a new CPU, we can actually use a modern CPU “emulating” the 6803.

There’s just something about the sound of a 2.2 or 2.5 the way the factory shipped it that feels good. It’s a thrumming, rumbling, not 100% efficient sound that reminds us of the muscle cars from a bygone age, those same muscle cars that we enjoy humiliating in a race, and yet many of us would like to own. So I personally would like to keep my car running as though it was stock, but greatly improve the available power.