Megasquirt-3 Fuel Delivery Tuning
Guide to fuel delivery tuning: VE table, ReqFuel, acceleration enrichment, warmup corrections, and autotune on Megasquirt-3
How Fuel Delivery Works in Megasquirt-3
Megasquirt-3 calculates injection pulse width based on several parameters. Understanding the overall fuel delivery logic is the key to successful tuning. The system operates in two fundamentally different modes: cranking and run mode.
Cranking Mode
While the engine is being cranked by the starter, Megasquirt uses only the Cranking Pulse Width curve — a relationship between injection pulse width and coolant temperature. All other tables and corrections (VE table, acceleration enrichment, EGO correction, etc.) are not applied at this point. This is important to remember: if the engine is hard to start but runs fine after starting, look for the problem in the Cranking Pulse curve, not in the VE table.
Typical Cranking Pulse values: at -20°C — 10-15 ms, at +20°C — 3-5 ms, at +80°C — 1.5-2.5 ms. Exact values depend on the engine and injectors.
Run Mode
Once the engine has started and RPM exceeds the Cranking RPM threshold, Megasquirt switches to run mode. The final injection pulse width is calculated using the formula:
Pulse Width = ReqFuel x VE(%) x corrections
Where corrections include:
- WUE (Warmup Enrichment) — enrichment during warmup
- ASE (AfterStart Enrichment) — enrichment after starting
- EGO Correction — closed-loop correction using the oxygen sensor
- Accel Enrichment — acceleration enrichment
- Barometric Correction — barometric pressure correction
Each of these multipliers is applied to the base injection pulse width, and the final result determines how much fuel the engine receives at any given moment.
ReqFuel — Base Injection Calculation
ReqFuel (Required Fuel) is the base injection time in milliseconds needed to achieve a stoichiometric mixture (AFR 14.7 for gasoline) at 100% volumetric efficiency (VE). In essence, it is the starting point for all fuel calculations.
What ReqFuel Depends On
The ReqFuel value is calculated based on three parameters:
- Engine displacement (in cubic centimeters)
- Number of cylinders
- Injector flow rate (in cc/min or lb/hr)
How to Calculate ReqFuel
TunerStudio has a built-in calculator: Tools -> Required Fuel Calculator. Enter your engine and injector parameters, and the software will automatically calculate the ReqFuel value and write it to the ECU settings.
The calculator also accounts for the injection type (simultaneous, batch, semi-sequential, sequential) and the number of injections per cycle. These parameters affect the calculation, so make sure they are set correctly.
When to Recalculate ReqFuel
- When replacing injectors with different flow rates
- When changing the injection type (e.g., switching from batch to sequential)
- When swapping the engine or significantly changing its displacement
Note: after recalculating ReqFuel, the VE table will need to be re-tuned, since the base injection pulse width — from which all other values are derived — will have changed.
VE Table (Volumetric Efficiency)
The VE table is the central element of fuel delivery tuning. It is a three-dimensional table where a volumetric efficiency percentage is assigned for each combination of RPM and load (MAP or TPS). The VE table determines how much fuel the engine receives at each specific operating point.
Table Structure
- X-axis (columns): engine RPM
- Y-axis (rows): load — intake manifold pressure (kPa) for Speed Density, or throttle position (%) for Alpha-N
- Cells: VE value in percent
Initial Values
If you do not have a base map for your engine, use the following guidelines:
| Operating Mode | VE, % | |---|---| | Idle (600-900 RPM, 30-40 kPa) | 30-40% | | Part throttle (2000-4000 RPM, 50-70 kPa) | 60-80% | | Wide open throttle (WOT, 90-100 kPa) | 80-100% | | Boost (>100 kPa) | 100-150%+ |
These are rough guidelines. Actual values depend on engine design, intake type, camshafts, and many other factors.
Practical VE Table Tuning
-
Install a wideband oxygen sensor. Accurate VE table tuning is impossible without one. A narrowband sensor (stock) does not provide sufficient accuracy.
-
Start with idle. Warm the engine to operating temperature. Monitor AFR readings. If the mixture is lean (AFR above target) — increase VE in the current cell. If it is rich (AFR below target) — decrease it.
-
Move on to mid-range RPM and loads. Drive in a calm manner, correcting cells based on oxygen sensor readings. Try to spend enough time in each operating mode to get stable readings.
-
Wide open throttle (WOT). Tune with caution — a lean mixture at full throttle can cause detonation and engine damage. Target AFR at full load is typically 12.5-13.0 for a naturally aspirated gasoline engine and 11.5-12.0 for turbo.
-
Smooth the table. VE values in adjacent cells should not differ sharply. Abrupt changes cause jerks during transitions between zones. Use the interpolation tools in TunerStudio.
Warmup Enrichment (WUE)
A cold engine needs a richer mixture because some fuel condenses on the cold walls of the intake manifold and combustion chamber, and fuel evaporation deteriorates at low temperatures. WUE is the electronic, automatic equivalent of the choke on a carbureted engine.
How WUE Works
WUE is a curve that sets the enrichment percentage based on coolant temperature (CLT). A value of 100% means no enrichment (base fuel delivery). Anything above 100% is additional fuel.
Typical WUE Values
| Coolant Temperature | WUE, % | |---|---| | -40°C | 200-250% | | -20°C | 170-200% | | 0°C | 140-160% | | +20°C | 120-130% | | +40°C | 110-115% | | +60°C | 105-108% | | +80°C and above | 100% |
At normal engine operating temperature (typically 80-95°C), the WUE value must be exactly 100%; otherwise, EGO correction via the oxygen sensor will constantly compensate for the excess enrichment.
Tuning WUE
The best method is to start the engine at various temperatures and observe AFR during warmup. If the engine stalls or misfires during a cold start — increase WUE for the corresponding temperature range. If the mixture is too rich during warmup (black smoke, high fuel consumption) — decrease it.
AfterStart Enrichment (ASE)
ASE is an additional short-term enrichment during the first seconds after the engine starts. It is needed to stabilize engine operation during the transition from cranking to self-sustained running.
ASE Parameters
- ASE% — the percentage of additional enrichment, defined by a curve based on coolant temperature. The value is higher for cold starts and minimal or zero for hot starts.
- ASE Taper Time — the time (in seconds/cycles) over which ASE enrichment gradually tapers to zero. Also defined by temperature.
Example ASE Values
| Coolant Temperature | ASE, % | Taper Time, s | |---|---|---| | -20°C | 40-50% | 15-20 | | 0°C | 30-35% | 10-15 | | +20°C | 20-25% | 8-10 | | +60°C | 5-10% | 3-5 | | +80°C | 0-5% | 1-2 |
If the engine briefly stalls or bogs down after starting, adjust ASE for the corresponding temperature.
Acceleration Enrichment
When the throttle is opened rapidly, air enters the cylinders almost instantly, but fuel arrives with a delay (some settles as a film on the intake port walls). Without acceleration enrichment, the engine experiences a brief lean condition, which manifests as a "bog" or "stumble" when pressing the throttle.
TPS-based Acceleration Enrichment
The classic acceleration enrichment mode. It responds to the rate of change of throttle position (dTPS/dt — the derivative of TPS over time).
Main settings:
- TPSdot Threshold — the minimum throttle opening rate (%/s) at which enrichment activates. A low threshold means enrichment triggers on gentle throttle inputs. A high threshold means only on aggressive inputs.
- Accel Enrichment Amount — the amount of additional fuel (in ms or %)
- Taper Time — how quickly the enrichment tapers off
- Decel Fuel Cut — mixture leaning or injection cutoff on abrupt throttle lift
MAP-based Acceleration Enrichment
Responds to the rate of change of intake manifold pressure (dMAP/dt). Can be used instead of or alongside TPS-based enrichment. Particularly useful for boosted engines, where pressure changes faster than throttle position.
Enhanced Accel Enrichment (EAE)
EAE is a more advanced acceleration enrichment algorithm available in MS3. Instead of simply adding fuel based on throttle opening rate, it models the behavior of the fuel film on the intake port walls.
How EAE works:
- Some of the injected fuel does not enter the cylinder immediately but settles on the port walls
- During acceleration, more fuel must be injected to compensate for new film formation
- During deceleration, the film evaporates and adds fuel — injection can be reduced
EAE performs better in transient conditions and provides smoother throttle response. It is recommended for engines with sequential injection.
Practical Tips for Tuning Acceleration Enrichment
- Start with the default settings.
- If there is a bog on sharp throttle input — increase the enrichment amount or lower the activation threshold.
- If the mixture is briefly too rich on throttle input (black smoke, bogging) — reduce the enrichment.
- Tune on a warm engine; otherwise, WUE will affect the results.
- Test at different RPMs — different settings are often needed for low and high RPM.
AutoTune in TunerStudio
AutoTune is a TunerStudio feature that automatically adjusts the VE table based on wideband oxygen sensor readings. It compares actual AFR to the target and adjusts VE values in real time.
AutoTune Requirements
- Wideband oxygen sensor connected to Megasquirt and properly calibrated
- AFR Target Table — a table of target AFR (air/fuel ratio) values, filled in for all operating modes
- TunerStudio MS license (AutoTune is not available in the free Lite version)
Setting Up the AFR Target Table
Before running AutoTune, you need to set target AFR values for each operating zone:
| Mode | Target AFR | |---|---| | Idle | 14.0-14.7 | | Cruise (part throttle) | 14.7 (stoichiometric) | | Wide open throttle (WOT), naturally aspirated | 12.5-13.0 | | Wide open throttle (WOT), turbo | 11.5-12.0 |
AutoTune Workflow
-
Rough manual tuning first. Before enabling AutoTune, achieve stable engine operation across all main operating modes. AutoTune is a refinement tool, not a tool for initial tuning from scratch. If the VE table is far from reality, AutoTune will apply excessive corrections and may behave erratically.
-
Fill in the AFR Target Table. Set target values for all zones. Do not leave cells empty or with zero values.
-
Enable AutoTune. In TunerStudio: Tools -> VE Analyze Live (AutoTune). A window will open with visualization of the current and target VE.
-
Drive. Try to cover as many operating modes as possible: idle, gentle acceleration, driving at various speeds, full throttle. AutoTune only corrects VE table cells that you have actually driven through.
-
Apply the changes. AutoTune accumulates suggested corrections. Periodically press "Burn" to write the changes to the ECU.
AutoTune Limitations
- Works only in zones where there is real data from the oxygen sensor. Cells you have not driven through remain unchanged.
- Does not correct acceleration enrichment, WUE, or ASE — only the VE table.
- Data is less accurate during transient conditions (rapid RPM or load changes). Best results come from steady-state operation.
- Does not fully replace manual tuning — it is a tool for refinement and maintaining map accuracy.
Injection Modes
Megasquirt-3 supports several injector operating modes. The choice of mode affects fuel metering accuracy and engine smoothness.
Batch Fire
All injectors open simultaneously, once or twice per full engine cycle (720° crankshaft). The simplest mode. Does not require a camshaft position sensor. Suitable for initial setup and simple installations.
Downside: some fuel is injected against a closed intake valve, which worsens mixture preparation and can increase fuel consumption.
Semi-Sequential
Injectors are grouped in pairs and fire in pairs. For example, injectors for cylinders 1-4 and 2-3 fire alternately. Does not require a camshaft position sensor. More accurate than batch fire but inferior to full sequential.
Sequential
Each injector opens individually at a precisely defined moment in its cylinder's operating cycle — just before the intake valve opens.
Requirements: a camshaft position sensor (CMP) to determine valve timing phase. Without a camshaft signal, Megasquirt cannot determine which cylinder is on which stroke, and sequential injection is not possible.
Advantages:
- Better mixture preparation — fuel is injected at the right moment
- More precise metering control
- Better idle and transient performance
- Ability to use Enhanced Accel Enrichment (EAE)
- Potentially lower fuel consumption and emissions
Recommendations for Choosing a Mode
If you have a camshaft position sensor and the wiring allows it — use Sequential. This provides the most accurate fuel delivery and the best engine performance. If there is no camshaft sensor — Semi-Sequential is a good compromise. Use Batch Fire only for initial debugging or when other modes are not possible for some reason.
Overall Fuel Delivery Tuning Sequence
For those tuning Megasquirt-3 for the first time, here is the recommended sequence of steps:
- Calculate ReqFuel using the TunerStudio calculator
- Fill the VE table with initial values (or use a base map for a similar engine)
- Set up Cranking Pulse for reliable starting
- Achieve stable idle — adjust VE at idle
- Tune WUE — verify starting and warmup at various temperatures
- Tune ASE — make sure the engine does not stall after starting
- Tune the VE table manually at mid and high RPM with a wideband sensor
- Tune Acceleration Enrichment — eliminate bogs on throttle input
- Run AutoTune to refine the VE table
- Re-check everything after making changes
Fuel delivery tuning is an iterative process. Do not try to achieve perfection in one pass. Each change to one parameter can affect others, so periodically revisit and verify previously tuned operating modes.