Electronic – Calculating pitch and roll from gyro data

accelerometergyrosensor

Does anyone know if it's possible to calculate pitch and roll angles from gyro data (without an accelerometer)? I'm trying to use a L3GD20 to measure pitch and roll. I can read the angular rates, but how should these values be converter to pitch and roll angles?

Any help appreciated.

Best Answer

If you have the kind of gyro that tells you its rate of rotation, you have to integrate that to get rotational position. This means errors accumulate over time, so any such rotational position has a limited useful lifetime from the last known rotational position.

Cheap MEMS accelerometers can track rotational position for a few seconds. Systems costing 10s of k$ can produce useful rotational position for hours. Mechanical gyros that inherently give you angles instead of rate of rotation don't have the problem of integrating errors, but have other long term effects. Still, such systems, called intertial navigation, have been used in spacecraft and airplanes.

The famous Korean Airlines disaster where a flight from Alaska strayed off course over Kamchatka and got shot down was due to improper initialization of the inertial navigation system on the ground before takeoff. Even very small errors can accumulate to many miles of error after a few hours.