08-31-2011, 09:18 AM
|
#1 (permalink)
|
EcoModding Lurker
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
Peak and Hold Software Solution
I think I may have come up with a software solution for Peak and hold injectors. I did some very quick tests at lunch time, and grabbed some scope traces, which look very promising.
This fix relies on the two inductive voltage spikes, one at injector on and one at injector off (the trick is to work out which is which).
After work I'll up date this post with the scope traces and my code mod fom people to have a look at and perhaps try out.
I dont have a mpguino (any body want to send me one for testing!), so loaded the code into an arduino and assigned one of the pins to show the injector pulse status.
I then attached my scope to the incoming signal and the pulse status pin. The traces look very good.
Regards, AJT
Last edited by winker; 09-09-2011 at 01:54 PM..
|
|
|
The Following User Says Thank You to winker For This Useful Post:
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
08-31-2011, 09:19 AM
|
#2 (permalink)
|
EcoModding Lurker
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
Here is my modified code (pin 10 was setup to output the digitaly processed signal (i.e. the square wave)
It use the injector settle parameter to determine if it is seeing a start pulse (I have mine currently set to 80uS, which as you can see works quite well).
Code:
#define dspInjectorPin 10
boolean lookForOpenPulse = true;
void processInjOpen(void){
//20110831 AJT Peak and Hold ;)
if(lookForOpenPulse){
injHiStart = microSeconds();
digitalWrite(dspInjectorPin,HIGH);
}
}
void processInjClosed(void){
//20110831 AJT Peak and Hold ;)
long t = microSeconds();
long x = elapsedMicroseconds(injHiStart, t);
if(x<parms[injectorSettleTimeIdx]){
lookForOpenPulse=false;
}
else {
// if(!lookForOpenPulse){
tmpTrip.injHius += x;
tmpTrip.injPulses++;
if (tmpInstInjStart != nil) {
tmpInstInjTot += x;
tmpInstInjCount++;
}
else {
tmpInstInjStart = t;
}
tmpInstInjEnd = t;
// }
lookForOpenPulse=true;
digitalWrite(dspInjectorPin,LOW);
}
}
pinMode(dspInjectorPin,OUTPUT);
The following is a trace showing the injector input at the top, and the digitally processed signal (pin10) out. Looks good!
https://picasaweb.google.com/lh/phot...eat=directlink
and zoomed in (note small spike is injector opening and large spike is injector closing).
https://picasaweb.google.com/lh/phot...eat=directlink
and the following shows a close up at idle of my injector signal
https://picasaweb.google.com/lh/phot...eat=directlink
Last edited by winker; 09-01-2011 at 05:39 PM..
Reason: Found bug in code, so before any comments added sorted it.
|
|
|
The Following User Says Thank You to winker For This Useful Post:
|
|
09-01-2011, 01:58 PM
|
#3 (permalink)
|
EcoModding Lurker
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
For completness the following image shows traces for both sides of my injector (SPI), realtive to ground. The traces were recorded at different times, but you can see the relationship.
Last edited by winker; 09-02-2011 at 03:26 PM..
|
|
|
09-08-2011, 08:18 AM
|
#4 (permalink)
|
EcoModding Lurker
Join Date: Apr 2011
Location: Muskegon,MI
Posts: 36
Thanks: 0
Thanked 7 Times in 6 Posts
|
Tried an LM339 comparator circuit
Thanks for the new thread.
I finally got to add the pictures about my comparator circuit. My LM339 comparator squared up the whole pulse, not just the two pulses that get wider as I rev up the motor-in gear w/ brakes on- to load the motor. I need a better circuit to get just the pulse width change.
pictures of the traces here.
1993 Fleetwood Flair
Thaks, Lee
Quote:
Originally Posted by winker
For completness the following image shows traces for both sides of my injector (SPI), realtive to ground. The traces were recorded at different times, but you can see the relationship.
|
|
|
|
The Following 2 Users Say Thank You to CrazyLee For This Useful Post:
|
|
09-08-2011, 02:47 PM
|
#6 (permalink)
|
EcoModding Lurker
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
@CrazyLee: can't see your pics, infact on your page the only pics I can't see are the mpguino trace ones! Guess you may have moved or be in the process of updating them.
I tried the comparator route, but got nowhere fast, as the gap between the pulses became almost smaller than than the hold portion of the waveform. Thats when I went for the software solution.
I have set my detection pulse to 40uS (aka injector delay parameter), and this seems to work very well. I now need to house my unit, then calibrate it.
If you have access to a scope might be worth trying my software mod, and see what you get.
|
|
|
09-08-2011, 02:50 PM
|
#7 (permalink)
|
EcoModding Lurker
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
@DCB:
thankyou for moving this thread.
Last edited by winker; 09-09-2011 at 01:55 PM..
|
|
|
09-09-2011, 11:45 PM
|
#8 (permalink)
|
EcoModding Lurker
Join Date: Apr 2011
Location: Muskegon,MI
Posts: 36
Thanks: 0
Thanked 7 Times in 6 Posts
|
Got pictures back.
Hi, I found out this morning the photo's weren't loaded onto the server. I fixed that tonight. Comparing the traces for other P&H injectors they don't look like mine turned out. I got 50 MPG in my converter test. I think I know why. The mpguino may be reading the trace upside down! Looking at the small pulse gap between the actual first and last pulse. If I invert the signal it may read OK.
Nah! I still wouldn't get the actual pulse width. But it explains the 50 mpg reading.
I'll keep trying. I got the pre-built 'guino and I can't rebuild the code.
I may the Inj Delay to 1350us to see what happens there. It's at 500us now. I'm reading 13 mpg right now and 10.5 mpg is what I have been getting.
I really need to do a mpg run. I just filled up the tank. UGH! 70.119 gallons @ $3.509/gal= $225.00 I drove 60 miles w/ my 57 chevy in tow. The gauge shows about 5-7 gallons gone. about 8.5 mpg ( 5/5ths on my gauge. ) about 15 gallons per mark. 787 miles at 10.5 mpg. Hows that for hyper-mileing!
Cheers, Lee
================================================== ========
Thanks, Lee
Quote:
Originally Posted by winker
@CrazyLee: can't see your pics, infact on your page the only pics I can't see are the mpguino trace ones! Guess you may have moved or be in the process of updating them.
I tried the comparator route, but got nowhere fast, as the gap between the pulses became almost smaller than than the hold portion of the waveform. Thats when I went for the software solution.
I have set my detection pulse to 40uS (aka injector delay parameter), and this seems to work very well. I now need to house my unit, then calibrate it.
If you have access to a scope might be worth trying my software mod, and see what you get.
|
|
|
|
09-13-2011, 03:43 PM
|
#9 (permalink)
|
EcoModding Lurker
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
I've built my MPGuino, and installed it in the car. Topped up yesterday, and now just need to get some miles on the clock to calibrate it.
|
|
|
09-14-2011, 09:20 AM
|
#10 (permalink)
|
EcoModding Lurker
Join Date: Apr 2011
Location: Muskegon,MI
Posts: 36
Thanks: 0
Thanked 7 Times in 6 Posts
|
mpguino calibration
Way to go! Be sure to note the fuel usage that appears unusual.
Calibrate your odometer on the expressway mile markers.
Follow the calculations to calibrate the mpguino.
Mpguino calibration - EcoModder
Have fun saving on fuel.
Cheers, Lee
Quote:
Originally Posted by winker
I've built my MPGuino, and installed it in the car. Topped up yesterday, and now just need to get some miles on the clock to calibrate it.
|
|
|
|
The Following User Says Thank You to CrazyLee For This Useful Post:
|
|
|