# Tuning # Subaru FA20/FA24 Direct Injection (DI) Documentation and tuning resources for Subaru FA20/FA24 direct injected engines # Ignition Timing & Knock Control ### Concepts #### Ignition

For more information on how fuel is delivered, see our documentation page on [Fueling & Injection](https://docs.motorsportsresearch.org/books/tuning/page/fueling-injection-open-closed-loop)

**Ignition, Flame, and Degrees BTDC** Gasoline engines operate on the principle of fuel [combustion](https://en.wikipedia.org/wiki/Combustion). Typically in a [direct injection system](https://en.wikipedia.org/wiki/Fuel_injection#Direct_injection_systems), first, fuel is [directly injected](https://en.wikipedia.org/wiki/Gasoline_direct_injection) into a cylinder some time before the spark is ignited. Additionally, it is compressed during the [compression stroke](https://en.wikipedia.org/wiki/Stroke_(engine)) as the piston travels upwards towards top [dead center](https://en.wikipedia.org/wiki/Dead_centre_(engineering)) (TDC). Relative to the top dead center position, and with its timing precisely controlled by the tuner's map, the [spark plug](https://en.wikipedia.org/wiki/Spark_plug) is electrically ignited by a signal sent from the ECU to start the process of combustion. Once combustion is started ideally with the spark plug, a flame front propagates evenly throughout the cylinder at a [specific speed](https://en.wikipedia.org/wiki/Flame_speed) relative to factors such as the fuel sprayed and the [air-fuel ratio](https://en.wikipedia.org/wiki/Air%E2%80%93fuel_ratio). Due to the flame's propagation speed and a goal of complete combustion, the ignition of the spark plug should be timed early enough in the piston's movement that the flame can fully propagate within the available time window up to the end of the exhaust stroke, helping to ensure that the air-fuel mixture is entirely combusted before the gasses are exhausted. Additionally, the timing of the flame propagation can be precisely controlled by the spark's timing to exact an idealized amount of force on the piston as it travels downwards during the power stroke, encouraging efficient energy extraction from the fuel-air mixture. To control this ignition timing, the [ECU](https://en.wikipedia.org/wiki/Engine_control_unit) has a series of maps that define when the ignition spark should take place relative to the top dead center position of the piston as it ends the compression stroke. Typically, and in the Subaru DI logic, this timing is measured in degrees before the top dead center position, or BTDC. In this case, the degrees in the measurement relates to the degrees of crankshaft rotation of the engine, with a 4 stroke engine (such as the FA24) taking two full revolutions (or 720 degrees) for all 4 strokes to take place. Here is a reference of BTDC values and the timing they are associated with relative to cylinder events:

Extreme values such as 90.00°, and 180.00°, negative or otherwise, are only provided as an example reference to cylinder events; these values are entirely unrealistic for engine operation, and **should not be used in real-world tuning**.

**Degrees Before Top Dead Center (BTDC)****Relative to TDC****Event**
`180.00°`BeforeEnd of intake stroke, beginning of compression stroke.
`90.00°`BeforeHalf-way through compression stroke, piston travels upwards towards the valves.
`0.00°`TDCTop dead center, power stroke begins.
`-90.00°`AfterHalf-way through power stroke, piston travels downwards towards the crank-shaft.
`-180.00°`AfterEnd of power stroke, beginning of exhaust stroke.
#### Detonation (or "Knock") **Detonation and Pre-detonation** In the ideal scenario, the ignition of the air-fuel mixture in a cylinder will result in a single, evenly propagating flame front that expands outward from the spark plug at a predictable and controlled rate of expansion. This controlled expansion of the flame front results in a linear, even pressure across the cylinder walls and the piston's surface. However, it is unfortunately possible for the air-fuel mixture to spontaneously ignite in various conditions, causing one or more flame fronts to propagate throughout the cylinder's volume in an uncontrolled manner. This spontaneous ignition of the air-fuel mixture is referred to as **[detonation](https://en.wikipedia.org/wiki/Engine_knocking)** due to the (sometimes audible) sound that is produced by multiple flame fronts colliding with each-other and creating extremely high pressure spikes inside the cylinder. Due to this sound, detonation is sometimes referred to as *knock;* not to be confused with *rod knock*, which is an entirely different phenomenon. These collisions can directly cause damage to the cylinder walls, valves, head surface, and piston surface. **Pre-detonation** is similar to detonation, but occurs *before* the spark ignites the air-fuel mixture, as opposed to detonation which occurs at some point *after* the spark ignites the air-fuel mixture. In either case, the unpredictable pressures generated by any form of detonation can exact chaotic forces on the piston surface, suddenly forcing its connecting rod into the crankshaft, possibly damaging the [rod bearing](https://en.wikipedia.org/wiki/Plain_bearing). This is especially true for pre-detonation, where the spontaneous ignition can occur as the piston is completing its upwards travel to complete the compression stroke, violently interrupting the piston's only available direction of travel in possibly its most *critically* pressurized moment. Detonation and pre-detonation can be caused by several factors, often compounding together simultaneously: 1. Faulty spark plugs or fuel injectors. 2. An air-fuel mixture that is too lean or too rich for proper combustion with cylinder conditions. 3. Low [fuel octane](https://en.wikipedia.org/wiki/Octane_rating), the measurable capability of a fuel to resist detonation. Fuels such as 93 or E85 have a higher octane rating than perhaps 87 or 91, but it is possible for fuel to lose octane after sitting for a long period of time. Fuel octane can be affected by any contaminants such as oil or coolant mixing with the air and fuel in a cylinder. 4. An ignition timing value that is too advanced (earlier in time). 5. A [compression ratio](https://en.wikipedia.org/wiki/Compression_ratio) incompatible with cylinder conditions and the commanded ignition timing. Compression ratios can be increased by carbon deposits (buildup) inside a cylinder. 6. Excessive temperatures inside the cylinder, including air temperature and hot spots within the cylinder surfaces. Carbon deposits can also be sources of these hot spots. ### Subaru Knock Control #### Introduction **Mitigation** As detonation and pre-detonation can be dangerous events, entirely eliminating all forms of detonation (or "knock") is an extremely important goal of any gasoline ignition strategy. By reducing (also referred to as retarding or pulling) the base ignition timing *later* in the engine cycle or by modifying the air-fuel ratio, it is possible for an ECU to significantly mitigate detonation events. While pre-detonation can be mitigated this way as well, it is likely that additional factors are involved if it is occurring. Unfortunately, delaying the ignition timing implies that torque would likely be lost due to the decreased mechanical advantage imparted by the piston on the crankshaft from the flame front's delayed propagation. However, this is a valuable trade-off, as an engine won't be making *any* torque (or, at best, significantly less) if severe detonation event(s) occur and cause damage to cylinders or other engine components. **Why Pull Timing?** It is important to note that if we are reducing (pulling back) ignition timing, we are effectively delaying (or retarding) the spark event's occurrence in time relative to the engine's cycle. This has effects that help mitigate detonation, with one primary advantage being that we are allowing for more time for [entropy](https://en.wikipedia.org/wiki/Entropy) to do its job and to enabling the air and fuel to mix within the volume of the cylinder. Additionally, the environment within the cylinder becomes less favorable for detonation as the piston moves past its top dead center (0 degrees BTDC) and travels downward in the power stroke. This downward motion has the important effect of increasing the cylinder [volume](https://en.wikipedia.org/wiki/Volume), which correspondingly decreases the air-fuel mixture's [density](https://en.wikipedia.org/wiki/Density) as the valves remain during the power stroke. This reduction of density reduces the cylinder's pressure and temperature, both highly advantageous effects to mitigate detonation. #### Sensors **Knock Sensors** On the Subaru FA platform, two [piezoelectric sensors](https://en.wikipedia.org/wiki/Piezoelectric_sensor) called [knock sensors](https://en.wikipedia.org/wiki/Engine_knocking#Knock_detection) are bolted directly onto the factory [short block](https://en.wikipedia.org/wiki/Automobile_engine_replacement#Short_block). With both positioned in the rear of the [crankcase](https://en.wikipedia.org/wiki/Crankcase), nearest the [bell housing](https://en.wikipedia.org/wiki/Bell_housing), each sensor is allocated to a [cylinder bank](https://en.wikipedia.org/wiki/Engine_configuration#Piston_engines). As Subaru engines utilize the [boxer engine](https://en.wikipedia.org/wiki/Flat-four_engine) layout, this means that the knock sensors are assigned to each case half, with the left sensor corresponding to cylinders #3 and #1, and the right sensor corresponding to cylinders #4 and #2. Acting as microphones, the knock sensors perceive vibrations propagating throughout the block in a similar manner a traditional microphone would record pressure waves in open air. By filtering and analyzing the signal received and restricting the recording time window to the firing cylinder's ignition time window, the ECU can take advantage of these sensors to approximate an extremely important feedback on the occurrence detonation, which itself is a noisy (and sometimes even audible) event. #### Mitigation Stategies **Introduction** The Subaru factory logic, including that of the DI models such as the FA20 and FA24, utilize three distinct methods to manage detonation (or "knock") in its ignition timing system. Each relies on the principle of reducing (or pulling) ignition timing. All three systems are permanently active and each can affect the ignition timing directly at any point in time if necessary. **Feedback Knock (FBK)** Feedback Knock is the component of the OEM strategy responsible for the **short-term** component of detonation mitigation. The ECU leverages the knock sensors to continuously analyze and perceive suspected detonation events in the form of recorded audio events in real-time. Once the intensity of an event exceeds a threshold defined in the table group **Knock Control - Threshold**, a binary signal is generated that indicates the presence of ongoing detonation. The **Feedback Knock** value will be decremented according to a magnitude corresponding to a calibration value. As the detonation event is mitigated or is resolved, the Feedback Knock value will return to a value of 0.0. Greater values seen from the Feedback Knock parameter are indicative of a more significant detonation event. Steadily or sharply increasing values are indicative of an event requiring more negative timing to mitigate, while small (-1.41, etc.) values that do not increase are indicative of possible noise or a much shorter event. The value of the Feedback Knock parameter is directly used as a **subtraction** from the **final ignition timing**. It is always active. In this way, the Feedback Knock is effectively able to respond quickly to transient detonation events for future cylinder firing events, but has the disadvantage of not being capable of preventing the first events that trigger it. This is, of course, due to the fact that it relies on these events occurring to react in the first place, even if it may be quick to mitigate them. When troubleshooting the Feedback Knock parameter demonstrating timing subtractions for a possible tune modification, it is important to classify the problem by analyzing the overall event and the engine conditions during it. For example, was the negative value seen during deceleration, light load, heavy load (a pull), or transient (quickly changing) conditions? What fuel was used, and what was its octane rating? Were new parts or mounts installed on the vehicle that may have increased vibrations? What parameters were recently modified in the tune? If it is difficult to reproduce the subtraction in an identical environment and condition, it likely would have been noise, especially for smaller feedback values. If it is readily repeatable, even semi-consistently, there likely is either an real issue with true detonation or the sensors are consistently recognizing noise from vibrations present only during certain conditions. **Fine Knock Learn (FKL)** To account for the shortcomings of the Feedback Knock strategy, Fine Knock Learn provides the **long-term** component of detonation mitigation, as a subtraction in degrees before top dead center (BTDC). As detonation events are observed, the ECU records these events and persists them in a long-term storage system called the [EEPROM](https://en.wikipedia.org/wiki/EEPROM). Internally, the ECU records these ignition timing subtractions in a small table based on the engine speed (RPM) and the calculated load (g/rev) at the time of the events. Fine Knock Learn can return to its normal state of 0.0 degrees subtracted from the ignition timing, but only when detonation events have not been seen in the affected operating condition's cells. By looking up this table before ignition occurs, the Fine Knock Learn parameter can express an engine condition-specific value that assists in mitigating detonation before it can occur, unlike Feedback Knock. However, Fine Knock Learn cannot react to transient events, so these two systems operate in tandem to provide continuous short and long-term coverage for both transient and recurrent detonation activity, respectively. Troubleshooting the Fine Knock Learn parameter can be slightly easier than troubleshooting the Feedback Knock parameter, as the important question of replicability has likely already been answered - values present in this learning table are normally recurrent. First, identify which cell(s) in the table the ignition subtraction(s) have been recorded to. Using this engine condition, run through the same troubleshooting steps as the Feedback Knock parameter, but instead with the assumption that these events have likely been recurrent. **Dynamic Advance Multiplier (DAM)** A third, broad-stroke strategy used by the Subaru ignition timing control system is the **Dynamic Advance Multiplier**. Unlike the Feedback Knock and Fine Knock Learn parameters, the Dynamic Advance Multiplier (or "DAM") parameter is a number ranging from 0.0 to 1.0, and acts as a scaling (activation) value against the Ignition **Dynamic Advance** tables. To determine a base ignition timing value, first the base ignition timing tables are calculated for the current engine speed (RPM) and load (g/rev). Then, the Dynamic Advance tables are processed. But, before adding this additional timing advance on top of the base timing, it is first multiplied by the Dynamic Advance Multiplier value. In this way, the Dynamic Advance Multiplier acts as an activation for additional timing in the map. The Dynamic Advance Multiplier can be decreased (reducing the base timing advance) if detonation events are seen, similar to how the Feedback Knock system works, but instead of directly controlling ignition timing, these events (if significant enough) can reduce a multiplier. Unlike Feedback Knock, however, increases to the Dynamic Advance Multiplier behave more similarly to Fine Knock Learn, where the DAM value will increase as detonation events are *not* seen during critical operation such as heavy acceleration (a pull). # Fueling & Injection (Open & Closed Loop) ### Concepts #### Air-Fuel Ratio/Lambda **Combustion and Air-Fuel Ratio** Gasoline engines operate on the principle of fuel [combustion](https://en.wikipedia.org/wiki/Combustion). By approximating the [mass](https://en.wikipedia.org/wiki/Mass) (not to be confused with volume) of air entering a cylinder from the [intake manifold](https://en.wikipedia.org/wiki/Inlet_manifold) prior to [fuel injection](https://en.wikipedia.org/wiki/Fuel_injection), a calculation can be made to determine the necessary mass of fuel based on the desired **target [air-fuel ratio](https://en.wikipedia.org/wiki/Air%E2%80%93fuel_ratio)**, or the *ratio of units air mass to units fuel mass*, for the intended combustion. Depending on the conditions of the engine, such as load (grams of air mass per crank revolution) and engine rotation speed (RPM), varying air-fuel ratios will be required. A carefully selected air-fuel ratio for the engine's operating conditions will include the following benefits: - The resistance to, or avoidance of [detonation](https://en.wikipedia.org/wiki/Engine_knocking) (or "knock") occurring inside a cylinder during or prior to intended, controlled combustion (which starts with the [spark](https://en.wikipedia.org/wiki/Spark-ignition_engine)). - Ensuring complete combustion, where the injected fuel is ideally mixed and combusted, which among several things, results in greater efficiency and more effective extraction of possible force on the cylinder's piston. - Avoidance of excessive combustion temperatures that can cause damage to any metal surfaces inside the cylinder (melting) or pressures that are outside of the design limitations (relating back to knock). **How Air-Fuel Ratio is Realized** Using the fuel mass derived from the air-fuel ratio and other factors, a calculation can be made to approximate the necessary duration of duty time ("pulse width") that the to-be-fired cylinder's corresponding injector should be electrically signaled to open, permitting fuel to spray into the cylinder. The longer the injector stays open, the more fuel mass is injected directly into the cylinder, and the shorter the time the injector is open, the less fuel is injected. This injection time is called the injector pulse width, or "IPW" for short, where *width* refers to the duration of time the injector should remain open, typically represented in milliseconds (ms). This is not necessarily the same as the injector hold time.
*Please note that, in the above graphic, time (X axis) is not to scale.* Other physical effects are factored during this calculation of pulse width, such as the fuel's delivery pressure behind the injector (fuel rail pressure), intake air density, coolant temperature, and so on, in order to estimate the precise amount of fuel being delivered as accurately as possible. Any modifications that affect this calculation are considered **compensations** (for physical effects) or **trims** (for controlling a target air-fuel ratio). #### Open vs. Closed Loop Fueling (Abstract) **Open Loop and Positives/Negatives** Although it is possible to estimate the ideal injector pulse width (IPW) to within a close margin, error accumulating from all sensor readings (of which there are many involved), calibration imprecision, and even rounding issues within the ECU's binary logic will effectively cause the calculated pulse width to the injectors to never be perfect. This means that, instead of injecting an ideal mass of fuel, the ECU will always be injecting some amount more (richer) or less (leaner) than the intended mass as it relates to the physical target air-fuel ratio by some unpredictable margin. The process of injecting fuel into a cylinder without any sensor feedback on the resulting air-fuel ratio (in this case, the setpoint) is called [**Open Loop**](https://en.wikipedia.org/wiki/Open-loop_controller).
Open Loop presents a problem when tight control over the real, physical air-fuel ratio is necessary: in a modern vehicle with lower margins of safety and greater incentive to optimize combustion efficiency, where the limitations to fueling are approached more aggressively, these errors can have a more significant impact on causing engine knock. Additionally, with an OEM assumption of the fuel's [energy density](https://en.wikipedia.org/wiki/Energy_density), which is typically only ever assumed to be that of gasoline unless modified (i.e. flex fuel), combustion will be negatively impacted when fuels with unanticipated energy densities are used or mixed (i.e. E85). Due to these restrictions, often a tuner will enrich (add fuel) in the Open Loop air-fuel ratio target map(s) in order to add a margin of safety to combustion, but this still does not cover the bases for all scenarios where Open Loop has challenges. On the other hand, Open Loop is fast. Where Closed Loop control requires a fixed amount of time to sense the combustion products and derive an approximate result of air-fuel ratio, Open Loop quickly commands an estimated value. Depending on the strategy taken by the tuner, Open Loop can be an effective way to control effective combustion in an engine in scenarios where delayed feedback (trim) to air-fuel ratio is not an option. Additionally, Open Loop is ideal in scenarios such as malfunctioning air-fuel sensors for Closed Loop, or simply not having them physically present/available. This can sometimes be the case on extremely high flow/horsepower engines, older vehicles without Closed Loop-specific feedback sensors, or even scenarios where the fuel type being used is trusted to be highly consistent. **Closed Loop and Positives/Negatives** Due to the challenges presented by Open Loop control, most modern ECUs control the injector pulse width based on the feedback signaled from physical sensors in the exhaust path. This feedback, in the form of the physical air-fuel ratio (often expressed as [lambda](https://en.wikipedia.org/wiki/Air%E2%80%93fuel_ratio#Air%E2%80%93fuel_equivalence_ratio_(%CE%BB))), is used to adjust (trim) the injector pulse width to account for the error observed between the sensed air-fuel ratio and the target air-fuel ratio (also known as the setpoint). This process of relying on feedback to adjust the commanded value is referred to as [Closed Loop](https://en.wikipedia.org/wiki/Closed-loop_controller) control.
Closed Loop control solves several issues with Open Loop control: 1. Open Loop is not sensitive to any changes in a fuel's energy density (i.e. blending ethanol), while Closed Loop control can adjust for these changes, although only up to defined limits. 2. Open Loop is not sensitive to long-term changes in combustion, such as those created by carbon build-up on intake values disrupting airflow, while Closed Loop control can learn these deltas over time. 3. Open Loop is not sensitive to errors in the air-fuel calculation caused by an improper calibration of the Mass Airflow (MAF) sensor, for example when replacing an intake with an aftermarket intake, while Closed Loop control can learn from these discrepancies. This is a critically important advantage for calibrating aftermarket intakes. Closed Loop control has drawbacks, however. When in Closed Loop mode, an ECU will make adjustments based on the downstream products of combustion *after* it has happened. Along with time-consuming signal processing such as smoothing, the sensed lambda value will be electrically delayed by some deterministic amount of time after the commanded pulse width value had been electrically commanded and combustion had physically occurred. Due to this discrepancy, errors in the approximated pulse width are never perfectly corrected in advance, but instead are corrected continuously with calculated **trims**. Also, if the feedback delay is out of a preset tolerable value (limit), then Closed Loop control cannot take place. Closed Loop relies on sensors to determine error, which unfortunately means that if sensors downstream of combustion, relied upon for reporting accurate estimations of air-fuel ratios, are not functioning properly, the corresponding calculated error (and therefore the trims) will be inaccurate as well. ### Key Hardware Sensors #### Mass Airflow (MAF) Sensor In order for the ECU to calculate and balance an injector pulse width (IPW) that harmonizes to the air-fuel ratio (lambda) value requested by the tune, an accurate estimation of the mass of air entering the cylinder (also referred to as engine load) must be calculated. To calculate this value, expressed in grams of air per crank revolution of the engine, first a mass airflow value (in grams per second) that represents the mass of air flowing through the engine's intake tract (or intake manifold) must be approximated. On a Subaru DI engine from factory, this is done using a [Mass Airflow (MAF) Sensor](https://en.wikipedia.org/wiki/Mass_flow_sensor). Typically, this sensor is positioned inside the intake piping immediately after the air filter, right at the entry-point of air for the vehicle's intake system. Then, a wire positioned within and exposed to the intake air stream is heated. The electrical characteristics of the wire as it responds to the flowing air mass affecting its temperature is measured, and the resulting value (voltage or otherwise) is mapped to a resulting mass airflow value by the tune/calibration. This is the standard, Subaru factory strategy of calculating engine load. On some engines, and in tunes using Speed Density, this can be approximated indirectly using the [Manifold Absolute Pressure (MAP) Sensor](https://en.wikipedia.org/wiki/MAP_sensor). In this scenario, the barometric pressure (absolute) of air in the intake manifold (**density**) is measured along with the temperature. Also factoring the engine **speed** (RPM), other compensations, and a map of the engine's [volumetric efficiency](https://en.wikipedia.org/wiki/Volumetric_efficiency), a mass of air entering cylinders can be closely approximated. This is not the standard, factory strategy of calculating engine load for Subaru ECUs. However, this method does offer some advantages over a mass airflow sensor. #### Narrowband O2 Sensor An [oxygen sensor](https://en.wikipedia.org/wiki/Oxygen_sensor) (or O2 sensor) is a physical sensor that is incorporated into the exhaust piping of the engine, with one being placed immediately after the primary [catalytic converter](https://en.wikipedia.org/wiki/Catalytic_converter) in the Subaru DI factory arrangement. Oxygen sensors, by interacting with exhaust gases, provide a value relative to the [stoichiometric](https://en.wikipedia.org/wiki/Stoichiometry) ratio that assists the ECU in approximating if the air-fuel ratio was richer (more fuel) or leaner (less fuel) than the ideal combustion ratio. It is important to underscore that these sensors are in essence providing an approximation of the relative direction of error of [lambda](https://en.wikipedia.org/wiki/Air%E2%80%93fuel_ratio#Air%E2%80%93fuel_equivalence_ratio_(%CE%BB)) value 1.0 of combustion. For example, a lambda value of 1.0 would be equal to an air-fuel ratio of about 14.7:1 for gasoline, and about 9.76:1 for E85. However, narrowband sensors cannot provide an accurate value for the combustion air-fuel ratio, only its relation to the stoichiometric ratio: if combustion was above or below that ratio, and a loose approximation of how significant the error is. The role of the narrowband O2 sensor in the Subaru DI arrangement, being so limited in its capabilities, is not to determine the air-fuel ratio of combustion across a wide range of possible values. Instead, it is primarily used for managing the catalyst efficiency through trims and monitoring its effectiveness when the engine is commanding an air-fuel ratio close to a stoichiometric target. Wideband Lambda Sensor (Closed Loop) A wideband sensor is a physical sensor that is incorporated into the exhaust piping of the engine, with one being placed immediately before the primary catalytic converter in the Subaru DI factory arrangement. Wideband sensors, by interacting with exhaust gases, provide to the ECU a close approximation of the air-fuel ratio ([lambda](https://en.wikipedia.org/wiki/Air%E2%80%93fuel_ratio#Air%E2%80%93fuel_equivalence_ratio_(%CE%BB))) condition that was present in the cylinder prior to combustion. This is a critically important sensor for Closed Loop control, as it provides the feedback value necessary to approximate the error between the commanded air-fuel target ratio and the physical combustion's indicated air-fuel ratio. The wideband sensor is able to sense this ratio as the exhaust gasses pass over it, flowing out of the engine through the exhaust piping where the wideband sensor is located after being collected by the [exhaust manifold](https://en.wikipedia.org/wiki/Exhaust_manifold). Using the wideband sensor in Closed Loop mode, the ECU is able to calculate an overall air-fuel ratio (lambda) error and generally speaking modulates (trims) the injector pulse width accordingly to compensate for any inaccuracies (too rich or too lean) in its pulse width calculations. ### Subaru DI
#### Correction (Short-Term) Trims **A/F Correction #1** This is the short-term correction of the injector pulse width, sourced directly from the wideband lambda sensor. To produce this trim, the ECU first determines the error (delta) for the sensed air-fuel ratio (lambda) as it relates to the commanded air-fuel ratio. With this error, an excitation value is applied corresponding to the engine speed and load, effectively controlling the trim's activation based on the engine's operating condition. This trim is only active in Closed Loop mode. **A/F Correction #3** This is the short-term correction of the air-fuel ratio (not to be confused with the injector pulse width), sourced directly from the narrowband O2 sensor. To produce this trim, the ECU determines a rough estimation of error from the narrowband O2 sensor. This trim is only active in certain conditions, especially those that relate to the operation of the engine in an idle state, where the commanded air-fuel ratio is close to the stoichiometric ratio (or lambda 1.0). #### Learning (Long-Term) Trims **A/F Learning #1** This is the long-term correction of the injector pulse width, sourced analytically from the wideband O2 sensor over time. **A/F Learning #3** This is the long-term correction of the air-fuel ratio (not to be confused with the injector pulse width), sourced analytically from the narrowband O2 sensor over time. # Mass Airflow (MAF) & Aftermarket Intakes # Ignition Timing - Primary, Decel, and Startup

For more information on the basics of Ignition Timing and Detonation, see: [Ignition Timing and Knock Control](https://docs.motorsportsresearch.org/books/tuning/page/ignition-timing-knock-control).

### Targets #### Acceleration (or "Primary") ##### Base and Dynamic Advance This target is active when the accelerator pedal is depressed, or otherwise when conditions are met for the [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Ignition - Accel. Dynamics - Decel Active (⚑, ubyte)** parameter to be **zero**. Generally speaking, conditions where this target is active are wide open throttle ("WOT") and cruising (when the accelerator is pressed). This ignition timing target and its associated tables and parameters are sorted under the **Ignition - Primary** folder and are comprised of four key **base** tables: - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Primary - TGVs Closed (AVCS Disabled)** - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Primary - TGVs Closed (AVCS Enabled)** - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Primary - TGVs Open (AVCS Disabled)** - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Primary - TGVs Open (AVCS Enabled)** These four tables are first blended based on the corresponding blending values of [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Engine - AVCS Map Ratio (﹪, ubyte)** and t [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Engine - TGV Map Ratio (﹪, ubyte)**. The resulting base value can be monitored using the [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Ignition - Primary - Base Table (°, sbyte)** parameter. Then, a **Dynamic Advance** value is calculated using the [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Knock Control - Dynamic Advance Multiplier (ubyte)**, commonly referred to as "*DAM*". This DAM value ranges from 0.00 to 1.00 and acts as a multiplier to the base dynamic advance table value. This base dynamic advance value is found by using the two primary base tables that are themselves blended using the TGV Map Ratio: - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Primary - Advance - TGVs Closed (Base)** - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Primary - Advance - TGVs Open (Base)** The resulting blended, base value can be monitored using the [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Ignition - Primary - Advance - Table (°, ubyte)** parameter. This value is summed with the [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Ignition - Primary - Base Table (°, sbyte)** to produce a primary base target value. ##### Tuning Strategy Tuning the Primary Ignition target maps is critical for any power-related objectives in the Subaru DI platforms, as these tables are designed to control the spark advance in all typical acceleration scenarios when throttle is applied. With the tables under the **Ignition - Primary - Advance** controlled by the **Dynamic Advance Multiplier** (or DAM), this presents an opportunity to you as a tuner to determine how ignition advance should be delivered in scenarios where the DAM is lowered. The DAM is reduced by negative ignition events such as detonation, therefore these associated tables can be used to design areas of the ignition timing advance that, were detonation to be identified, timing may be removed. #### Deceleration (or "Decel") This target is active when the accelerator pedal is depressed, or otherwise when conditions are met for the [![parameter.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/wHX4oSnrXt7twvE9-parameter.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/wHX4oSnrXt7twvE9-parameter.png) **Ignition - Accel. Dynamics - Decel Active (⚑, ubyte)** parameter to be **one**. This ignition timing target and its associated tables and parameters are sorted under the **Ignition - Decel.** folder and are comprised of two key **base** tables: - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Decel. - TGVs Closed** - **[![table.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/scaled-1680-/9eh6kI73WySG3tND-table.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-02/9eh6kI73WySG3tND-table.png) Ignition - Decel. - TGVs Open** # Organization # Tuning Do's and Dont's ### Introduction If you're new to tuning, it's good to have a guideline to how you approach this process. That's why we have this document, to help you get in the right mindset to make your goals with your car realized with the reliability you want. These are based on our own experiences, or own successes, failures, and hard lessons learned. We hope that we learned some of these things that hard way so that you don't have to! ### The Dunning-Kruger Effect To understand the premise behind the Do's and Don'ts, it's good to understand and reflect on the [**Dunning-Kruger Effect**](https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect). This is a cognitive bias that was first described by David Dunning and Justin Kruger in 1999. It describes how *competence* (in our case, background in the physics and experience behind-the-wheel tuning engines) relates to *confidence*. With low competence (starting out in tuning), it's possible to have an erroneous, over-estimation of your skills which leads to *thinking* you know more (are more competent) than you do/are. The Dunning-Kruger effect tells that we are more likely to overestimate our abilities as we are freshly starting to learn how to tune our cars. In many disciplines, this doesn't carry huge consequences. Unfortunately for tuning cars, though, the consequences of this overconfidence can be as serious and expensive as a hole in your engine. In essence: **this entire page is attempting to help you avoid being in the upper-left region of this chart.** ### [![image.png](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-03/scaled-1680-/joRfUJXxYgyWmMds-image.png)](https://docs.motorsportsresearch.org/uploads/images/gallery/2025-03/joRfUJXxYgyWmMds-image.png) ### Do's and Dont's

This list isn't exhaustive, and examples provided aren't anywhere near complete; make sure you do your own research to expand on areas or ask us questions in our community Discord where you are interested in learning more. If you find yourself doing things in the "Don't Be This Guy" category, understand that this is only our assimilated opinions. We humbly provide these contrasts as one more guide of many available for ourselves and for our community members to grow as more objective, data-driven tuners.

**Aspect****Don't Be This Guy****Be This Guy**
**Limits**- Don't start making changes to your tune without identifying your limits, both with the car and with your own background knowledge. - Don't assume what the limits *might* be, even if you feel like you have an intuition based on a prior project. - Don't ignore your limits, because the laws of nature aren't ignoring you! - Ask for help and identify what the limits are to the vehicle you're working with. Here are some examples: - What timing advance is reasonable for your fuel? - What boost pressure yields the greatest efficiency on this turbocharger? What boost pressure just "blows hot air"? - Everything in life has a limit. Even drinking too much water can be fatal (it's even got a name). So does your car, and reflexively, every aspect of your tune has some sort of a limit. Know them. - Stick to these limits, if that's your plan. Understand that if you don't know, it's better to stop and ask for information or help from our community before continuing.
**Risks**- Don't ignore risks or underestimate the possibilities for critical component damage (i.e. engine). - Your risks are derived from your limits; don't fall into a false sense of security by disregarding limits. - Don't make assumptions about your luck. Luck won't make your tune a reliable one. - Don't let a fear of your risks limit yourself from realizing your goals. A proper risk assessment should give you the courage to approach your *realistic* goals with confidence. - Know your risks as you learn your limits. Here are some example questions to ask yourself: - What are you risking by increasing the boost too much? - What outcomes can you anticipate if you advance ignition timing too much? - What are the possible risks of running to lean or rich? - Realize that your risks are always present whether you want them to be or not, and physics doesn't care about your luck or your gut feeling. - Form a personal assessment. Compare it with your capabilities, both financially and your part reinstallation options. Can you afford to risk an engine? How much uncertainty in reliability are you willing to accept by inching closer to or even *past* a limit? - Be confident in how your approach to tuning reduces the risks you're trying to avoid, and base that off of examples. Who else has accomplished your goals? How did they do it? - You can never be too safe; get a second opinion. Are you and others who are ahead of you in the journey comfortable with your approach?
**Goals**- Don't be the tuner without a goal. - Don't keep adding boost, timing, etc. just because it feels good and you're waiting to see if it'll be fast enough this time. That itch might not go away until it's too late... - Don't end up looking back and wish your goals were more realistic! As is often said, "my car felt the best it ever had before it threw a rod!" - Don't "scope creep" (break beyond your goals) if you haven't mentally revisited your limits and risks associated with your new goals and are, once again, okay with the risks. - **Set** your **own goals**. Have an end result in mind. 1. How much X (horsepower, boost, etc.) do I want? 2. How do I want to use this tune? Do I prefer to joyride my car, auto-cross, rally, or do I prefer to run the quarter mile? 3. Now, how much X (horsepower, boost, etc.) do I *need* to enjoy that? 4. Now, what goals do I need to set so I end up with a tune that makes my car run the way I *really* want my car to run? - Be realistic. Scale back your goals to reasonable ones that are within your comfort zone and don't push the boundaries of what limits you can't afford to exceed. - Once set, stick to your goals until you've reached them and you determine that it's time to set new ones.
**Learning** - Don't set yourself up to learn things the hard way. This will be a lot easier to avoid if you learn your limits, assess your risks, define your goals from those, and stick to them. - Don't blindly throw yourself at a problem without having done at least some research beforehand into possible root causes. - Don't overestimate your own understanding. - Don't forget that every platform is different, and a prior platform almost never affords you *everything* you *need* to learn about a new platform, even if you've tuned other platforms for a decade. - Recognize when something has gone wrong, and do your best to learn from your mistakes. Something unexpected in your data is an opportunity to expand your understanding and learn from the experience. - Have some humility, and do your best to be open to other's advice. - Be fully informed prior to your map changes; learn anything and everything you can before making adjustments, even seemingly small ones. - Furthermore, understand what your map changes mean in the physical world. What is timing advance, really? What is the wastegate's job? How are these things controlled? - Learn your sensors. What sensors does your vehicle provide? How do they work? What do the reported values mean? How and when can your sensors report values to you incorrectly? - Learn and be comfortable with stock reported values. What does the OEM tune command? Why is it commanding it?
**Process**- Don't tune without a process in mind. - Don't disregard the importance of root cause identification. - Don't disregard your process and start trying random things if feedback from your car is suggesting your approach was wrong. - Making a change to your tune to realize one of your goals? Have a process. - When you have a problem, always identify the root cause with the evidence and data to irrefutably back it up. - Get a second opinion on your approach to reach your goal or solve your problem. Is there a better way to dial in that wastegate map? - If things still aren't working to produce the result you want, revisit your process. How could it be improved? What could you be missing? What do you need to learn?
**Data vs. Assumptions**- Don't make assumptions. - Don't disregard your data in your logs. It's there to guide you. - Don't only log what parameters you *think* you need to log. Don't only record logs with parameters that help you confirm your theory, record logs with parameters that help disprove any other possibilities. - Don't fall victim to confirmation bias, even if your data has been teasing that you are right about your intuition; it could still be misguided. - Don't make a guess without data to back it up. For example, if you weren't logging when that problem happened, don't start making adjustments until you catch it again with data to prove your theory. - Get comfortable reading and understanding data. Don't make assumptions about what you think is going on. Instead, get data so clear that it's good enough to convince others. - Log anything you can that might be relevant to your situation. It doesn't hurt to have more data available to correlate. - Doubt your own preclusions unless you can verify them completely with *reliable* sensor data. - Understand your knowns and unknowns: - What do you know? This should be derived from your sensor data, not driver's seat feedback from the vehicle. - What knowledge gaps do you have that you're fully aware of? These are called known-unknowns. This could be, for example, a possible condition that you don't have a sensor available to truly characterize, or even a parameter you have available, but didn't datalog in that last run. - What could you theorize you might be missing altogether? These are your unknown-unknowns, or things that you don't know, that you don't know. A broader, deeper understanding of the physics involved helps eliminate these.
**Iterate**- Don't make giant adjustments to skip over steps that might seem insignificant to you, even if it's not your first time following those steps. - Don't assume that you're ready to iterate again towards your goal if you haven't developed a broad confidence in your current tune. - Don't change so much at once that you introduce too many variable to any possible problems that could arise from those changes. - Iterate. For example, don't make one big adjustment, divide it into 3 small adjustments with a test drive for each. Build confidence in your understanding by observing incremental success at each iteration. - Prefer small adjustments, even if you have confidence that larger adjustments will surely be fine. This is, unfortunately, a hugely common failure point for most beginners and suggests lack of understanding, poor assumptions, and finally is a good inflection point to revisit their risk assessment. - Prefer changing one area at a time, or minimize the change to multiple areas at once. If you change too much, you risk introducing too many variables that might make diagnosing problems stemming from those changes very time consuming. - Save often and keep a history of previous iterations. If you hit a problem, sometimes the easiest thing is to start from yesterday's map and step through the changes one-by-one, retesting as you go.
**Patience**- Don't expect to get to "X" horsepower at the end of the week or month. Be realistic with your capabilities and your experience. - Don't let frustration with your process distract you from your limits or enable you to disregard your risks. - Don't rush yourself by not setting aside enough time to tune, to deny yourself the ability to produce quality results. - Be patient. The more time you spend tuning your car, the better your results will get. - If you're waiting on advice, don't lose your patience and start trying things. You asked for advice for a reason, right? Maybe ask others if a reply is taking too long from one resource. - If you've been suggested to slow down, slow down. - If you've been told what you're doing is dangerous and you should stop and rethink your process, stop and rethink your process. - Know what steps you'll take if your process doesn't work the way you expected it to. - For example: if you run out of ideas out on the street, will you be comfortable accepting that you need to do more research and head home, or will you get impatient, make unplanned changes, and possibly make things worse as a result?
# Closed Beta Introduction & Overview #### Introduction Atlas is a open tuning project, provided for free to the Subaru community as a resource to recalibrate (tune) modern Subarus such as the VA and VB WRX. Even though we are a wide open door and do not impose any paywalls, licensing, or tune restrictions (beyond emissions tampering) on any number of vehicles you wish to tune, we do have certain tiers of releasing that does mean new features are released to a select group of individuals before the general public. Although our public releases are typically a quarter-by-quarter phenomenon, truthfully Atlas is evolving every single day with enormous features and changes under the hood on a weekly basis. Our codebase is architected to enable us to move *extremely* quickly, unusually so for the tuning industry, and we simply cannot overwhelm the public with quickly evolving releases. But, we still need a solution to get our changes tested. ##### Closed Beta and the Fast Ring Our Closed Beta is a small group of volunteers (roughly a dozen) who are hand-selected by our development team to field suggestions, mold our releases, and test new changes. The Closed Beta group comprises our **fast ring**, which is the group that receives bleeding-edge development releases as they are made available from our development environment for Atlas. Due to this tight integration with our extremely high-paced development environment, it is not uncommon for 2 or more patches to be made available to our Closed Beta testers in a single day. Beta testers are regularly reinstalling Atlas, upgrading projects, and providing feedback, sometimes doing all of this on an hour-by-hour basis. **Support** We take this group and our commitment to its members ability to flash very seriously. For example. if an ECU ends up bricked due to our code (which is exceedingly rare), we have spare ECUs ready-to-go in storage in multiple team member's hands that we can overnight ship, free of charge, to our closed beta testers. We also typically are able to provide direct, same-day support to our beta testers using software like TeamViewer, and we do this for free. If you can't flash and tune, that is a stop-the-world event for us, halts all development, and your car immediately becomes our top priority. If you are experiencing mechanical, electrical, or tune issues, we expect our small community to swarm to each-other's aid. **Culture** Our ultimate goal is maximum efficiency, ease-of-use, and overall product satisfaction from our end-users, so our Closed Beta groups and every single member is expected to be a part in setting the standard for that. Our Closed Beta members, ideally, become key members in our community that help guide new users using Atlas due to their extensive experience and background with the software. But, in reality we're just a bunch of car enthusiasts that hang out and - for the most part - just have fun. There is a Closed Beta group for each generation of vehicle we support, and they are separated from each-other so as to help reduce noise and clutter. We do this on purpose as it's best for discussion between beta groups to happen in the public, so the entire community can gain from this as well. ##### New Additions and Requests to Join

We also recommend reading through and familiarizing with our [Tuning Do's and Dont's](https://docs.motorsportsresearch.org/books/tuning/page/tuning-dos-and-donts). We prefer if you try to be the "guy" on the right in green, but we're not going to force you to.

Due to the high bar for support excellence and the time commitment it involves, and being a tight-knit community with its own culture, we are meticulous about who we add into these groups. **Expectations** Each of these expectations is paramount, and sadly we have had to make the tough decision to remove closed beta members for not adhering to expectations, so take these into serious consideration if we're asking you to join a Closed Beta group: - Comfortable with a fast-paced conditions with releases dropping almost daily in some cases and helping stay on top of multiple conversations/troubleshooting going on at once, etc. - Understands the risks with nightly software updates; it's possible to brick an ECU, though it is typically less urgent as we have brick protection. We do test our releases before pushing them out, but there is always a risk. - Open to learning and taking advice, and offering your own candidly, but doing so with respect. Remember, we're a small community passionate about tuning so our conversations about tuning, etc. can occasionally be disputatious, but we are still all friends at the end of the day. - Will exercise patience if we ask you to **stop**. We won't be unreasonable (i.e. we're not about to tell you not to tune your car if you can't get to your job), but there are rare circumstances where we will ask you not to move forward until a release, etc., is made available that will avoid you from a situation we don't want to put you in. - Commitment to respect confidentiality and **not** share tunes, software packages, special Atlas "flags", etc. with members outside of Closed Beta. We really don't have any DRM here, we just expect you to honor this ask. Your commitment to this prevents buggy things from leaking out to the public before they're ready, that we then have to support/handle.