Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 01-23-2009, 03:47 AM   #1 (permalink)
EcoModding Lurker
 
Join Date: Dec 2008
Location: USA
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Instant GPH jitter fix

I noticed the instant GPH value jumping around at idle between 2 fairly stable values, eg. .12 .12 .12 .15 .12 .12 .12 .12 .15 .12 .12

I looked at the code and found what seems to be an error in how the instant injector time is calculated. Injector pulses are counted toward the instant calculation but if the trailing "off" portion of the cycle isn't complete the elapsed time containing the pulse isn't counted. So you get a spurious GPH increase whenever this happens. This error only affects the instant GPH and MPG values. Current and tank values are accurate.

I fixed it by counting the instant pulse time and elapsed time together at the end of the injector pulse (so the "off" portion begins each cycle) and now the instant GPH value is rock solid.

Code:
void processInjOpen(void){      
  injHiStart = microSeconds();  
}      
 
void processInjClosed(void){      
  long t =  microSeconds();
  long x = elapsedMicroseconds(injHiStart, t)- parms[injectorSettleTimeIdx];       
  if(x >0)
    tmpTrip.injHius += x;       
  tmpTrip.injPulses++;      

  if (tmpInstInjStart != nil) {
    if(x >0)
      tmpInstInjTot += x;     
    tmpInstInjCount++;
  } else {
    tmpInstInjStart = t;
  }
  
  tmpInstInjEnd = t;
}

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 01-23-2009, 04:23 AM   #2 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
Cool, I will take a look at it at my first opportunity.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 01-27-2009, 10:46 PM   #3 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
Ok, I like it

I ran it in parallel with the previous version at a fairly constant consumption rate for several minutes and its displayed value corresponded well with the accumulated fuel/time for the trip display.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 02-05-2009, 09:26 AM   #4 (permalink)
Master EcoModder
 
Join Date: Nov 2008
Location: 18603, USA
Posts: 759

The Crimson Crawler - '04 Hyundai Elantra GLS
90 day: 36.71 mpg (US)
Thanks: 221
Thanked 60 Times in 45 Posts
Question for you both. I just finally got my MPGuino in my car and wired into an injector. I don't have VSS yet, but I've been working on my GPH number. I noticed when I was running it on my desk just to test things out and input my variables, that sometimes the GPH number would fluctuate even though there was nothing attached to the pin. If I stuck my finger on the USB connector shield, it seemed to stop - almost as if it needed additional grounding.

Is my issue and this fix related? I haven't noticed it occur in the car with the injector actually wired in finally, but I can't guarantee that it's not occurring either.
  Reply With Quote
Old 02-05-2009, 09:34 AM   #5 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
nothing attached=all bets off
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 02-05-2009, 10:15 AM   #6 (permalink)
Master EcoModder
 
Join Date: Nov 2008
Location: 18603, USA
Posts: 759

The Crimson Crawler - '04 Hyundai Elantra GLS
90 day: 36.71 mpg (US)
Thanks: 221
Thanked 60 Times in 45 Posts
Ah, go figure. I had it plugged in to power just sitting next to me at work one day. Display was on big instant, so that if people walked by and saw MPG they might ask about it. I look down, and instead of 00.0 it says 999 INST MPG! I don't know where the data came from, but I haven't had issues with it since plugging in.
  Reply With Quote
Old 03-18-2010, 03:37 PM   #7 (permalink)
EcoModding Lurker
 
Join Date: Jan 2010
Location: romania
Posts: 16
Thanks: 4
Thanked 1 Time in 1 Post
mine does not indicate mpguino l / h at idle
show only if speed is greater
which may indicate liters / h?
use code 075

  Reply With Quote
Reply  Post New Thread


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
MPGuino release one workspace dcb OpenGauge / MPGuino FE computer 1061 01-17-2020 01:37 AM
How to get instant fuel consumption from Megasquirt TELVM Instrumentation 11 08-29-2011 02:47 PM
SG shows 0.04 GPH during EOC Tango Charlie Instrumentation 2 08-27-2008 05:24 PM
I cause more problems than I fix!!!!! bennelson Off-Topic Tech 11 06-09-2008 04:37 AM



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