Home Forums Garage Blogs 201 Tips To Save Gas News Reviews Coupons FAQ UserCP Articles
  Mark All Forums Read -  Glossary -  Search The Forums -  View Recent Posts Log Out 

Go Back   GasSavers HomePage > Forums > News and Articles > How To - Do It Yourself

How To - Do It Yourself If you have made a nice modification and want to show others how to do it, post it here. Any and all types of modifications are allowed here.

Reply
 
Thread Tools Display Modes
Old 07-21-2007, 03:12 PM   #31
sonyhome
Member
 
sonyhome's Avatar
Pretty cool ... but I don't quite understand your diode clamp interface you used.

Could you explain how you make it work?

You connected directly to the injector via a 10K resistor?
And then you grounded the signal via a diode bridge? Is that to avoid having signals above 0.6V? Don't understand...

And what's VSS for?

I though you'd use a coil to detect the pulses so the laptop would be totally independant from the car's electrical circuit...

All you have to do now to compute duty cycle is count the number of samples above a threshold vs all the samples.
You may need to adjust with a constant, or adjusting the threshold since the ramp up slope is not vertical, but seems constant.
sonyhome is offline   Reply With Quote
Old 07-22-2007, 03:40 AM   #32
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
We have gui

Tada!!, it's somewhere in the ballpark for a 98'tro!! Now anyone who has a laptop or tablet in their car can monitor MPG

***you need to be logged in to see the pictures,
You can go here to see the pictures without logging in:
http://opengauge.org/diympggauge/
***

*tank will persist when window is closed


Using this circuit, with right and left switched



Zoom in on recording of line in (44100 8 bit stereo) for anylizing the waveform (vss* on top, injector on bottom) and general futzing in response. I don't think the diodes are doing much on the vss side

*Yellow line is default threshold for the vss,
*Cyan "..." injector
*I adapted the code to the latest wave form (inj pulse was on other channel and right side up?!?)
*vss is the misnamed Vehicle Speed Sensor. It really only measures distance. The computer watching the vss still has to keep track of time to figure out the velocity.



Speaking of code, here it is in it's entirety, 6 drama filled pages to chew on in one file called Mpg.java :
Code:
import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.text.NumberFormat;
import java.util.Properties;

import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.TargetDataLine;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class Mpg extends Thread {
	static String propFile = "./mpg.properties";	// place to persist confguration and trips. 
												//Will be created on first run if it doesnt exist.

	static int injThreshold = Integer
			.parseInt(getProperty("injThreshold", "-30")); // value above the noise

	static int vssThreshold = Integer
			.parseInt(getProperty("vssThreshold", "100")); // value above the noise

	static double distanceFudge = Double.parseDouble(getProperty("distanceFudge", "3200.0"));

	static double fuelFudge = Double.parseDouble(getProperty("fuelFudge",	"8000000.00"));

	static String dummyFile = getProperty("dummyFile", "");

	// low level stats tracked in the "trip" class.
	class Trip {
		String name;

		long sampleCount; // num samples, used to compute elapsed time, good
							// for about 58 billion hours @ 44100hz

		long injHi; // stores number of samples that were "HI" (injector was
					// open)

		long vssTot; // how many pulses from the vss, indication of distance
						// travelled

		public Trip(String _name) {
			name = _name;
		}

		// real lightweight update process, gets called at end of audio chunk
		public void Update(long _sampleCount, long _injHi, long _vssTot) {
			sampleCount += _sampleCount;
			injHi += _injHi;
			vssTot += _vssTot;
		}

		public String toString() {
			return "name=" + name + ";sampleCount=" + sampleCount + ";injHi="
					+ injHi + ";vssTot=" + vssTot;
		}

		public void reset() {
			sampleCount = 0;
			injHi = 0;
			vssTot = 0;
		}

		public Trip load() {
			sampleCount = Long
					.parseLong(getProperty(name + ".sampleCount", "0"));
			injHi = Long.parseLong(getProperty(name + ".injHi", "0"));
			vssTot = Long.parseLong(getProperty(name + ".vssTot", "0"));
			return this;
		}

		public void save() {
			properties.put(name + ".sampleCount", "" + sampleCount);
			properties.put(name + ".injHi", "" + injHi);
			properties.put(name + ".vssTot", "" + vssTot);
		}

		public double miles() {
			return (double) vssTot / distanceFudge;
		}

		public double hours() {
			return ((double) sampleCount) / (44100.0D * 3600.0D);
		}

		public double gallons() {
			return (double) injHi / fuelFudge;
		}

		public double mpg() {
			return gallons() > 0.0D ? (miles() / gallons())
					: Double.POSITIVE_INFINITY;
		}
	}

	class TripPanel extends JPanel {
		Trip trip = null;

		JLabel name = new JLabel("name");

		JLabel miles = new JLabel("miles");

		JLabel gallons = new JLabel("gallons");

		JLabel mpg = new JLabel("mpg");

		JLabel hours = new JLabel("gallons");

		JLabel mph = new JLabel("mph");

		JButton reset = new JButton("reset");

		/** used for limiting numbers to 4 decimal places*/
		NumberFormat fm = NumberFormat.getNumberInstance();

		public TripPanel(Trip _trip) {
			trip = _trip;
			setLayout(new GridLayout(1, 8));
			setBorder(BorderFactory.createLineBorder(Color.BLACK));
			add(name);
			add(miles);
			add(gallons);
			add(mpg);
			add(hours);
			add(mph);
			add(reset);
			reset.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					trip.reset();
				}
			});
			fm.setMaximumFractionDigits(4);
		}

		public void upDateLabels() {
			name.setText(" " + trip.name);
			miles.setText(fm.format(trip.miles()));
			gallons.setText(fm.format(trip.gallons()));
			mpg.setText(fm.format(trip.mpg()));
			hours.setText(fm.format(trip.hours()));
			mph.setText(fm.format(trip.miles() / trip.hours()));
		}

	}

	private TargetDataLine m_line;

	protected boolean m_bRecording = true;

	Trip instant = new Trip("instant");

	TripPanel instantPanel = new TripPanel(instant);

	Trip current = new Trip("current");

	TripPanel currentPanel = new TripPanel(current);

	Trip tank = new Trip("tank").load();

	TripPanel tankPanel = new TripPanel(tank);

	public Mpg(TargetDataLine line, AudioFileFormat.Type targetType) {
		m_line = line;

		new Thread(new Runnable() {// thread to update the view every second
					public void run() {
						while (m_bRecording) {
							instantPanel.upDateLabels();
							instant.reset();// reset the instant trip after
											// displaying it
							currentPanel.upDateLabels();
							tankPanel.upDateLabels();
							try {
								Thread.sleep(1000);
							} catch (Exception e) {
							}
						}
					}
				}).start();

	}

	public void start() {
		m_line.start();
		super.start();
	}

	public void stopRecording() {
		m_line.stop();
		m_line.close();
		m_bRecording = false;
		System.out.println(" inj sampleCount = " + current.sampleCount
				+ " inj hi = " + current.injHi + " inj vssTot = "
				+ current.vssTot);
	}

	boolean ig = true;

	boolean vg = true;

	void processChunk(byte[] b, int c) {
		long ih = 0;
		long vt = 0;

		for (int x = 0; x < c; x += 2) {
			int val = ((int) b[x] & 255) - 127;
			if (val > vssThreshold && vg) {
				vt++;
				System.out.println(" vss going hi "
						+ (current.sampleCount + (x / 2)));
				vg = false;
			}
			if (val < 0) {
				vg = true;
			}

			val = ((int) b[x + 1] & 255) - 127;
			if (val < injThreshold) {
				ig = true;
			}
			if (val > 0)
				ig = false;
			if (ig)
				ih++;
		}
		instant.Update(c / 2, ih, vt);
		current.Update(c / 2, ih, vt);
		tank.Update(c / 2, ih, vt);
	}

	public void realrun() {
		byte[] buffer = new byte[m_line.getBufferSize()];
		while (m_bRecording) {
			int c = m_line.read(buffer, 0, m_line.available());
			if (c != 0) {
				processChunk(buffer, c);
			}
		}
	}

	public void run() {
		if ("".equals(dummyFile))
			realrun();
		else
			dummyrun();
	}

	public void dummyrun() {
		try {
			String strFilename = dummyFile;
			File soundFile = new File(strFilename);
			AudioInputStream audioInputStream = null;
			audioInputStream = AudioSystem.getAudioInputStream(soundFile);

			int nBytesRead = 0;
			byte[] abData = new byte[44100];
			while (nBytesRead != -1) {
				nBytesRead = audioInputStream.read(abData, 0, abData.length);
				if (nBytesRead >= 0) {
					processChunk(abData, nBytesRead);
				}
				try {
					Thread.sleep(1000);
				} catch (Exception e) {
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) throws Exception {

		AudioFormat audioFormat = new AudioFormat(
				AudioFormat.Encoding.PCM_SIGNED, 44100.0F, 8, 2, 2, 44100.0F,
				false);
		DataLine.Info info = new DataLine.Info(TargetDataLine.class,
				audioFormat);
		TargetDataLine targetDataLine = null;
		targetDataLine = (TargetDataLine) AudioSystem.getLine(info);
		targetDataLine.open(audioFormat);
		AudioFileFormat.Type targetType = AudioFileFormat.Type.WAVE;

		final Mpg recorder = new Mpg(targetDataLine, targetType);
		JFrame j = new JFrame("MPG Monitor!!!");
		j.setSize(640, 125);
		Container c = j.getContentPane();
		c.setLayout(new GridLayout(4, 1));

		JPanel hd = new JPanel();
		hd.setLayout(new GridLayout(1, 8));
		hd.add(new JLabel(""));
		hd.add(new JLabel("MILES"));
		hd.add(new JLabel("GAL"));
		hd.add(new JLabel("MPG"));
		hd.add(new JLabel("HRS"));
		hd.add(new JLabel("MPH"));
		hd.add(new JLabel(""));

		c.add(hd);
		c.add(recorder.instantPanel);
		c.add(recorder.currentPanel);
		c.add(recorder.tankPanel);

		j.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				recorder.stopRecording();
				recorder.tank.save();//this just adds the trip fields to the properties object
				try {
					properties.store(new FileOutputStream(new File(propFile)),"");
				} catch (Exception f) {
				}
				System.exit(0);
			}
		});

		j.setVisible(true);
		recorder.start();

	}

	static Properties properties;

	static String getProperty(String tag, String dflt) {
		String s = "";

		try {
			if (properties == null) {
				properties = new Properties();
				try {
					properties.load(new FileInputStream(new File(propFile)));
				} catch (Exception e) {
				}
				;
			}
			s = properties.getProperty(tag);
			if (s == null) {
				s = dflt;
				properties.put(tag, s);// will propogate default values to the
										// file
			}
		} catch (Exception e) {
		}
		return s;

	}

}
So, believe it or not, it's all there. I think its a solid proof of concept anyway. Every car will be different, and there's plenty else that can be done to it: RPM column, invert signal/swap channel from mpg.properties file. A a collection of presets for different cars... But I, personally, am gonna try and do other stuff for a while
Attached Images
File Type: gif Mpg.GIF (10.2 KB, 983 views)
File Type: gif graph.GIF (15.6 KB, 971 views)

Last edited by skewbe : 07-12-2008 at 03:20 PM.
skewbe is offline   Reply With Quote
Old 07-22-2007, 10:26 AM   #33
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
Quote:
Originally Posted by sonyhome View Post
Pretty cool ... but I don't quite understand your diode clamp interface you used.

Could you explain how you make it work?
You connected directly to the injector via a 10K resistor?
And then you grounded the signal via a diode bridge? Is that to avoid having signals above 0.6V? Don't understand...
the diodes are supposed to limit the max voltage going into the sound card, yes. The resistor is supposed to prevent the diodes from trying to clamp the vss and injector to .6 volts. The VSS side could use some work in my case.


Quote:
Originally Posted by sonyhome View Post

And what's VSS for?

I though you'd use a coil to detect the pulses so the laptop would be totally independant from the car's electrical circuit...
To do Miles per Gallon, you need to know how many miles you have gone. A direct signal is much easier to parse than an induced signal in a coil. The resistor provides enough independance.


Quote:
Originally Posted by sonyhome View Post
All you have to do now to compute duty cycle is count the number of samples above a threshold vs all the samples.
You may need to adjust with a constant, or adjusting the threshold since the ramp up slope is not vertical, but seems constant.
Yah, I just have a fudge number, there probably is a constant component to the injector pulse that could be factored in for greater accuracy.

*Note, if one were to add a "injectorPulseCount" field to the Trip class, and detect it like the vss pulses, then RPM and a constant value adjustment per pulse could be accomplished.

*also note that it is trivial to add more trips, like "trip 1", "trip 2", etc, and have them save to disk when the window is closed.

Here is the sample a mpg.properties file it creates in the current directory, you can tweak the thresholds and fudge factors (and even pipe in a .wav file of a recording of your probes):
#
#Sun Jul 22 11:13:47 CDT 2007
dummyFile=
tank.injHi=3984869
tank.vssTot=1076
fuelFudge=8000000.00
injThreshold=-30
vssThreshold=100
tank.sampleCount=3984876
distanceFudge=3200.0
__________________
Standard Disclaimer

Last edited by skewbe : 07-22-2007 at 01:28 PM.
skewbe is offline   Reply With Quote
Old 07-22-2007, 04:55 PM   #34
thisisntjared
|V3|2D
 
thisisntjared's Avatar
 
Join Date: Mar 2006
Location: southern nj
Posts: 1,516
thanks for the open source project
__________________
don't waste your time or time will waste you
thisisntjared is offline   Reply With Quote
Old 07-22-2007, 08:37 PM   #35
MetroMPG
I should be WORKING now
 
MetroMPG's Avatar
 
Join Date: Dec 2005
Location: Eastern Ontario
Posts: 4,791
I am duly, duly impressed! (And in over my head.) Congratulations are in order!
MetroMPG is offline   Reply With Quote
Old 07-23-2007, 08:29 PM   #36
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
MPG cruise control

Thanks yall, I wanted to get this idea down somewhere after looking up DWL again.


Ok, so now the computer knows the mpg, big whup. BUT, that old parallel port... It is great for driving, say, a stepper motor, which could, say, be chained up to, say, the throttle to...

Yah, you got it...


Maintain a pre-determined MPG, exactly
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 07-23-2007, 08:40 PM   #37
MetroMPG
I should be WORKING now
 
MetroMPG's Avatar
 
Join Date: Dec 2005
Location: Eastern Ontario
Posts: 4,791
Inspired. Creativity is cool.
MetroMPG is offline   Reply With Quote
Old 07-23-2007, 10:59 PM   #38
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
Heh, a couple more goodies that could be added by providing things like car weight:

1. monitor acceleration (based on change to vss pulses) and other dynomometer/ET type stuff.

2. provide indication of acceleration/fuel consumption (find the peak when accelerating?) Might be good to have an audio signal for this so you can watch the road while accelerating. Make small adjustments in the gas pedal till the pitch frequency tops out.

3. Compute CDA, accelerate to 60 on a flat road and coast to a stop, let it figure out the rest.
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 07-24-2007, 08:04 AM   #39
MetroMPG
I should be WORKING now
 
MetroMPG's Avatar
 
Join Date: Dec 2005
Location: Eastern Ontario
Posts: 4,791
Ooo! I like the audio signal idea. Sort of like version 1.0 of the DWL cruise control.

An audio tone to help you stay near your target FE, rather than spending a lot of time glancing at a screen.
MetroMPG is offline   Reply With Quote
Old 07-24-2007, 08:18 AM   #40
psyshack
Member
 
psyshack's Avatar
 
Join Date: May 2006
Posts: 596
Boy there are some smart folks in this old world. WOW
__________________
09 HCHII, w/Navi
07 Mazda3 S Touring, 5MT
Mild Hypermiler or Mad Man?
psyshack is offline   Reply With Quote
Old 07-24-2007, 01:05 PM   #41
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
Actually, I was thinking of a tone that peaks when you are accelerating most efficiently. If you give the computer throttle control it might be able to find the most efficient accelerator setting for you (for a given gear).
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 07-24-2007, 02:06 PM   #42
cfg83
Senior Member
 
cfg83's Avatar
 
Join Date: Sep 2006
Location: Southern California
Posts: 2,099
skewbe -

Quote:
Originally Posted by skewbe View Post
Actually, I was thinking of a tone that peaks when you are accelerating most efficiently. If you give the computer throttle control it might be able to find the most efficient accelerator setting for you (for a given gear).
Ha ha! I was thinking that this would be a perfect 2600 article, and here you are talking in terms of "tones" for your solution.

Most excellent work!!!!! I think you should publish this in http://www.makezine.com

CarloSW2
__________________
Old School SW2 EPA ... New School Civic EPA :

What's your EPA MPG? http://www.fueleconomy.gov/feg/calculatorSelectYear.jsp
cfg83 is offline   Reply With Quote
Old 07-24-2007, 10:01 PM   #43
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
I got a request to provide a binary, so, just this once. If your signal looks like mine (vss cranked on the left channel, injector upside down and about the same height), it might work out of the box.

you will have to save this Mpg.zip file somewhere then run (trust me?!?)
java -jar Mpg.zip

from a command prompt in that directory, or put a shortcut together, whatever. Google is your friend. If you see error messages, start there, or give yoshi his $170 bucks
Attached Files
File Type: zip Mpg.zip (11.5 KB, 116 views)
__________________
Standard Disclaimer

Last edited by skewbe : 07-24-2007 at 10:04 PM.
skewbe is offline   Reply With Quote
Old 07-25-2007, 01:06 AM   #44
philmcneal
Sweet my own title
 
philmcneal's Avatar
 
Join Date: Feb 2006
Location: Surrey B.C
Posts: 494
the power of open source, now you just need a odb/odbII to usb2 for newbies and downloadable exe and your set!
__________________
If your reading this, then good for you, your saving some gas because your here.
philmcneal is offline   Reply With Quote
Old 07-25-2007, 07:05 AM   #45
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
Not obd, not for newbies, not exe. It's for folks who can figure out how to compile a "hello world" program in a given language, who can put a simple circuit together and hook it up to the vss and an injector, and can make sense out of what they are seeing.

I'm not even going to try to compete in the support department with paid for products, this is Do It Yourself land (that means you too)
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 07-25-2007, 07:22 PM   #46
sonyhome
Member
 
sonyhome's Avatar
Hypermiling User Interface idea:

I think one of the useful things for hypermiling not done by SG2 that this software could do is compute MPG by speeds.

Here's the idea:

Create buckets of speeds, say:
0MPH, 1~5MPH, 5~40MPH, 40~65MPH, 65~100MPH.

For each bucket, compute
- GPH
- average time spent in that bucket
- distance travelled in that bucket
- MPG (when applicable)

Also compute overall MPG.

Now say you're driving in the city, with some highway.

At first you drive normally, and check your buckets, see time spent in each and what part of your driving contributes to your overall MPG.

Now start using hypermiling techniques that apply to specific buckets.

For example, if you see you spend most time on stop lights (the bucket 0MPH will tell you how much gas it costs you), then you know you must turn of your engine at lights to improve MPG.

If the profile shows it costs little gas though it may seem like a long time while you drive, you know you don't need to risk damaging your starter and look for another solution.

Say you spend your gas in the 5~40MPH buchet. Then you can try to focus on gliding.

If it's at highway speeds, then you can try to use drafting instead, and maybe gliding.

The time spent per bucket can also tell you something as you try different techniques, like gliding causes you to hit more red lights, so you need to be more aggressive.
sonyhome is offline   Reply With Quote
Old 07-25-2007, 07:26 PM   #47
sonyhome
Member
 
sonyhome's Avatar
OK a few other things:

- Do you have PICs of the setup, where you wire-in onto your car for collecting Vss and injector signals?

- For OBD-1, you can buy a scan cable, and you could use it to connect a serial cable, with an open source software AND collect the same info I suspect.

- For OBD-2, the scan cable has to hook up to a device ($) that processes and converts the info into data that can be passed to a USB/serial cable.
sonyhome is offline   Reply With Quote
Old 07-25-2007, 08:12 PM   #48
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
re buckets: Sure, you can do that, have a blast You will need to program a tiny bit. If you add trips for each bucket and at the bottom of processChunk, look at instant.mph() and call update on the appropriate trip(bucket), that will get you close.

re: pic, don't have one, mine was just a couple sewing pins soldered to the resistors and stuck into the appropriate wires. I do not have a permanent installation yet though am considering it. There is a number of folks that already have computers running linux or windows in their cars, for whatever reason.

re: obd, yah someone posted a whole bunch of obd stuff earlier in this thread. That road has been pretty well travelled, and I'm not going down it myself. This approach is universal to electronic fuel injection vehicles and operating systems, and that is worth something.
__________________
Standard Disclaimer

Last edited by skewbe : 07-25-2007 at 08:17 PM.
skewbe is offline   Reply With Quote
Old 07-25-2007, 08:15 PM   #49
sonyhome
Member
 
sonyhome's Avatar
Agreed

I was just currious where you tapped the info and routed the wires.

It helps to have photos to actually commit to do it yourself. There is a sense of concretization, and understanding that the solution is complete
sonyhome is offline   Reply With Quote
Old 07-25-2007, 08:35 PM   #50
sonyhome
Member
 
sonyhome's Avatar
Looking at your "diode clamp" again, I have this to say:

I think:
- VSS trips the diodes (sharp horizontal cutoff)
- Injectors voltage is too low and does not trigger the clamp (no cutoff).

It seems to be a 0.4V swing, comparing to VSS cutoffs.

- R is only to limit current if the diode passes current (aka voltage from 0.6V to 13V). At 10KOhm, that is max 1.3mA draw. I dunno if that is noticed by the car's Vss/injector circuits. Likely not?
sonyhome is offline   Reply With Quote
Old 07-26-2007, 01:52 PM   #51
mpmetro
New Member
 
Join Date: Jul 2007
Posts: 6

could you take a picture of your setup and circuit, so I can then try to replicate

thaks
mpmetro is offline   Reply With Quote
Old 07-26-2007, 09:07 PM   #52
txe5502
1996 Nissan Maxima
 
txe5502's Avatar
 
Join Date: Jun 2007
Location: Midway, NC, USA
Posts: 44
Is there any way to use this if your computer's only audio input is mono?
txe5502 is offline   Reply With Quote
Old 07-26-2007, 09:24 PM   #53
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
Are you sure it is only mono? You could only monitor fuel consumption & time OR distance & time with one channel, so it would be worth double checking with a miniscule amount of experimenting (recording) that it is indeed mono.

If I had to choose, I would choose fuel consumption, since I know how long my commute is, and I have reasonably accurate distance instrumentation in the vehicle already.
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 07-28-2007, 10:18 AM   #54
itjstagame
Member
This is really awesome, finally some paved ground for a meter on my non-obd car. Can you think of a way that you'd use a serial or parralell port to capture the signals instead? Because I'd like to get more signals then just those two. Namely RPM because then I can show instantaneous HP and TQ and well and log and throw into StreetDyno.

Also one other nice thing that I'll add to this when I get it all working is an automatic crr and cid recording. I'm thinking choose a 'stop' MPH (like 20MPH entered through a text box) and then have a start button. I cruise to 70MPH, hit start and slip into neutral and let the vehicle slow to whatever the 'stop' MPH is. BAM, I know now exactly how long it takes me to slow down different thresholds, in fact instead of just 5 numbers at different speeds I have a full curve! Not exactly sure how to automate something to solve the crr cid equation based on this curve, but I'll certainly figure it out.

Do you think you could sample from the microphone jack AND line in at the same time? That might be easier than serial/parallel.
itjstagame is offline   Reply With Quote
Old 07-28-2007, 10:33 AM   #55
itjstagame
Member
Actually thinking a bit more I'm pretty stupid to need rpm signal. I can easily get that from the injector pulses! I guess the only difference is that as their duty cycle changes the peaks may start or stop at different times causing a very miniscul shift, but the Hz*2 should be rpm.

In fact if you just had your program ask for the gearing ratios of the transmission and final drive, as well as tire diameter and size, as StreetDyno does, then you wouldn't need VSS either, since you could calculate speed based on RPM. Of course you'd contantly have to tell it which gear you were in on the fly....
itjstagame is offline   Reply With Quote
Old 07-28-2007, 01:43 PM   #56
sonyhome
Member
 
sonyhome's Avatar
Now that you mention it, you should be able to automatically find the gear ratio then with the 2 signals you get then, and when you're not in gear.
sonyhome is offline   Reply With Quote
Old 07-28-2007, 10:06 PM   #57
skewbe
Senior Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 1,103
sonyhome, maybe a smaller resistor on the injector would give a larger pulse signal (and thus more resolution)? I think the automatic gain control might be kicking in on the VSS and reducing both channels.

itjstagame, Yah RPM is right there, so is accelleration and deceleration, and if you know the cars weight then power can be deduced.

I don't think we care about the ratios. If you have RPM AND VSS they are the ratio when the clutch isn't slipping.

I also don't know how to get windows to let you record from more than one jack. Other ports are possible but I don't have any firm plans for them.


The coastdown tests could be completely automated, sure. The computer will gather a lot more than just 5 points on the curve, it will gather the whole curve from , say, 60mph to 0mph


One last note, trying to determine distance from rpm and gear ratios wouldn't work for me, I spend most of my time coasting with the engine off. I really need that vss signal if I want to know how far I've travelled (the 'M' in 'MPG').
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 07-29-2007, 09:10 AM   #58
itjstagame
Member
Quote:
Originally Posted by skewbe View Post
One last note, trying to determine distance from rpm and gear ratios wouldn't work for me, I spend most of my time coasting with the engine off. I really need that vss signal if I want to know how far I've travelled (the 'M' in 'MPG').
Ah, very good point. Yeah, VSS is easier, I was only saying that if you only had a mono jack, just that you could get fairly close with one signal.

For calibration there are a set number of VSS pulses per mile, speed is just the rate of pulses, but I'm calibrating toward the constant number of pulses per mile?

Also how'd you decide how much fuel to attribute to each pulse? Do you have some formula based on the cc of each injector? Becaues obviously 50% pulsewidth isn't an exact amount of fuel, only if you know how much fuel the injector delivers at that 50% pulsewidth. And do most injectors ramp up linearly? ie. 80% pulsewidth used exactly 60% more fuel than 50% pulse width?

Lastly, I can solder and I can follow a diagram, but I'm afraid my electronic skills fail at the basics, so if I'm told I want to output a constant .6V I don't know if that means I need a resistor a transistor a whatever, etc. Can you give me an idea of what kind of diodes you use and what rating (varies based on VSS out signal I'm sure). And it looks like you hook the + audio signal to before the diode bridge but still on the negative (grounded) side of the VSS/injector? Or do you tap in to the + side and use the - only after the diode bridge, also aren't you making the whole ground for that injector pass through that bridge, is that an issue? Can I just use any common ground in the car? This seems it might work for the injector, but the VSS is a stand alone pulse (probably VAC)?
itjstagame is offline   Reply With Quote
Old 07-29-2007, 01:44 PM   #59
itjstagame
Member
Actually I guess the only other signal that would be nice to have is TPS. Then you can compare throttle position to pulse widths and various loads.

I don't think I like MPG as an indicator, I'd like to see acceleration or maybe energy produced per gallon. I often wonder is accelerating slowly at 12MPG is better than accelerating quickly at 8MPG, etc. Finding the most efficient spot for acceleration coupled with EO P&G should help a lot. I would assume this would be maximum torque rpm, but I wonder how much of an effect throttle position has, especially with today's ecus, even at the max tq rpm, if you're cruising or WOT it's very different, typically different target AFRs and advances. Even building my own ECU I'm not sure 'theoretically' which would be better, lean is for efficiency but more power seems more efficient (unless it's less power/Gal).

Maybe the cruising/leaning is simply to try to help the fact engines aren't as efficient maintaining a steady state load versus accelerating against a load? That's why stuff like dropping out cylinders helps?

Sorry I keep posting, I'm just anxious to get playing with my vehicle and can't at the moment.
itjstagame is offline   Reply With Quote
Old 08-04-2007, 06:10 AM   #60
caprice
My Gas log updating soon.
 
caprice's Avatar
 
Join Date: Feb 2007
Location: Arizona
Posts: 120
I'm lost here, but excited too... what do you have "do" to use this DIY MPG Monitor?

I know a little bit about programming, and my brother knows Java, so that helps.

In fact I have used "WIN ALDL" and an old computer to track the performance when I upgraded to TBI in my car.
__________________
David
85 Chevrolet. 30 MPG or bust!

Last edited by caprice : 08-04-2007 at 06:35 AM.
caprice is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Switch to Shut Off Cylinders on the Fly SVOboy General Fuel Economy Discussion 78 10-08-2009 09:13 AM
Spark plug mod zpiloto General Fuel Economy Discussion 56 08-28-2009 10:47 PM
Some ridic article by some fool SVOboy Articles 39 06-09-2007 06:18 PM
Vacuum Guage and Digital Fuel Gauge krousdb How To - Do It Yourself 37 04-19-2006 06:23 PM

Common topics of discusion include: gas mileage, fuel economy, best gas mileage car, MPG, miles per gallon, acetone, increase gas mileage
Archive Links: General Fuel Economy Dicussion - Experiments - General Tech - Automatic Transmissions - Diesels - Aerodynamic Modifications -
How To/Do It Yourself - Articles - Around the House - Electric/Solar Powered - People Powered - Vegetable Oil/Bio-Diesel - Hotel Price Comparison - VPS Hosting - Content Writing - Managed Hosting

 
Copyright 2005-2008 GasSavers.Org