Data Analysis Problem

Possible Solution.

I have two rate gyros and a 3D accelerometer mounted on a turntable with a potentiometer connected to the shaft to measure relative rotation.  Here is a picture of the components and Turn Table.

I want to use the accelerometer data to correct for gyro drift.  The accelerometer data is noisy, reacting to every bump and jiggle as the table rotates.  In my tests, I moved the turntable and then waited to make clearly distinguishable points in the data stream.  As can be seen in the graph, I first rotated 1 turn CW and then back to the starting position.  After several similar rotations, I wiggled the table back and forth thru some 180 degrees.

I collected data in an ascii file with11 columns, DLE, count, time in msec, heading gyro, zero, tilt gyro, zero, potentiometer value, xAccel, yAccel, and, zAccel.

The gyro data is rate data and needs the bias removed and then integrated.  The accelerometer data is in mg and needs to be smoothed and converted to angles with atan.  Since the accelerometer is moved mostly in the x-y plane, the xAccel and yAccel data is most likely applicable to correcting the heading gyro drift.

The data was processed with Attitude.sci, producing the graph of raw data.  In filtering the accelerometer data, I limited it to reasonable values and applied a 3 degree IIR filter with a cutoff frequency of 0.1 Hz.

Possible Solution:

The gyro produces an output which is the adc value of the angular rate about its axis.  The conversion from the spec sheet provides a mechanism to convert this to mVolts.  The offset and sensitivity are used to convert this value to a rate in degrees or radians per second.  The cumulative sum of this value is the angle of the gyro in degrees or radians.

The accelerometer produces an output which is the sum of angular acceleration and gravity.  The accelerometer has an internal low pass filter, which may be set to one of four values by software control.  This setting changes the corner frequency of the filter.  The output of the chip is an acceleration in radians/second/second.  Assuming this to be a unit circle, the atan2(y,x) function changes this data stream to radians per second.  This may be changed into degrees, if desired.

The problem with the gyro is its bias drift, a low frequency, almose dc, signal.  Passing the gyro through a high pass filter will remove this drift.  The problem with the accelerometer is its responsiveness.  Passing the accelerometer through a low pass filter will remove the rapid response.

If the sum of the low pass filter and the high pass filter transfer functions is one, then, the sum of these two filtered data streams is the correct angle.

The system block is Hp Lp Filter.