how does the distance to empty mechanism work on a car computer?

I have a new (to me) car. Its got the display for trip time,avg mpg, miles to empty etc. I filled the tank today as much as it would hold and it read 407 miles to empty. I did a bit of driving and it was saying 368 to empty. I was curious about the accuracy so when I stopped off at gas station to get a drink on the way home I added $4.00 in gas. About 1.25 gallons. My distance to empty still reads 368. So for some reason one gallon is not enough to alert whatever mechanism that measures the tank level. So how exactly do these things work?

I can’t speak about the particular implementation in your car, but there are several problems here. One, the distance for empty varies based on your driving habit. And two, fuel sloshes in the tank, and there is a limit to the precision of whatever sensor is measuring the fluid level in your tank.

A good implementation would use averaging. It would average out the mpg for some large time interval into the past, and it would also average the fuel level for how much it thinks is in the tank.

Finally, it must have a filter to only update the display occasionally. This is so it doesn’t constant change the numbers displayed, which would be distracting. I bet if you idled your vehicle for 10 minutes or so with it displaying 368, eventually it should update to display 400 something.

One final thing I thought of. If I were writing software to filter the fuel level detected, I would assume that a small increase in the fluid level was NOT because someone put more gas in the tank, but because the fluid was sloshing or the car was on an incline. This assumption feeds in to the car’s estimated range.

I don’t know how many of them work this way, but my Cadillac seems to simply take the mpg average from your recent driving and combines that with how many gallons are left in the tank and makes a simple computation based on that. It’s a bit inaccurate at the top end and bottom end of the tank, since the level meter can’t detect the extremes of the tank level. Above a certain point it’s just “full” and below another point it’s just “empty”. Once it reaches the empty point in the fuel gauge the range never gets any lower, which means that the display still shows quite a few miles of range left when the car runs of out of gas (I accidentally ran it out of gas once). It seems to have about a gallon or so at the top of the tank that it can’t measure, and also about a gallon or so at the bottom of the tank that it can’t measure either (it’s a 17 gallon tank).

When I have gone on long trips, the range starts out using the mileage I get from driving around on local two-lane roads. Then, as the car detects that I am getting better mileage (since I am on the highway) the range slowly increases to match it. This confirms that it is doing a very simple mpg x gallons calculation.

Yours may work differently.

That makes perfect sense and is likely the answer. Thanks.

That seems like it defeats the purpose if it always says you have a few miles left. My Nissan Quest reads *** once it gets below 1 mile. There is still gas left in it at that point as I’ve had it read that many times and have, thankfully always made it to the gas station in time.

My car, which dates from the last century, behaves the same way. Recently, after driving for a couple of hours at an illegally high speed on a motorway, the computer beeped at me to indicate 50 miles left in the tank. We were about 45 miles from home and cheap supermarket petrol, so I eased off to conserve fuel. I then saw the indicator increase as my fuel consumption dropped. 20 miles later, I still had 40 miles left in the tank.

My old Saab, the first car I had with one of these readouts, specifically said in the owner’s manual that the “miles left” figure was based on the last 20 miles driven. It also had a “current mpg” reading that was entertaining but useless because it appeared not to be averaged or damped at all - the number went up and down wildly from single digits to 200. Much like those aftermarket mpg gauges from the JC Whitney catalog that I remember from WAY back.

My current VW says that the “miles left” is based on the current mpg reading and how much fuel is in the tank. The current mpg reading changes at a reasonable rate, so it’s presumably averaged over a short distance - the manual doesn’t indicate how it’s computed.

At any rate, when those things started appearing I rapidly found myself normally having the display set to “miles left”, and looking at that instead of the gas gauge. The number just seems more precise than looking at the needle, whether that’s valid or not.

I think **Habeed[/B is right. I think something will eventually tell it to recalculate, like if it sits overnight, so it will eventually change to reflect the extra gas…

When mine goes to zero, I know I have about a gallon of gas left, which is usually at least 20 miles. It’s pretty reliable, because when it goes to zero I reset the trip meter, and based on the trip meter when I refill, I can guess how much gas will fit, and I’m usually pretty close.

I can also tell that it uses a number that’s not the value shown for instantaneous gas mileage (which is a pretty useless display since it’s insufficiently filtered) and also not the average mileage (since last reset, which is usually for me the last fillup). That makes sense; the average mileage varies too much if recently reset and too little if reset too long ago.

I pay a lot of attention to gas mileage; it’s a bit of a game that helps me keep from speeding. I routinely beat the EPA highway mileage even though my trip to work is part city and part highway.

I haven’t run out of gas yet. Closest I’ve come is putting 19.6 gal into a 19 gal tank. (Actually a 20-gal tank but the last gal is below the outflow.)

Were I coding it, I’d recalculate whenever the engine is turned on, ignoring previous tank levels, unless someone found a really strong reason to do otherwise. But, parking on a hillside might be enough of a reason.

My instinct would be to simply low-pass filter it, but during driving time, not when stopped. If that’s the method, then sitting idling just brings down the gas mileage and reduces the DTE. You’d have to drive for a bit before seeing it rise based on the added gas.

A better test might be to add about a half a tank, in integral number of gallons to make the math easy.

Yes. It’s probably more precise.

However, it important to remember the difference between precision and accuracy.

I concur. When pulling my trailers, my truck gets about half it’s normal highway mileage. When I fill up after dragging the trailers around, the DTE shows only half the typical range value. After a while driving sans trailers, it climbs up to the normal 500+ range.