EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   OpenGauge / MPGuino FE computer (https://ecomodder.com/forum/opengauge-mpguino-fe-computer.html)
-   -   Enhancements to MPGuino code -- bargraph display, etc. (https://ecomodder.com/forum/showthread.php/enhancements-mpguino-code-bargraph-display-etc-8695.html)

skelly 06-08-2009 07:37 PM

Enhancements to MPGuino code -- bargraph display, etc.
 
I have been playing with the MPGuino code, and I've made a number of usability enhancements:
  • Enhanced large font -- see Code Hacks Wiki page
  • Store tank data in EEPROM -- never again lose your tank info if the MPGuino blanks out for some reason. The tank data is written to EEPROM when the unit goes to sleep.
  • Turn off LCD as well as backlight on sleep -- probably does not save any power or anything, but I just like having the display off when I'm not in the car.
  • Fuel cut indication on all screens -- get a visual indication that "fuel cut" is happening while you are driving in any display mode. If I am in the bargraph display or the "Big Current" display mode, I like to know if fuel cut is happening. I am just writing a lower-case "c" on the screen when the car is in motion and no injector pulses have been measured. (I've also implemented the fuel cut indication as an animated 'spinner'.)
  • Distance To Empty (DTE) big number display -- I have this working right now, but it is based on your tank economy. This means that when you reset the tank economy this value can flop around a bit and I personally don't like it. Needs some improvement.
  • Prius-like economy histogram (bar graph). Get a new bar representing fuel economy every two minutes. The oldest bar is all the way to the left. Here is a photo:

    http://lh6.ggpht.com/_ERCBSb5GqMU/Sh...0/IMGP6866.JPG
    The "C" value on the top is the "Current" economy and the "P" value on the bottom is the "Periodic" (two minute) value.

Other things I am thinking about:
  • Multiple vehicles, stored in EEPROM, and selected by the user (i.e. if you want to use the MPGuino in more than one car, and keep the configuration for both vehicles)
  • Selectable units for our smarter neighbors who use the metric system. :)
  • Bar graph display of tank history -- each time you reset the tank, add a new bar, and store this history in the eeprom. (intention would be to use this history for the DTE display too)
  • Visual warning (overwrite any display) when low DTE.
  • "eco" indication -- some kind of indication that your driving style is optimal for fuel economy. Maybe a special display pops up during acceleration from zero, that helps you keep your fuel consumption during acceleration in check. (thinking out loud)
  • User-configurable cost/gallon, and corresponding Current and Tank "cost" of fuel used. My brain in general responds better to dollar signs than it does to a fuel economy readout. Someone on the forum suggested something like this too.

Okay, the above is all fine and dandy. Now the bad news. The bargraph display will not fit into the existing ATMEGA 128 or 168. I bought a 328 (about $5), which has plenty of room, and I'm using it with Arduino-0015. More on the bad news side -- this represents a departure from the official project, which has moved away from the Arduino framework and is moving toward straight gcc. This raises the bar of entry for most casual hackers, who probably don't want to install gcc and take the time to get the project compiling.

The good news: I've made all of the features above available at compile-time, so you can turn on or off various features above until you run out of room. I will be tough, however, to get the bargraph display without upgrading to the ATMEGA328 (about $5).

All of that said, I have talked with dcb about these things, and in general I am making changes for my own benefit, and with zero regard for selling 'prebuilt' units with any sort of guarantee. I do, however, think that the changes I've made make the code more maintainable, and in most cases will reduce RAM and executable requirements.

I am not trying to be disruptive of the project. On the contrary, I'm trying to (and I am, in fact) help add value to the project. This is what I see as the *point* of open source. Open source has no guarantees. Use at your own risk. But also, the beauty of it all -- feel free to crack open the cover and poke around.

I offer up the above as an 'alternative' firmware based on version 0.75. It will not be in lock-step with dcb's changes. Obviously this work is all free of charge and the changes are donated back to the community.

I will figure out a way to post the source(s) if anyone is interested in such changes/features.

dcb 06-08-2009 08:55 PM

It's good stuff, it just hasn't made it to the top of my list yet (and we hit the wall in arduino).

I think you would do well to just make a "Skellys arduino based mpguino mods" wiki page with the code embedded in it to cut and paste into arduino. I can add a pointer to it from the top of the pde file in googlecode for the adventurous sorts. And of course a pointer from the code hacks page.

Also, you might want to incorporate the changes for .75, some fundamental accuracy fixes in there, and of course keep an eye on the mpguino update thread if you are going to try to keep it current. This way I know there is a well tested version published on the main site, but there is a path forward the adventurers. I just can't personally help them much these days, and they are good at getting into trouble :)

Thanks,
Dave.

P.S.: the prebuilt does not come with any guarantees either, but I do try extra hard to make sure it works :) My reputation is worth something to me.

McTimson 06-08-2009 10:45 PM

I'm very interested in your code - the bar graph doesn't look too useful to me, as I'm pretty much always watching the screen anyway, so I at least have a general idea of how I've been doing. But, the storing of tank data, fuel cut indication, and DTE look very useful.

I think putting the code up on the wiki would be great, with some sort of disclaimer that adding all the extra code will take up more space, and may not fit on different Atmega chips.

skelly 06-09-2009 08:28 AM

Quote:

Originally Posted by dcb (Post 108756)
Also, you might want to incorporate the changes for .75, some fundamental accuracy fixes in there, and of course keep an eye on ...

Oops, yes, I did start with 0.75 and I've just updated my post to reflect that.

Let's think about the best way to store the source, as I've broken it into multiple source files:

Code:

"lcd.h"
"lcd.pde"
"mathfuncs.pde"
"mpguino.h"
"mpguino.pde"
"mpguino_conf.h"

I can use a wiki to post some photos of what to expect, and describe the feature or whatever, but I think it will be a PITA to store source there.

dcb 06-09-2009 08:44 AM

Quote:

Originally Posted by skelly (Post 108819)
I've broken it into multiple source files

Well that is an issue you created, don't know what to tell you, and don't want to make a huge debate about it either. It was one file when you found it though so that it was easy to load it into arduino (just cut and paste ONE thing, no download and navigating filesystem stuff). So there is plenty of precedent for not fragmenting it. There are PITAs in all directions.

SVOboy 06-09-2009 11:29 AM

Looks like good stuff! I wish I was more near to my car to play around. Looking forward to what you do and how it is when I get home. Maybe when I get my second mpguino up I will compare side by side :P

CoClimber 06-10-2009 10:58 AM

More changes
 
I like the ideas for your mods. I'm actually thinking of other mods for my personal needs. I'm working on data logging capabilities so that I can analyze data on my PC. I'm installing an I2C eeprom on my IDuino board to store the data.

I realize this is blasphemy here but I also autocross my car (Honda Del Sol) so I also want to log my lap times so this will serve double duty. The last reason I want to log speed, etc. is for when my son borrows the car so that I can make sure he isn't getting stupid with it.

Doug

dcb 06-10-2009 11:33 AM

for the last one, not that I'm offering to write it, or that there is space for it, but you *could*, without using a separate computer:

1. initialize the guino with the odometer reading
2. have it track max speed (store it and odo in eprom)
3. have it reset max speed/update odo with password (up to 10 digit number for password would be easy)

So you can track max speed (or some sort of average) confidently, or your kid will figure out how to hack it, it's all good :)

CoClimber 06-10-2009 01:43 PM

Good ideas. I'm not worried about my kid hacking it. I don't even plan to tell him that it logs. :)
The next trick will be to get the CD down below .35...

arlo 07-21-2009 02:12 AM

skelly,
Where have you posted this code? I really wanted to check out distance to empty. I made a function for it, but it takes up too much memory and won't fit.
Thanks


All times are GMT -4. The time now is 01:42 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com