Sunday, March 6, 2016

Soft Iron and Hard Iron Magnetometer Calibration

Since the Pi will be using the magnetometer on the MPU9150, calibration becomes necessary. The first steps are handling soft iron and hard iron errors which will be the subject of this post. I've written 4 sections: Fitting an ellipsoid, Hard Iron Estimations, Soft Iron Estimations, Final Algorithm.  Lets begin!

Raspberry pi MPU9150 setup

We'll begin our journey by connecting the inertial sensors (accelerometer and gyroscope) and the compass (magnetometer) to the pi. With these sensors we'll be able to estimate 3 out of the 6 dimensions describing a quadcopter in flight. Those 3 being roll, pitch and yaw. Latitude, longitude and altitude will come later.

Introduction

Welcome!

The purpose of this blog is to document the development process of a quadrotor run by a raspberry pi model b+. I'll cover everything from sensor calibration and fusion to the flight algorithms themselves. Currently I have done enough to get a feel for the whole spectrum, however most of my time spent has been pertaining to the sensors.


Programing Laugauges:
The main programming language will be Python. I chose Python because it's easy to pick up and very popular. For testing I use Matlab as it's much easier for me to work the algorithms out on it first. Java will probably be used down the line as a ground station. Mainly because WorldWind is absolutely amazing. Lastly C++ may be used as well because I am familiar with openCV and I have a few ideas with it. All code will be hosted on my github:

Plans:
Content on here will probably take me a while to make. When I get to the meat of things I expect I'll get a substantial update one once a month, maybe once every other month. At the time of writing this I have finished calibration, AHRS fusion and have a little on the ground station. That leaves a flight controller and GPS fusion as the major milestones. There will no doubt be miscellaneous things I share in the mean time.

Audience:
I want for anyone interested in the subject of UAV design to be able to get something out of this blog. My plan is to make the blog as self contained as I can. There are a lot of wonderful online resources for this type of stuff, however it's not all in one location. My goal is to provide a resource that it's a single go to location detailing the build behind a quadcopter. I also am striving for good information, so I encourage anyone who spots errors to let me know.

Thanks for reading