But what is the ECU measuring?.
We have the same issue on our boats running modern efi 4 stroke outboards. And knowing how much fuel used in our boats is far more important than in cars, there are no gas stations to pull into and top up out in the ocean, so we have to know that it is accurate.
And, the data derived from the outboard ecu’s is incredibly accurate, and has been proven to be so.
How does it do it?
In laymans terms, the ecu determines exactly how much fuel to inject based on a wide range of information it receives from engine sensors. These include air temperature, load, speed, accelarator position, exhaust gas oxygen levels, and so on. Too many parameters to list here.
So it is simple for the ecu to constantly record exactly how much fuel has been used by the engine, because it detremines how much to inject in the first place.
(This has a very vague relationship to your fuel gauge, and in fact, the fuel level as shown on your gauge is not used to calculate fuel economy. At any point in time, your cars system will know exactly how much fuel has been used since the last reset. A reset sets the fuel used figure to zero)
The only other parameter required to give us real time (instantaneous) fuel economy (mpg, km/litre or L/100kms) readout is speed. (Speed of course also determines distance and distance allows an AVERAGE fuel economy figure to be calculated over a certain distance)
There are two potential sources for speed data that the car’s onboard systems can combine with fuel use data from the ecu for this purpose - the speedo, or the GPS.
I am not sure which speed source the Mazda system uses to calculate fuel economy, I suspect it might be speedo.
But I would also not put it past them to use the GPS data, which itself is incredibly accurate, to correct the speedo data so that it is “real” speed, and to then use that figure to calculate mpg. Wouldnt be diffiuclt to do at all.
As I said, we have found that the ecu derived fuel use data on our boats is very accurate indeed. As an example, i recently filled up my boats fuel tank and it took 33.3 litres to fill. The ecu said it had used 33.0 litres. That is a 1% variation. (0.3 litres = 300ml = about half a pint,or a large cupfull)
Now, that 1% variation could easily have been due to just how “full” I filled the tank, or even a slight variation in the angle of the gas station pavement resulting in the fullness of the tank being different. But over time, with repeated fills showing similar 1% plus or minus variations to that experience, the system accuracy has been well and truy proven.