# MAV-blog

Stuff related to MAV's (and UAV's) from a hobbyist's point of view. Info

## What is an IMU

Every good autopilot system needs an IMU-module. IMU stands for Inertial Measurement Unit. Basically, you can look at it as a black box that gives information concerning your current position and orientation. Position could be GPS-coordinates. Orientation could be roll, pitch and yaw. Sometimes you need to calculate it yourself, sometimes the black box calculates it for you. Soooo, since an autopilot needs to know the current position and orientation, it needs an IMU.

 The 6DOF by SparkFun electronics. Notice the 2 gyroscopes standing in upright position. One for each axis!

Every interested mind now wonders “how does this black box work?”
Well, I’ll give you the three most importent sensors.
The first one is, of course the GPS. It gives you your current position and your speed.
The second one is a set of 3 accelerometers. Each one senses acceleration in one direction. Remember from your physics class that gravity is also an acceleration! So the 3 accelorometers give you the 3 components of the gravity vector! Knowing that the gravity vector is supposed to point right to the middle of the earth, you can calculate the orientation! Keep in mind that when an MAV is flying, other forces like centripetal acceleration may badly influence those 3 accelerometers used to sense the gravity vector. As a result those measurements are only correct when averaged over a longer period of time.
The last one is a set of 2 or 3 gyroscopes. Thats a very fancy word for a sensor that senses the speed of rotation (also called angular velocity). With 3 gyroscopes you can sense the speed of rotation around your 3 (x, y, z) axes. Clever readers may notice that the mathematical integration of the values give you the orientation (integration of speed = position)! Unfortunately, there is a lot of drift on those values, so they are only correct for a short period of time…

Readers who payed attention noticed that the orientation given by the accelerometers are correct over a long period of time, and the one given by the gyroscopes are correct over a short period of time. Can’t be combine those two?! Yes we can! A very special filter called the kalman filter does the trick.
Nowadays, every guided vehicle (from a guided missile to a jumbojet) uses those sensors with the kalman filter. Mr. Kalman who invented his filter in the fifties must be so proud!