PDA

View Full Version : Gasoline consumption Math



srspinho
- 8th November 2007, 17:15
Hello friends,

after some time, I finally put the new version of my on-board computer on my Opel, and it is workng very fine.

But (there´s always something to do...), I´m measuring just the Instant consumption.

Now, I would like to measure the average consumption, just like on Opel Zafira or VW Golf.

I know it´s easy to calculate : Average = Distance_Traveled (km) / Amount_of_Fuel_Used (liters)

My injectors can bleed 17 ml / s (each one, there are 4 injectors)
I read the time that one injector keep open in 500 ms.
My digital odometer gives me the distance in 100 meters steps
I would like to calculate the Average of consumption for each 100 meters

For example : When my car is stopped, It waste around 1.9 Litters / Hour :
Gasoline = 40 (or 0.004 s) * 17 ml/s (injector flow) * 4 (number of injectors) * 2 (1 second) Gasoline = 0.54 ml / s or 1.9 litters / hour

When the car is in movement, the formula is a bit different and also takes the distance traveled do calculate the instant consumption.

My problem is : How to work with big numbers when, for example, I´m stopped in the traffic for, let´s say 10 minutes (very common here in Sao Paulo, Brazil) and the calculation of the amount of gasoline used goes over the 65535 limit ?

Is there another way of doing this math ?

If I was not that clear, let me know and I will try to explain it better .

Thanks guys !

Sérgio

Acetronics2
- 8th November 2007, 18:01
Hi, Sergio

You really want to be frightened by your consumption results !!!

There are no definite solutions for your problem ... cause you can take 2 hours or more to make 100 meters ... ( here some people stopped by the snow sometimes stay at the same place for ... 12 Hours, Engine idling, ... not to be frozen !!! )

Note at this moment ... you do not really want to know the average gas per 100 m !!!

so, just detect if your fuel volume is over the " Horror value " ( say 60 000 ...) as there was no odometer pulse ... and let the L/ km maths aside as they really do not mean anything !!!

show L/h at this time , if you like Horror films !!!

So, I think it will be simpler to show l/km ... only if your car runs ... Infinite is really difficult to write !!! ( yes : liters/ 0 m = infinite !!! )

A problem well explained is half solved ... don't you think ???

Alain

srspinho
- 9th November 2007, 10:20
Hi Alain,

thanks for your Tips.

Well, gas / etanol consumption is one of my, lets say, obsessions.

I would like to measure the average during a trip, and after a very good sleepy night, I think I found a way of doing that using some auxiliary vars.

Thanks again !

Sérgio

Luciano
- 9th November 2007, 15:42
I read the time that one injector keep open in 500 ms.

Hi Sérgio,

The injection time will change depending on the load of the engine.
The pressure of the fuel is constant, the supply of the fuel is
controlled by the injection time.

Best regards,

Luciano

EDIT:
(See next post)

I have cleaned my glasses now, but I'm not sure that was the problem!

Sorry about that!

Luciano

Acetronics2
- 9th November 2007, 17:17
Hi Sérgio,

The injection time will change depending on the load of the engine.
The pressure of the fuel is constant, the supply of the fuel is
controlled by the injection time.

Best regards,

Luciano

Hi, Luciano

500 ms: It's the time to make the consumption mesure ... let's say for an average consumption on a 500 ms period !

Alain

srspinho
- 12th November 2007, 10:21
Hi Guys !

I think my problem is almost fixed.

I decided to implement the solution using some intermediate variables counting the amount of fuel used (milliliters and decilliters ) and making calculations for each 100 meters. If the division cannot be performed, the display shows "- -", like in some on-board computers I have seen.

I just have to bootload the new software and run some kilometers in the traffic here in Sao Paulo.

Well guys . . . Thank you for your advices ! ! !

Regards

Sérgio