Quote:
Originally Posted by ecoxantia
...I have also noticed that the guino reckons coasting in-gear uses a lot more fuel than out of gear. That could be down to the code struggling to pick up on some very short injection pulses, I don't know.
|
My MPGuino is installed in a 1997 Audi A6. It has a negative injector signal like you. I reversed the external interrupt edge detection so it would read the actual pulse rather than the non-pulse part of the cycle. It works just fine now.
I noticed that the GPH jumps to a very high value when coasting. Looking at the signal, the injectors are being shut off by the ECU. The signal is a flat line. For some reason, the interrupt routines still run though and they pick up the non-pulse part of the cycle. Hence, the jump to high GPH values. As the car coasts slower and slower, the detected pulsewidth increases. You might experiment with coasting down to a slow speed and see if the GPH increases as you go slower.
My workaround involves modifying the processInjClosed() routine to limit the range of pulsewidths that are considered valid. I've limited the range to: lower end=injector settling time, upper=4000uS. Any other pulsewidth is clamped to zero so it doesn't affect the fuel usage calculations. I use 4000uS as the upper limit because, in normal driving, I've never seen a pulsewidth greater than 3000. When the jump to high GPH occurs, the pulsewidth is at least 11000uS. I added a new setting parameter for the upper pulsewidth limit.
Code:
unsigned long parms[]={69ul,13406ul,119500000ul,6ul,420000000ul,19800ul,72ul,4097ul,0ul,2ul,4000ul};//A6 defaults w/ECU signal
char * parmLabels[]={"Contrast","VSS Pulses/Mile", "MicroSec/Gallon","Pulses/2 revs","Timout(microSec)","Tank Gal * 1000","Injector DelayuS","Weight (lbs)","Scratchpad(odo?)","VSS Delay ms","Pulsewidth Limit"};
#define pulsewidthLimit 10
void processInjClosed(void){
unsigned long t = microSeconds();
unsigned long s = parms[injectorSettleTimeIdx];
unsigned long x = elapsedMicroseconds(injHiStart, t);
if (x >= s && x < parms[pulsewidthLimit]) { //if elapsed time > settling time and < upper threshold
x -= s; //then normal pulse, subtract settling time
}else{
x = 0; //otherwise pulse width assumed to be invalid
}
tmpTrip.injHius += x;
tmpTrip.injPulses++;
if (tmpInstInjStart != nil) {
tmpInstInjTot += x;
tmpInstInjCount++;
} else {
tmpInstInjStart = t;
}
tmpInstInjEnd = t;
}
When coasting out of gear, the engine is at idle and the ECU will feed pulses to the injectors to keep the engine running. While coasting though, to minimize fuel usage, no pulses are sent.
I have no idea if that's what you are seeing but it's worth knowing about.
Good luck.