EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   OpenGauge / MPGuino FE computer (https://ecomodder.com/forum/opengauge-mpguino-fe-computer.html)
-   -   Instant GPH jitter fix (https://ecomodder.com/forum/showthread.php/instant-gph-jitter-fix-6861.html)

fx57 01-23-2009 04:47 AM

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;
}


dcb 01-23-2009 05:23 AM

Cool, I will take a look at it at my first opportunity.

dcb 01-27-2009 11:46 PM

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.

Nevyn 02-05-2009 10:26 AM

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.

dcb 02-05-2009 10:34 AM

nothing attached=all bets off :)

Nevyn 02-05-2009 11:15 AM

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.

passat19tdi 03-18-2010 04:37 PM

mine does not indicate mpguino l / h at idle
show only if speed is greater
which may indicate liters / h?
use code 075


All times are GMT -4. The time now is 01:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com