Has anyone set up an aftermarket MPG meter for their diesel engine?

I don't expect perfection, just comparative values.
It would be extremely hard to do on a mechanical diesel. Only a tiny fraction of the fuel flowing through the pump gets injected - most of it is used for cooling and for running the timing advance system. There's no real practical way to measure what is used by the engine.
i think that on most cars they only work by comparing current speed, rpm, and throttle input or vacuum. honestly i don't think any of them are at all precise, just a general idea.
It's not hard at all, but aircraft and marine GPH meters are pretty spendy.
I may have admitted this once here in the past but the VW Rabbit isn't the only rig I own. So the Ford Ranger has a ScanGauge II installed in the plug for the OBD scanner.
http://www.scangauge.com/ Does pretty good with the overall mpg for the tank in all situations. You do have to dial it in for a couple of tanks worth but does give instant MPG. But again it plugs in and takes most all its information off the ECU sensors and such.
Does all kinds of consumption read outs. MPG, GPH, total consumed so far, how much left. Miles from both.
I thought at one time that we could fab something up from those in line measuring meters and get the value of the fuel going out the pump with one and the volume going back to the tank with another and figuring the difference. Then doing something with the electronic signal from a tach or speedo to get to MPG that way. I might have to talk with my sons lady friend as she designs this stuff all the time.
Retirement project?
i think that on most cars they only work by comparing current speed, rpm, and throttle input or vacuum. honestly i don't think any of them are at all precise, just a general idea.
I presume that since the ECU in my 2007 gasser knows the rail pressure and the injector size and pulse length that it has a pretty good idea of how much fuel is actually entering the cylinders.
'course, just because the measuring blocks are there doesn't mean that they are being read. And what real use is an instantaneous MPG meter anyway?
I don't lose a lot of sleep over it but the guys who obsess over gasser power tell me that the factory ECU in any modern vw/audi group car (and presumably other major makes) has far more capability than any of the aftermarket stand-alone engine controllers on the market. But manufacturers go to some lengths to make it difficult to modify or even reveal the internal programming without access to the factory tools. The software tunes are typically just a map file, and almost always installed by directly interfacing with the electronics rather than through a diagnostic connector.
Though a friend of mine has a very interesting tale about how an issue his neighbor had with a six-figure volvo culminated in him figuring out how to install and select map files on the current volvo engine management system using a windows pc and a usb obd2 cable. neighbor took his car in for scheduled new car service and they installed an updated map per factory service campaign. but neglected to select any map, leaving the engine controller in a crappy failsafe mode.
What good is an instantaneous MPG? I gives you knowledge for how you drive. If you want to run for miles per tank you strive to keep the instantaneous reading above average. That means you make a choice to only press this far into the accelerator to go faster. One of the readings I use often is the amount of throttle open. LOD on the gauge, think load. If I am on the straight and narrow stretch and want to bump it up by 5 or 10 mph and I only push the accelerator down to get a reading of 70% on the gauge I get 24 mpg on the instant reading. Push to 90 and I get 14. Do I need to get to speed that fast? Maybe but I pay for it on the average side. So mostly it is a reminder that it is your choice to get there in a hurry or save a few bucks and burn the time.
I find the current built in meters to be fairly accurate so I use them on our fleet trucks. It does give one something else to look at besides the road and keeps me alert.
Just a couple reasons to have one. If so inclined.
Back in the early 80's there were a bunch of em, they used a fuel flow meter and several other sensors with an LCD display and keypad, I forget the brand but they were pretty common from
Sears and JC Whitney and such. Not that it'd be easy on a diesel, but those cars had fuel return too and they worked.
June 1979 for instance..
http://blog.modernmechanix.com/car-computers-new-electronic-know-it-alls/ A lot of new stuff isn't really very new I notice the older I get.
What good is an instantaneous MPG? I gives you knowledge for how you drive. If you want to run for miles per tank you strive to keep the instantaneous reading above average. That means you make a choice to only press this far into the accelerator to go faster. One of the readings I use often is the amount of throttle open. LOD on the gauge, think load. If I am on the straight and narrow stretch and want to bump it up by 5 or 10 mph and I only push the accelerator down to get a reading of 70% on the gauge I get 24 mpg on the instant reading. Push to 90 and I get 14. Do I need to get to speed that fast? Maybe but I pay for it on the average side. So mostly it is a reminder that it is your choice to get there in a hurry or save a few bucks and burn the time.
I find the current built in meters to be fairly accurate so I use them on our fleet trucks. It does give one something else to look at besides the road and keeps me alert.
Just a couple reasons to have one. If so inclined.
Well, when it tells me I'm getting 100mpg, I have to presume that i was getting 100mpg for the single refresh cycle of the sensors it took to determine that.
Might have some application in flatland. I live in a mountainous region and i see that number jump rapidly anywhere from 8 to 100 mpg in the space of seconds, so i never bother selecting it on the cluster.
I too live in the land of hills and flats and hitting the big numbers is cause for giving WHOOPPEEE out the windows. Bikers shake their heads. It isn't real or real for very long but it is fun. And just a slight bit interesting. It is a feel good thing. What I thought was funny was an ad for some sort of Miles per Gallon enhancement device that used pictures of the gauge showing that the device gave 45 mpg at this or that MPH. It would have been more truthful if they also selected the LOD gauge so you could see the foot was off the accelerator at that point as well.
Having the gauge I noticed that the cruise control really dumps the throttle when trying to keep speed. I can always better the average MPG on a trip compared to cruise. I can anticipate the hill and it can not. It pulls the throttle closed in reaction to the downhill and dumps it in to keep speed on the uphill. Not the way I was taught to drive. I have found if I have the cruise on and I do get to a long downhill if I simply cover the accelerator lightly with my foot I can keep it from going to total closure and won't loose speed at the bottom of the curve due to engine braking. Then the machine just pulls the pedal away from my foot on the way up but not as hard. So I can customize how it works that way. Still I can out drive it for better gas consumption. I just need it for getting my foot off and shake it around to keep the circulation moving. Old is not good for steady state anything.