-
Notifications
You must be signed in to change notification settings - Fork 0
Measuring Orientation
Measuring the orientation starts with the Inertial Measurement Unit, or IMU, as I will call it from now on. The IMU we are using is the Sparkfun 9DOF Sensor Stick This IMU contains an accelerometer, a gyroscope, and a magnetometer, which are used in combination with each other to determine the quadcopter's orientation.
We use the accelerometer and the gyroscope together to measure the pitch of the quadcopter. We need to use two sensors because each has certain tradeoffs. Basically, the gyroscope is very accurate but drifts over time. In other words, it is good when used over a short period of time. The accelerometer is kind of the opposite. It is inconsistent from one measurement to the next, but overall it remains accurate regardless of how long it has been.
For more information on how we are getting degree values from the readings of the accelerometer and the gyroscope, see this page: Getting Degrees from our Sensors
There are two main ways to combine the values from the accelerometer and gyroscope once we have them. The simplest way, which is currently being used, is called a Complementary Filter. You take some number from [0-1] (call it "K") and calculate your combined reading with the following equation:
degree = K * gyroscope_value + (1-K)*accelerometer_value
Basically, you take the two readings and "average" them together. When you do it this way, you bias your average towards one sensor based on how you choose your K value. In our project, we are currently using .98 as the value for K. That implies that we are only using the accelerometer a small amount, while we overwhelmingly trust the reading from the gyroscope. That small amount of accelerometer input, however, helps to prevent the drifting of the gyroscope which we talked about earlier.
We are not using the magnetometer and we haven't tackled the problem of yaw yet. Once we do, I will update this with information on how we did it!