I am aware there is a lot of information out there regarding the sensor, http://www.sparkfun.com/commerce/product_info.php?products_id=9268, but I am afraid I am still lost.

I am able to understand all the equations converting the raw ADC values to degrees/second and degrees for the gyro and accelerometer respectively. However I have used the following code in an attempt to bring the values together.

void find_angles()

{

delta_t = (millis() - prev_t)/1000.0; // Finds the change in time

prev_t = millis(); // Stores current time in previous time variable

alpha_read = radians2degrees * asin((analogRead(4) - ss_y_ADC)/69.0); // Roll Acc.

est_alpha = prev_alpha + ((analogRead(2) - ss_rollrate_ADC)/gyro_sensitivty_ADC)*delta_t; // Alpha Gyro.
alpha = factor*alpha_read + (1-factor)*est_alpha;

if (alpha > -1 && alpha < 1) {

alpha = 0;

}

prev_alpha = alpha;

//pid();

}

However, the angle is still very much subject to abrupt translations in x, y or z. Which means the gyro is not having enough input into the final angle value. If I weight the angle towards the gyro’s angle, the response is very slow and unresponsive.

I really need help getting the correct angle from this sensor, it is driving me insane.

PLEASE HELP ME!!!