Safety Warning
DIY auto repair can cause serious injury, fire, or vehicle damage. These guides are for informational purposes only. Always follow OEM torque specs, wear PPE, and consult a certified mechanic if you are unsure. You are solely responsible for your safety.
Exponentially Weighted Moving Average
Exponentially Weighted Moving Averaging is a well-documented statistical data processing technique that is used to reduce the variability on an incoming stream of data. Use of EWMA does not affect the mean of the data, however, it does affect the distribution of the data. Use of EWMA serves to "filter out" data points that exhibit excessive and unusual variability and could otherwise erroneously light the MIL.
- New Average = [New data point * "filter constant"] + [(1 - "filter constant") * Old Average]
The simplified mathematical equation for EWMA implemented in software is as follows:
This equation produces an exponential response to a step-change in the input data. The "Filter Constant" determines the time constant of the response. A large filter constant (i.e. 0.90) means that 90% of the new data point is averaged in with 10% of the old average. This produces a very fast response to a step change. Conversely, a small filter constant (i.e. 0.10) means that only 10% of the new data point is averaged in with 90% of the old average. This produces a slower response to a step change.
When EWMA is applied to a monitor, the new data point is the result from the latest monitor evaluation. A new average is calculated each time the monitor is evaluated and stored in Keep Alive Memory (KAM). This normally occurs each driving cycle. The MIL is illuminated and a DTC is stored based on the New Average store in KAM.
In order to facilitate repair verification and DDV demonstration, 2 different filter constants are used. A "fast filter constant" is used after KAM is cleared or DTCs are erased and a "normal filter constant" is used for normal customer driving. The "fast filter" is used for 2 driving cycles after KAM is cleared/DTCs are erased, and then the "normal filter" is used. The "fast filter" allows for easy repair verification and monitor demonstration in 2 driving cycles, while the normal filter is used to allow up to 6 driving cycles, on average, to properly identify a malfunction and illuminate the MIL. This feature is called Fast Initial Response (FIR). The fast filter is always calibrated to 1.0 which means that the EWMA is effectively disabled because the new average is 100% of the new data point. Since the EWMA is effectively disabled, it takes two driving cycles to set the MIL. The first driving cycle with a fault will set a pending DTC; the second driving cycle will set a confirmed code and illuminate the MIL.
The other unique feature used with EWMA is called Step Change Logic (SCL). This logic detects an abrupt change from a no-fault condition to a fault condition. This is done by comparing the new data point to the EWMA old average. If the two points differ by more than a calibrated amount (i.e. the new data point is outside the normal distribution), it means that a catastrophic failure has occurred. The fast filter is then used in the same manner as for the FIR feature above. Since the EWMA is effectively disabled, it takes two driving cycles to set the MIL. The first driving cycle with a fault will set a pending DTC; the second driving cycle will set a confirmed code and illuminate the MIL. The SCL becomes active after the 4th "normal" monitoring cycle to give the EWMA a chance to stabilize.
During "normal" EWMA operation, a slower filter constant is used. The "normal filer" allows the MIL to be illuminated in 1 to 6 driving cycles. A confirmed code is set and the MIL is illuminated as soon as the EWMA crosses the malfunction threshold. There is no pending DTC because EWMA uses a 1-trip MIL.
- Time constant = [ (1 / filter constant) - 1 ] * evaluation period
In order to relate filter constants to driving cycles for MIL illumination, filter constants must be converted to time constants. The mathematical relationship is described below:
The evaluation period is a driving cycle. The time constant is the time it takes to achieve 68% of a step-change to an input. Two time constants achieve 95% of a step change input.
EWMA Examples
EWMA with FIR and SCL has been incorporated in the catalyst monitor, the Rear O2 response test and the EONV Evaporative system leak check monitor. There are 3 calibrateable parameters that determine the MIL illumination characteristics.
"Fast" filter constant (0.9999), used for 2 driving cycles after DTCs are cleared/KAM is reset (FIR) and for Step Change Logic (SCL)
"Normal" filter constant (typically 0.4), used for all subsequent, "normal" customer driving
Number of driving cycles to use fast filter after KAM clear (normally set to 2 driving cycles)
Several examples for a typical catalyst monitor calibration are shown in the tables below. The first example does not show SCL in order to better illustrate the EWMA calculation and the 1-trip MIL.
| Monitor evaluation ("new data") |
EWMA Filter Calculation, "normal" filter constant set to 0.4 Malfunction threshold =.75 |
Weighted Average ("new average") |
Driving cycle number | Action/Comment |
| 0.15 | .15 * (0.4) +.15 * (1 - 0.4) | 0.15 | normal 120K system | |
| 1.0 | 1.0 * (0.4) +.15 * (1 - 0.4) | 0.49 | 1 | large failure occurs |
| 1.0 | 1.0 * (0.4) +.49 * (1 - 0.4) | 0.69 | 2 | |
| 1.0 | 1.0 * (0.4) +.69 * (1 - 0.4) | 0.82 | 3 | exceeds threshold, MIL on |
| 1.0 | 1.0 * (0.4) +.82 * (1 - 0.4) | 0.89 | 4 | MIL on |
| 0.8 | 0.8 * (0.4) +.15 * (1 - 0.4) | 0.41 | 1 | 1.5 * threshold failure |
| 0.8 | 0.8 * (0.4) +.41 * (1 - 0.4) | 0.57 | 2 | |
| 0.8 | 0.8 * (0.4) +.57 * (1 - 0.4) | 0.66 | 3 | |
| 0.8 | 0.8 * (0.4) +.66 * (1 - 0.4) | 0.72 | 4 | |
| 0.8 | 0.8 * (0.4) +.72 * (1 - 0.4) | 0.75 | 5 | equals threshold, MIL on |
| 0.8 | 0.8 * (0.4) +.75 * (1 - 0.4) | 0.77 | 6 | MIL on |
| 0.8 | 0.8 * (0.99) + 0* (1 - 0.99) | 0.8 | 1 | 1.5 * threshold failure after code clear, pending DTC |
| 0.8 | 0.8 * (0.99) +.8 * (1 - 0.99) | 0.8 | 2 | MIL on (I/M Readiness set to "ready" |
NO RELATED
Use the Manual With the Right Hardware
Pair factory procedures with proven DIY tools so the instructions are easier to execute.
Affiliate disclosure: We may earn a commission at no extra cost to you.
When to See a Mechanic
Stop DIY work and contact a certified mechanic immediately if any of the following apply:
- • You smell fuel, burning insulation, or see smoke.
- • Brakes feel soft, pull hard to one side, or make grinding noises.
- • The engine overheats, stalls repeatedly, or misfires under load.
- • You are missing required tools, torque specs, or safe lifting equipment.
- • You are not confident in the next step or safety outcome.