diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Projekt Systementwicklung/obd-verbrauch-hint.txt | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
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
|
