Accelerometers and Gyroscopes to form a G meter ?

10 Dec 2010

Hi all..

tis a very quick question. I want a sort of "G Meter" to put in a race car. That'll log G as I go round.

(like they have on the screen on F1 !)

so I have myself an ADXL345, but I've not thought that through have I? as orientation is rather important.

(it would be wouldn't it!)

Do I get the feeling that I need to also have a gyroscope so that I can subtract the actual gravity factor, and just end up with the force i want to read.

have I barked up the wrong tree ?

Any pointers as to which tree I should be looking at would be greatly appreciated.

 

 

10 Dec 2010

Unless you drive like the second half of this clip:

I'd assume you can assume gravity is always in the same direction :)

10 Dec 2010

gravity is a constant force, you can pick it up on the accelerometer and then do some maths to work out what the orientation of the car is. this gets complex as rotation makes life horrible. but to be honest you can assume its always acting in same direction and subtract it from that axis. unless you drive like an lunatic.

however, if you add a three axis gyroscope, you can plot the sensor units trajectory, and infer the path of the car taking into account rotation. of course flaws include the sensor unit detaching, and drift in mesurements. add a GPS unit to work around the drift factor, and bolt the sensor unit to something solid.

the great thing about mbed is you can do this latter, after the accelerometer is set up.

10 Dec 2010

Not quite like that clip.. !!

but racetracks have quite a lot of uppy/downy bits.

(and I mean UPPY/DOWNY !)

So after some "on my table" experiments..

The accelerometer will view me going up quite a gentle hill as 2g in the backwards direction.

because the chip starts off all initialised and flat, (and reading 0) and then when I point it up hill, there's now gravity acting in that plane, which it tags a -2g.

I think its behaving how I'd expect now I've thought about it, but that means it only works on its own on a flat road. (or a constant gradient that I can factor out)

It'd be so much easier to explain if I could show you me wiggling this board around !

anyway...

any pointers anyone ?

 

 

10 Dec 2010

The other problem...

when I'm racing, I do drive like a lunatic ;-)

but seriously, I can't always just say gravity is pointing 9.8 in the Z plane.

as when you are going up hill. Its not. (time to look at some gyros? unless someone can advise me different)

 

10 Dec 2010

Yeah, the reality is you'll probably need to use a gyro if you want to do it properly. Or someone else may have another good idea. Really, I just wanted to post some of michael's great work ):

11 Dec 2010

I've been asking myself similar questions recently. The issue is that these accelerometers are sensitive to two types of acceleration, static and dynamic. Static acceleration is measured for tilt sensing / level meter applications - that is what you are seeing when you 'wiggle' the board. Dynamic acceleration is what you are interested in when you are measuring the motion of a car.

The question is how do you distinguish between the two? I'm coming to the conclusion that the difference between the two is the rate of change of the readings. In a static application the tilt can change rapidly (between 0 and 1g in a fraction of a second) but in a dynamic application the change in acceleration caused by motion is more gradual (unless you hit a stationary object) over a longer period of time and is the dominant movement (unless the car flips!).

I'd suggest doing some actual experiments in a car - my instinct tells me that the long-term contribution from the tilt effect is going to be negligible.

11 Dec 2010

ok,..

as soon as I work out a way to represent the reading in real time as a dot that moves around on my PC, I shall put my laptop and mBed in a car and get my wife to come for a drive!

I'll have to data log it too.

I already have a GPS on the same breadboard, so I'll fire that up.

It's a harder project than I at first thought it was, involving lots of thinking of what is actually going on. If I get a gyroscope, I think first stop is going to be the IMUfilter, published on this site, but I'm not looking forward to the consequent maths !

btw, where I put 2g earlier, I meant 0.2g

So If I'm accelerating up hill at 0.5g, that is going to read 0.7g. then when I brake at 1.5g, that's going to read 1.3g (if still on the hill), and thats a gentle hill... the run up to druids at Brands is quite steep, the gooseneck at Cadwell is a 1 in 4. ! I could easily be 0.5g out. That's a lot.

 

 

 

 

 

 

11 Dec 2010

Having thought a little about this, it could be a *really* interesting project to try and do just using an accelerometer. What you know (i think) is that every reading you take will include a 1g vector you must subtract to get the readings you want. The bit that matters is really working out what direction this vector is pointing at any time.

You could just do that on a per-sample estimation, and that would probably give you reasonable results. However, you could start throwing some maths and statistics at it!

For example, why not mix Bayesian Inference and a response model of the car with respect to its orientation. Bayesian Inference is one of those really simple ideas that seems very underused. But basically I'm thinking the confidence in the vector at ay point in time can be much more accurate if you take in to account the future and past predicted vectors, what you know about how fast the vector can change (how fast the car can pitch/roll), and the limits it can be within (roll the car!).

Of course, if you are logging the raw data, you could play with this as a post processing step initially. Perhaps even use it in conjunction with a gyro too for super accuracy!

11 Dec 2010

Many thanks for the pointers,..

I shall certainly be having a read up of that stuff !

I'll let you know how I get on.

 

11 Dec 2010

This site is also worth reading:

"Vehicle Performance Measurements Using Accelerometers"

http://www.kempower.be/Performance%20meter/vehicle_performance_measurements.htm

14 Dec 2010

I think this will work but I haven't tried it...

Get 2 accelerometers and mount them on opposite sides of the PCB. Then say you are accelerating up a hill at 1g, the one on the top side will see 1g + whatever is contributed by the hill, the bottom side one will see 1g - the hill. Average out the 2 and you should be left with just the acceleration - I think?

13 Mar 2011

2 accelerometers (in the same orientation but separated) = 1 gyro. You could add a three axis magnetometer to give you true direction, but I'm not sure how practical that would be in a car. The autonomous model plane people use them to make a '9 degrees of freedom' inertial nav unit. Acc + gyro is a '6 degrees of freedom' sensor'. Alternatively you could use a couple of precision GPS units to give front and back positions of the car - they can be extremely precise as differential sensors. Tim