06-10-2008, 12:34 PM
|
#241 (permalink)
|
SuperMID designer
Join Date: Mar 2008
Location: Yokohama, JAPAN
Posts: 37
Thanks: 0
Thanked 13 Times in 2 Posts
|
You're welcome.
Quote:
Originally Posted by dcb
Any thoughts you'd be willing to share on the trip vs instant mpg discrepancy?
|
I've no time to figure it out yet, but I think you could.
I believe you can refer raw numbers for the variables and you'll find the cause is whether distance data or gallons, instead of the result of mpg value.
Quote:
Or better yet, a generic way to multiply and divide 32 bit numbers while not overflowing but retaining max resolution (without a bunch of "if" statements)?
|
I know 32 bit data is better than 16 bit, but...
We observe approx 1% variance on the VSS and injector pulse width, therefore 1% accuracy is my target. I believe 0.1% internal calc error is acceptable, then 5 digit decimal value (or 16 bit data) is enough for our instrument.
Again, my suggestion is to place cli()/sei() codes for another interrupt driven variables, such as vssPulse and injector pulses.
Following is an example in instruction level. A 32 bit variable is sent to registers as follows and interrupts can be occurred any timing between instructions.
Code:
; a 32 bit variable is 0x0000FFFF
LDS R14,0x0244 ; R14<-0xFF byte 0 of 0x0000FFFF
LDS R15,0x0245 ; R15<-0xFF byte 1 of 0x0000FFFF
; an interrupt occurred, then it became 0x00010000
LDS R16,0x0246 ; R16<-0x01 byte 2 of 0x00010000
LDS R17,0x0247 ; R17<-0x00 byte 3 of 0x00010000
; then R17..R14=0x0001FFFF
Regards,
Yoshi
Last edited by Yoshi; 06-10-2008 at 04:35 PM..
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
06-10-2008, 01:04 PM
|
#242 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
FYI, we are working with a copy of a trip to avoid that exact interrupt interaction situation at display time, and the initial bench tests would indicate that the model is reasonaby correct at 32 bits after many hours of running. This mpg issue is a funky scaling thing I'm reasonably certain (and we would have the same problem no matter how many bits the numbers were).
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
|
|
|
06-10-2008, 02:49 PM
|
#243 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
OK, I reproduced the runaway on the bench. It is really really strange. If I unplug the signal generator, for say, two seconds, then when I plug it back in the trip gauges count up by 1 second of injector open time every 1/2 second for two seconds ?!? If I unplug it for 10 seconds, it runs away with the fuel consumption for ~10 seconds when I enable the signal generator again.
So it is a weird one, but needs fixing. The instant raw data is fine, which is where the trips work off of, at least that is how it is supposed to work?
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
|
|
|
06-10-2008, 08:32 PM
|
#244 (permalink)
|
EcoModding Lurker
Join Date: Jun 2008
Location: Tampa, Fl
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
question about hardware
Does it matter if the resistors are 1/4 watt, 1/2 watt, or higher? On a side note, keep up the hard work...the project is coming out awesome!!! I can't wait until I build this and test it in my 1995 geo metro.
__________________
|
|
|
06-10-2008, 11:07 PM
|
#245 (permalink)
|
Master EcoModder
Join Date: May 2008
Location: boston ma
Posts: 381
Thanks: 0
Thanked 5 Times in 5 Posts
|
Quote:
I've got a nice 40x4 LCD that is LED back lit. I'm not even going to try to run it off a 7805 unless i can find something much lower than 12V as the input voltage.
I/we should hunt down a decent sized power resister and run it inline with the 7805 in all honesty.
|
Take this lm317
http://www.national.com/mpf/LM/LM317.html
adjust the output to some reasonable value- 8 volts maybe?
feed that to the 5 volt regulator.. Or maybe just use the lm317 as a 5 volt regulator?
Don't forget the heatsink.
|
|
|
06-11-2008, 10:49 AM
|
#246 (permalink)
|
EcoModding Lurker
Join Date: Jun 2008
Location: NC
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
|
I just found out how much the AC influences my gas mileage.
That was a depressing drive home
|
|
|
06-11-2008, 02:11 PM
|
#247 (permalink)
|
EcoModding Lurker
Join Date: May 2008
Location: Sacramento, CA
Posts: 26
My GSR - '96 Acura Integra GSR 90 day: 35 mpg (US) My 500F - '04 Suzuki GS500F 90 day: 62.99 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
|
I don't know what kind of power requirements are needed but I found this site that deals with a pretty cool power supply. Probably overkill though.
http://tangentsoft.net/elec/teps/
__________________
|
|
|
06-12-2008, 04:09 AM
|
#248 (permalink)
|
needs more cowbell
Join Date: Feb 2008
Location: ÿ
Posts: 5,038
Thanks: 158
Thanked 269 Times in 212 Posts
|
I think I see specifically what the discrepancy between instant and trip MPG is... Here is the log from a short signal gen run (Gallons and MPG are in thousandths)
Code:
,HI,uS, iC,VC,Mi,G, MPG, ,HI, uS, iC, vC, Mi,G, MPG
instant, 0,133228,54,83,10,0,48543, current, 0,133228, 54, 83, 10,0,48543
instant, 0,44084, 18,27,3, 0,44117, current, 0,177312, 72,110, 13,0,47445
instant, 0,44092, 18,28,3, 0,44117, current, 0,221404, 90,138, 16,0,46647
instant, 0,44056, 18,27,3, 0,44117, current, 0,265460,108,165, 20,0,48661
instant, 0,44092, 18,28,3, 0,44117, current, 0,309552,126,193, 23,0,48016
instant, 0,44064, 18,27,3, 0,44117, current, 0,353616,144,220, 26,0,47445
instant, 0,44064, 18,28,3, 0,44117, current, 0,397680,162,248, 30,0,48701
instant, 0,44080, 18,27,3, 0,44117, current, 0,441760,180,275, 33,0,48245
instant, 0,43032, 18,28,3, 0,45454, current, 0,484792,198,303, 36,0,47936
instant, 0,44044, 18,27,3, 0,44117, current, 0,528836,216,330, 40,0,48840
instant, 0,44068, 18,28,3, 0,44117, current, 0,572904,234,358, 43,0,48423
instant, 0,44060, 18,27,3, 0,44117, current, 0,616964,252,385, 46,0,48117
instant, 0,44044, 18,28,3, 0,44117, current, 0,661008,270,413, 50,1,48828
instant, 0,43072, 18,27,3, 0,45454, current, 0,704080,288,440, 53,1,48579
instant, 0,44064, 18,28,3, 0,44117, current, 0,748144,306,468, 57,1,49180
instant, 0,44068, 18,27,3, 0,44117, current, 0,792212,324,495, 60,1,48859
instant, 0,44072, 18,28,3, 0,44117, current, 0,836284,342,523, 63,1,48611
instant, 0,44060, 18,27,3, 0,44117, current, 0,880344,360,550, 67,1,49120
instant, 0,45092, 18,28,3, 0,43478, current, 0,925436,378,578, 70,1,48814
instant, 0,44072, 18,27,3, 0,44117, current, 0,969508,396,605, 73,1,48569
instant, 0,44056, 18,28,3, 0,44117, current, 1, 13564,414,633, 77,1,49013
instant, 0,45080, 18,27,3, 0,43478, current, 1, 58644,432,660, 80,1,48750
instant, 0,44080, 18,28,3, 0,44117, current, 1,102724,450,688, 83,1,48566
instant, 0,44072, 18,27,3, 0,44117, current, 1,146796,468,715, 87,1,48931
instant, 0,44068, 18,28,3, 0,44117, current, 1,190864,486,743, 90,1,48754
instant, 0,44044, 18,27,3, 0,44117, current, 1,234908,504,770, 93,1,48589
instant, 0,44064, 18,28,3, 0,44117, current, 1,278972,522,798, 97,1,48915
instant, 0,44088, 18,27,3, 0,44117, current, 1,323060,540,825, 100,2,48756
instant, 0,44064, 18,28,3, 0,44117, current, 1,367124,558,853, 103,2,48607
instant, 0,44080, 18,27,3, 0,44117, current, 1,411204,576,880, 107,2,48903
instant, 0,44072, 18,28,3, 0,44117, current, 1,455276,594,908, 110,2,48758
instant, 0,43040, 18,27,3, 0,45454, current, 1,498316,612,935, 113,2,48643
instant, 0,44072, 18,28,3, 0,44117, current, 1,542388,630,963, 117,2,48933
instant, 0,44060, 18,27,3, 0,44117, current, 1,586448,648,990, 120,2,48800
instant, 0,43044, 18,28,3, 0,45454, current, 1,629492,666,1018,124,2,49089
1629492,666,1018
The sums for the instant columns data model exactly match the trip columns, so that isn't the problem (and is good to know). But the instant mpg is only working with .003 miles, which introduces a wide margin of error. I think in the case of instant we need to work directly with vss tics(27/28) for now, eventually we should measure the microseconds between pulses for an indication of instant distance/fuel.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
|
|
|
06-12-2008, 07:03 AM
|
#249 (permalink)
|
EcoModding Lurker
Join Date: May 2008
Location: Big City
Posts: 9
Thanks: 0
Thanked 3 Times in 2 Posts
|
DCB,
If someone wanted to throw you a bone for all this damm good work you are doing, could we do it by Paypal? As for me i have collected all the stuff needed to put unit together but just have not had time to get started yet. Only thing i see so far as needing some work is power supply filtering and sensor interface, automobiles can be a nasty environment and you will have all kinds of possible problems if these areas are not done properly. We may also need a peak to hold converter for those cars that have that type of injector. Here is a nice link on injectors.
http://www.megamanual.com/v22manual/minj.htm
|
|
|
06-12-2008, 09:10 AM
|
#250 (permalink)
|
EcoModding Lurker
Join Date: Jun 2008
Location: NC
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
|
I get odd behavior from my LCD.
The initial screen comes up fine (opensource ;mpguino) but then the next screens are messed up. The fact that the first screen appears ok makes me feel its not wiring but it may very well be wiring (lol). If I power cycle it a few times it goes away.
Curious to hear if I am alone.
Last edited by MilesPerTank; 06-12-2008 at 11:22 AM..
Reason: .
|
|
|
|