accelerometer g force/vectors

Hello,

I was wondering is someone can help me please with the mathematics of forces/vectors and acceleration. Now I realize that I have a good deal to learn on the subject but as I am starting out on this venture the challenge is find the right reference,. Hence I need more than just a little help; so to the problem.

I have an accelerometer that I can read the x, y, z g forces from, and I have record two sets of data that can be found below. The first set is the static, and the second set are reading taken when the device was accelerating. The device is tiled over at 45 degrees around the y axis thus the orientation of the device is x=45, y=0, z=45 for both sets of measurements.

I can calculate the total g force from the device thus:sqrt(x*x+y*y+z*z) and the angle of an axis thus by the cos-1 thus 0.7 g = 45 degrees.Now this works for the static case, but does not work for the dynamic (accelerating) case. I have tried to scale the x, y, z g forces by the total g force but the cos-1 produces an incorrect result as the orientation of the device has not changed..

http://www.freescale.com/files/senso...MMA7260QFS.pdf
Above is the device, I have post processed the outputs thus my input data is calibrated to +- 1g on each of is axes. Thus the device is on my desk and I can rotate it around to axis and read plus or minus g from that axis.
If as in the example I have rotated the device at around the y axis at 45 degrees, I get 0.7g from the x and z axis and 0 g from the y axis. If I sum these I get 1 g as expected, now if I take the cos-1 of 0.7 I get 45 degress. Which compare to the device actual orientation.
If however I slide the device across my desk I get a set of dynamic values these sum to 1.28g in total as the device is accelerating, however the cos-1 of the value does not come to 45 degress. So this simple method of pridicting the device orientation does not work.
What I want to know is what is the device orientation when it is moving

http://www.freescale.com/files/senso...MMA7260QFS.pdf
Above is the device, I have post processed the outputs thus my input data is calibrated to +- 1g on each of is axes. Thus the device is on my desk and I can rotate it around to axis and read plus or minus g from that axis.
If as in the example I have rotated the device at around the y axis at 45 degrees, I get 0.7g from the x and z axis and 0 g from the y axis. If I sum these I get 1 g as expected, now if I take the cos-1 of 0.7 I get 45 degress. Which compare to the device actual orientation.
If however I slide the device across my desk I get a set of dynamic values these sum to 1.28g in total as the device is accelerating, however the cos-1 of the value does not come to 45 degress. So this simple method of pridicting the device orientation does not work.
What I want to know is what is the device orientation when it is moving

Okay, I think I see what you are trying to do here.

This example won't be your accelerometer (which is digital) but the principle involved is identical. Consider a simple pendulum: a string attached to a support and a mass (of size "m") on the bottom of the string. This is a simple accelerometer: If the string is vertical there is no acceleration in the horizontal direction.

Say there is an accleration. Netwon's 2nd says that the string will no longer be vertical: it will make an angle theta with the vertical. How do we find the acceleration?

In this case we draw a Free-Body Diagram and use Newton's 2nd to figure the horizontal component of the acceleration in terms of the measured angle. (The tension on the string is what applies the horizontal force to the pendulum mass. We calculate the horizontal component of the tension and divide by m.) The acceleration will be:
a = g*tan(theta)

As this result doesn't depend on m it will be universal in the sense that ANY accelerometer can be used and this formula applies.

If I understand your experimental setup, the answer to your question is to determine the angle your device is at by doing the static case. Then do the acceleration experiment and theta will be the difference between the measured angle of "down" and the angle you measure with the (accelerating) accelerometer. Then apply the formula.

Hello Dan, and many thanks for your reply.
Mmm again I seemed to have explained my problem poorly.
What I am trying to figure out is what this orientation of the device is when it is moving.

The two sets of example data I have used are my poor atampt at keeping the problem simple. For the static set of data the device is sitting on my desk stationary, the g values are 0.7, 0.0, 0.7 and from the cos-1 and can tell
the device is tilted over at 45 degress.
What I need is the formula by how I can tell the orientation of the device when it is in motion. As moving the device produces different g forces, however there must be a way of finding the devices orientation by the relative force to each other as the axes are all at 90 degrees to each other.

Hello Dan, and many thanks for your reply.
Mmm again I seemed to have explained my problem poorly.
What I am trying to figure out is what this orientation of the device is when it is moving.

The two sets of example data I have used are my poor atampt at keeping the problem simple. For the static set of data the device is sitting on my desk stationary, the g values are 0.7, 0.0, 0.7 and from the cos-1 and can tell
the device is tilted over at 45 degress.
What I need is the formula by how I can tell the orientation of the device when it is in motion. As moving the device produces different g forces, however there must be a way of finding the devices orientation by the relative force to each other as the axes are all at 90 degrees to each other.

And many thanks IMK

If you know the acceleration it is under, then you can reverse what I did:
Use the acceleration to figure out what theta is, then theta is the difference between what your device measures and vertical. (This, of course, assumes all your motion is horizontal. If you are moving it through space, you'll have different "thetas" in different directions.)