Canadian MPGuino for kilometers
1 Attachment(s)
I've modified 0.75 to select US or metric units at compile time.
Eventually I'd like to be able to switch units on the fly or at least select USA/Metric in the configuration and I've started coding in that style, but there wasn't enough program memory on my first attempt. Updated June 12, 2009: it works on my 95 Neon Sport, 2.0L SOHC, 5MT - VSS/KM=9926, MICROSECONDS/LITRE=57442679. I'm working on version 76m using the Atmel328 and Arduino IDE 0013 - plenty of space now - have already added RPM and working on L/KM. Thanks everybody for this most excellent project. Being relatively new at Arduino, it is good to see more advanced code samples using interrupts/etc. |
Thanks, I myself gonna convert units for a while but i'm just too lazy to start. I think this must be included in wiki.
|
Well done!
The runtime switch will be difficult if you don't want to reset the MPGuino but just switch the current information from gallons/miles to liters/km or vice versa. It's possible but would require conversion functions everywhere that the units are used. I suppose the data could be kept internally in some arbitrary units and then always converted for display. I gave up trying to work within the ATmega168 Flash constraints. I'm using an ATmega328 with Arduino-0013. Works just fine and cost $5.00US for the chip. |
Just FYI, here is a mega88 (half the flash of a 168), lot of work but can do a lot with not much:
http://www.youtube.com/watch?v=sNCqrylNY-0 I'm working on metric and pulse direction for the 168 cuz there are a lot of 168s out there. Might come down to a "bootloader not installed" compiler flag though. |
MPGuino Metric
Thank you very much!
By the way, what does 0.75 mean or state for? Thanks again, Old Beaver Quote:
|
instead of km/l, it will be good to have a l/100km display.
|
Honda Civic LX 1999 metric
Hi,
Thanks to DCB for this great project and Mluckham for the metric conversion. I've built the MPGuino using an iDuino kit, everything went smoothly, installed it on my Honda Civic LX 1999, it's working great! http://forum.ecomodder.com/images/smilies/smile.gif I'm still in the ballpark about VSS p/km (currently 5100, I estimate it is no more than 10% in error) and uSec/km (using 0087696156 guess it is showing consumption 10 to 20% better than it really is...), need more time and fillups to calibrate better. http://py2wm.qsl.br/MPGuino/MPGuino.jpg |
MPGuino metric by Demarco
Hello Demerco!
Nice picture! Congratulations for your work! I haven´t been able to attach my MPguino to my diesel car yet. Can you tell me the nature of the vss signal the MPguino wants to receive? Well, I know it is a digital signal, but, what else? I have a diesel car with two fuel flow sensors which send a digital signal each. Computing the difference I have the actual fuel consumption. Do you figure where can I input this fuel consumption signal to MPGuino as to be understood as real time fuel consumption? Somewhere in the program, the vss signal si converted to fuel consumption, isn´t it? Can you help me to identify the program sequence where that variable is inputted? Thank you much, OldBeaver |
Hello Oldbeaver,
Thanks for the compliments. My car runs on gas, I don't know how to connect a MPGuino to a diesel car. About the VSS signals, I suppose they are pulses of 12V and the AVR microprocessor counts how many pulses, each pulse corresponding to a certain distance travelled. If the motor doesn't have injectors from where to obtain the fuel flow data, instead it has two different fuel flow sensors which requires an arithmetic operation, then I guess MPGuino would need another input and a new software. I'm a newcomer to microprocessors and I'm not able to help you with program modifications, sorry! Gud luck, demarco |
Ok to all.
Well, I am not an expert myself. But what you said gave me a idea, that I will test. Maybe I just need a constant to convert my pulses into MPguino like pulses. Vocé fala Portugués? OldBeaver |
Yes, português is my native tongue.
|
Is it possible to have a l/100km reading?
I know that 235.2/MPG = L/100km Can be possible to modified it to have this reading? |
Quote:
If someone wants to test it, I will send it to you with pleasure! Then I could correct issues if there are any.. It's also supporting a temperature sensor, if you want to use one. |
I've been waiting my MPGuino-kit from Fundamental logic for 11 weeks and I'm starting to believe that my package is lost forever. I paid 39 dollars for nothing.:mad:
Trying to save gas seems to be expensive.:( So I read about the Arduino, and realized that it can be used in many other applications than just mpg computer. Only have to learn some programming:confused:;) or to find ready solutions from the net. Plus some external electronic components, ofcourse. Anyway I've always wanted to try microcontroller stuff and this Arduino seems to be quite easy way to start. So today I ordered Arduino Duemilanove Atmega328 and this time from my home country so that it hopefully will not get lost on the way. How much kb's does the 0.75 version for kilometers need? Should fit easily to Atmega328, I think, since it has more memory than Atmega168? |
Quote:
How I test it? You send the code to dcb and I buy a preasamble kit from im with your code in it? |
Would be possible, but I don't know if he simply can flash a 0.75
version. If I'm right, he don't uses the original Arduino system anymore. Also, there should be an error in the code, you would have to send the unit back to him for a new software version or find someone who can program it. It has no USB port! So I would recomend to build your own MPGuino from an Arduino board. It's simple. If you send me your mail adress, I can give the software to you. You may want to comment out both of the "#define _funktion" directives in top of code (_temperature and _lambda) if you don't use an LM135, 235 or LM335 temperature sensor or lambda readout. Also, there is a little tricky think to mention: My parameters list (saved from setup-menue) is not compatible with original code. I removed all of the unused variables so I don't confuse the users more then neccesary. That means, if there was an original software on your unit, you first have to clear the memory or rewrite it with the new parameters. And same in other direction. Else it will read / write to undefined adresses and mess up the running program. |
L/100 KM, and Metric Update
2 Attachment(s)
I upgraded my MPGuino to the Atmel 328 (double the memory).
Here's the latest version (0.79), which uses the 013 IDE which supports the 328. It features L/100KM, KM/L, RPM, Distance, etc. And it saves the current Tank readings when you stop the vehicle ... handy for when you update the software. I also included some data acquired from a short trip in my 95 Neon, for your interest. This version contains a new method for calibration, it isn't fully debugged though. Instead of the mathematical method to adjust calibration, it displays the current Kilometers or Litres and you are simply to adjust to the readings from your odometer or the gas pump. I've been playing around with accelerometers and GPS, and plan to extend this project to collect more statistics and store them on a memory card. |
Fine, if I count them right now we have 3 L/100km versions :D
Two points to you: .) I think the rpm function was disabled because it varies to much. Do you get a steady reading in your car? .) Why are you not using Arduino 17? |
Three versions LOL
Agreed that 3 versions is not useful but each has something to contribute ... not just metric, but other additions too? In that light, I will check out the other versions more carefully :)
I found bugs in my original post (.77m) thought it would be nice to post a corrected version. If I should be posting in some other manner, I welcome your suggestion please. RPM seems stable and correct in my vehicle. IDE 17 - sure, why not - it's just that when I got the 328 a few months ago, I didn't hit on the latest version. What's your opinion of replacing the hard-to-understand integer math functions with the regular math library? |
Quote:
Quote:
But if there is a faster one I would use it, because space is no problem with an ATMega328. |
I understand the original developer used the integer math routines, instead of the math.h library, because the library plus his code was too large for the 186. With more memory, this optimization is not necessary. Using the math.h functions will make it easier to modify or extend the program, or discover errors in calculations.
However floating point math takes longer than integer math to execute, which is the main reason embedded developers avoid it ... but I wouldn't think that would be a big issue in this application. Another thing to experiment with ... |
I have no good experience with float variables in other projects especialy when it comes to big numbers. I didn't check it, but I think there was a reason to choose unsigned long. This goes up to 4,294,967,295. In float this becomes to 4.2949672E9, so we loose the last 2 digits. That may impact acuraty if there are realy numbers larger then 1E7.
As I understand the code, if its faster it's also more precise because of time for interrupts and so on? (See change to 20MHz crystal) But it may be an option :turtle: |
Floating Point
I would never use floating point calculations in an interrupt service routine - in this case, it is just incrementing counters or subtracting integers to get pulse widths, anyway.
The CPU percentage is around 50%, so it should be quite safe to throw in floating point calculations for the twice-per-second display updates. I have an accelerometer project with lots of floating point, it works fine. I haven't found any floating point benchmarks for the Arduino, it will be interesting to try and quantify the difference between FP and integer math operations. |
Quote:
Your code: Code:
parms[calibrationDistanceIdx] = tank.distance(); // distance x 1000, for updating parms[vssPulsesPerDistanceUnitIdx] Code:
unsigned long tmptankdistance = tank.distance(); Simply think at a situation, where you go into setup menue while engine is running or you are still driving. parms[calibrationFuelIdx] != tank.fuel() will always be true, because tank.fuel() increased since last capture :thumbup: |
Thanks very much, I'll test it. I made an additional change, to save the calculated values:
Quote:
|
Metric Version 0.80m
1 Attachment(s)
Thanks for inspiring me to fix up these problems, all the outstanding issues appear to be fixed now - including the alternate "math-less" method of calibrating fuel and distance.
I also changed the Current and Tank L/100KM displays to alternate metric and US MPG equivalent. Now I can throw away the little chart clipped to my sun visor :) |
Thanks to everybody, who has beem developing this product.:thumbup:
I have used my arduino based mpguino now for 327km and still need some fine tuning with the calibration, but I think I'm quite close already. I was really surprised about the ecodistance (distance without injection) and the fuel used at idle. Ecodistance = 17,1 km Idle Fuel = 2,6 Litres Have I really gone 17,1 km without any use of fuel?:rolleyes: I've always thought that the engine braking does'nt make much difference. Have I really spend 2,6 litres just idleing at traffic lights? Maybe the Start-stop automatic in the new cars is not so bad thing afterall:) One small improvement to the mpguino I would like to have though, My instant L/100km reading is not steady. On the highway at steady speed it's showing 5,70...6,10...6,30...4,90...5,80...6,30...5,10 L/100km. Is this normal? How about others? are your instant readings steady? Would it be possible to have some averaging on the instant reading? Maybe take samples of every 2 seconds and display average from that? I have studied the code already quite much, but I still don't have the skills to do the averaging stuff. |
Quote:
I've been thinking of adding a new configuration parameter so the update rate is a user-configurable number of seconds. |
Thank you for your reply.
Glad to hear it's normal. Then my wiring is propably ok. I was thinking that the variation on the readings is caused by the closed loop operation of the efi. The mixture is constantly changing between lean and rich, as the oxygen sensor gives feedback signal. That user-configurable update rate would be nice. :) I mean it would great if it could collect the data for few seconds and calculate the average from that data. Not just update the display at lower rate.:rolleyes: |
Wow, all the code is over my head - but I sure want one of those Canadian litres and kilometers MPGuino!
Is there one available from the original developer yet? I had heard that they were working on it. I'd buy one tomorrow if it is metric. |
Still waiting for an MPGuino unit in the mail. Is it unusual for 2 weeks delay? Have a USPS tracking number, but according to that website, the parcel hasn't actually been sent yet.
Thanks |
Canadian Metric 0.81m
1 Attachment(s)
Here's my current version of the MPGuino software, metric version. It is not based on the metric version currently distributed by dcb, it is an evolution of 075metric that I posted last year.
It contains these "improvements": - built with Arduino IDE 0020, targeting Atmega 328 - I have successfully used my Spiffie MPGuino and Freeduino platforms to program the 328 for a couple of people who asked for it, so far everything has been compatible with the "Official MPGuino" from dcb - just pop out the 168 from the Official MPGuino and pop in the 328 - added SKelly's font hack to make the large fonts more readable - added big vehicle speed display - added alternating L/100KM / MPG display for Tank and Current - modified edit parameter to leave cursor under OK, instead of the first non-zero digit - don't calculate MaxLoop (for CPU % statistic) while the user is operating the configuration menu - added Tank save to EEPROM, reload on power up - added comments to the code By the way, I've been concentrating on metric outputs and although the US gallons/MPG are still supposed to work - well, they haven't been testing in awhile. If anyone can test that and report back, it would be great. I hope this helps somebody :) Mike |
I did get my MPGuino very shortly after posting (above mluckham's), but haven't have had time to do more than open the package and marvel at the little device. (thanks DCB)
Interesting to hear of your Mods mluckham. I may look into asking to try them in my unit - when I get it mounted. In the meantime, anyone have any experience putting the MPGuino into a 1988 VW Westfalia? Or any similar VW EFI vehicle? |
I just got mine, it has the option of MPG and L/100KM, but i think KM/L is more helpful. Its been ages since i wrote code for anything and am not too keen on tinkering too much with it. Can any1 help me out, I dont mind replacing any of the 2 existing units. Do let me know how to go about it.
|
Quote:
For folks who drive mostly fixed commutes, it makes even more sense to put the distance in the denominator. However, you can have it either way, without any programming. If you calibrate it for km instead of miles and liters instead of gallons, while it is NOT in metric mode, you will get the numbers you seek, though the labels will be a little off. |
Hey thanks dcb, yes that seems like a good option. Also, in that case, hardly any programming would be required if i were to try and edit the code to change the labels, if required, right?
I mean if its just a matter of editing labels i can take the help of someone to edit the code, my only concern was to play with the logical part of it, which can be totally avoided, right? Or am i downplaying the work required? |
Changing labels in a text editor is easy. But it is not a trivial thing to learn how to reprogram/test these chips if you haven't done so before, you have a lot of homework ahead of you if you go that route.
|
Hmmm.. Well could you guide me as to where to start!? as I'd like to do it some time, if not right away. And learning something new is something i'm always up for so what the heck :)
|
My first post :) First thank all to great project mpguino.
Big thanks all developers and mluckham to km versio. I look soft and lcd i think why example "big current" are "KM/H" if i get right that should be "L/100km"? I look some youtube clips and there are about 4-5L values in motorway. That don't right if think 5km/L :) Please tell me why values are that. I see only (L/100km) display example new cars every manufactor. Or i miss understanding to "KM/L" values, if somebody can tell me what values means? edit: Couple new ideas goes my head, example anyone connect graphic display to mpguino (enough cpu power?), outside temperatures, open doors(easy draw graphic display), How that "long" consumption saved in arduino memory? If i drive home to work and car is stopped aboud 8hours and i go back home. Can mpguino remember my old (morning home-work) travelling and continue "long" consumption calculatin or reset mpguino "long" consumption always than cars stops over (7min?)? (example Toyota, Honda, and i think many more cars do) |
Very nice version !!! :thumbup:
I have a question is this version (0.81) suitable for a 16Mhz Crystal ? And is it possible to see big instant L/100Km ? Thank you!!! |
All times are GMT -4. The time now is 12:15 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