Quote:
Originally Posted by mikets
The accelerometer doesn't give you "absolute heading", it gives you the G force that was applied to each axis. It's perfect for detecting tilt using the Z-axis because if you are flat on the ground, the Z-axis will read 1 G. But if you are tilted then by applying physics to split the G force vector into two vectors (one perpendicular to the accelerometer: the Z-axis, another parallel to the surface of the accelerometer), you can see the Z-axis will have a value smaller than 1 G. The more it is tilted, the smaller the Z-axis value). So to determine the tilt angle, you can do an arccosine to the Z value.
|
It actually gives you exactly the acceleration applied to each axis, including:
-The acceleration of gravity
-The acceleration of the robot when it accelerates/decelerates (moves)
-The acceleration of the robot when the bridge moves up/down
What happens when you move? When the bridge moves? You will get acceleration other than gravity.
Your solution assumes all of the signals represent the same gravity vector. In reality, there are more acceleration vectors which affect the accelerometer, making it a poor choice for bridge balancing while you and the bridge are moving.