Cancellling Out the Effect of Constant Gravitational Acceleration in a Datalogger

accelerometerdataloggergyroscope

In a design that records not only accelerometer readings (X + Y + Z) but also gyroscopic readings (X + Y + Z) how is it possible to remove the accelerometer readings caused by gravity?

I have found many datasets from Crawdad that provide better readings that are not effected by the said idle acceleration caused by gravity.

I have prepared a data logger to record the motion of a specific animal. In idle orientation I have noticed the z-axis is continuously recording 9.81ms^-2. I Would like to know if there is a method I can use to reduce the effect of this unwanted gravitational component. I only intend to record the acceleration caused by the animals movement.
Any other suggestions are most welcome.

Best Answer

Depending if you process logged data or real-time data the method vary. What you need is presume that object is not constantly accelerating, which can be proved by the fact that animal stays on Earth.
You can use a moving average filter to subtract the mean value (gravitational bias) from each sample. You do this in Matlab by using filtfilt() which properly matches the initial and final state based on the data values. For filter you can design a simple averaging FIR filter with equal taps or some more suitable FIR filter. A good reason to use a filtfilt() is that it filters forth and back thus the filter delay is canccelled, all signals remain in exact phase. You do the same with gyro, then fuse both data together.