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