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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 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..
  Reply With Quote
The Following User Says Thank You to winker For This Useful Post:
California98Civic (09-08-2011)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 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.
  Reply With Quote
The Following User Says Thank You to winker For This Useful Post:
California98Civic (09-08-2011)
Old 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.
Attached Thumbnails
Click image for larger version

Name:	InjectorBothSidesRelGND.png
Views:	122
Size:	26.5 KB
ID:	9377  

Last edited by winker; 09-02-2011 at 03:26 PM..
  Reply With Quote
Old 09-08-2011, 08:18 AM   #4 (permalink)
EcoModding Lurker
 
Join Date: Apr 2011
Location: Muskegon,MI
Posts: 36

The Beast - '93 Fleetwood Flair includes kitchen sink
90 day: 9.2 mpg (US)

The Bigger Beast - '03 Winnebago Sightseer Motor Home
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 View Post
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.
  Reply With Quote
The Following 2 Users Say Thank You to CrazyLee For This Useful Post:
California98Civic (09-08-2011), dcb (09-08-2011)
Old 09-08-2011, 02:41 PM   #5 (permalink)
EcoModding Lurker
 
Join Date: Nov 2009
Location: UK
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
I have today finished building my own MPGuino based on the these schematics

/trunk/mpguino/ - opengauge - Open Source Fuel Efficiency Instrumentation - Google Project Hosting (the 13 version)

I plugged it in and got no injector pulses though the VSS was working. After quite a bit of checking I realised that I had been here before. I needed to replace the 50K input resistor on the injector with a 1k. See my previous post

http://ecomodder.com/forum/showthrea...ers-11291.html

That sorted things, and is what I had on my test rig cobled together when I first tried to get this working. Im now going to switch the 50K VSS for a 1K (perhaps 1.2K what the hell).
  Reply With Quote
Old 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.
  Reply With Quote
Old 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..
  Reply With Quote
Old 09-09-2011, 11:45 PM   #8 (permalink)
EcoModding Lurker
 
Join Date: Apr 2011
Location: Muskegon,MI
Posts: 36

The Beast - '93 Fleetwood Flair includes kitchen sink
90 day: 9.2 mpg (US)

The Bigger Beast - '03 Winnebago Sightseer Motor Home
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 View Post
@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.
  Reply With Quote
Old 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.
  Reply With Quote
Old 09-14-2011, 09:20 AM   #10 (permalink)
EcoModding Lurker
 
Join Date: Apr 2011
Location: Muskegon,MI
Posts: 36

The Beast - '93 Fleetwood Flair includes kitchen sink
90 day: 9.2 mpg (US)

The Bigger Beast - '03 Winnebago Sightseer Motor Home
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 View Post
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.

  Reply With Quote
The Following User Says Thank You to CrazyLee For This Useful Post:
wasilvers (04-18-2012)
Reply  Post New Thread


Tags
dsp, hit and hold, peak and hold, pulse stretch

Thread Tools




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