How to Find the acceleration from 3-axis accelerometer?

1. May 19, 2010

aamirqau

Hi All,
I am working with accelerometer,i have 3-axis accelerometer,Now i have X,Y,Z points and i want to Find the acceleration, How can i find the acceleration? any formula any help? and at which acceleration i could say that now the particle is static i.e not in motion?

Regards,
Aamir

2. May 19, 2010

cjameshuff

Those XYZ vectors are the accelerations. An accelerometer doesn't give points. As for a formula to relate the measurements to real-world units...check the datasheet for your accelerometer.

What particle? For what purpose? And an accelerometer can't tell you if you're in motion, only how motion is changing.

If you're after the magnitude of the acceleration vector, apply the Pythagorean theorem...sum the squares and take the square root.

3. May 19, 2010

aamirqau

>> Those XYZ vectors are the accelerations. An accelerometer doesn't give points. As for a formula to relate the measurements to real-world units...check the datasheet for your accelerometer.
What do you mean by data sheet? id ont have any

Device gives these Points ,
11:28 AM------AccX = 1949 AccY = 1609 AccZ = 1999
11:28 AM------AccX = 1950 AccY = 1617 AccZ = 2001
11:28 AM------AccX = 1952 AccY = 1604 AccZ = 1998
11:28 AM------AccX = 1947 AccY = 1613 AccZ = 2000
11:28 AM------AccX = 1953 AccY = 1616 AccZ = 1999
11:28 AM------AccX = 1943 AccY = 1604 AccZ = 1997
11:28 AM------AccX = 1949 AccY = 1604 AccZ = 2002
11:28 AM------AccX = 1947 AccY = 1616 AccZ = 2002
11:28 AM------AccX = 1948 AccY = 1618 AccZ = 2003
Now this is the acceleration?

>>What particle? For what purpose? And an accelerometer can't tell you if you're in motion, only how motion is changing.

Means if device is attacched with the person and person is moving,i want to know that either the person is static or he is walking,

4. May 20, 2010

cjameshuff

Someone made your accelerometer. The manufacturer will have some kind of data available about the part. Google for the manufacturer and the part number.

It depends on the accelerometer, all accelerometers are not identical. The datasheet will tell you how to convert those acceleration vectors to real-world units.

At a glance, it looks like the values are centered on 2000, scaled so that a difference from 2000 of 400 is equivalent to 1 g. At the time of those measurements, it was almost level on the x axis, but a little cockeyed around the z axis (the positive x axis tilted up slightly). This is just a guess though (and would be a rather unusual scaling if true), consult the datasheet.

As those measurements show, even when sitting still, the accelerometer will register an acceleration due to gravity. You will want to measure changes in acceleration due to the accelerometer being jostled around or changing orientation.

5. May 21, 2010

piitaj

Hey!
I just finished calibrating a 3 axis accelerometer. The keyword is CALIBRATION, since you dont really know what the data means that you get from your accelerometers.
What we did:
1) make a record of your accelerometer data with each side idle for lets say a second or two. This we do to use the earths constant 9.81m/s^s gravitationaly acceleration. So if you put your accelerometer on the table, one axis of the accelerometer will be at either +1G (9.81) or -1G (-9.81). So if you make idle records for all 6 sides ( lets say you have a cubical accelerometer) you will have data for all axises for - and+ 1 g.
2) do some avaraging on your data. you could look for the maximum and minimum value for one axis and chose the minimum difference data
3) , try to find the best "idle" data for all 6 idle sides. We achived this by classifying our data to some custom regions. We made a "data window" of custom length and if if that data window had the lowest avarage and differences than we chose it as "best"
4) now you have 6 "best avarages" data, for your 6 sides. each consists of 3 axis data, so at all you have 18 constant data. what you need to do is, try to apply a "trend line" to your data. that can be achieved by using the least squares algorithm. you can write your equations in the following way:
9.81= a11X + a12Y + a13Z + b1;
0 = a21X + a22Y + a23Z +b2;
0 = a31X + a32Y + a33Z + b3;

you will have 6 of this (6*3 = 18 equations and 12 variables). that means you have an overdetermined equation system that you can solve with SingularValueDecomposition for example (or QR decomposition).

after you will have the values for a11, a12 ... and b1,b2,b3
applying these to your raw data, will give you quite punctual calibrated data in m/s^2

cheers

6. Jul 9, 2012

benjas

you can do what piitaj recommend or if you have acces to the rotation angles ( e.g. from a gyro) you can found the inverse of the rotation matrix and find out the ax ay and az. i.e. the values of the accelerometer in terms of m/s^2 are igual to the rotation matrix times the g-a:

Avalues = Rxyz*(g-a). therefore,
a = g - inv(Rxyz)*Avalues.

g = [0 0 9.81]'

Avalues = [sensorLectureInX sensorLectureInY sensorLectutreInZ]' ( in m/s^2)

Rxyz = Rx*Ry*Rz;

Rx = [1 0 0
0 cosζ sinζ
0 -sinζ cosζ ] (ζ is the angle around x, θ around y and ψ arund z)

Ry = [cosθ 0 -sinθ
0 1 0
sinθ 0 cosθ ]

Rz = [ cosψ sinψ 0
-sinψ cosψ 0
0 0 1]

To find the inverse of a matrix just google it.

The disadvantage of this method is one that you need the angles. and two that a gyro gives you rad/s and you need to calculate rads and that will bring an error that will increase with time so a bias will be needed.