View Single Post
Old 05-19-2008, 12:10 AM   #84 (permalink)
mosier
EcoModding Lurker
 
Join Date: Jan 2008
Location: us
Posts: 14

grnsat - '95 Saturn SL1

metro - '95 Geo Metro LSi
Thanks: 0
Thanked 0 Times in 0 Posts
Didn't have much chance to do testing today. The only thing I remember from today, is in current trip, my MG would increase by 15 every second until it hit 360 i think, then would roll over to around 180, and go back up, but at a slower rate. I noticed a few things in the code though..

Code:
unsigned long Trip::mph(){
//  if(seconds<2) //i.e. instant
//    return vssPulsesPerMile*10000/(currentVSS*36);
  if(vssPulses<1000)
    return (vssPulses*3600000)/(vssPulsesPerMile*seconds);
  return (vssPulses*3600)/(vssPulsesPerMile*seconds/1000);
}
both returns return the same value, unless I'm completely going about it the wrong way. The 1000 in the second return is the same as just multiplying the (vssPulses*3600) by 1000..

Same goes with the

Code:
unsigned long  Trip::gallons(){
  if(injHiSec<4000) //will overflow here
    return ((injHiSec*1000000) + injHius)/(microSecondsPerGallon/1000);
  else  
      return ((injHiSec*1000))/(microSecondsPerGallon/1000000);
}
other than adding in injHius, i'm pretty sure it's the same thing. I don't think it is behaving as intended..

I added my car to the garage. It's a 95 Saturn SL1, 5spd.

Currently i'm using 9980 as my vss calibration, although I should probably just change it to 10000 as per dcb's find of the factory spec (x2).

For the injector constant, I'm using 296052632. I believe this should be a good starting point for my car. I figured it using:

19lb/h injectors, 6.25 lbs per gallon of gas.

((60 minutes * 60 seconds * 10^6 microseconds) / (19/6.25) )/4 injectors

or you can just divide 22,500,000,000 by injector lbs per hour, and then divide by number of injectors. I guess we'll find out if the math is close or not..
  Reply With Quote