05-16-2008, 12:34 AM
|
#61 (permalink)
|
|
MP$
Join Date: Jan 2008
Location: Ohio
Posts: 488
|
The VSS signal from the transmission transducer on my '91 Ford is fairly weak. In fact, a couple months ago, the connector at the trans had gotten oil in it and that was enough to pull down the signal. I don't think i have a wire from the ECU to the speedo because i have a speedo cable too.
|
|
|
|
05-16-2008, 12:45 AM
|
#62 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
Just FYI, the debug screens are accessible via the left right buttons now, as is a "Demo mode" if you press both left and right together once (cycles back and forth through pre-recorded data). So, the data is all there, it is just a matter of presenting it now (and you don't even have to get your hands dirty now). I don't know actually what mpg values it should be, but I'm guessing the end of the array data is 45mpg @ 25mph instant.
The other button combinations are:
middle: brightness
middle+left: Tank Reset
middle+right: Current Reset
The previous patched version debug screen may be out of date, so make sure to use the latest from post 1.
|
|
|
|
05-16-2008, 12:51 AM
|
#63 (permalink)
|
|
Captain Slow
Join Date: Nov 2007
Location: Lunenburg, Nova Scotia, Canada
Posts: 6,033
|
Way to go, dcb. Very cool to watch things unfolding.
I'm going to get in on the fun next week with mine.
|
|
|
|
05-16-2008, 03:34 AM
|
#64 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
Thanks Cap'n
So how do I have 64 bit math on the arduino without the 7k libraries. I can't declare one long long without running out of space. But need to do some accurate multiplying/dividing that would benefit from the extra bits. Does anyone know of any short and sweet 64 bit math routines handy that take less than 7000 bytes?
|
|
|
|
05-16-2008, 09:46 AM
|
#65 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
Well, if I trim down my demo mode so it just uses constant values I can get the 64 bit library to fit (things start breaking before you get to the maximum), so we are officially tight on space and might even need to pare down a couple things, but nobody has to write and debug and integrate any 64 bit math routines for version 1.
Binary sketch size: 14030 bytes (of a 14336 byte maximum)
Last edited by dcb; 05-16-2008 at 10:34 AM.
|
|
|
|
05-16-2008, 11:05 AM
|
#66 (permalink)
|
|
EcoModding Apprentice
Join Date: Feb 2008
Location: Streamwood, IL
Posts: 105
Dakota - '00 Dakota Club Cab, Sport 90 day: 19.48 mpg (US) Jeep - '01 Wrangler TJ Sport 90 day: 16.95 mpg (US)
|
That would be reason to evaluate your code and see if there are any optimizations that can be done, any old school tricks to eliminate instructions in the compiled code. May need to dig into the compiler to see if there any optimizations that can be leveraged there.
I'm not sure you will need the 64 bit data, you could get more than .1 variation from a signal (timing, weak/faulty unit, etc), so having resolution beyond one decimal may not be helpful and in this case detrimental to other features desired.
BTW, I just got my *duino and display. So, I'll get to assemble it and do my "Hello World" test. Something to do this weekend!
Also, I was thinking of putting together a simple circuit, something based on a few 555/556 chips to provide a generator for test signals (static injector and VSS pulse trains) to allow bench testing of the code without having to deal with the connect issues. I don't have a scope, so I'll have to rely on just the math for the apparent frequencies and pulse widths. Unless anyone has any other ideas...? 
__________________
|
|
|
|
05-16-2008, 12:24 PM
|
#67 (permalink)
|
|
Captain Slow
Join Date: Nov 2007
Location: Lunenburg, Nova Scotia, Canada
Posts: 6,033
|
awillard: great - another beta tester signs up!
I believe the list of beta testers/second fiddlers now includes:
larrydag - '95 Honda Accord DX
myself - '98 Pontiac Firefly (Geo Metro)
andrewj - '94 Civic CX
mosier - ??
awillard69 - ??
Mr Clean - ??
And of course our fearless leader:
dcb - 97 saturn s2
Did I miss anyone?
dcb: I wasn't aware of the sketch size limitation. Way to squeak 'er in there.
The size challenge reminds me of the5k.org... which now sadly appears to be defunct. It was a great web site where contests were held to build the best web pages that came in under, you guessed it, 5kb. There was awesomely creative stuff there at one point. I'm sure there are other sites like it out there.
|
|
|
|
05-16-2008, 01:11 PM
|
#68 (permalink)
|
|
FuelSipper
Join Date: Mar 2008
Location: Dallas, TX
Posts: 88
|
I had the debug mode on this morning as I drove into work. I pretty much saw the same results. Injector %D would jump around from 0 to 40% approximately. Although it seemed to go to a very large whole number occasionally (23456 maybe)? I don't know if that is a bug or something. The C would just jump to 0.0, 0.1, 0.2. Don't know if that is accurate but sure doesn't look like an rpm. Maybe needs to be multiplied by 10000 in the code.
Nothing with VC. I'm thinking it might be the connection circuit because I definitely get a reading with the multimeter albeit a small one. I don't think the signal goes above 0.4-0.5 Volts. What kind of signal are we supposed to get with the VSS?
__________________
|
|
|
|
05-16-2008, 01:46 PM
|
#69 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
The "%D" tells me you don't have the latest and greatest. I would start with the latest code from post 1.
Last edited by dcb; 05-16-2008 at 08:08 PM.
|
|
|
|
05-16-2008, 05:59 PM
|
#70 (permalink)
|
|
EcoModding Apprentice
Join Date: Feb 2008
Location: Streamwood, IL
Posts: 105
Dakota - '00 Dakota Club Cab, Sport 90 day: 19.48 mpg (US) Jeep - '01 Wrangler TJ Sport 90 day: 16.95 mpg (US)
|
Quote:
Originally Posted by dcb
So how do I have 64 bit math on the arduino without the 7k libraries. I can't declare one long long without running out of space. But need to do some accurate multiplying/dividing that would benefit from the extra bits. Does anyone know of any short and sweet 64 bit math routines handy that take less than 7000 bytes?
|
I couldn't wait for my board to get assembled, so I started playing with the latest code here at work.
I was able to shrink the sketch size from 7464 bytes to 6642 bytes (11% reduction) by just adjusting the data types used. For instance where you have
Code:
for( int x = 0; x < 10; x++ )
You can save space by converting it to
Code:
for( byte x = 0; x < 10; x++ )
It can be anywhere from 1 to 3 bytes, depending on system. Note: I cannot verify that any changes do not negatively impact the operation of the code itself.
Just changing the various loop control variables from "int" to "byte", I was able to reduce the size quite a bit.
Nextly, removing variables from the global scope has an even greater impact.
For instance, moving into the function where it is used saves 40 bytes! I think that maybe you planned to use it elsewhere, but are not currently. If you don't intend to use it, trim it completely and save the space altogether.
Now that I look deeper into the code, not that I understand everything you build so far, you are using some OO constructs (LCD and trip classes). You may also be adding overhead you don't expect and may gain some significant space by converting to structures and functions. Anecdotal perspective: there is no OO/C++ in the Linux kernel (per Linus) because of the overhead in complexity, size and speed - performance is critical. OO is for the programmer, not the processor/CPU.
Let me know if you want to see my modifications. Since you are up and running, you may be able to evaluate their "properness" better than I can at this point.
It's nice to be more than the sum of our individual parts - together we are stronger.
__________________
|
|
|
|
05-16-2008, 08:06 PM
|
#71 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
I see what you mean,
just going from:
unsigned long vssPulsesPerMile =14400ul;
to:
#define vssPulsesPerMile 14400ul
chops off 72 bytes! (was expecting 4 bytes)
I'm thinking though that 7000 bytes is just too big a penalty for 64bit math. The data is there, we just need to figure out how to scale it down to 32 bit math for display purposes, like in the mpg and gallons and miles functions.
edit: one thing with int vsspinstate=0; it gets destroyed if it isn't declared out of the scope of the interrupt handler, just remembered. If i declare it method static, it takes up just as much space as in global scope
Last edited by dcb; 05-17-2008 at 02:44 AM.
|
|
|
|
05-17-2008, 10:08 PM
|
#72 (permalink)
|
|
EcoModding Apprentice
Join Date: Feb 2008
Location: Streamwood, IL
Posts: 105
Dakota - '00 Dakota Club Cab, Sport 90 day: 19.48 mpg (US) Jeep - '01 Wrangler TJ Sport 90 day: 16.95 mpg (US)
|
You might be counting transitions, from 0 to 5v, and 5v to 0.
So you have 5000 ticks per mile, what about the injector? How often and at what pulse duration?
I assembled by quino today, it was pretty cool. Fun to be doing that stuff again, but my eyes ain't what they used to be.
I haven't fully assembled a working configuration, because I had to run to the Shack to pick up some Zeners.
I used an old IDE cable to interface to the display. Just peeled off the 16 conductors, separated, stripped and tinned the ends, stuffed them into the holes on the board for the LCD. Then did the same for the other end, with a longer "pull back" for more flexibility, and tinned them. Looks nice. I might need to hot glue the ribbon to the back so it won't stress the solder connections.
I had to go scrounging thru my parts piles (more like bins, boxes, baggies, etc), looking for some perf board so I can setup my button interface and the input locations. I had some really nifty little switches that I scavenged from an old VCR some time ago - I knew I was keeping them for something!
__________________
|
|
|
|
05-17-2008, 11:08 PM
|
#73 (permalink)
|
|
Captain Slow
Join Date: Nov 2007
Location: Lunenburg, Nova Scotia, Canada
Posts: 6,033
|
I have a pile of parts to scavenge too. Thanks for the ribbon cable idea. It'll come in handy for me this week when I do my LCD hookup.
|
|
|
|
05-18-2008, 01:01 AM
|
#74 (permalink)
|
|
EcoModding Lurker
Join Date: Jan 2008
Posts: 14
|
Got mine installed today. I have yet to get any usable mpg readings, but after an 8 mile trip I compared the guino and speedometer to get 9969 ticks per mile. After a 90 mile trip, I was less than .1% (yeah, 1/10th percent) off.. My VSS seems solid. My instantaneous mpg never went over 15 however, even when I decreased microsecondsPerGallon by a factor of 10.
I used a harddrive power connector to connect my car to the guino. Since we only need 4 wires, it seems to work great. An added benefit is you can use another hd power connector to power it on the bench.
|
|
|
|
05-18-2008, 04:11 AM
|
#75 (permalink)
|
|
EcoModding Lurker
Join Date: May 2008
Location: Central New Mexico
Posts: 18
Bun - '02 Focus ZTS 90 day: 31.3 mpg (US)
|
I just tested my guino today! I've been following the project for a while, but I haven't had the time to play until school let out last week. I'll post some pictures when I get my usb ports working.
I also noticed the low numbers on the instant mpg readout. My instant mph was fine. It also seemed that only speed affected instant mpg, not throttle. My instant raw injector time was usually 20000 to 26000 uS at light throttle. I did some quick calculations and noticed that gallons() would underflow to zero for the values typically seen in instant.
My fix for this:
Code:
unsigned long Trip::mpg(){
unsigned long mi=miles();
unsigned long gal=gallons();
if( injHiSec<4 ) // prevent overflow
{
gal = ((injHiSec*1000000000) + (injHius*1000))/(microSecondsPerGallon/1000); // 1e-6 gals
if (gal==0) gal=1;//default to a millionth of a gallon so not division by zero
return mi*1000000/gal; // 1e3 mi * 1e6 / 1e-6 gal = 1e3 mpg
}
if (gal==0) gal=1;//default to a thousandth of a gallon so not division by zero
return mi*1000/gal; // 1e3 mi * 1e3 / 1e3 gal = 1e3 mpg
}
It seems to work fine on the simulated values. I have not yet tested this in the vehicle.
Other things I've noticed:
My injector line is low when the engine is off. The guino incorrectly counts this as injector firing.
When changing screens the banner text is hard to see because of the leftover text and symbols cluttering the screen.
I'm willing to help with programming this project.
|
|
|
|
05-18-2008, 09:06 AM
|
#76 (permalink)
|
|
Captain Slow
Join Date: Nov 2007
Location: Lunenburg, Nova Scotia, Canada
Posts: 6,033
|
Hi, Mr Cheap - welcome to the project.
What kind of car are you testing on?
|
|
|
|
05-18-2008, 09:08 AM
|
#77 (permalink)
|
|
Captain Slow
Join Date: Nov 2007
Location: Lunenburg, Nova Scotia, Canada
Posts: 6,033
|
Mosier - you too: what kind of car?
It would be useful if you guys make garage entries for your vehicles, just so we know at a glance at your posts what the context is.
|
|
|
|
05-18-2008, 01:07 PM
|
#78 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
That's really cool guys!! mr. cheap, instant is looking good. I'm still getting way too much consumption in the car (might be the low signal, might be the computer mixing up high and low, but it will get figured out). Mosier, I've got your microSecondsPerGallon figure in and it looks ok on instant. We need to get instant to do 999999 on an EOC. I'll update post one asap, but have exceeded the post size limit currently.
Actually someone suggested using wiki, I might just do that, then anyone can maintain it.
Oh, yah, disclose your car models, and some pics if you get a chance. Here is mine after taming the wiring (and doing the 12v hookup through the terminal block also):

Last edited by dcb; 05-18-2008 at 01:12 PM.
|
|
|
|
05-18-2008, 06:46 PM
|
#79 (permalink)
|
|
Captain Slow
Join Date: Nov 2007
Location: Lunenburg, Nova Scotia, Canada
Posts: 6,033
|
Quote:
Originally Posted by dcb
Actually someone suggested using wiki, I might just do that, then anyone can maintain it.
|
We've got a wiki here on EM - haven't used it yet, but we could fire it up. Do you think it'd help?
|
|
|
|
05-18-2008, 08:55 PM
|
#80 (permalink)
|
|
Master EcoModder
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,310
|
Sure, I'll give it a shot if you are up for it. Send me what I need to know.
|
|
|
|
Vauxhall Car Insurance Vauxhall car insurance is one of the cheapest out there. If you have a Vauxhall, see online for the best car insurance at uSwitch.com!
|