I'm trying to develop an app that shows your real-time miles per gallon based on output from scanning software. Is this logic correct? It seems like it really accurate based on initial calculations. Again, it's real-time only to calculate what MPG you're getting at that instant. This would be to figure out why your car is getting low mileage, how easy you need to be on the throttle, etc.
Here it is:
1) Get RPM
2) Divide #1 by 60 to get to Revolutions per second.
3) Divide #2 by 2 since the injector opens only once per 2 RPM
4) Get current pulse width
5) Multiply #3 by #4. This is how long your injector will stay open (in milliseconds) per second.
6) Multiply #5 by 3600 to get the number of milliseconds the injector will stay open per hour.
7) Divide #6 by 1000 to get the number of seconds it would be open for,given an hour of driving at that flow rate.
8) Multiply #7 by the number of cylinders. (Or calculate by bank if you have split BLMs/pulse widths). This is the number of seconds of using fuel per hour, for all cylinders.
9) Get injector rate (lb/hr). If you know gal/second rate, skip tp #12
10) Divide #9 by the weight of a gallon of gas (this can vary, but generally 6.25 is close).
11) Divide #10 by 3600 to get gallons/sec rate of injectors.
12) Multiply #11 by #8. This is the number of gallons consumed when running an hour.
13) Get MPH.
14) Divide #13 by #12. This is miles/gallon.
Example driving an LT1 on the freeway:
2100 RPM, 70 mph, 5 mS PW/injector, 24.9 lb/hr injector flow rate
1) 2100
2) 2100/60 = 35
3) 35/2 = 17.5
4) 5
5) 17.5 * 5 = 87.5
6) 87.5 * 3600 = 315000
7) 315000/1000 = 315
8) 315 * 8 = 2520
9) 24.9
10) 24.9/6.25 = 3.984
11) 3.984/3600 = 0.001106666666667
12) 2520 * 0.0011066666666667 = 2.788
13) 70
14) 70/2.788 = 25.108
If you were driving for one hour at exactly 70 mph at 5 mS pulse widths with A4/3.23 gears (2100 RPM) and perfect throttle control, you'd get 25.1 mpg.
Does this seem right?
Here it is:
1) Get RPM
2) Divide #1 by 60 to get to Revolutions per second.
3) Divide #2 by 2 since the injector opens only once per 2 RPM
4) Get current pulse width
5) Multiply #3 by #4. This is how long your injector will stay open (in milliseconds) per second.
6) Multiply #5 by 3600 to get the number of milliseconds the injector will stay open per hour.
7) Divide #6 by 1000 to get the number of seconds it would be open for,given an hour of driving at that flow rate.
8) Multiply #7 by the number of cylinders. (Or calculate by bank if you have split BLMs/pulse widths). This is the number of seconds of using fuel per hour, for all cylinders.
9) Get injector rate (lb/hr). If you know gal/second rate, skip tp #12
10) Divide #9 by the weight of a gallon of gas (this can vary, but generally 6.25 is close).
11) Divide #10 by 3600 to get gallons/sec rate of injectors.
12) Multiply #11 by #8. This is the number of gallons consumed when running an hour.
13) Get MPH.
14) Divide #13 by #12. This is miles/gallon.
Example driving an LT1 on the freeway:
2100 RPM, 70 mph, 5 mS PW/injector, 24.9 lb/hr injector flow rate
1) 2100
2) 2100/60 = 35
3) 35/2 = 17.5
4) 5
5) 17.5 * 5 = 87.5
6) 87.5 * 3600 = 315000
7) 315000/1000 = 315
8) 315 * 8 = 2520
9) 24.9
10) 24.9/6.25 = 3.984
11) 3.984/3600 = 0.001106666666667
12) 2520 * 0.0011066666666667 = 2.788
13) 70
14) 70/2.788 = 25.108
If you were driving for one hour at exactly 70 mph at 5 mS pulse widths with A4/3.23 gears (2100 RPM) and perfect throttle control, you'd get 25.1 mpg.
Does this seem right?
Comment