I am looking for a method of compensating for tilt in an accelerometer- based application... lots of google searches show how to calculate tilt with an accelerometer ,but that is not quite what I am looking for.
I need to measure 3-axis acceleration of a moving vessel with my device.. the problem is the device may not be mounted truly flat. For example, if it's tilted slightly on the X-axis, the X-axis will always read a slight gravity component at DC, and the Z-axis will have a little bit removed.
The problem is this: If the vessel moves perfectly along the "flat x- axis", since my device is slightly tilted on the X-axis, this acceleration will result in a change in the Z-axis.
So I am wondering if there is a way I can "rotate the device" to true
0 degrees using post-processing/math. If I could do this, then that forward motion along the TRUE X-axis would result in a reading that only changed the X-axis, not the Z-along with it. I can get samples at DC, so I could easily calculate what the starting tilt is. So if at DC, the X-axis reads -0.1g and the Z-axis 0.98g for example, I don't think it's as simple as adding/subtracting those offsets all the time since that doesn't take into account the component of one into the other..Thanks.