diff options
Diffstat (limited to 'Master/Projekt Systementwicklung/obd-verbrauch-hint.txt')
| -rw-r--r-- | Master/Projekt Systementwicklung/obd-verbrauch-hint.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Master/Projekt Systementwicklung/obd-verbrauch-hint.txt b/Master/Projekt Systementwicklung/obd-verbrauch-hint.txt new file mode 100644 index 0000000..36eebf3 --- /dev/null +++ b/Master/Projekt Systementwicklung/obd-verbrauch-hint.txt @@ -0,0 +1,13 @@ + // divide MAF by 100 because our function return MAF*100
+ // but multiply by 100 for double digits precision
+ // divide MAF by 14.7 air/fuel ratio to have g of fuel/s
+ // divide by 730 (g/L at 15°C) according to Canadian Gov to have L/s
+ // multiply by 3600 to get litre per hour
+ // formula: (3600 * MAF) / (14.7 * 730 * VSS)
+ // = maf*0.3355/vss L/km
+ // mul by 100 to have L/100km
+ // if maf is 0 it will just output 0
+ if(vss<toggle_speed)
+ cons=(maf*3355)/10000; // L/h, do not use float so mul first then divide
+ else
+ cons=(maf*3355)/(vss*100); // L/100kmh, 100 comes from the /10000*100
|
