PDA

View Full Version : Fuel consumption display



veijavi
- 14th November 2006, 22:59
I have a project to build an instantaneous fuel consumption meter for my car. I'm quite a new in PIC programming and PICbasic so I would be very pleased if you have any hints or opinions about my project.

I’m planning to use 16f628a, 20x2 lcd and few buttons. I have melab’s LAB-X3 proto board for code testing.

For the consumption calculation I need vehicle speed, engine rpm, injector open time and injectors flow rate @ 3bar.

-speed signal form speedometer hall sensor, it outputs 16 pulses per tyre rotation
-engine rpm from 58 teeth vr sensor or alternatively from rev counter signal
-injector pulse width from injectors

I think that the consumption is calculated with following formulas:

Fuel consumption (liters/sec) = RPM * injector open time * injector flow

and

Fuel consumption (liters/100km) = (RPM * injector open time * injector flow) / speed * 100000

e.g.

Fuel consumption (liters/100km) = (( 1500 rpm / 60 ) * ( 8 ms / 1000 ) * ( ( 190 cc/min ) / 1000 )) / ((( 30 km/h) / 3.6) * 100000) = ~7.6 liter/100km


I think that it might be enough to measure 500 -1000ms each signal and after that calculate the results and print the results to display.

I have searched the forum about pulse counting and pulse width measurement. Something like this is maybe suitable for injector pulse width measurement: http://www.melabs.com/resources/samples/x2/pbp/ccpx2.bas

Do you have any tips for counting the other pulses and handling all the three signals almost at the same time?

The attachment is a excel file for demonstrating the calculations.

-Vili

skimask
- 14th November 2006, 23:35
I have a project to build an instantaneous fuel consumption meter for my car. I'm quite a new in PIC programming and PICbasic so I would be very pleased if you have any hints or opinions about my project.

I’m planning to use 16f628a, 20x2 lcd and few buttons. I have melab’s LAB-X3 proto board for code testing.

For the consumption calculation I need vehicle speed, engine rpm, injector open time and injectors flow rate @ 3bar.

-speed signal form speedometer hall sensor, it outputs 16 pulses per tyre rotation
-engine rpm from 58 teeth vr sensor or alternatively from rev counter signal
-injector pulse width from injectors

I think that the consumption is calculated with following formulas:

Fuel consumption (liters/sec) = RPM * injector open time * injector flow

and

Fuel consumption (liters/100km) = (RPM * injector open time * injector flow) / speed * 100000

e.g.

Fuel consumption (liters/100km) = (( 1500 rpm / 60 ) * ( 8 ms / 1000 ) * ( ( 190 cc/min ) / 1000 )) / ((( 30 km/h) / 3.6) * 100000) = ~7.6 liter/100km


I think that it might be enough to measure 500 -1000ms each signal and after that calculate the results and print the results to display.

I have searched the forum about pulse counting and pulse width measurement. Something like this is maybe suitable for injector pulse width measurement: http://www.melabs.com/resources/samples/x2/pbp/ccpx2.bas

Do you have any tips for counting the other pulses and handling all the three signals almost at the same time?

The attachment is a excel file for demonstrating the calculations.

-Vili


The consumption meter won't work as you have it described. I've tried it ('98 Nissan and '01 Dodge). The numbers end up out in the weeds.

TPI, multiport, (sequential fire, batch fire, doesn't matter) etc. fuel injection systems have a fuel pressure regulator referenced to manifold vacuum which means the rail pressure changes as the manifold pressure changes. Now, yes, this does mean that the pressure across the tip of the injector remains relatively constant, but it's not nearly as precise as a person would think.
Then you have to throw in the fact that most autos don't spend all of their time in perfect closed loop. Hit the gas, and you're burning roughly a 12-13 to 1 Air/Fuel ratio, get off the gas for a stop sign and you might only be burning 20 to 1, idling will tend to be on the rich side of stroich (14.7:1).

BUT! Don't let all of that negativity stop you! It's a fun project to play around with. And as I learned, you get to play with figuring out how to hook up to various inputs, condition the noise out of them, and do math in the relatively restrictive environment of a PIC. Even if the fuel meter part doesn't work so well, you can log your speed, rpms, pulse width, etc. and look at it later to see what you were doing. Just don't forget to keep your eyes on the road while you're testing the system, and not on the LCD to see what's going on!

JDG

DynamoBen
- 15th November 2006, 03:12
If this is a newer (95-Present) car you may want to think about interfacing with the onboard diagnostics computer via the OBDII standard. You will be able to compensate for all the variables mentioned above and make the device fairly accurate.

This company makes a chip that interfaces directly with the computer (check out the ELM327). You could tie your pic to IC and read the onboard computer directly:
http://www.elmelectronics.com/

I know your are looking to make your own device but here is some inspiration:
http://www.scanguage.com

skimask
- 15th November 2006, 23:36
On another note, I'm in the process of making just such an item. Interfacing with OBD2, pulling air flow data, temp's, rpm, speeds, etc. and calculating fuel mileage. The only problem is that nobody sells a blank PCB to stuff parts into. That's what I'm designing right now, getting the bugs out, making sure it can stand up to a vehicle's rotten power system. Hold off for another week or so and I should have a load of blank PCBs on hand.
JDG

MaxiBoost
- 18th November 2006, 15:34
Veijavi ,
Im interesting your project ,

also I think you dont need rpm data ,
if you know injectors duty cycle, calculate per hour fuel consumption .
for example ,if your injectors 200 cc/min ,duty cycle is 100 percent (of course this is example ,otherways most car injectors duty cycle is maximum %70-%85 ) your consumption is 200 cc per minute /per injector ..

So ,
How are you calculate injectors duty cycle ?
I dont know well ,but people do it ,only 1 injectors input ,calculate duty .

Here you can check this,I have this kit ,they are only use a 16f84a pic microcontroller and only 1 injector data ,than calculate easy and its true ,I use and check it .

http://www.jaycar.com.au/productView.asp?ID=KC5375&CATID=25&keywords=&SPECIAL=&form=CAT&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=347

Other friend say about rail fuel pressure ,
yes its true ,because fuel pressure regulator is change fuel pressure ,mostly on turbo car ,it is a problem also ..

Maxi

sirvo
- 24th September 2007, 04:35
The consumption meter won't work as you have it described. I've tried it ('98 Nissan and '01 Dodge). The numbers end up out in the weeds.

TPI, multiport, (sequential fire, batch fire, doesn't matter) etc. fuel injection systems have a fuel pressure regulator referenced to manifold vacuum which means the rail pressure changes as the manifold pressure changes. Now, yes, this does mean that the pressure across the tip of the injector remains relatively constant, but it's not nearly as precise as a person would think.
Then you have to throw in the fact that most autos don't spend all of their time in perfect closed loop. Hit the gas, and you're burning roughly a 12-13 to 1 Air/Fuel ratio, get off the gas for a stop sign and you might only be burning 20 to 1, idling will tend to be on the rich side of stroich (14.7:1).

BUT! Don't let all of that negativity stop you! It's a fun project to play around with. And as I learned, you get to play with figuring out how to hook up to various inputs, condition the noise out of them, and do math in the relatively restrictive environment of a PIC. Even if the fuel meter part doesn't work so well, you can log your speed, rpms, pulse width, etc. and look at it later to see what you were doing. Just don't forget to keep your eyes on the road while you're testing the system, and not on the LCD to see what's going on!

JDG

Hello you All..

Skimask, are you there?

I built my car fuel consumption and something is not going well. It works like this:
The software does the measuring of the injector's on_time and also the distance run. TMR1 ticks every 100us and the injector's on_time keeps being added up by 1 at each tick in a WORD variable. The distance is also being added up in a word variable. (my car 'distance' sensor ticks 8,31 pulses per meter). The software keeps counting both ticks and on every kilometer (8310 pulses) it does the math and calculates the km/L by a running average of 10km.

So, the thing is. When driving at a low rate of speed it shows a very low km/L. When driving at high speed, it shows a very high km/L. For example: Driving in the city, it shows 5~7 km/L (it should show 7~9 km/L) and driving at the roadway, it shows 13~20 km/L (it should show 9~11km/L).

I read what you wrote about pressure's difference and stuffs like this. But, what I can not understand is: Isn't the injector's on_time proportional to its output? Do you know why this is happening?

It would be great any tips now.. :)

Thanks in advance!

Regards.

Archangel
- 24th September 2007, 07:18
Isn't the injector's on_time proportional to its output?
Hi Sirvio,
The short answer is, likely not. The OEM computer in your car keeps adjusting injector on time based upon sensor input from the oxegen sensor in the exhaust, the throttle position sensor, the mass airflow sensor, if equipped, a MAP sensor, if no MAF sensor, temp sensors in the air and water, a BARO sensor, a data lookup table, Knock sensor, and probably the engineer's astrologer too. So there is no design requirement for the injectors output to be linear, in fact most computers have what they refer to as BLOCK LEARN, which is most likely flash or eeprom memory to keep track of fuel curves so as to alter the computer's calibration around your driving habits. I notice my old exCHP car sure runs better after the wife drives it for a while.

sirvo
- 24th September 2007, 07:37
Hi Sirvio,
The short answer is, likely not. The OEM computer in your car keeps adjusting injector on time based upon sensor input from the oxegen sensor in the exhaust, the throttle position sensor, the mass airflow sensor, if equipped, a MAP sensor, if no MAF sensor, temp sensors in the air and water, a BARO sensor, a data lookup table, Knock sensor, and probably the engineer's astrologer too. So there is no design requirement for the injectors output to be linear, in fact most computers have what they refer to as BLOCK LEARN, which is most likely flash or eeprom memory to keep track of fuel curves so as to alter the computer's calibration around your driving habits. I notice my old exCHP car sure runs better after the wife drives it for a while.

Hi Joe.. thanks for answering..
I agree with you but, let me ask you in another point of view. Lets think that the pressure on the gas line is constant (~3bar). The same way, lets think that if you let 1 injector 1s on, it will output 15ml, it means, the injector outputs 15ml/s. If I can measure the injector on time, It does not matter the fuel curves and engine maps, only the on time. Isn't that write? In other words, the sensors, maps, curves, engineer's astrologer (heheh) and so... only change the on time, but not the 15ml/s. Could you get it?

I did not mean to be rude or anything. Don't get me wrong please! I'm not english neither north american so sometimes my english does not help me to be clear.

Thanks a lot..!

Regards..

Acetronics2
- 24th September 2007, 08:17
Hi, Servo

You're right, fuel pressure keeps steady ... so, just measure how long your injectors are open, make a "real life" calibration ( how much fuel vs total injectors "bleeding" time ) and that's it ...

It's very simple ... just look at fluid mechanics laws for quasi-ideal liquids, and you'll see volume is a function of time and pressure @ 99.99% !!!

so, you just have to measure the pulses driving your injectors ... just 5 wires to wire !!!

Alain

calzaman
- 22nd December 2011, 09:04
I am trying to calculate fuel consumption as a function of RPM. So for a given rpm and an engine size I can fetch the approximate fuel consumtion (liters per minute). Does any one know of an equation that can achieve that.

Also your equation which you have used (Fuel consumption (liters/100km) = (RPM * injector open time * injector flow) / speed * 100000) is quite good and it is working for me. However, do you have a reference for where you got the equation for. Also is the 8 ms a standard for flow open time for all engines.

Thank you kindly for your help

Tobias
- 26th December 2011, 01:32
You will be closer at guessing the next lottery numbers than using just RPM to measure fuel consumption. You need to know BSFC and AF ratio as a starting point.

rshaver
- 26th December 2011, 02:32
Just a thought but if you can get 2 fuel flow sensors you can get a pretty accurate reading. You have to get the flow in and out of the system and then just do a little subtraction. Can't remember where I saw it. But someone did this and it worked over all driving conditions. If you have a flow of 5 gallons per hour(GPH) in and 3GPH out then you are using 2GPH. Or what ever measure you use. You get the in and out because the injection system has a return line to the tank for the fuel not used. Only problem with this is trying to find the flow sensor. I have been trying to find just one for my old truck and they seem to be non-existent now. They used to be every where.

Tobias
- 26th December 2011, 05:28
The flow sensors we use in drag racing are about $2000!!! They are deadly accurate but very pricey.

ardhuru
- 26th December 2011, 05:50
Guys, I'm no authority on this, but if that data is available on the OBD2 connector in your vehicle, how about just getting a bluetooth OBD2 adapter, and couple it with a tablet/phone running Android (App: Torque)? Would be an inexpensive, and easy solution.

calzaman
- 26th December 2011, 10:07
Thanx.

BUt what I need is an approximation. I understand that there is no way to caclulate the fuel consumption because of the acceleration, deceleration, and load. However, if you are calculating fuel consumption at a constant speed, then wouldnt there be an equation to calculate the fuel consumption.

calzaman
- 26th December 2011, 10:08
Also, does any one know where this equaiton comes from:

(Fuel consumption (liters/100km) = (RPM * injector open time * injector flow) / speed * 100000)

Is there a source or is it just a wild guess...........

Acetronics2
- 26th December 2011, 10:33
Hi,

post #1 was not clear enough ???

I do not see a clearer explanation .... :chargrined:

Alain

calzaman
- 27th December 2011, 06:05
I will make the question clear, if a car is moving at a constant speed (constant RPM) no acceleration or decleration (no going up the hill or down the hill).

Through some research I found this equation: Fuel consumption per minute = (RPM/2)*(Engine size in Liters), however the number it gave was really out of scope.

The other equation which is the one I got from this thread which is

Fuel consumption (liters/sec) = RPM * injector open time * injector flow

For the this equation, I assumed that injector flow is the engine capacity and it gave me good results but I still need to know the source for the equaiton.