Tag Archives: plot

Oil Dilution News

Through comparing a few ROMs recently I have noticed some significant changes regarding oil dilution.
So far it seems, this is about newer Euro 6 diesel ECU firmware only, meaning MY 2015+. Apparently, firmware containing modifications were created in May 2017, probably published since 2017-07.

The oil dilution ratio threshold to trigger DTC P1468 Oil Dilution is now 15 % instead of 10 %.

A couple of tables have been adjusted, for example “oil dilution evaporation” is now defined up to 15 % and a few DPF regeneration behaviour tweaks.
Also, the relationship between log items “Distance To Oil Change [km]” and “Oil Dilution Ratio [%]” is not linear anymore, rather nonlinear in fact.

Both graphs were created out of 2015/2016/2017 Outback Diesel CVT ROM data:

CID JB4K104B, ROM date 2017-05:

Older Euro 6 CID JB4K102B, ROM date 2016-10, and probably still applicable to all Euro 4/5 models:

I will update related pages in the near future.
For now, if you are affected, don’t use my custom “Oil Dilution 2” log item anymore.

If you like, you can use this simple formula instead, but it is only valid between 0 % and 8 %:
OilDilutionRatio3[%](DistanceToOilChange[km]) = 60-DistanceToOilChange/250

Example values:

13500 6.0
13400 6.4
13300 6.8
13200 7.2

Since diagnostic item “Distance to Oil Change” is scaled in [100 km], above formula provides oil dilution in 0.4 % steps. Accuracy has become worse but is still better than standard log item “Oil Dilution Ratio” which only provides integer resolution. Not sure if logging apps such as Torque can handle table lookup or piece-wise functions.


Log Graphs 1


Car: 2009 Impreza 2.0 Turbo Diesel, 110 kW / 148 hp / 150 PS, European domestic market, Euro 4 spec.

Important: Newer Boxer Diesel generations (Euro 5/6) may show different behaviour!

ECU firmware: patched ROM for unlimited logging, otherwise stock.
Protocol: SSM2 via CAN
More than 120 items had been logged, plenty of RAM variables (*) plus standard SSM2 items at roughly 170 ms interval.


I prepared two graph images plotting some interesting parameters, click picture for full resolution:

Image 1/2


Image 2/2


Additional details

… at specific time positions:

#1: State before active regeneration

Time @ ~ 33 ½ min
Cruise Control: active
Vehicle Speed*: 110 km/h
Engine Speed: 2300 rpm
Gear: 5
Coolant Temperature: 93 °C
Injections: 2 (pre + main)
Soot Accumulation Ratio: 64 %
DPF Pressure Difference: ~ 5 kPa
Exhaust Gas Temperature (EGT) Catalyst Inlet: 345 °C
EGT DPF Inlet: 370 °C
Intake Air Amount: 430 mg/cyl
Mass Air Flow: 33.8 g/s
Manifold Absolute Pressure (MAP)*: 126 kPa
Inlet Air Temperature: 25 °C
Manifold Air Temperature: 48 °C
Fuel Temperature: 58 °C
Throttle Opening Angle: 79 deg
EGR Valve Opening Angle: 38 deg
Final Oil Dilution Rate*: -1.9 mg/s (evaporation)
Oil Dilution Amount: 282.0 g (4.6 %)

#2: Soot 65%, preparing for DPF regeneration

@ 33 ¾ min
Soot Accumulation Ratio* reaches 65%, this triggers active regeneration preparations. Note: I am referring to the actual RAM value, diagnostic parameter may indicate 65% earlier due to rounding.
Apparently ECU now does 3 injections (pre + main + after) when power demand is high enough, no post injections yet

#3: Active Regen ON

@ 34:04; = 20 seconds after #2, DPF Regeneration Switch turns ON
EGR valve closes instantly, 0 deg
Manifold Air Temperature dropping
Boost Control opens VGT immediately, from 52 to 25%
Manifold Absolute Pressure* dropping
pilot-injection kicks in, 2 injections (pilot C + main)
post-injections begin to fade in but not active yet

#4: Post-Injections

@ 33 seconds after #2, post-injections A + B become operational (injection amount > 0)
oil dilution rising
EGTs climbing
Manifold Absolute Pressure*: 75 kPa (~ 25 below ambient), varying, stays below ambient most of the time during regen at low power demand
EGT Catalyst Inlet: 340 °C
EGT DPF Inlet: 320 °C
injections: 4 (pilot C + main + post A + post B)

#5: Coasting Fuel Cut-Off During Regen

Example @ 35:12
EGR valve opens instantaneously, 70 deg; EGR behaves rather digitally during regen – either fully closed (0 deg, for max EGT) or max opened (70 deg, less fresh air)
Throttle Opening Angle: rising up to 31 deg
injections: 0
Fuel Consumption*: 0 mm³/s
oil dilution going down slowly due to estimated evaporation
EGT Catalyst Inlet: decreases fast, EGT at DPF inlet (> 600 °C) follows with a delay
Engine Speed: gear change from 5th to 6th to reduce engine braking effect

#6: Idling with Active Regen ON

@ 45:30
Engine Speed: 800 rpm
Post A Injection Amount*: 0
Post B Injection Amount*: ~ 8 mm³/st
Apparently while idling the ECU prefers the 2nd post-injection (“B”), otherwise during driving it’s rather mixed
Final Oil Dilution Rate: ~ 20 mg/s (medium)
Boost Control: 25 % (VGT fully open)
Manifold Absolute Pressure*: 74 kPa
Throttle Opening Angle: 5.5 deg
EGR Valve Opening Angle: 0 deg
Intake Air Amount: 370 mg/cyl
Mass Air Flow: 9.8 g/s

#7: DPF Regeneration OFF

@ 46:15, decision is based on elapsed time from #2, achieved soot level does not matter (!)
DPF Regeneration SW had been ON for 12.2 minutes
all post-injections off
Oil Dilution Amount*: 299.6 g (4.9 %) = + 0.3 % during regeneration
EGR back to normal operation
Boost Control: 65 % instantly (max speed, spooling up turbo)
MAP rising
EGT Catalyst Inlet: 270 °C
EGT DPF Inlet: 490 °C

Yet another color map for EcuFlash

Perhaps another color map for EcuFlash might be interesting? I wrote a little SageMath python script to generate a ScoobyRom-like color map file.

EcuFlash using ScoobyRom color map

EcuFlash using ScoobyRom color map

Note: Although generated color map matches ScoobyRom’s precisely, EcuFlash applies colors based on “min” and “max” specified in XML definitions.

Excerpt from EcuFlash definition file: 32BITDIESELBASE.xml

<scaling name="ChargeAirPressure" units="kPa" toexpr="x" frexpr="x" format="%.0f" min="0" max="255" inc="1" storagetype="uint8" endian="big"/>

Whereas ScoobyRom scales colors ranging from a map’s actually used mininum and maximum. For example, if you would change min="0" to min="100" in above scaling definition, low value colors would appear bluish like in ScoobyRom, effectively making map graphics cover more/most of available color range.


1) Download file scoobyrom-map.odt

2) Rename downloaded file to ScoobyRom.map, since normal file extension is not allowed on wordpress.com.

3) Move file into EcuFlash’s color maps folder, i.e.

C:\Program Files (x86)\OpenECU\EcuFlash\colormaps\

4) Launch or restart EcuFlash.

5) Via EcuFlash menu: File → Options → Appearance → Default Color Map
Select “ScoobyRom.map”
(Btw., default color map directory can also be defined in Options)

Color Map File Format

Color map format is plain text ASCII file, usually 256 lines as in this case, specifying RGB values which will be applied to maps, from low to high:

153 153 255
153 154 255
153 156 255
152 157 255
255 110 103
255 107 102
255 105 102
255 102 102

Fuel Level


On Euro 4 and early EU 5 (MY till including 2011) diesel models fuel level is being measured by BIU and transmitted on CAN-bus as resistance value in ohms (Ω). The ECU parses this and does some processing. First it calculates artificial fuel level voltage using standard voltage divider formula. Voltage value is being damped because the level information fluctuates a lot with fluid moving. Then the damped result is being used for LUT (Lookup table).

Euro 5 gen3 and EU 6, = MY 2012+: Fuel level is being digitized by combination meter. ECU ROM does more sophisticated damping/averaging.


Did some math, using exact ROM table data (ScoobyRom, export as CSV), applying formulas, creating plots.

For above voltage divider, where:

  • Vin: Battery Voltage (assumed constant in this case)
  • R1: constant series resistor
  • R2: variable fuel level resistance (two sensors in series, one per tank half)
  • Vout: fuel level voltage (artificial ECU value in this case)

This way I eliminated ECU’s artificial fuel level voltage, creating direct relationship between resistance [Ω] (CAN value) and volume [litre].

ROM Tables and Calculated Results

gen1 Euro 4 (MY 2008-2010)

Fuel tank capacity: 64 litres.

Fuel Tank Level, 2D table, Euro 4, ScoobyRom screenshot

gen2 Euro 5 (MY 2010-2011)

Fuel tank capacity: 65 litres.

Fuel Tank Level, 2D table, gen2 Euro 5, ScoobyRom screenshot

gen3 Euro 5 (MY 2012-2014) and gen4 Euro 6 (MY 2015+)

Fuel tank capacity: 60 litres.

There seems to be a calibration data error as the vertical step (at 19 ↔ 23 litres) does not make sense! ECU’s LUT code can handle this but technically it is a flaw. The averaging algorithm after table lookup will mitigate this issue. Same map data was found in newer Euro 5 and Euro 6 ROMs.

Fuel Tank Level, 2D table, Euro 6, ScoobyRom screenshot

Diagnostic Trouble Codes

DTCs are triggered when (artificial) fuel level voltage is outside range. As usual it’s not that simple, many conditions may affect this, too – battery voltage, CAN state etc.

  • P0462 Fuel Level Sensor Circuit (Low Input)
  • P0463 Fuel Level Sensor Circuit (High Input)

For some reason, above codes are not publicly exposed in Euro 6 spec models, also not available in service manual DTC listing. They are processed internally however.

Fuel Gauge

Fuel gauge and fuel warning light, Subaru Impreza diesel Euro 4. At depicted position, there are still 5 to 10 litres left in the tank.

I tested the fuel gauge by inserting a variable resistor after disconnecting a fuel level sensor connector from the wiring harness, below the rear seats. The Euro 4 fuel gauge at least reacts very slowly. It takes more than 20 seconds from empty to full and vice versa. The combination meter does its own damping obviously. Therefore, gauge hijacking, i.e. abusing the fuel gauge in order to display something fluctuating like manifold air pressure (MAP) is not feasible (without hacking combination meter ROM, of course).

gnuplot Power Graph

Created gnuplot script file which plots 2.0D 110 kW power graphs out of two CSV files (torque & power). For CSV data origin see post Power graphs and Calculations. gnuplot experience might come handy from time to time…

Script + data files in here: gnuplotPowerGraph1.zip

By the way, thanks go to http://www.pariaonecu.com for file hosting support.

Tested on Linux, script file displays graph on screen, also creates SVG vector graphics file.
View SVG result (best, good web browser needed): PowerGraph(Subaru).svg

Raster screenshot in case you cannot view SVG:

Assuming gnuplot is installed. To run script type:
gnuplot -p 'PowerGraph(Subaru).gpl'

# gnuplot script
# Linux: gnuplot -p "thisscriptfilename"
# -p  --persist		to keep graph window

# set custom variables
fileTorque = "Torque(Subaru).csv"
filePower = "Power(Subaru).csv"
color1 = "blue"
color2 = "brown"
plotFile = "PowerGraph(Subaru).svg"

# debug: show variable content
#print fileTorque

# necessary for CSV data, input file contains comma-separated values fields
set datafile separator ","

###### terminal settings
set termoption enhanced
set term wxt font "sans,14"

###### title, labels
set title "Boxer Diesel 2.0 110 kW Power Graphs (digitized official Subaru data)"

set xlabel "Engine Speed [1/min]"
set xrange [800 : 4700]	# optional

set ylabel "Torque [Nm]" textcolor rgb color1
set y2label "Power [kW]" textcolor rgb color2

###### define linestyles
# 1: Torque curve
set style line 1 linetype 1 linecolor rgb color1 linewidth 3
# 2: Power curve
set style line 2 linetype 1 linecolor rgb color2 linewidth 3
# 10: grid lines
set style line 10 linetype 1 linecolor rgb "gray"

###### grid lines (independent settings for x, y, y2 are not possible?)
#set grid xtics ytics y2tics linestyle 10
set grid xtics ytics linestyle 10

###### axis tics & labels
# nomirror: don't display tic marks on other side/axis
# x axis tics+grid: increment = 200 1/min
set xtics 200
set ytics nomirror textcolor linestyle 1
set y2tics nomirror textcolor linestyle 2

set autoscale y
set autoscale y2

###### legend
# set key default
# set key bottom center box

###### plot
plot fileTorque title "Torque" with lines linestyle 1, filePower title "Power" with lines linestyle 2 axes x1y2

# quit script immediatly for debugging

pause -1 "Hit return to create SVG file"

###### SVG output (commands sent via standard input from app)
# could also do PDF, LaTeX, PNG etc.
## remember current terminal
set terminal push

# page size affects page layout, relative font size etc. - defaults may not look nice
#set terminal svg size 1200,800 dynamic enhanced font "sans,16"
set terminal svg size 1600,1000 dynamic enhanced

# plot into file, using own variable set at beginning
set output plotFile

## switch back to previous terminal
set terminal pop

Power Graphs and Calculations v2

Updated 2011-01-16: corrected data, added details

Official graphs

These are official Boxer Diesel power graphs from Subaru press info, dated 2008:

Digitizing with Inkscape, zoomed in, bitmap layer in background:

Saved as SVG (Inkscape’s default format) coordinates are plain readable. Some conversion had to be done – SVG origin is top left, scaling, relative coordinates etc.

Digitized torque data

Engine Speed [1/min],Torque [Nm]

Function plot, linear interpolation:

Digitized power data

Engine Speed [1/min],Power [W]

Since power can be calculated from torque and angular velocity, this can be used to check the official power curve. Looks like someone put “lipstick” on the last part of the curve…

Drive force

After applying some math (torque curve, vehicle speed vs. RPM, gear ratios)…

View above graph as SVG (best quality).

Theoretical shift points

Calculated intersection points (drive force equality solutions), slightly rounded:

v [km/h] Gear1 RPM1 [1/min] Gear2 RPM2 [1/min]
75 2 4340 3 2630
116 3 4070 4 3010
151 4 3920 5 3170
181 5 3800 6 3340

Engine Speed vs. Vehicle Speed

View/download above graph as SVG (best quality).
Unfortunately SVG graphics cannot be inlined directly in here.

X-axis is actual vehicle speed as reported from a GPS device or logging using OBD-II protocol. Speedometer shows 6-8% higher e.g. 107 km/h instead of actual 100 km/h.
By the way, tachometer indication seems accurate, this one is driven by square-wave signal generated by the ECU.

Might also apply to other models (same final drive ratio, wheel size)! For gearbox information (gear ratios) see this page: Transmission – 6MT