I'm trying to develop a 3D position estimation program using an xyz accelerometer. Ignoring the massive error introduced by double integration of the acceleration to get displacement, I have another problem with rotation.
When the phone is upright I have no problems. I can stand the phone straight up and move it side to side on the desk on the x-axis alone to get the desired values. The issue is if the phone is tilted slightly (say 45 degrees) and again moved side to side. Internally the phone thinks it's moving in a diagonal direction on both x and y axes.
Since the phone is actually just moving on the x-axis, is it possible to use the tilt angle to modify the x and y values so that x is the actual acceleration in the x-axis and y is 0?
To clarify, imagine the phone is set at a 45 degree angle and moved right at a speed of 1ms-2. The x and y accelerometer values will both read ~0.71. I can use the SOH CAH TOA rules to get an x value of 1, which is what I wanted. However I can't see how I can get the y value to 0.