Vag scope front end

Would you like to see an acceleration meter added to the program?

  • I Don't have this program, but I would get and use it if this were added.

    Votes: 6 54.5%
  • I have this program and think it is a great idea!

    Votes: 3 27.3%
  • Not really interested in an acceleration meter.

    Votes: 2 18.2%

  • Total voters
    11

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
Ok, I have pretty much finished the software. Below is a screenshot of the RR vagScope skin:


The full skin for this can be found here:
1) http://www.PuterTech.net/VagScope/BMV2_VagScope.zip

The install file for the VagScope code that is needed to run the skin can be found here:
2) http://www.PuterTech.net/VagScope/VagScopeInstall.zip

The Code is in C#. All code and Project Studio projects can be found here:
3) http://www.PuterTech.net/VagScope/VagScopeMod.zip

Ok, now that all the links are there here are some notes on it:
1) This would best be termed as "beta". It will have glitches, and it will change a lot. Keep checking back for notes on changes, if I change it I will replace the file on the server.
2) A known bug is that the MPG on the left is not valid until after 2 minutes of runtime. It is an average over the two minutes, and until all that data is collected the values will be incorrect. The MPG to the right is always accurate and is the instantaneous MPG over the last two seconds. These times may change as I refine what is useful :)
3) Those of you who are coders:: please help me debug this. I know there are bugs, specifically I know of one instance where it crashes and I have not been able to replicate the conditions that cause it. If you figure out where the crash is coming from (it has only happened 3 or 4 times) please let me know!
4) It is dependent upon the reliability of vag-com (not very good). To deal with the fact that vag-com will sometimes fail to communicate, it detects the lack of incoming data. Don't stop and restart vag com for it, the program will detect the freeze of data after 20 seconds and do this itself. The exception to this rule is if communications have been established and then they freeze. If this is the case then you will need to hit back on the skin and then go back in. I intend to detect this in the future and restart vag-com, I just have not put the code in yet.

now for the install instructions, they are not too hard:

1) extract all the zip files
2) Install vag-com from Ross-Tech
3) Install the latest RR (Important!)
4) run setup.exe
5) Copy the skin folder into your RR skins folder
6) Set the RR skin as your skin.
7) make sure you have a vag-cable hooked up (This WILL NOT WORK with an OBD-II cable)
8) copy the following line to the top of your rr.ini file:
startcommand=Runq;C:\Program Files\VagScope-RoadRunner\VagScope-RoadRunner\VagScopeMod.exe

Thats it, Should all work.

Here are some simple instructions to calibrate the MPG gauge:
1) Track your miles using your odometer (I use a handy palm program to track my mpg)
2) You will notice a Vag-Config button on the main screen of the skin now, click it
3) This screen shows an add mpg field and a subtract mpg field along with your current tank mpg
4) if your actuall mpg (that you tracked in step 1) shows higher than the tank-mpg then increase the add mpg value, do the opposite if it is less (this is more likely). Note: The tank mpg already has any offsets you applied earlier
5) When you change the offset the gauge will reset.

I recommend repeating this every tank, different factors (such as how clear your fuel filter is) will require the offset to be changed.

Thanks everyone for your support :)

P.S. for those of you that want a standaone version, here is the project code and you will find binaries under the bin folder. THIS IS ALREADY OUT OF DATE. I am not supporting the standalone version, if you wish to develop it into something more or port the code from the RR plugin (this is possible) into the standalone version you are more than welcomed to, but I will not be doing any work on the standalone.
http://www.PuterTech.net/VagScope/VagScopeMod_StandAlone.zip
 
Last edited:

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
To get information about when I update code, bug fixes, etc. Please check (or just subscribe to) this thread. There is not a lot of traffic on it other than me just posting about updates.

http://www.mp3car.com/vbulletin/rr-plugins/116143-embed-vag-scope.html

P.S. sorry to post cross-forumn links, I know it's in bad taste...but the idea of updating threads in three forumns is really unapealing to me.
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
A couple updates.

Some bugs have been fixed, there are new version at the links provided.
There are two outstanding bugs that I have not had time to fix.

the first is that the average MPG is not accurate..I realize this. It's a matter of data being horked by coasting. If you get one value in while coasting it can be in the area of 300 mpg (or much more), whereas the lowest you could get is like 10 mpg...which means one value while coasting drastically scews the data. I need to work out how to deal with this, it will most likely involve fuzzy math where I take any large values and lock them to a max value (probably anythng larger than 80 or so will be made to equal 80).

The next is that if you press the "vag-scope" button before the vag-com automation completes the automation breaks. The workaround is to wait to change screens until everything is loaded, I will try to find the time to fix this.

Also, it looks like there is a user on mp3car.com that will be updating the standalone version to my current code. If he does follow through on this I will be sure to post an update about it, watch the mp3car.com link in my original post for any updates on this.

Thanks all, I really hope people get use out of this...I've really enjoyed it in my car. I'll try to get the bugs fixed asap...life is just busy right now.
 

milehighassassin

Top Post Dawg
Joined
Mar 18, 2005
Location
Fort Collins, CO
TDI
2005 Golf TDi PD, Reflex Silver
I am not sure how it works on a GM Truck (Duramax) but it will show a max value of 99, while coasting. Then I think the lowest I have seen the MPG is 1, but that was not for long. Even on hard downshifts it usually shows 3-4 MPG.
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
milehighassassin said:
I am not sure how it works on a GM Truck (Duramax) but it will show a max value of 99, while coasting. Then I think the lowest I have seen the MPG is 1, but that was not for long. Even on hard downshifts it usually shows 3-4 MPG.
Problem is, there is no data blocks to show MPG. I take the current speed and the current consumption (in l/h) and calculating the instantaneous (actually the average of the last 4 1/4 increments). I then take this instantaneous value and store it, and increment an accumulator (I remove the previous value from the accumulator since I am only tracking the previous ten minutes).

The problem with this is, how do I round off those astronomical values (I have seen the values hit "infinity"...yes..really, it occurs when coasting in gear due to the 0 consumption).

So, what is the best value to round to at that point? See what I mean? When you coast in gear you really are getting infinite mpg, or free miles on your odo without fuel cost, but that value just completely horks the data. So any manipulation of it is not sound mathematicaly, but makes the average more "accurate" I guess the question is, how do I define accurate? Mathematically accurate would be to do no rounding, but that does not match real world.

interesting problem, eh?
 

milehighassassin

Top Post Dawg
Joined
Mar 18, 2005
Location
Fort Collins, CO
TDI
2005 Golf TDi PD, Reflex Silver
What about miles travelled divided liters/gallons of fuel used? I guess the problem is that the car does not know how many miles it has travelled since the last refuel. Can you somehow tap into the fuel level sender? It knows how full/empty the tank is and if you can assign a number based on that level (1/2 full= aprox 8 gallons, etc)?
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
I was unable to find a way to tap into the fuel sender.

On top of that, it's notoriously innacruate, especially if you have a ventectomy.

Watch your guage, it will drop at different rates, especially at the start and end of the gauge.

I thought about that as well, but it won't work. I can get the injection quantity, but that would be extremely hard to track because it changes so often and it would be innacurate because I'm only sampling every 1/4 second.
 

milehighassassin

Top Post Dawg
Joined
Mar 18, 2005
Location
Fort Collins, CO
TDI
2005 Golf TDi PD, Reflex Silver
I would think the information is available somewhere since there are VAG vehicles in other countries that have MPG calculations, etc.
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
I have never installed one of those, but I thought they had their own sensor?

also, do they give you instantaneous or average? Because instantaneous is much easier than average.

My instantaneous mpg is dead on accurate.
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
milehighassassin said:
I am not sure.
Anyway you can use the instantaneous averaged out for run time?

I dunno, just tossing ideas out there.
That's what I'm doing now.

I pull the instantaneous value every second and store it (I keep the last ten minutes) and then divide the total by the number of values.

problem is that just a few coasting values swamp any of the low end values by hundreds of mpg. I can clearly limit these values, but at that point it's no longer sound math and I have to question the accuracy of the average.

I would be very curious to know how others have done this, but I haven't seen any info on it.

I wish vag-com had a mpg data block.
 

QtmMech

Veteran Member
Joined
Sep 19, 2007
Location
Mpls
TDI
2004 Jetta 5-speed
removing infinities

puter said:
The problem with this is, how do I round off those astronomical values (I have seen the values hit "infinity"...yes..really, it occurs when coasting in gear due to the 0 consumption).
No problem, just do your calculations with the inverse: l/km or gal/mile. If you do all you calculations with consumption instead of MPG, you will have zero consumption during coasting instead of infinity MPG. Consumption will never approach infinity, even in worst case scenario: the planet has finite resources. Easy solution, no rounding necessary (and no ripping off the P & G gamers!). Do this for all the consumption time averages and give the user the choice of displaying consumption (the european way) or its inverse. If the user wants to display MPG, then you only have to deal with the coasting infinities when calculating the display units conversion. A simple if, then will deal effectively with the zero consumption case. Display something like "inf." or "99999" MPG during zero consumption, but all your saved data should remain in consumption units to make sense over all time.

I am inclined to go with consumption on display myself as it just makes more intuitive sense. We are trying to reduce consumption so to go for a lower number (l/Km) 'feels' more rewarding than increasing MPG. It just sounds backwards . . . ( . . . or inverted . . .)

Thanks for doing this skin, I like the multi display format.

Jim

PS: This is much easier than 'renormalising' the multiple infinities out of quantum chromodynamics! This odd but effective technique causes mathematicians to break out in shingles. But to the Math nerds , Physicists are just part of the 'bottle and test tube crowd.'
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
QtmMech said:
No problem, just do your calculations with the inverse: l/km or gal/mile. If you do all you calculations with consumption instead of MPG, you will have zero consumption during coasting instead of infinity MPG. Consumption will never approach infinity, even in worst case scenario: the planet has finite resources. Easy solution, no rounding necessary (and no ripping off the P & G gamers!). Do this for all the consumption time averages and give the user the choice of displaying consumption (the european way) or its inverse. If the user wants to display MPG, then you only have to deal with the coasting infinities when calculating the display units conversion. A simple if, then will deal effectively with the zero consumption case. Display something like "inf." or "99999" MPG during zero consumption, but all your saved data should remain in consumption units to make sense over all time.

I am inclined to go with consumption on display myself as it just makes more intuitive sense. We are trying to reduce consumption so to go for a lower number (l/Km) 'feels' more rewarding than increasing MPG. It just sounds backwards . . . ( . . . or inverted . . .)

Thanks for doing this skin, I like the multi display format.

Jim

PS: This is much easier than 'renormalising' the multiple infinities out of quantum chromodynamics! This odd but effective technique causes mathematicians to break out in shingles. But to the Math nerds , Physicists are just part of the 'bottle and test tube crowd.'
The infinity is not a problem

The problem is the fact that you can easily hit 300 mpg while coasting (or more) and a value of 300 for a high has a drastic affect on the average when compared to a value of, say 5 on the low end when the median value is 50.

Say, the median mpg were actualy 300 for a jetta, then the problem would be exactly the opposite if you get a value of 5 mpg.

See what I mean? I clearly need to cap the mpg value, the question is where and how can I mathematically approve it.
 

QtmMech

Veteran Member
Joined
Sep 19, 2007
Location
Mpls
TDI
2004 Jetta 5-speed
capping the mpg

Don't actually know how capping the mpg will ever give you an accurate MPG. If you do weighted averages of consumption (over miles), the zero or near zero consumption will accurately average into the total consumption. I really don't know how this statement can be unclear. Capping the MPG during the glide will necessarily give you a false average MPG. And a lousy result for p & G.

The solution is to do weighted averages of consumption. Solves all your problems. If this is still unclear, PM me and I will do some algebraic proofs for you.
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
it is already a weighted average.

Think about it this way, you would agree that the instantaneous value is accurate correct? The value is calculated by multiply the inverse of consumption times the speed (hr/gal * mile/hr = mile/gal)

I am grabbing this value every second. That means if you have the same consumption over 60 seconds, that consumption level is weighted heavier.

The main issue I have with this is if you hit a hill I guess the consumption could go up while you're traveling the same distance.

The problem is that I have no way of accurately getting the amount of fuel in the tank, and i don't think I can get the value on the odo (I have not checked this). So there is no real way for me to calculate the mpg the conventional way

what I am trying to do is figure out a way to accurately do it given the constraints I have; which are out of my control.
 

QtmMech

Veteran Member
Joined
Sep 19, 2007
Location
Mpls
TDI
2004 Jetta 5-speed
weighted average

puter said:
it is already a weighted average.

Think about it this way, you would agree that the instantaneous value is accurate correct? The value is calculated by multiply the inverse of consumption times the speed (hr/gal * mile/hr = mile/gal)

I am grabbing this value every second. That means if you have the same consumption over 60 seconds, that consumption level is weighted heavier.
Taking each second gives you a average over time. This is actually an unweighted average. The hint is time is removed from the calculation by dividing it out (but is of course intrinsic to the sampling limitations). Time is therefore irrelevant to both the weighting and the overall average.

I don't know what you are trying to get at with the last sentence quoted above.

What you really want is a weighted average over distance in order to get a meaningful value of gal/mile or its inverse. So for each given interval grab gal/hr and miles/hr and divide as you have above. To properly weight the average, you need to pull a distance traveled during each sample time interval by dividing miles per hour by 3600 seconds per hour (given a one second interval). Again this weighting will only make practical sense if you are working with the more intuitive gal/mile consumption calc.

(and Assuming the instantaneous values are good enough averages for the one second interval where the values in question are often non constant . . .)

Weight the average by taking mi/Mtot where m (sub) i is the fraction of miles traveled in interval i and Mtot is the sum of i=1 to Imax of mi. Multiply mi/Mtot to each Ci, then sum the mi*Ci.
Where Ci = (gal/hr)i / (miles/hr)i. Or more computationally efficient: Multiply the (sum of Ci)by 1/Mtot

Sorry this looks so ugly without the full mathematical symbols.

All your calculations will be simpler if you deal with consumption averages (gal/mile) rather than trying to average MPG which will blow up during in gear coasting. The infinities will indeed be a problem as our diesels consume zero fuel in gear and coasting. Arbitrarily truncating these zero consumption numbers will give you non-sense for your average MPG.

Jim
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
This has definitely sent me on the right track

I would like to point out that your Ci cancels out to just be gal/miles

Ci = (gal/hr)i / (miles/hr)i = (gal/hr)/(miles/hr) = (gal/(miles*hr/hr) ) = gal/miles
 

QtmMech

Veteran Member
Joined
Sep 19, 2007
Location
Mpls
TDI
2004 Jetta 5-speed
puter said:
This has definitely sent me on the right track

I would like to point out that your Ci cancels out to just be gal/miles

Ci = (gal/hr)i / (miles/hr)i = (gal/hr)/(miles/hr) = (gal/(miles*hr/hr) ) = gal/miles
Yes, Ci is the instantaneous consumption that you then are summing and averaging, yes the hours divide out. My understanding these were the only quantities avail from the CPu to get at consumption. The point is I have a weighted average of consumption and you have an unweighted average calculation which will under represent the greater fraction of a mile covered when the vehicle is going faster.

Cheers!
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
QtmMech said:
Yes, Ci is the instantaneous consumption that you then are summing and averaging, yes the hours divide out. My understanding these were the only quantities avail from the CPu to get at consumption. The point is I have a weighted average of consumption and you have an unweighted average calculation which will under represent the greater fraction of a mile covered when the vehicle is going faster.

Cheers!
Ya, I worked out how to do it, I have an implementation problem tho

As far as I can tell, the i will need to be i/itotal will need to be re-calculated for each value, every cycle. This would require way too much repetition.

Am I missunderstanding how to implement it?

edit: Apparently C# for unknown reasons will take a double and make it an int if you divide by an int literal.

diving by 3600 caused it to change from a double to an int. Very stupid.

I should have a bug fix posted by the end of the day tomorrow is my guess barring any problems. It will be nice to have accurate mpg :)
 
Last edited:

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
On a side note, I was being stupid. the avgMPG should be divided by itotal right before it is printed since it can be mathematicaly removed from the summation, sorry...I don't know what I was thinking.

now...if anyone can tell my why when I divide a double (value 30) by 3600 it comes up as zero rather than .008 I would be very happy

language is C#

edit: Apparently C# for unknown reasons will take a double and make it an int if you divide by an int literal.

diving by 3600 caused it to change from a double to an int. Very stupid.

I should have a bug fix posted by the end of the day tomorrow is my guess barring any problems. It will be nice to have accurate mpg :)
 
Last edited:

Growler

Got Soot Vendor
Joined
Nov 24, 2003
Location
Millersport, Ohio
TDI
Schmutz, 2015 Golf Sportwagen DSG & Schnurren, 2001 Golf GL 2 door 5M
does this only work with little computer screens? like on a carputer or something?

sounds like a fun project for sure.

any way to get this to work on a small LCD screen like gets hooked to a mobile DVD player?
 

QtmMech

Veteran Member
Joined
Sep 19, 2007
Location
Mpls
TDI
2004 Jetta 5-speed
conceptual error or special case?

I tried a simple case of intervals from t = one to nine where mph = t and consumption was a constant. The time averaged mph/gph was identical to the total miles/total gallons. I might have been mislead re: the weighted average. If I have time this evening, I will try the same routine for mph = t*t . . .
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
QtmMech said:
I tried a simple case of intervals from t = one to nine where mph = t and consumption was a constant. The time averaged mph/gph was identical to the total miles/total gallons. I might have been mislead re: the weighted average. If I have time this evening, I will try the same routine for mph = t*t . . .
Apparently C# for unknown reasons will take a double and make it an int if you divide by an int literal.

diving by 3600 caused it to change from a double to an int. Very stupid.

I should have a bug fix posted by the end of the day tomorrow is my guess barring any problems. It will be nice to have accurate mpg :)
 

puter

Top Post Dawg
Joined
Jun 19, 2007
Location
Tacoma, Washington
TDI
2002 Jetta GLS
Growler said:
does this only work with little computer screens? like on a carputer or something?

sounds like a fun project for sure.

any way to get this to work on a small LCD screen like gets hooked to a mobile DVD player?
Roadrunner is designed for carputers.

My laptop is mounted in the trunk of my car where the cd-changer would usually go. It's actually really slick, you can't even tell there is a computer there. i have a usa-spec adapter going from the laptop into the cd changer wire harness for audio from the laptop (GREAT mp3 player built into roadrunner)

In the front of my car I am running a 7" lilliput touchscreen display.

From there I can read out the information using the display you see at the front of this post. I also have gps and an mp3 player built in.

All of this is available through a very slick interface skin for roadrunner that is designed to be used with a finger-input touchscreen

it has worked extremely well thus far, I have been using it in my car of a few months.

The skin is the original roadrunner skin that I have done a number of modifications to. And, of course, the vag-scope code etc. is all my original stuff.

I'm hoping people like this and use it :)
 
Top