View Single Post
Old 06-09-2013, 05:34 AM   #58 (permalink)
Master EcoModder
Join Date: Apr 2013
Location: World
Posts: 385
Thanks: 82
Thanked 82 Times in 67 Posts
Originally Posted by jeff88 View Post
Keep me posted with updates!
Sure. I have got some good ideas from the discourse on here.

How do you bench test the VSS? Are you going to do something similar with the voltage divider and patch ECM cable and whatnot?
What I have planned is using the tone() function in the Arduino to generate a square wave signal on a digital pin (i.e. any particular pin). That will be in response to a variable 0-~5V input (via a trim pot connected to an analog pin), using the map() function to convert 0-~5V to the appropriate frequency. I could just change the frequency of the tone explicitly in the sketch but bread boarding the 0-5V input is easy and easy to adjust.

0-100Hz will do for your car (I have yet to measure mine; no shop manual but it does use a Hall sensor). It depends upon tyre size, but that assumes 4 pulses and ~2 1/2ft travelled per wheel rev. and 100mph max. speed.

The tone() signal will switch a transistor that earths a 13.8V (or 11V for you) source. That's my Hall sensor emulation. The patch harness and voltage divider will be as previously described and feed back into another digital pin, that part being as it will be in the car.

So because you are not putting a gyro into the system (yet ) you don't need to worry about the reset then, there's no drift on it right?
That's the idea.

I think I will just go with an I2C device then. Once I get it, I can try the copy and paste method and if it doesn't work, then I can tweak it as necessary.
While there's no substitute for actually doing it, you might find it useful to download the Arduino IDE and play around with some sketches. You won't find all the possible problems but you can try to understand what is being done and at least see if the changes you are making result in a sketch that can be compiled.

To help eliminate the noise. If you try it and it works better, then I figured I should get a couple, especially if it only costs me a few pennies each.
100nF across the accelerometer board output voltages and ground didn't make any appreciable difference to the readings. (That means there was 106.8nF capacitance across the outputs from the IC because there are also 6.8nF capacitors on the outputs to ground on the board I am using.) The capacitance is combined with the resistance in the IC to block specific frequencies, probably close to the optimum, so I didn't expect too much, but it was easy to do and cost nothing. I might play with some different capacitances but I don't expect too much more from doing it.

Capacitors across the power and ground might be of more benefit, particularly if you are switching relatively high currents on and off.

There is scope to reduce noise within the sketch. Two ways I am playing with are to use a rolling average (varying the number of samples) or use a series reduction that weights more recent signals more heavily than earlier eg. (using 6 sample readings) Xc = Xc/2 + Xc-1/4 + Xc-2/8 + Xc-3/16 + Xc-4/32 + Xc-5/32 (think that is an FIR filter). The last "/32" is to get the total of the co-efficient fractions to add so as to equal one while using a finite number of samples. The co-efficients can be arbitrary instead, with heavier weighting to the latest or earlier samples. I haven't (yet?) looked at using a statistical method.

So it doesn't matter what measurement rating it is then? Or should I look for the smallest one possible (say +/-250 like the MPU-6050 like you suggested)?
You will be able to figure it out better than I can. The angle that is being measured is quite small and, neglecting road bumps, the rate of angular acceleration likewise low. Resolution is important.

It's possible that a road bump might produce a rapid angular rotation. You might have to compensate for that in the sketch eg. discard an angular acceleration above a certain rate and use the previous value, filtered or not.
  Reply With Quote