MegaManual Index -- Tuning Theory -- Tuning Software -- Using MegaTune
Setting the Constants -- Before Starting Your Engine -- Get the Engine Started and Idling -- Setting the PWM Criteria
Setting the Cold Start and Warm-Up Enrichments -- Setting the VE Table -- Tuning with Alpha-N Table -- Idle Pulse Width
Datalogging and MSTweak3000 -- Setting the Acceleration Enrichments -- Check Certain Resistors -- Tuning Issues
Tuning for Economy -- Tuning for Emissions -- Other Tuning Software and Platforms
MegaView

Tuning Your MegaSquirt

Now that you have assembled, tested, and installed your MegaSquirt, you need to get your engine started and tuned. This is not too difficult if you work methodically, and do not let your enthusiasm prod you into a premature full-throttle melt-down. It does help if the engine was running before the conversion, and does not need a pile of tune-up/rebuild parts.

Read this entire tuning section first, before attempting to start or tune your car. There may be some later passages that will help you in earlier steps, depending on your installation details. You will get the 'big picture', and the tuning process should make more sense to you. Reread this section if necessary.

When you do your conversion, it helps if you can hook the fuel injection up (sitting on the fender) except for the actual injectors, while still running the engine on its original fuel system. This allows you to start the engine and verify that the temperature sensors, TPS sensor, the O2 sensor, fuel pump, etc., work as expected. It will ease your mind when you proceed to running on MegaSquirt. If you have a running engine, it is something you might consider.

Tuning Theory

Tuning involves setting all the parameters that MegaSquirt uses to be optimal for your engine, injection, and driving. These include things like cold start pulse widths and acceleration enrichments. The most fundamental parameters are in the 8×8 volumetric efficiency table.

In general, this is all much easier to understand when you are working on a running engine. Trying to estimate what your engine will specifically need beforehand can be more confusing than productive. It is worthwhile exercise to understand the requirements, but always remember that ultimately you will rely on your “seat of the pants” and O2 sensor (as well as drag strip times, exhaust gas temperature sensors, etc. etc., if you have them available) to tune your engine.

Remember that people tuned engines for maximum performance and efficiency for many years with carburetors without any quantitative feedback at all. They often got very good results The O2 sensor and MSTweak3000 make tuning much easier. By the time you have had a few sessions with MSTweak, you will have a better idea of how to tune the remaining areas.

When tuning:

If you have a settings file from someone else's similar configuration, by all means use it as a start. Using other people's settings and tables is a reasonable starting point for tuning. However, no-one should ever assume another person's table is totally right for their engine, even if it is seemingly identical. The reason is that the tolerance build-up of variables makes things different. Small changes (within acceptable tolerances) in injector flow rates, regulated fuel pressure, MAP sensor output, etc., etc., etc., can add up to needing quite different settings and tables. This is especially true of the more subjective parameters, like accel enrichment, and those that interact, like afterstart enrichmnet and warm-up enrichment.

Note that in this manual we assume you are running gasoline. However, other fuels have different Air/Fuel Ratio (AFR) requirements. Below is a chart of the equivalent air/fuel ratios for several popular fuels:

Air/Fuel Ratio Equivalents

Lambda

Gasoline

Propane

Methanol

Ethanol

Diesel

0.70

10.3

11.0

4.5

6.3

10.2

0.75

11.0

11.8

4.9

6.8

10.9

0.80

11.8

12.5

5.2

7.2

11.6

0.85

12.5

13.3

5.5

7.7

12.3

0.90

13.2

14.1

5.8

8.1

13.1

0.95

14.0

14.9

6.1

8.6

13.8

1.00

14.7

15.7

6.5

9.0

14.5

1.05

15.4

16.5

6.8

9.5

15.2

1.10

16.2

17.2

7.1

9.9

16.0

1.15

16.9

18.0

7.4

10.4

16.7

1.20

17.6

18.8

7.8

10.8

17.4

1.25

18.4

19.6

8.1

11.3

18.1

1.30

19.1

20.4

8.4

11.7

18.9

Lambda is the ratio of a given AFR (air/fuel ratio) to the stoichiometric AFR for that fuel. So if a gasoline engine is rich, say 12.5:1, lambda is:



12.5:1 ÷ 14.7:1 = 0.85


Tuning Software

There are a few software applications to help you tune and configure your MegaSquirt.

Download these programs by clicking on their links above.



Note: If you get a pop-up message stating,
Component 'COMDLG32.OCX' or one of its dependencies is not correctly registered: a file is missing or invalid.
you need to download this file and/or register it.

To fix this error,

  • download COMDLG32.OCX You can download COMDLG32.OCX from:

    http://www.e-systems.ro/download-ocx/comdlg32.ocx/


  • copy it into the \Windows\System directory (Win 9x/Me) or \Windows\System32 (WinXP) directory.
  • open the run dialog box using "Start Run..." and enter:
    Regsvr32 c:\windows\SystemXX\comdlg32.ocx
    to register the file. (SystemXX should match the directory to which you saved the file)

To tune all the parameters of MegaSquirt so that your engine runs the best it can, you will need to do the following:

  1. First, learn to use MegaTune (or MegaTunix),
  2. Next, set the constants,
  3. Get the engine started and idling,
  4. Then set the PWM criteria,
  5. Then set the cold start and warm-up enrichments,
  6. Then set the VE table,
  7. Set the acceleration enrichments,
  8. Check that certain resistors are not getting too hot while driving.

We will go through each of these steps in turn.

Using MegaTune

MegaTune is the Windows 95 and later configuration editor for the MegaSquirt EFI controller. You can download the latest version from the MS Forums file download section at:



http://www.msefi.com/dload.php?action=category&cat_id=26.

MegaTune allows all of the parameters to be modified and has a real-time VE table editor, which allows a vehicle passenger to tune the engine while driving.

Note that instead of MegaTune, you can use MegaTunix tuning/datalogging software for Linux, Unix and Mac OS-X (and now cross-compiled for Windows) for tuning your MegaSquirt.

The front page shows eight gauges, the left four of which are the major inputs to MegaSquirt and the last four are the output pulse width and resulting duty cycle for the two injector banks.



Pulse width is the measure in milliseconds (1/1000 of a second) of how long the injector is opened for each pulse, regardless of how many times it is opened in a cycle. Duty cycle gives the percentage of time the injector is open irrespective of individual pulse duration.

The bar gauge across the bottom of the window shows the oxygen sensor reading. The scale is determined by egoGauge value in the Tuning section of the megatune.ini file. This same setting controls the analog and bar gauges on the tuning page. The first value of this setting controls the lowest voltage displayed on the gauges, the second number controls the highest and the optional third value specifies the “alert” value, above which the LEDs are red. The bottom of the front page contains a status bar. The current file name (used for Save operations) is displayed in the left part of the status bar, followed by “saved” status. When the memory image has been modified since the last Open or Save operation, this entry shows “SAVED” in bold face.

MegaTune allows you to save and restore configurations as files. Use the "Open", "Save" and "Save As" menu items to do this.

You should check that MegaTune reads approximately the correct barometric pressure when no vacuum is applied (i.e. the engine isn't running). Below is a chart of the 'normal' barometric pressures for various geographic elevations. MegaSquirt should generally be within 4 or 5 kPa of the value below for your elevation. If it is significantly different, check that you have the correct ".inc" files loaded for MegaTune. See the MegaTune help file for more details.



Barometric Pressure vs. Elevation


Elevation Above Sea Level

Atmospheric Pressure

Feet

Meters

kiloPascals
(kPa)

example

0

0

101.33

New York, Vancouver, Washington

500

153

99.49

Dallas (435 feet), Detroit (585 feet)

1000

305

97.63

Geneva (1230 feet), Kelowna (1129 feet)

1500

458

95.91

Helena (1404 feet), Wichita (1290 feet),

2000

610

94.19

Canberra (1886 feet), Las Vegas (2030 feet), Regina (1893 feet)

2500

763

92.46

3000

915

90.81

Red Deer (2968 feet)

3500

1068

89.15

Brasilia (3480 feet), Calgary (3750 feet)

4000

1220

87.49

4500

1373

85.91

Banff (4500 feet)

5000

1526

84.33

Albuquerque (4945 feet), Denver (5280 feet)

6000

1831

81.22

Colorado Springs (5890 feet)

7000

2136

78.19

Mexico City (~7200 feet)

8000

2441

75.22

9000

2746

72.40

10,000

3050

69.64

15,000

4577

57.16

La Paz (13,169 feet), Mauna Kea (~14,000 feet)

Note that weather reports usually report the barometric pressure 'corrected' to read as if 101.3 kPa was the 'normal' for your elevation. Do not expect these reports to correspond to what you get on MegaSquirt unless you are at sea level.

Setting the Constants

Before attempting to start your MegaSquirt equipped engine, you will need to set a number of parameters that determine how MegaSquirt injects fuel. These include the injector open time, Req_Fuel, injector control criteria, PWM criteria, EGO characteristics, etc. These constants are either calculated, or based on the configuration of your system.

Note that for a Wankel rotary engine (Mazda 13B, etc.), see the MegaSquirt & Rotary Engines document for settings and other advice.



On the Settings/Constants page:

If you are running high-impedance injectors (greater than 10 Ohms), then set the:

If you have low impedance injectors (less than 4 Ohms), set the:

You will tune these after getting the engine running. See “Setting the PWM Criteria” in this section. Failure to perform these steps can result in damage to your injectors. If you have high-impedance injectors, set these values to 25.4 ms and 100%, and you do not need to tune them further.

Control Algorithm” lets you choose between Speed Density and Alpha-N. In all cases, you should choose speed density unless you have a good reason to do otherwise, and understand how this will change your tuning efforts. All tuning advice in this manual is based on the speed-density algorithm. Alpha-N uses the throttle position (alpha) and RPM (N) to calculate the amount of fuel to inject as opposed to using the manifold absolute pressure (MAP) and RPM to calculate the amount of fuel to inject. Alpha-N is useful for long duration cams where the resolution of manifold air pressure (map) would be small. It is also useful to get smoother idle on engines that have erratic map values. MegaSquirt be converted from its default speed-density calculations to Alpha-N which uses RPM, temperature and TPS only. You must have version 2.0 (or higher) of the embedded software installed. Start up the tuning software, go to the Constants dialog and change speed density to Alpha-N. Re-map your VE table. You will no longer use the MAP sensor for estimating the load on the engine -- the throttle position and rpm are used instead. This can help with cams with long duration and/or a lot of overlap, as they have low and variable vacuum at idle, making tuning very difficult.

Required Fuel – (Req_Fuel) this is top field of the Constants window. It has a calculation dialog to help you find an appropriate value. It should contain the injector pulse width, in milliseconds, required to supply the fuel for a single injection event at stoichiometric combustion and 100% volumetric efficiency.

In order to come up with this value, MegaTune provides a calculator that will suffice for 99% of applications (those for which it will not work generally require changes to the MegaSquirt controller code itself, and that is beyond the scope of this manual). To use the calculator, click on the Required Fuel button, and fill in the fields (Engine Displacement, Number of cylinders, Injector flow, and Air:Fuel ratio, then click 'Okay').

For a 4-stroke, a complete stroke cycle is 720 degrees of crankshaft rotation (i.e. two revolutions); for a 2-stroke, it is 360 degrees (this is also factored in the REQ_FUEL value down loaded to MegaSquirt).

In the tuning software, the upper REQ_FUEL box is the amount per cylinder, as noted above. The lower REQ_FUEL box is the value down loaded to MegaSquirt. It is the REQ_FUEL number on top, but scaled by your selected injection mode (number of squirts and alternate/simultaneous).

For example, if you inject simultaneous and one injection, and have the same number of injectors as cylinders [i.e. port injection], then REQ_FUEL on the bottom is the same as REQ_FUEL on top. Same with alternate and two squirts. If you put in simultaneous and two squirts, then REQ_FUEL is divided in half - because you squirt twice, you need to inject 1/2 the fuel on each shot.

Injector Opening Time (ms) is the amount of time required for the injector to go from a fully closed state to a fully opened state when a 13.2 volt signal is applied. Since fuel injectors are electro-mechanical devices with mass, they have latency between the time a signal is applied and the time they are in steady-state spraying mode. Typically, this value is very close to 1.0 milliseconds.

The current MegaSquirt controller code assumes that NO fuel is injected during the opening (and closing) phases. However, it is very likely that a small amount actually is injected. Thus making this value larger will enrich the mix and will have a much greater effect at low pulse widths. MegaSquirt also uses this value as an additive constant in pulse width calculation, thus making this the lower limit for pulse width.

Injections per Engine Cycle is set the number of squirts you want per engine cycle. You want this to be set so that your idle pulse width is no less than 2.0 ms, if possible, and your Req_Fuel is less than 12-15 milliseconds, but more than 8 milliseconds. These values allow proper tuning of the idle mixture while maintaining the ability to apply enrichments (acceleration, warm-up, etc.) under full throttle. This is the total injector events that you wish to occur for every engine cycle (360 degrees for two stroke engines and 720° for four strokes).

Injector Staging values for injector staging are simultaneous or alternating. If you want all your injectors to fire at once, select simultaneous. If you want half your injectors to fire at each injection event, and the other half on the next event, select alternating.

Note that with port injection, you must choose at at least 2 squirts per cycle with alternating injection, otherwise every other cycle for each cylinder will get NO fuel! The engine will run very badly.

There is some benefit to choosing 2 squirts/alternating for port injection, since only half of the injectors fire at once, the pressure drop in the fuel rails is reduced and the fuelling is more consistent.

With throttle body injection, the number of injection/cycle you can will depend on your number of cylinders, plenum size, Req_Fuel, etc. You have to experiment to see what works best for your combination.

Engine Stroke values for engine stroke type are two-stroke or four-stroke. MegaSquirt uses engine stroke to determine how many degrees are in an engine cycle.

Number of Cylinders is the count of the cylinders on your engine. If you are unsure how many cylinders your engine has, you should not be installing MegaSquirt on it. This value is actually the number if ignition events per cycle sent to the ignition input on the controller.

Injector Port Type is used to select the type of injectors that you are using, throttle body or multi-port.

Number of Injectors is the total number of injectors MegaSquirt is controlling, whether port or throttle body injection.

MAP Type values for this may be selected from the option menu, and are either 115 kPa or 250 kPa. All Version 2 MegaSquirt partial kits have the 250 kPa MAP sensor (this is all MegaSquirt sold in the last few years). The MAP sensor type should be auto-detected from MegaSquirt, but if it is not, select the right one and hit "Send to ECU" right away.

Engine Type has the options of Odd fire or even fire. Odd-fire or even fire does not refer to the firing order, but rather the interval between successive firings.

So if you have a 4 cylinder, and a spark every 180 degrees, you have an even fire. Almost all 4 cylinder engines are even fire.

However some 90 degree V6s, some V4s, and most V-Twins (usually motorcycle engines), as well as a few others, have 'odd-fire' arrangements.

For example, from 1978 to 1984, the GM V6 (200 and 229 cid) had a semi-even fire sequence, with firing intervals of 132°/108°. It is "semi" because the rod journals are offset, but not quite enough to make for even firing intervals. In MegaSquirt terms, this is an 'odd-fire' engine, because the interval between firing can be either 132° OR 108° degrees.

On the Enrichments page:



Set the EGO switch point to a value between 0.45-0.50 volts with a narrow band O2 sensor. With a wide-band sensor, set it at 2.50 volts (DIY-WB, others may differ). These values will attempt to give stoichiometric mixtures under closed loop operation. Note that MegaSquirt will convert these values to binary numbers, so when you "fetch" the values back from MegaSquirt, they are converted back and may change slightly.

Note: If you do not have an oxygen sensor, be sure to set the EGO Step (%) on the enrichments page to zero, so that MegaSquirt will not try to use any stray signal from the O2 sensor input pin.

On the Communications/Settings page:

Port - The communications port number should correspond to the port to which the MegaSquirt controller is attached.

Timer Interval (ms) - The timer interval dictates how frequently the runtime and tuning displays are updated. An interrupt is generated at the specified interval, and the real time data is pulled down from the MegaSquirt controller. Use 100-200 ms to start; you can try to smaller values (ex. 50 ms) if your computer is fast enough.

Verify ECU Communications - Click this button to attempt communications with the MegaSquirt controller. Success will be reported.

Before Starting Your Engine

If your engine is newly assembled, consider running it on a known good carburetor before attempting to run it on MegaSquirt. This way you wont have to worry about proper run-in for the cam shaft, proper ignition timing, etc., while trying to get a reasonable initial tune into MegaSquirt.

Before starting, make sure to:



Get the Engine Started and Idling

You start, naturally enough, by getting your engine started.

Be sure to set your base timing before starting your car (if it hasn't previously been set).

Typically, the first time someone tries to start their engine with MegaSquirt, it starts after about 5 minutes of alternating various cranking pulse widths numbers to get started (on the Enrichments page), and REQ_FUEL to keep it from stalling (on the tuning page). It may take a bit of cranking, so you might need to keep a battery charger on hand.

Note that even in a 'piggy-back' application, do not set MegaSquirt's cranking pulse widths to zero. This will cause unpredictable pulse widths up to 13 milliseconds. Instead, set them to 0.1 milliseconds in that application. This allows very little fuel to flow.

Once you have it started and running, you can reset the REQ_FUEL value back to its original number. It is very easy to change without having to re-enter the VE numbers. Start up MegaTune, go to Tools->Scale VE Table, and enter your original and new REQ_FUEL values. This adjusts the VE table.

Then go to Settings->Constants and change the REQ_FUEL from the value you used to start the engine to the value calculated in MegaTune. The injector pulse widths will be the same, but the VE numbers will more accurately reflect your actual volumetric efficiencies.

If you have been trying to start your engine for more than 10-15 minutes, you ought to investigate other sources of problems before continuing to try to start the engine.

Properly tuned, MegaSquirt will start your engine quickly and reliably. If you have trouble with starting, either hot or cold starts (or both):

You start tuning by just getting it to idle properly by adjusting the speed [with the throttle stop and/or FIdle solenoid], and mixture [with the VE table or REQ_FUEL]. There is little danger of harming anything, as there is not enough load on the engine to build the heat that would melt anything. The engine will idle on a very wide range of mixtures, so it is not too hard to get it started, you just play around with the REQ_FUEL until it fires. After you have the engine idling, note the pulse widths at idle. Then you can reset your REQ_FUEL to the calculated value as described above.

Once you can start the engine and have it idle, proceed by tuning your idle AFR. At idle, the exhaust gases may not be hot enough for a one wire O2 sensor to read correctly, even though the engine is fully warmed up. In that case it will read lean all the time. This is especially true if you have:

In any case, unless you are tuning for minimum emissions, the best strategy is to tune your idle for a minimum MAP reading at your chosen idle speed (by altering the VE values around the idle point). This will give you the smoothest idle, and best off idle response. You may have to reset the idle stop a few times as your adjust the mixture.

Just watch the MAP reading as you adjust the VE table. It should move up or down if you adjust the VE table enough.

If it is cold out, you may need to adjust the warm-up enrichments before you can get the engine warmed-up so that you can adjust the idle mixture, etc. The easiest way to do this is to use MegaTune's Warmup Wizard ("Runtime/Warmup Wizard"). There are more details here.

Later, when you have the engine started and idling well, you can fine tune the cranking pulse widths. General Motors uses stoichiometric mixtures for both idle and cranking pulse widths at full coolant temperature, and a 1.5:1 cranking AFR at -30°F or so. For example, to establish out some starting point pulse widths, lets assume a 4-cylinder engine, with the injector staging set to 2-squirts/alternating. The injector pulses look like this (0 = injector pulse, - = no injector pulse):



o---o---o---...   Bank 1
--o---o---o-...   Bank 2

The picture when cranking is much easier, since it fires every injector on every igntion event:



oooooooo...   Bank 1
oooooooo...   Bank 2

So what we have is four times as many injection events when cranking compared to running. Now let's assume we have tuned:

Then we get our "best idle" fuel delivery amount of:



2.2 - 1.0 = 1.2 milliseconds fuel deliver per injector pulse

Split this up into the 4 times as many injector events we see during cranking, add in the Open/Close time and get our hot cranking PW.



(1.2/4) + 1.0 = 1.3 ms

Now for cold we want 1.5:1, which is close to ten times as rich as 14.7:1, so just multiply that first part by 10 and we get our cold cranking PW.



(1.2/4)*10 + 1.0 = 4.0 ms

This calculation requires:

  1. Good idle tuning to get that initial pulse width, and
  2. Good tuning of the open/close time so that the actual fuel delivery number from the first equation is correct.

Setting the PWM Criteria

To tune the PWM [pulse width modulation] values for your engine, you need to know what kind of injectors you have: low impedance or high impedance.

On the car, setting the PWM parameters is very easy to do and only takes a few minutes. At idle the overall injector pulse widths are small compared to their close time, so this will allow you to adjust the values. In other words, adjust the PWM current limit before taking the car out on the street where injector pulse widths become high, increasing the possibility of overheating your injectors.

You may find that you can idle at a very low PWM%, but the engine will stumble or cough if given any throttle. This can be due to a too low PWM% especially if your injectors are large and the idle pulse width is approximately equal to the PWM Time Threshold. In that case you may be idling almost entirely on the PWM Time Threshold. So rev the engine occasionally as you are tuning the PWM parameters, to ensure that you haven't gone too low.

Also, for some setups, an initial PWM Current Limit of 75% may be too low, so they will need to increase this value - same for the time threshold. Use PWM time threshold values greater than about 1.5 to 1.7 milliseconds only with great caution – it is possible to burn out your injectors!

Note that if you are running the flyback board and need PWM% of 70% or more to run properly, your flyback board isn't working properly! Troubleshoot it carefully to find out why.

Setting the Cold Start and Warm-Up Enrichments

If it is cold out, you have to figure out the cold start enrichments/warm up enrichments right away to keep the engine running as it warms up. Otherwise you can leave this until you experience some cold weather. During cranking mode (defined when RPM is less than 400), MegaSquirt shoots out cranking pulse widths that are calculated by a linear interpolation of two end-point values defined by the user, one at -40°F and one at 170°F.

A typical setting for a Chevrolet small block V8 with a Tuned Port Injection set-up and 30 lb/hr injectors is 2 milliseconds at 170°F and 10 milliseconds at -40°F. The values for your combination are likely different, though generally should follow a similar pattern. During cranking, MegaSquirt injects one pulse for every ignition event, so for an 8-cylinder it shoots out 8 times for 720 degrees crankshaft, with all injectors squirting. So with the above values, at 170°F, the effective amount of fuel per cylinder is 8 * 2 = 16 milliseconds. For -40°F it is 10 * 8 = 80 milliseconds.

Once the engine fires up (defined by engine RPM greater than 400 RPM), the engine goes into afterstart enrichment. The afterstart enrichment starts out at a user-defined percentage enrichment value (typically around 25%), and ramps down to 0% after so many ignition trigger events, which is user-defined (use about 200 for this number to start). This is an enrichment above the normal warm-up enrichment, which is temperature dependent.

If the engine starts and runs for a few seconds, then stalls, this is usually a sign that the afterstart enrichment isn't quite right. Leave everything else the same, and adjust the afterstart % and number of cycles. 20% to 30% and 200 cycles are reasonable starting points for most engines, but yours may run better with more or less. There should be a point at which it works without stalling.

If the engine starts and runs for more than 20 seconds or so, then stalls, you need to adjust your warm-up enrichment bins. As you adjust your warm-up bins, you may need to re-adjust the afterstart, since these interact (i.e., a larger warm-up value may require a shorter or smaller afterstart enrichment).

To set the Warm-Up Enrichments, use the "Warmup Wizard" under "Runtime" on the main menu. This lets you adjust the cold start and the warm-up bins while indicating which bin(s) are currently active. Note that you have to start from a true cold start - the engine needs to sit for several hours, before trying to adjust the warm-up enrichments after running the engine.



You can also set your Fast Idle Threshold (ºF) if you have installed a fast idle solenoid. Enter a coolant temperature to turn on the fast idle solenoid. A typical value is 145º Fahrenheit. The Fast Idle valve will be activated below this temperature (145ºF) and turned off above 145ºF. The Fast idle Threshold is independent of any warm-up enrichment, though generally has a similar value.

With the above numbers tuned properly, nearly any engine can be tuned to fire immediately, every time, just like any OEM fuel injected car. It takes a while to converge on the best numbers, especially the after start enrichment, which needs to be just right, or the engine will run rough or stall immediately after starting.

You can do this as the engine warms by adjusting the warm-up bins, loading it to the ECU, and noting the effect on idle quality. It will take several starts {from a cold soak} to get this close. Then you can play around with revving the engine in neutral and adjusting the mix to stoichiometric. Up to here it easy enough to do without an O2 sensor by adjusting for maximum vacuum (lowest MAP kPa) ant any given rpm.

Setting the VE Table

To set up the fuel curves for the engine with MegaSquirt, you have a number of parameters to work with. The most important of these are the Req_Fuel value and the VE table (8x8 volumetric efficiency table). You are aiming to achieve 12.5-13.1:1 air/fuel ratios under full throttle, and 15-17:1 under light loads for a naturally aspirated engine. Boosted engine may require a richer mixture under power.

To start you tuning efforts with MegaSquirt, you can calculate an initial VE table that has sufficient RPM and kPa bins, as well as an estimate of the VE based on your maximum torque and horsepower figures. The calculator is under the "Tools" section of MegaTune (version 2.25 and higher). This calculated VE table will need to be tuned carefully to avoid damage to your engine, however.



(Or you can use a web version of the VE table calculator.)

Tuning the VE table involves richening (by increasing the VE) or leaning (be decreasing VE) at each point in the VE table. Most of your driving will occur in a diagonal strip of the VE table, from low rpm, low kPa (i.e. idle) to high rpm, high kPa (i.e. WOT). You can adjust these values using the O2 sensor, data logs and MSTweak, and/or the seat of your pants. Low rpm and low kPa (say less than half of the max rpm and max kPa) might be able to use stoichiometric or leaner. Richer mixtures would be used at high rpm and high kPa.

However, the low rpm/high kPa and high rpm/low kPa are not seen as often driving your vehicle. Basically, if the engine never runs in certain parts of the MAP, then the numbers there should not matter. However, since you may not be able to guess where you will run under every possible set of conditions, you put estimated VE numbers that make sense into the little used areas.

From this frequently used diagonal strip of the VE table, you will be able to see how much the VE rises from one rpm bin to the next, and use these differences to estimate the low rpm, very high kPa numbers and the high rpm, very low kPa numbers. Since you rarely (if ever) run in these parts of the table, the actual numbers will not make much difference, but they will be there "just in case". You are looking to create a smooth VE map wherever possible.

Deciding exactly when (and how much) you should run rich is mostly a "seat of the pants" thing. When tuning, you will find the engine will surge (at low loads) and "coughs" at higher loads if it is run lean. Adjust the VE at the point where this happens so the this does not occur. Check the plugs for detonation (tiny black and white flecks) when tuning at high loads and rpms if you suspect detonation at all. A narrow band should read at least 0.8 volts under full throttle, at least for a starting point in tuning WOT. There are more details later in this section.

For an example, look at the sample VE table later in this section. It is the default MegaSquirt table, from the 350cid Chevrolet V8 engine that Bruce Bowling has in his Jaguar. It will work adequately for starting your tuning efforts in many more applications than you might suspect.

Volumetric Efficiency (VE) entries in 8x8 MegaSquirt VE table actually are VE * gamma, where gamma is the (stoichiometric AFR)/(actual AFR), and VE is expressed as a percent (i.e. 65 represents 65% volumetric efficiency at 14.7:1 AFR).

Note: If you do not use the “correct” REQ_FUEL value, the VE numbers in the VE table will be skewed by the amount REQ_FUEL is “incorrect”.

For MegaSquirt (and most MAP based EFI controllers), VE is based not on the percentage of cylinder filling relative to atmospheric pressure, instead it is based on the percentage of filling relative to the intake manifold pressure. So even with a highly “boosted” engine, VEs will not be much above 100%, except to richen the mixture.

You can tune your engine to a stoichiometric mixture with NB O2 sensor, but not at high loads/rpms. You can then use a little math to “correct the mixtures”. For example, if you get a stoichiometric mixture with 65% VE at a certain RPM and kPa, then to lean the mix to 16.0:1 you need:

65% * (14.7 / 16.0) = 60%

To richen an 80% VE entry to 12.5:1 from stoichiometric:

80% * (14.7 / 12.5) = 94%

Note that with MSTweak3000, you will get stoichiometric mixes if you set the crossover voltage to 0.45 - 0.50 volts with a narrow band O2 sensor. This is where you should have the EGO switch point set on the enrichments page in MegaTune as well. You can then adjust the MSTweak suggested VE table as described above to get other mixtures. Note the you will want to be sure of running rich mixture under high load/high RPM conditions. This makes a narrow band sensor somewhat less useful. As a starting guide, make sure you have at least 0.8 - 0.9 volts from the sensor under “wide open throttle” (WOT).

MAP sensor values can be between 0 and 250 kPa for all V2 and “turbo” V1 MegaSquirts. Naturally aspirated V1 MegaSquirts (from the very first group buy in 2001) can have MAP values between 0 and 115 kPa. Idle RPMs below 300 rpm will induce “cranking mode”, so should be avoided.

You can set RPM and MAP sensor values for table wherever you want them, but they must be in the same order as in the table supplied with the software. Put them so they cover entire rpm/boost range of your engine. That is, you want to cover from your slowest idle speed to your red line, and from the kPa at idle or deceleration (whichever is lower) to full throttle (with boost, if applicable). Evenly spaced values work well, but you may choose different values to suit your combination.

Generally, VE table numbers above 100% are used only to richen mixtures. Even a turbocharged engine capable of 20 lbs/in of boost will generally not have extremely large VE numbers. The addition of fuel for boost comes through the MAP term in the fuel equation:

PW = REQ_FUEL * VE(kpa,rpm) * MAP * E + accel + Injector_open_time

Thus increasing the VE at higher boosts makes the mixture richer, but it would not have run leaner simply because of the higher boost.

In essence, the mass of the air is computed using the ideal gas law (PV=NRT), where the pressure p is a function of VE and MAP, the volume v = cylinder displacement, the air temperature t is a function of E, r is the gas constant. We are looking for n, the mass of inducted air) and then that result is combined with a characteristic number for a given injector.

If you get the injector opening time correct, and the REQ_FUEL accurately represents the flow rate of your injectors, then the VE entries will be close to the VE*gamma noted above. However, if your opening time is not right, or your REQ_FUEL is not, then the numbers will be skewed by the amount the values are in error. In general, except for when you are first trying to get your engine started, use the calculated value for REQ_FUEL and do not change it.

Here is a sample VE table (it is the default table in MegaSquirt, used for Bruce's 350 Chev V8 with Tuned Port Injection). Note that the engine rpm range is from 500 rpm to 5200 rpm, and the MAP values range from 30 to 100 kPa (telling us that this is a naturally aspirated engine). Beyond these values, MegaSquirt will use the last value from the “edge” of the table. (It does not “shut down” by substituting zero values.) In theory, at stoichiometric mixtures, the values at 100kPa would reflect the torque curve of the engine at WOT, assuming a constant AFR level.



idle and cruise - lean ~stoichiometric - 14.7:1 WOT and acceleration - rich not normally seen


20 39 40 41 44 44 44 45 45
30 47 47 51 51 50 50 50 50
40 52 55 55 57 60 61 61 65
50 59 60 60 65 66 70 70 70
kPa 60 61 63 65 65 68 70 72 75
75 65 72 72 74 74 75 75 77
90 70 74 74 75 75 77 77 78
100 75 77 79 82 82 82 82 85
500 1000 1500 2000 2800 3600 4400 5200
RPM

Having an O2 sensor makes the driving part of the setting up much easier, as you can datalog and use MegaTweak to get the VE table set up with a few easy drives up and down the street, a bit more tuning, and you are ready to go a bit harder. You do not go harder if there are any problems [typically a back fire means too lean, sluggish revving means too [rich]. Read the “Datalogging and MSTweak3000” section for more information.

Have someone ride with you and bring up the tuning page. See where the "dot" hangs around when you are under load - this is where you need to focus on tuning. Use the up-arrow + shift to richen the VE values - enrich (with increased VE number) the four corners around where the dot is - give each corner five up-arrow-shifts, and see if this helps. Turn off the O2 closed-loop mode by setting the step size to zero. Watch the O2 gauge on the tuning page and use this as feedback for rich and lean. The 02 gauge may move to fast from rich to lean to be able to tune. Another strategy that works is to turn on EGO correction, and then tune using the EGO correction gauge rather than the EGO voltage gauge. If correction is below 100%, then raise VE to raise correction and so on.

Basically, the strategy for tuning with an oxygen sensor is:

If you have a "strip-only" vehicle, an O2 sensor is less useful. Some tuning hints are:

Tuning with Alpha-N

MegaSquirt can be converted from speed-density to use RPM , temperature and TPS only. This is called "Alpha-N". Alpha-N uses the only throttle position and RPM to calculate the amount of fuel to inject as opposed to using the manifold absolute pressure and RPM to calculate the amount of fuel to inject.

With boosted engines, you MUST use the speed density algorithm with MegaSquirt, because the throttle position bears little relationship to the amount of air going into the engine. Alpha-N is for naturally aspirated engines ONLY.

Using the speed-density algorithm, MAP is the main variable and VE is a 'tweak'. On alpha-N the VE table is the main variable, as TPS is used as a lookup into this table. Actually it is a fuel map rather than a VE table.

Alpha-N is useful for long duration cams where the resolution of manifold air pressure (map) would be small. It is also useful to get smother idle on engines that have erratic map values.

For example: On a flat part of the torque curve, going from half to ¾ throttle might not require the value to change in the VE map on speed-density if the air/fuel ratio is the same for the 2 loads as the change in MAP will do this. On the alpha-N system the map bins will be different as this is the only way the MegaSquirt can find out about the higher fuel demand.

You must have v2.0 or higher of the embedded software installed. Start up the tuning software, go to the Constants dialog and change speed density to Alpha-N. Then you 're-map' your VE table.

In Alpha-N mode MS still makes 02 corrections (i.e runs 'closed loop'), if you have it enabled.

One thing you have to always remember with alpha-N that you don't actually know where the effective WOT is anymore (i.e., when you have enough throttle that opening it further doesn't affect the amount of air being ingested). At low RPM WOT could be only 20% throttle.

As an aside, there has been a change in the way v3.000 alpha-N works, it now multiplies in TPS as a factor, where v2.0 did not multiply by TPS.

In V3.00 embedded code the fuel equation (minus the enrichments and open/close time) looks like:



PW = Req_Fuel * tps * VE(tps,rpm)

as opposed to V2.xxx code, which looked like this:



PW = Req_Fuel * VE(tps,rpm)

Note the extra factor of TPS (in red) in the V3.000 code.

Since the idle fuel pulse width depends on VE table value for that engine speed and TPS position, which is then mulitplied by the TPS value (in the 3.000 code), you must make sure that your closed throttle TPS value is not very low (otherwise you will be unable to generate sufficient idle pulse widths even with the VE table entries max'ed out at 255). To ensure sufficient idle adjustability, go to the Tools/Calibrate TPS in MegaTune, and verify that your closed throttle ADC count is 30 or more. Also note that on the stim, you may see lower pulse widths than expected (and be unable to adjust them in the VE table) if the TPS pot is set too low. This does not occur on V2 code, since the VE table alone is uses to determine fuel, and TPS is not a multiplier.

Also, since the TPS is now a multiplier in V3.000 code, once you reach the 'effective WOT' (where increasing the throttle opening no longer increases the manifold pressure), you will have to decrease the entries in the VE table as TPS continues to rise to maintain the same amount of fuel and air/fuel ratio. In V2.XXX code, since TPS is not a multiplier, you can achieve a constant fuel and AFR by keeping the VE table entry constant above the 'effective WOT' point.

Tuning with alpha-N its much the same as speed-density, except you no longer have an input for load. What this means is that you don't really know what full throttle is at the low and mid RPM ranges. For example, at 2000 RPM, 20% throttle might flow all the air the engine needs. So the usable area of the table will end up looking a bit like a triangle. The table itself will be actual fuel rather than a VE multiplier.

The tricky part with tuning alpha-N is working out where the effective WOT is. It is a very non-linear relationship and depends critically on the sizing of the throttle body.

Also, with alpha-N, the final fuel pulse is a simple product of the VE table entry and enrichments, so your VE table is far more critical than in speed-density mode.

If you are running alpha-N, disable closed loop operation until you have a good handle on where the effective WOT is. If you still have a MAP line connected you can (and should) log map to give you an idea of where full throttle is across the rev range.

If you are going to have varying loads,or are going to tow with your MegaSquirted vehicle, and you have good vacuum at idle and a good vacuum range, then go with speed-density because it reacts to changes in load a lot better than Alpha-N.

Alpha-N does have legitimate uses, and one would be an engine with a small intake vacuum range and a poor vacuum at idle. A strip/drag vehicle where there will be small changes in load and it'll see most of its use at WOT might benefit from alpha-N.

The original MegaTune TPS calibration tool was designed to allow alpha-N users the ability to move their TPS without having to re-tune their whole VE map. This is accomplished by storing the VE table in terms of TP%, and then using the tuning software to translate the TP% numbers into ADC counts.

In alpha-N, if you use barometric correction, it will look at the pressure at first power up and set the offset from that value. Otherwise if baro correction is off it does not use the map sensor at all.

Alpha-N still uses the temperature sensor to increase or decrease the fueling based on the ambient air temperature.

Even if you only plan to use alpha-N in your MegaSquirt, it is a good idea to build up the complete board. Use all the sensors. If you do not use liquid cooling and do not want cold start enrichment, hang the sensor in the air. Set the warm up bins to 100% across the board. Place the intake air temperature sensor in the intake or as close to the incoming air as possible. That way you have all the hardware and the board will operate properly. You can turn off almost any thing in MegaSquirt by placing the key values out of range.

Idle Pulse Width

You have to select your injectors based on the maximum horsepower your engine can produce to prevent the engine from running lean at wide open throttle. But why not just pick the biggest ones you can find?

The answer has to do with idle and cruise pulse widths. If you use very large injectors, your idle pulse widths get very short. This can drastically reduce the mixture ratio control that you have during idle and cruise situations, and lead to very poor driveability and seemingly strange tuning behavior.

To illustrate, suppose you have established that your engine produces the lowest MAP reading at an idle pulse widths of 1.2 milliseconds, and your opening time is 1.0 milliseconds (considered the 'standard opening time'). Recall that MegaSquirt can only change fuel by 0.1 milliseconds at a time.

And also recall that MegaSquirt assumes NO fuel is injected during opening (which is close to true, since the injectors remain closed until the coils charge, then they snap open at the end of the opening time). Now if the net effect of the enrichments change by 2%, the pulse widths don't change at all. Even if they change by 49%, nothing changes. But once they change by 50%, the pulse widths suddenly changes to 1.3 seconds.

So the next leaner possibility is 1.1 seconds, and the next richer is 1.3 seconds. However 1.3 milliseconds is not 1.3/1.2x100% = 8.3% richer, instead it is (1.3-1.0)/(1.2-1.0) = 50% richer! The mixture becomes very, very rich, and the engine runs poorly.

To confuse your tuning efforts further, it may be that you are already near a threshold, so that a small change in one parameter makes a very big change in the air/fuel ratio in one direction, but no difference at all in the other direction!

But doesn't the EGO correct? Actually, it can't. Even if you set the step size to 1%, nothing happens until the 50% (i.e. 1.3 milliseconds) threshold is reached. That is, the step size only takes effect once the 0.1 threshold of PW is reached. And if the number of ignition events between steps is large, the engine may stumble and die before it recovers and leans out. So in fact you may be better to set the O2 step high (50%), and the number of ignition events low (say 2) so that the average over just a few injections is correct. It is a band-aid approach, however, and likely to induce ignition related problems.

Obviously the converse is true if the engine goes lean. It has to go at least (1.1-1.0/(1.2-1.0)=50% lean before anything happens. If does go lean, it may back fire and die before it gets a chance to become richer.

You might think you can get around this by decreasing the injector opening time (to get a larger "adjustable time") and increasing the VE (or req_fuel), but that doesn't work because the 'ideal' injection time is still 1.2 seconds, and the permissible step is still 0.1msec, regardless of the way you add the components of the pulse width up.

And making matters worse is the fact that many high-performance engines will want even lower pulse widths at cruise than at idle, compounding the tuning problems and introducing more driveability issues. A system with a very short pulse widths like this will be difficult to tune. It will appear not to respond at all to enrichments over a certain range of a parameter (say IAT), then suddenly it will seem to change so drastically that you seem to require an entire new set tuning values.

Now even if your engines idles perfectly at a very low pulse widths, changing load, speed, and other variable (EGO, IAT, etc.) will demand slightly different air/fuel ratios. However, none of them are likely to need exactly the +50% you have to choose from!

This is why several aftermarket ECU manufacturers recommend an idle pulse widths of not lower than 1.7 milliseconds. If yours is lower than this, you need to address it before you will be able to tune your engine for all operating conditions. The high-resolution code, or lowered fuel pressure may help. Ultimately the best solutions are appropriately sized injectors or staged injectors.

Datalogging and MSTweak3000

Datalogging allows you to create a running record of the MegaSquirt real-time variables. Once you have enabled datalogging (by clicking on the Datalog menu item on the File list), MegaTune polls the MegaSquirt controller when any of the front page, runtime display or tuning page are active, and writes this data to a file. The file has a comma-separated value format and defaults to having an extension of “.xls”, so Microsoft Excel will open them automatically. The data logs can be used as input to the MSTweak3000 program to automatically correct your VE table. See the MSTweak3000 folder at the www.msefi.com site.

When datalogging is enabled, the second status box contains a bold “LOGGING” indicator. The rightmost indicator contains either grayed-out “CONNECTED”, meaning that MegaTune is not communicating with MegaSquirt, dark “CONNECTED”, indicating that MegaTune and MegaSquirt communications is working properly, or dark “RESET n”, indicating that the MegaSquirt controller has been erroneously re-booted n times since MegaTune started talking to it.

Note: the Logging option under the Communications menu is a different function, and does not need to be selected to enable datalogging of the real time variables. See the MegaTune help menu for details on the Comm Logging function. If you can drive the car at all, start datalogging. Look through the log and MAP-RPM pairs that are near grid points in your VE map, when they O2 sensor reading is significantly below 0.500 (say 0.014), jack up the VE at that point by 10%. When the O2 sensor is significantly above 0.500 (say 0.825) then drop it down by 10%. A couple runs around the block should get things running pretty well.

Or you can use MSTweak3000, which will sort through your data logs and suggest what VE points need to be changed. Everybody (who is running and datalogging) should try MSTweak3000 - it is very powerful and easy to use. It allows you to read in your data logs, get rid of outlier points, and then generate a new VE map. You can pick new bin values - rpm especially (at the peaks and valleys of your filtered datalog) - then calculate a new VE map with the push of a button! No more gazing with crossed eyes at Excel spreadsheets to pick data for tweaking your VE table.



If you get errors when try to use MSTweak3000, you may need to change the regional settings on your computer (you need to use "." as the decimal marker, rather than ","). In your Windows Start menu (bottom left of the screen on the taskbar):
  1. Go to Settings / Control Panel / Regional Settings (it's the icon with the globe), you probably have your local language selected,
  2. Switch to US English, and the problem should be solved, (there's no need to change the keyboard layout).
This has been checked on numerous computers, and it solves errors in most cases.

MSTweak looks for points in the datalog where the EGO voltage crosses your chosen set point (~0.450 volts for a narrow band oxygen sensor at stoichiometric, 2.500 volts for a wide band sensor). If you are operating closed loop, then you will generate lots of these "crossover points" automatically. So:

When datalogging in cruise, watch the EGO voltage, and you should see it flip back and forth around the set point. If so, you are getting the crossover points logged that MSTweak needs.

Crossover points are where the EGO voltage cross the EGO switch point you have set on the enrichments page of MegaTune. So, for example, on a narrow band sensor and have set the switch point to 0.450 volts (for example), if you have gone from 0.400 volts to 0.600 volts, you get one cross-over point. If you then go back to 0.425 volts, you get another crossover point.

MSTweak uses these crossover points as an indication that the air/fuel ratio is very close to the 'desirable' ratio. So the more crossover points you have, the more certain MSTweak can be that it is setting the right mixture.

You use EGO feedback to generate crossover points, because what EGO feedback does is pull the voltage down if it is above the switch point (by lowering the fuel amount if it is narrow band), and pull the voltage up if it is below. In essence, EGO feedback is designed to generate crossover points.

The ignition events per step is a way of slowing and smoothing the EGO response, so that it doesn't react too fast, potentially getting into an oscillating loop. The step size is the same idea, larger steps react more quickly, however, larger steps also may not hit the exact ratio you need.

What MSTweak3000 does with these crossover point is use them to determine what VE entry value will give you an AFR of 14.7, based on the O2 transition point recorded in the file. MSTweak3000 gives you a RegenVE, which is the VE value for 14.7:1. If you want another AFR, you can estimate it by taking the RegenVE value and multiply by the ratio of the stoichiometric over the desired AFR. For example, if MSTweak3000 gives you a value of 50% for the VE table, and you want 12.5:1 instead, then 50 * (14.7 / 12.5) = 59 - this is what you plug into the VE table. See the MegaTweak software and help file for more information. Note that the latest versions of MSTweak allow for the setting of wide-band O2 sensor AFR targets for each MAP bin. See the MSTweak3000 manual for more details.

Do not get hung up on actual AFR numbers - for the example above to work, everything else must be dead on, including the injector offset, injector battery voltage correction, REQ_Fuel for your injector flow rate, and air temperature correction. It will get you close enough with the resolutions we are working with, but remember that the only AFR you can nail down with a NB O2 sensor is 14.7:1, everything else is an estimate from this point. If you have a WB-O2 sensor, then you can read the AFR directly from the sensor output voltage and use those results to tweak your VE table.

MSTweak3000 will not tune your MegaSquirt for you (yet) but it will suggest new VE table entries for you. It is a tool to help you visualize the VE map and choose better VE values and to better place the MAP and RPM bins for your engine. Keep in mind you need a good O2 sensor to do this though (the WB-O2 sensor will work great). To start, set the O2 +/- limit to 100% for a really rough map, and if your map is more or less tuned in then 50-70% will work too (keep this high though for tuning).

The critical settings are O2 step% and ignition events per step.

For fine tuning, keep the O2 adjustments per second between 3 and 5. For roughing in VE maps, set the O2 adjustments between 5 and 10 per second (depending on how good the O2 sensor is, if it is old, go lower).

Once the map is tuned in, set the:

You can calculate your:

O2 adjustments per second = ((rpm/120) * cylinders) / ignition events per step

Note that the datalog includes an 'EngineBit' field. This bit will tell you if the engine was accelerating, warming-up, etc., and can be used to sort unsuitable data lines (because O2 correction is not active under acceleration, warm-up, etc.) from the file.

The enginebit has 6 binary bits. The rightmost bit represents running. It is 1 if running, zero if not running, so 000001 = 1 or 000000 = 0. The next rightmost value is for cranking, 000010 = 2 if cranking. Note that and engine is never both running and cranking, so you should never see 000011 = 3. The fields are:



Binary Bit Decimal Meaning
00000X 1 Running
0000X0 2 Cranking
000X00 4 Start-Up enrich
00X000 8 Warm-Up enrich
0X0000 16 TPS accel enrich
X00000 32 TPS decel enlean

Note that the only suitable value for reading O2 sensor values is when the engine bit is equal to 1 (i.e. running and no enrichments). Here are examples of what some of the various values mean:



You can view your datalog files in graphical form using MS Logfile Visual Viewer, available from the files section of the Yahoo! MegaSquirt group. Be sure to set your screen resolution to 1024x768 (for version 1.2, later versions may support other screen settings). MSLVV can be set for either narrow-band or wide-band oxygen sensor readings. Using the viewer, you can see the trends in your datalog, and spot trouble areas more easily than viewing the numbers in a spreadsheet.

Using Datalogs for Tuning and Troubleshooting

Below are some screen shots of MSLVV showing datalogs with various diagnostic conditions. Click on the image to download the actual datalog.



Above is an example of a good datalog. The sensors are all responding, and the MAP and RPM go up when the throttle is pressed, and not otherwise.



Above is a datalog showing the classic tach spikes. You can see that the RPM appears to rise very high, with the TPS seeming to be opened at all. The person tuning this engine has made the best of it by minimizing the accel enrichments (otherwise the pulse width and duty cycle would also rise very high), but the better solution is to fix the tach signal. There are hints on how to do this here.



Above is an example of what happens when the TPSdot parameter is set too small (under ~1.0 is considered small). The usual amount of 'noise' in most TPS signals triggers the accel enrichment, and greatly increases the pulse width. The result is a very rich mixture and a poorly running engine that doesn't respond well to tuning. The solution is to increase the TPSdot parameter to 1.0 to 2.0.



Above is an example of a 'noisy' TPS signal. Unlike the above example, is this case the TPSdot threshold is set appropriately, but the TPS itself (or it's connecting wires) is generating a lot of noise. It may have a loose connection, it may have its wires running close to the spark plug wires or coil, or it may be damaged internally. In any case, it will trigger extra accel enrichment, and make tuning difficult.



Shown above is a fairly subtle problem. The CLT sensor is broken. Notice near the bottom of the page that it is stuck at -40°F. Because the CLT graph line is off the bottom of the page and is constant, it would be easy to overlook it. However, it will be adding a LOT of extra warm-up enrichment, and make it difficult to tune the warm-up parameters. If this had bee the IAT sensor, it would be even worse, since MegaSquirt uses that directly as part of the fuelling equation.



This screen shot above shows a very subtle example of a datalog, showing that the ego is causing an unstable idle. You can see that when the narrow band EGO is is rich (above 0.450 volts), the MAP is lower, and when the EGO is lean, the MAP is higher. In this case, richening the idle VEs, and turning off EGO correction at idle (by setting the EGO Active above rpm to a few hundred RPM higher than idle) will help this engine have a more stable idle.

Setting the Acceleration Enrichments

After you have the VE table dialed in, or if you have driveability problems initially, then start adjusting the acceleration enrichment.

The first thing to set is your TPSdot threshold (V/s). This setting determines the rate at which acceleration enrichment begins. If you set it too high, no accel enrichments will be applied, and the engine may respond poorly, backfiring or coughing under sudden throttle movements. If you set it too low, however, you may have inadvertent enrichment triggered by noise on the TPS signal. In general, use a setting between 1.00 and 2.00 (MegaTune may round these number slightly) - start with 1.00 unless you have a reason to do otherwise (it will be rounded to 0.977, which is fine). Check you datalogs to see if the accel enrichment is being triggered when you don't want it to be (like at idle). This will show up as very large jumps in the pulse width for no apparent reason (though later versions of MSLVV will show the Accel indicator).

One of the reasons that there isn't a "magic formula" for accel tuning is that it really is a "feel" and "driving style" sort of thing. And it depends critically on your state of tune for the VE table, warm-up enrichments, manifolding, idle and cruise speed and AFR, TBI vs. port, injector flow rate, and a million other things.

In a nutshell, too much accel enrichment produces a sluggish throttle, too little accel enrichment produces backfires in the intake manifold.

The best way to get a rough accel tune is to "blip" the throttle with no load (at different rates, but you have to guess which bin was active), and adjust the accel bins for the best throttle response (and this will also depend on the decel amount).

The more rapidly you can get the engine to rev and recover, the better your accel/decel enrichments. If they are really tuned in, you should be able to rev the engine repeatedly, with the engine responding 'crisply' every time.

You may want to try a short Accel Time (like 0.2 ms) and jack up the accel enrichment bins.

A Decel Fuel Amount (%) setting of 100% means no cut. 1% means reduce the pulse width by 99%, to 1% of what it normally would be. The low MAP part of your VE table is probably a touch lean, so the NB sensor drops below stoichiometric. If the car does not buck too hard, you are close to correct settings. If it bucks and stumbles, then it is going too lean and you need to richen that part of the table.

Before tuning decel [or accel], try to make sure you have your VE table close to correct first. To get the VE table set up, set the delta-TPS setting very high (30v/s or something like that) so that TPS enrich/enlean never kicks in. Then, (in steady state) set up VE table. If the vehicle is undriveable without tuning the accel enrichments, by all means do it, but be sure to revisit the accel tuning as you tune your VE table.

To adjust the accel bins, start with them high, something like:

Bin

Default MegaSquirt (ms)

Start tuning at (ms)

2 volts/second
(idle to WOT in 2.5 seconds)

0.5

1.0

4 v/s

2.0

4.0

8 v/s

4.0

8.0

15 v/s (idle>WOT in 3/10 sec.)

7.7

15.0

This will reduce the possibility of backfiring while trying to tune the VE table. If you experience backfires or bucking, increase the bin values even more, until the car no longer backfires when you step on the throttle.

Then reduce the lowest bin (2 v/s) value by 0.1 milliseconds at a time until the engine stumbles or coughs under gentle opening of the throttle. If the engine never stumbles, increase the rate at which you open the throttle and try again. If it stumbles even with the above values, double them and try again.

Then repeat with the next higher bin and slightly faster throttle movement. Continue with each higher bin and more aggressive throttle application until all the bins are satisfactory.

In addition to the accel enrichment bins, you also need to set the cold acceleration enrichments. These are the Cold Accel Enrichment (ms), and the Cold Accel Mult (%). Both of these affect the amount of enrichment when cold.



overall pulse width = Req_Fuel * MAP * VE + (AE *CM + CA) + ...

where:

AE = acceleration enrichment pulsewidth
CM = cold accel multiplier
CA = cold accel additive

Thus, the cold accel mult (%) a linear scalar for the acceleration enrichment that increases it by the specified percent, whereas the cold accel enrichment (ms) is an additive constant that does not depend on the accel bin settings at all. Both are linear functions of the coolant temperature (i.e. they have no effect at 160°F, 50% effect at 60°F, full effect at -40°F).

In general, you need to set both for best driveability when cold. Try settings of 3.0 milliseconds for the Cold Accel Enrichment (ms), and 130% for the Cold Accel Mult (%) to begin. Adjust them to get the best overall driveability when the engine is warming-up. When you get it right you should be able to start the car up and drive away with any stumbles at all.

Check Certain Resistors

If you want your MegaSquirt to be reliable, do not skip this step. You need to tune two of the resistors to values appropriate for your ignition and injector set-up.

While then engine is running, check the temperature of R10 (kit supplied 390 ohm, 1/2 watt, orange-white-brown), which is used in the ignition input circuit from the coil. It should not be too hot to touch with your fingertip. If it is too hot, the value of this resistor may have to be changed depending on application - start with the supplied value (390 ohms), and if runs hot while running, then increase its value, in steps, up to 10K (like 470 ohms, 560 ohms, 680 ohms, 1K, ...). Some applications may require even higher resistance, check the MegaSquirt Forums group for advice. Use 1/2 watt resistors.

Also check the temperature of R32 (270 ohm, 1/2 watt). This resistor is used in the flyback circuit to control the closing of your injectors. It should not be too hot to touch with your fingertip. If it is too hot, the value of this resistor can be increased, or the Zener D21 can be replaced with a Zener diode that has a lower breakdown value than the 36 volt 1N4753 specified in the BOM. You might try 22 volts (1N4749).

Tuning Issues

If you have a very long duration cam in your motor, and it idles poorly, you might be able to get it to idle better through careful tuning with MegaSquirt. Often a rough idle may be caused by lean air/fuel ratios. This is really is more of a cam issue than a fueling issue. The exhaust valve is held open later into the intake stroke and the intake opens earlier near the end of the exhaust stroke. At low speeds and relatively high intake vacuum you get more exhaust contamination of the fresh air/fuel charge. As you get more contamination of the air/fuel charge you typically need a richer mixture to get it to ignite and burn properly.

This means you probably cannot run a stoichiometric [chemically correct] mixture of 14.7:1 with your long duration cam. You need to run richer. So you tune your idle by ear rather than with a narrow band EGO [oxygen] sensor. And make sure you are not allowing EGO correction at idle if you have a rowdy cam! It will be trying to “correct” your mixture back to a lousy idle. If your engine will not idle well at stoichiometric mixtures, set the EGO Active Above RPM to a few hundred RPM above your idle speed. This will ensure that MegaSquirt does not try to lean the mixture back to stoichiometric to compensate for your adjustments.

Another tip you can try if you have a large overlap cam is to pinch off the MAP hose slightly while the engine is idling, and see if the idle quality improves. If so, then try a restriction in the MAP vacuum line. This has the effect of damping the vacuum pulses that the MAP sensor sees. Start with a ~0.040" (1.0mm) restriction in the line. You may have to experiment with restrictor sizes to see what works best for your system.



A few more things to try:

1) Check your VE table entries near the idle point - if the RPM or MAP fluctuate, then you can get rolling idles, etc. You may have to move some of the bins around to bracket the idle RPM/MAP region, and keep flat VE values within this.

2) If you run low-impedance injectors, you need to tune your PWM current limit. Start with 75% PWM and 1.0 millisecond time threshold. Once you get idling, then first adjust the PWM duty cycle down until you notice a change in idle quality, then move the value back up 3 - 5%. Do the same with the time threshold. On the car it is very easy to do and only takes a few minutes. And, at idle, the overall injector pulse widths are small compared to their close time, so this will allow you to adjust the values. In other words, adjust the PWM current limit before taking the car out on the street where injector pulse widths become high.

Your engine will idle at a certain vacuum. It might help on a street use motor on the VE map to use a lower point for starting MAP than idle vacuum. For example you can have yours set at 20 even though you idle at 27 or so. This allows you to run less fuel on overrun deceleration and coast events (not just for a second like the TPS will do). This allows you a saving of 3-4 MPG on average driving and you might be able to run more advanced timing under this vacuum.

On the other hand, you may want to do the opposite. You can increase the VE values just to the left and above idle. You can make them really rich [say double the idle VE value, to keep the car from stalling. This seems to work really well, if the engine starts to stumble, the pulse width goes up and it recovers.

By working with the RPM and MAP bins, you should be able to work out a set of values that lets you run lean at cruise and decel [where the RPM is above idle, and MAP below idle], but rich when stalling [RPM below idle].

On the warm up enrichments page, the warm up enrichment only goes to 160º F. The 160º F bin value of the enrichment (which should ideally be 100%) is used at all temperatures above 160º F.

The system compensates automatically for any amount of idle solenoid bypass air because of the effect it has on the MAP value [i.e. the vacuum in the manifold is lowered by the bypass air, this is sensed by the Manifold Absolute Pressure sensor, and the processor decides to inject more fuel. The effect is exactly the same as if you had cracked open the throttle a bit. The fuel goes around the throttle plates, which are never truly closed. They are set at the opening required for the slowest throttle speed desired for the engine under optimal conditions, which leave plenty of room for the fuel to get by. The fast idle air then adds to this baseline amount of air to raise the idle speed. In some circumstances, you may want to run without oxygen sensor feedback, called “open loop”. The best way of forcing MegaSquirt to run open loop is to change the O2 sensor step to 0 [zero] on the enrichments page. It will still log the O2 voltage, but not do anything about it.

With the version 2.00 (and higher) code the MegaSquirt Fuel Pump output is programmed with a priming pulse option to shut off the unit in case of an engine stall, etc. It turns on the pump immediately when the power is applied and shuts it off 2 seconds later if the engine is not running. If you set the width of priming pulse in MegaSquirt to zero, then the system defaults to not turning on the pump until the first tach pulse. If this field is non-zero, then when the key is turned on, the injectors will fire once with a duration specified by the priming pulse field, and the pump is also activated, and will stay on for two seconds if there is no tach activity, or for as long as there tach activity plus two seconds. The version 1.0 software only runs the fuel pump when it sees activity on the tach input. So, if you just turn on the key and do not crank the engine, the pump is off. When you start cranking, the pump comes on, and times out two seconds after the last pulse on the tach signal.

On start-up MegaSquirt records the ambient barometric pressure. The barometer correction multiplier to VE increases as pressure decreases. If it the ambient baro pressure is low (high altitude) the algorithm adds fuel. This is mostly because at a given MAP, the engine will flow more air with less exhaust back pressure and therefore needs more fuel at higher altitudes. Once running the MAP sensor determines fuel based on you VE table entries which are then scaled by the baro correction recorded at start-up. The correction values used by MegaSquirt came from a code disassembly of a 1990 Corvette ECU.

If your MegaTune displays bizarre values for the barometer on the runtime display, 76 kPa, for example, you may be resetting while running. MegaTune has a check that detects most resets by watching the seconds value. If the seconds goes to zero from any value other than 255, then it signals a reset with an audible “beep” and sets a counter visible on the lower right corner of the screen, where it normally says "connected".

As well, you can check the datalog seconds count - make sure it counts up to 255, and then rolls over to zero and continues again and again. If you get shorter counts (like say 56 then a roll over) then the processor is resetting. Note that most of the time on the car you will not notice that the reset has occurred because it happens so fast. What happens when the engine has a running reset (when the engine is running and the processor resets), then it grabs the barometer near the beginning of the MegaSquirt processor boot procedure. If the engine is running, then it will grab engine vacuum and use this for barometer.

For normal operation the processor comes up so fast that it has grabbed the MAP value before the engine has a chance to start cranking, much less running.

You need Windows 95/98/ME/XP and a conventional serial port to communicate with MegaSquirt. USB will NOT work directly, however some people have reported that they have been successful using a USB-serial adapter. You do not need a fast computer to tune MegaSquirt, just about any computer that is capable of booting Windows 95 (or better) will be fast enough, but get the fastest machine you think is reasonably priced.

Tuning for Economy

To get maximum fuel economy, you want the engine to run as slowly as you can (hence the proliferation of overdrive transmissions in the last 15 years), and to run an Air/Fuel ratio (AFR) of about 16.5:1 to 17:1.

To tune for economy with a wide band oxygen sensor is relatively easy. Look up the sensor output at ~16.5:1 for your sensor (~2.65 volts for the DIY-WBO2, for example). Put that value as your EGO trigger point in MegaTune, and if your EGO ± Limit (%) is sufficient (given the state of tune of your VE table), you should be getting good economy.

You can try mixtures leaner than 16.5:1, however you may get a lean 'surge' that feels like someone is pushing the car forwards, then pulling it backwards. Generally, this is a sign that you are too lean.

With a narrow band, it's a bit tougher to set it for maximum economy. You can adjust the VE table, but the EGO correction tries to bring it back to a stoichiometric AFR.

You could raise your EGO_RPM_limit to just above your cruise rpm, but depending on where that is, it might not be all that workable. A better method, if you have a narrow band oxygen sensor, is:



Do this for all the values in the VE table you actually cruise at, but not the higher rpm, higher load areas of the VE table.

That keeps the EGO at 16.5:1 at cruise, but lets you set it anywhere else in the rest of the table.

Tuning for Emissions

To tune your engine for minimal emissions using MegaSquirt properly requires expensive test equipment. However, as a start, you can:



Here is an example of how a few changes affected one engine:



Baseline Timing
Retarded 10°
Timing
Advanced 10°
Mixture
richened
Mixture
leaned
HC 1.00 0.78 1.14 1.39 0.88
CO 14.5 11.6 13.0 81.0 9.8
NOx 2.91 1.89 5.18 0.71 3.03
O2
Not usually tested
22.3 19.8 23.8 17.4 25.4
CO2
Not usually tested
305 307 298 246 310

You can see that retarding the timing and leaning the mixture slightly gives the best possible compromise, increasing only the NOx slightly among the regulated emissions. (The above was without a catalytic converter. With a converter, emissions would have been best at stoichiometric mixtures and the timing retarded somewhat.)

Other Tuning Software and Platforms

MS-Palm is available from the files section of the MegaSquirt Forums. It has worked well for some. MS-Palm uses the HOTPaw basic, and does data logging. It is limited to about 60 datalog lines or about 15 seconds or so at 4 Hz. It writes the data out as Memopad entries, which are limited in size to 4k. The source code is there for anyone to modify. It would be easy to cut back on the variable list, to get a log time up over a minute if someone so desired. MS-Palm does allow editing of VE table, enrichment bins, etc. as well. It worked fine with V2 code, but has not been tested yet with the new DT code. Or you can use MSMiniTune, which requires the NSBasic files from the files section, but it may not be fully functional.

A Linux version of the tuning software is under development, check the forums for details.

You might be able to use a Mac to tune MegaSquirt. Some people have successfully run PC Configurator and MegaTune hooked up to the MegaSquirt board with the Stimulator, on a Mac using VirtualPC and Win98. They report using a Mini DIN 8 to DB9 cable, selecting the Mac serial port as COM1, and "shared" the Mac hard drive with Win98 as volume (F). Their set-up includes an Airport wireless network (802.11b), sharing the DSL connection, setting up VirtualPC to utilize various resources (e.g. Mac serial/printer port as COM1, Ethernet, faking the video and sound cards, etc). MegaTune runs great and there is no lag between turning a MegaStim pot and seeing the results on the screen.

MegaView

The MegaView display/digital dashboard for MegaView offers two operation modes: Runtime, which displays the current engine operating parameters in "ticker-tape" scroll format, and Configurator, which allows the user to edit any of the MegaSquirt variables in real-time. For more information about MegaView check out:



www.bgsoflex.com/mv/megaview.html.

MegaView has the following features:

The MegaView display is based on the CU20025ECPB-W1J from Noritake. It is a 20 character by 2 row display. The outer dimensions are 116 mm x 37 mm, with a display area of 70.8 mm x 11.5 mm. Individual characters are 2.4 mm x 4.7 mm in size. Click the above links for more details.

You can purchase the MegaView PCB and programmed CPU for MegaView in the same you do for MegaSquirt.

Order the PCB and processor at:



http://www.bgsoflex.com/mspo1.html

Then get the other parts from Digi-Key. The ordering page is at:



http://www.msefi.com/msinfo/mvbom.htm

Here are there instructions for building MegaView. Be sure to study the images before assembling your MegaView

1) Solder the 2x7 male header to the back side of the MegaView PCB.

2) Solder the 2x7 female receptacle to the back side of the VFD PCB. This will allow you to plug the 2 boards together. But to maintain stability you need to install the 4 hex stand-offs in between the 4 holes on each PCB. However, do not assemble the two boards yet. Leave this until the LAST step.

3) Install and solder P1, the DB9 connector.

4) Solder JH1, the single row, 6 pin header to the top side of the MegaView PCB. Mark the #1 pin (square pad) on the board (it is the pin closest the DB9 connector).

5) Assemble the power supply. Start by installing and soldering J1, the two position terminal block.

6) Insert and solder D1, D2. Note the polarity - the band on the diode matches the line on the PCB (i.e away from J1).

7) Install and solder C13 and C14, These are tantalum capacitors, which are polarized. Be sure that C13 positive lead is towards the side of the board with the DB-9 (left-hand side on picture below - you can see the trace run from this to the voltage regulator). For C14, the positive lead is to the top of the board (see picture - look for the trace again which runs to the voltage regulator).

8) Install and solder U3, the voltage regulator. Bent the leads to match the PCB, and apply heat sink compound to the back of the regulator before screwing it to the PCB with one of the screws and nuts.

Below is a picture of the power supply components installed. Ground is furthest from the DB9, +12V is closest to the DB9. Here is a picture:

When done, verify there is 5V at the output of the LM7805 when you put 12V and ground into the power terminal block. The positive side of this terminal is closest to the DB9 connector and should be marked in some way to avoid mistakes when connecting it in the car.

9) Install and solder C1, C5, C7, C9, C10, C11, and C12 (104 marking).

10) Install and solder C2 (333 marking).

11) Install and solder C3 (103 marking).

12) Install and solder C4 (470 marking).

13) Install and solder C6 (20 marking).

14) Install and solder R1 (brown-black-orange marking).

15) Install and solder R2 (brown-black-yellow marking).

16) Install and solder R3 (brown-black-blue marking).

17) Install and solder Y1 (small metal can). Bend the leads so that it lies flat between C4 and C6.

18) Install and solder the 16 pin socket, if you are using one. Otherwise install and solder U2, the MAX232.

17) Install and solder the 40 pin socket, if you are using one. Then insert the CPU. Otherwise install and solder U1, the CPU.

Here is a picture with the entire MegaView populated:

Next is a picture of the bottom side of the board. Note the header on the bottom of the board:

18) Install the stand-offs on the display. The male end of the stand-off goes through the front (display side) of the display PCB, and the female end of another stand-off is used to attach it in place. Leave them a little loose. Then attach the male ends of the remaining stand-offs through the back side of the MegaView PCB. Use the nuts to attach the PCB. Make sure the 7 position header is properly aligned. Tighten all the stand-offs and nuts.

Here is an image of the two boards together with the hex stand-offs holding them together:

You are done! Plug everything into each other (Stim/MegaSquirt/Cable/MegaView + battery or power supply) and it should come to life after one second.

To work the various functions of MegaView in the vehicle, you'll need to install push-buttons (though you can simply touch appropriate wires together for testing on the bench). The connections to the push buttons are:

The four push-buttons are connected to pins 1, 2, 3 and 4 respectively.The other side of each of the push buttons is connected to ground (pin #5). When a button is pushed, it connects the corresponding CPU pin, which is normally pulled up to +5V in the CPU, to ground. The pulse triggers an interrupt in the CPU and it then acts on the button push.

To install in a car, you need to get a Molex 5 or 6 pin connector and corresponding pins and make a cable. The plug, on which the no. 1 terminal should be marked, goes on the header, and the 5 wires go to the buttons which are mounted in a piece of sheet metal or plastic located wherever you want - generally close to the VFD display. Note that you can put the buttons in whatever order makes the most sense to you.

To make a bezel for MegaView?, see this simple front panel bezel out of 3/16" (5mm) Lexan, go to the MegaView home page

To operate MegaView, simply mount the unit on the dash or in an enclosure, supply +12V and ground wires to the power terminal block, and connect the DB9 sockets on MegaSquirt and MegaView with an RS232 cable. Turn on the ignition - you don't need to crank - and you should see the display scrolling.

When power is applied it takes about a second for MegaView to initialize the VFD and start up. By default, it comes up in Runtime Display Mode, as a ticker tape scroll, which is the primary intended usage mode. If it is desired to freeze a particular variable, one may push the Select button. This causes the scrolling action to cease, so the selected variable may be viewed continuously. Pushing this button again restores the scroll. The increment/ decrement buttons do nothing in this mode. The only other item of note is that, if any variable begins to flash, it is a sign that it is out of range, for example, the coolant temperature may be excessive or the sensor broken (railed).

By pushing the Mode toggle button one enters Configurator Mode. This mode starts by displaying the first of the configuration parameters. (These are the parameters you change in the PC tuning programs.) By pushing the increment/ decrement buttons you cause the display to scroll to the next or the previous parameter. Holding the button down causes a continuous scroll.

When you reach the parameter you want to modify, you can hit the Select button. This causes the word 'Selected' to appear on the top line, and means that in this submode hitting the increment/ decrement buttons will cause the parameter to increase or decrease in value, and will affect operation of the vehicle. Clearly one should use CAUTION in doing this, especially while driving.

When the variable has been modified as desired, hit the Select toggle again (Unselect). This will cause ALL parameter values currently in RAM to be burned into flash, so the modified parameter value will continue to be used on the next restart. The 'Selected' string on the top line will disappear, and you can now move to another configuration parameter using the increment/ decrement buttons, or you can return to the Runtime Display Mode by pushing the Mode button.

Note: if you don't want the change burned in flash permanently, then don't hit the Select toggle to Unselect it, but instead hit the Mode toggle. However, if you later return to the configure mode and select and Unselect another parameter, then both of the modified parameters, which are now in RAM, will be burned in flash. So if you make a change and don't want it to be permanent, then restore its value before exiting Configure mode. But note also that if you DO want the change to be permanent, you must Unselect it with the toggle.

Here is what you should check if your MegaView is not working:

If you have installed a socket for the CPU, REMOVE THE CPU after making sure that MegaView is not powered.

1) First - visually inspect all of the solder joints. Make sure none are bridged to other joints - especially at the DB9, headers, and IC pins. Make sure no bits of snipped off leads are trapped between pins, and that excess solder flux isn't bridging pins. Examine the components around R1, R2, etc. are very closely spaced, and you may want to double check that there is no flux and other problems there. For example, the leads of C4 and/or C6 could ground against the crystal if the capacitors are bent over

2) Do you have the capacitors installed correctly? There are two polarized capacitors in MegaView: C13 and C14. C13 should be placed with the "+" lead (on the right when looking at the label with the leads pointed down) towards J1. If it isn't, remove it and throw it away. Get a replacement and solder it in correctly. C14 should be installed with the "+" lead toward the J1 terminal block - if it is not, throw it away and get a new one.

3) Make sure you have not swapped C3, with the 103 marking, for one of the other similar looking caps at C1, C5, C7, C9, C10, C11, or C12 (104 marking). They are not the same. If C3 is misplaced, remove the incorrect items and put them in correctly.

4) Is the MAX232 (V2) chip installed correctly? The notched end should be closest to the C10 capacitor at the bottom of the board.

5) Is the 68HC908 (V1) installed correctly? The notched end should be opposite the DB9 connector. If it isn't, turn it around (a lot easier if you have used a socket).

6) Are the diodes (D1, D3) installed correctly? They should have their "banded" ends furthest from the J1 connector. If they don't, turn them around.

7) Is the DB9 connector (P1) installed correctly? It should be on the same side as the CPU and J1 (i.e. away from the display). If it's the wrong way around, de-solder it and put it in right.

8) Is the display header installed correctly? It should be on the opposite side of the board to the CPU, J1, etc. It is the only component installed on the "back side" of the PCB.

9) Verify that resistor:

  • R1 is brown-black-orange-gold,
  • R2 is brown-black-yellow-gold, and
  • R3 is brown-black-blue-gold.
Note that R1 and R2 may be quite similar in appearance.

10) Measure the resistance between pin 2, pin 19, and pin 32 of the CPU socket and the ground terminal of J1 (the terminal furthest from the DB9). You should get very low numbers (<1 ohm) for these measurements. If you don't, find out why.

11) Plug the stimulator into your MegaSquirt, and then plug MegaView into MegaSquirt via the cable you plan to use. Make sure it is a straight through M/F cable - like the one you use to connect MegaSquirt to your laptop. Don't use a null modem cable. If your cable works for MegaTune, it should work for MegaView. Leave it all plugged together up to test #17.

12) Put a fresh 9 volt battery (or power supply) across the J1 terminal block. Do you have at least 8 volts coming into MegaView? Check across J1. You should have 9 volts across the two screw terminals, and positive should be nearest the DB9 connector. If you don't have sufficient voltage, get a fresh battery.

13) Do you have 5 volts from the 7805 regulator (V3)? You should have ~5.00 volts across the two terminals of the 7805 nearest the DB9 connector.

14) Do you have ~5 volts on pin 1, pin 20, and pin 31 of the CPU? Measure between each these pins of the socket and the ground terminal of J1 (the terminal furthest from the DB9). If you don't have 5volts on all these pins, find out why and fix it.

15) Unplug the display, and leave it unplugged for the remaining tests.

16) Turn on the board and check the heat level of the 7805 voltage regulator. If it is still hot after running a bit, then there is a problem on the board. The display takes up all of the current - with it unplugged the current level is in the low milliamps, and the 7805 should be cool to the touch.

17) Unplug the processor chip from MegaView, and hook up a null-modem cable with a gender changer between the MegaView and the PC.

You need a cable with two ends the same. The null modem cable has different ends, and the gender cable converts one end. Also, the null modem cable has pins 2 and 3 swapped. The gender changer does the same, so the net effect is to make a straight-through cable that mates the MegaView to the computer.

If you used your 'regular' MegaSquirt cable, then gender changer would swap pins 2 and 3, and the loopback test would fail.

Apply the power and check for heat - if the heat goes away then the processor is at fault. Try the 'loop-back' test described in step #22 of the assembly manual for MegaSquirt. Jumper the transmit/receive pins (12 and 13) on the processor socket (same pins as directed in the MegaSquirt manual for MegaSquirt - it is the exact same processor). Run hyperterminal and check for character echo.

18) If you get echo, then you could carefully try the following: take the chip out of the MegaSquirt box and put it in the MegaView - make sure that the display is not plugged in. The chips are the same, and with the display unplugged none of the processor pins are held in contention - they are basically floating. Plug in the MegaSquirt chip into the MegaView board and fire up MegaTune on the PC. Hook up using the null-modem cable/gender changer combination. Power up the board - you should see the seconds count up. Nothing else will be right, but if you see the seconds counting, then the MegaSquirt processor is running fine in the MegaView socket. This checks out the oscillator circuit, serial port, etc. If this is the case, then either the MegaView processor is bad or the MV display is bad.

19)If you have access to an oscilloscope, you can use it to check more components. With just power to MegaView, you should see a nice oscillation at pin 4, with a "squarish" wave form. Pin 5 should have a sine waveform.

20) Hook up MegaSquirt, and you should be able to see data being clocked into MegaSquirt at pin 13 and 14 on your scope. This should flow through to pins 11 and 12, showing up on pins 13 and 14 on the processor. If this is working, and if the processor is functioning, you should see the data being driven at the VFD connector at pins 11-14. If this is the case, you can add the VFD and check the pins for the same signal.

If all of this checks out, then you will have to start tracing each circuit for continuity, etc. Use the MegaView schematics as a guide.

If you tried with a different processor (from MegaSquirt), and you have power and ground at all the right places, then the problem has to be one of the components besides the processor. The most physically fragile component is the 32.768kHz crystal, so this is the one to replace first. It is fairly common and you might be able to pick up it locally.




If you have a question, comment, or suggestion for this FAQ, e-mail the editor.

©2004, 2005 Bruce Bowling and Al Grippo. All rights reserved.