Nulling Horizontal Motion in 6DOF to calculate tilt angle

There is an abundance of knowledge for using Kalman or complementary filters with a 6DOF to calculate tilt angle (in respect to gravity). These approaches have some commonalities:

  • An arctangent (x-axis , z-axis) is used to calculate the angle in respect to gravity. Zero angle is assumed to be 1g on the z-axis and 0g on the x-axis. Since accelerometers are noisy, filtering is needed.
  • A gyroscope is used to measure rotation around the y-axis. Since gyroscopes drift, it needs to be corrected by accelerometers.

I noticed that these calculations would compute an angle due to linear motion, even in the absence of angular tilt. The gyro's signal has noticeable output due to linear motion. The Z-axis accelerator is generally stable, while the x-axis registers the linear motion.

Is there an available filter that separates linear motion from the x-axis and gyro. therefore allowing a more accurate angular tilt measurement in the presence of linear motion?

You cannot use an accelerometer to measure tilt when there is acceleration due to forces other than gravity. A gyro does not help in this case.

However, with a good 9DOF sensor it is possible to estimate the sensor orientation in 3D with reasonable accuracy (to roughly 1 degree on each axis, if all sensors are properly calibrated). See RTIMUlib for Arduino.