05-16-2008, 08:06 PM
|
#71 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
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
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
Last edited by dcb; 05-17-2008 at 02:44 AM..
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
05-17-2008, 10:08 PM
|
#72 (permalink)
|
EcoModding Apprentice
Join Date: Feb 2008
Location: Streamwood, IL
Posts: 105
Dakota - '00 Dodge Dakota Club Cab, Sport 90 day: 18.57 mpg (US) Jeep - '01 Jeep Wrangler TJ Sport 90 day: 18.46 mpg (US)
Thanks: 0
Thanked 1 Time in 1 Post
|
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)
|
Batman Junior
Join Date: Nov 2007
Location: 1000 Islands, Ontario, Canada
Posts: 22,532
Thanks: 4,082
Thanked 6,978 Times in 3,613 Posts
|
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
Location: us
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
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 Ford Focus ZTS 90 day: 31.3 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
|
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)
|
Batman Junior
Join Date: Nov 2007
Location: 1000 Islands, Ontario, Canada
Posts: 22,532
Thanks: 4,082
Thanked 6,978 Times in 3,613 Posts
|
Hi, Mr Cheap - welcome to the project.
What kind of car are you testing on?
|
|
|
05-18-2008, 09:08 AM
|
#77 (permalink)
|
Batman Junior
Join Date: Nov 2007
Location: 1000 Islands, Ontario, Canada
Posts: 22,532
Thanks: 4,082
Thanked 6,978 Times in 3,613 Posts
|
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)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
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):
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
Last edited by dcb; 05-18-2008 at 01:12 PM..
|
|
|
05-18-2008, 06:46 PM
|
#79 (permalink)
|
Batman Junior
Join Date: Nov 2007
Location: 1000 Islands, Ontario, Canada
Posts: 22,532
Thanks: 4,082
Thanked 6,978 Times in 3,613 Posts
|
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)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
Sure, I'll give it a shot if you are up for it. Send me what I need to know.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
|
|
|
|