Calibrate Magnetometer in Multiwii for Multicopter Quadcopter

by Oscar

What is Magnetometer and Why Calibration is important

Magnetometer is simply an electronic compass, it gives readings in X, Y, Z directions, it is used alongside with Gyro and Accelerometer to give the aircraft a reference to the current orientation.

Some of the links on this page are affiliate links. I receive a commission (at no extra cost to you) if you make a purchase after clicking on one of these affiliate links. This helps support the free content for the community on this website. Please read our Affiliate Link Policy for more information.

Magnetometer should help your quadcopter, multicopter or RC plane better stabilize, but if the sensor is not calibrated and trimmed properly, it might not do you any good.

Here we will go through some very simple steps to calibrate magnetometers in multiwii.

Before the Calibration

You first need to calibrate the Accelerometer first described here, and make sure Z-axis is showing a reading around either 256 or 512 (+/- 5).

In the ACC calibration you want to hold the board very still while the calibration process is performed. With MAG calibration the complete opposite is true, you want to reach every possible orientation possibly within the 30 second calibration time frame.

How to Calibrate the Magnetometer?

Beginners tend to make this mistake when they are calibrating their mag sensor: they keep the magnetometer perfectly still and 30 seconds later the compass start to behave in an unexpected way, or malfunctioning way.

Hit the CALIB_MAG button in the Multiwii GUI, this starts the calibration process and you have 30 seconds to rotate the board in all orientations. It doesn’t matter too much which order of directions you rotate it, but this is what I generally do:

  1. Begin by rotating the copter 360 degrees passing through North, East, South and West.
  2. Now flip the board over 360 degrees in the roll axis, then undo the flip back to normal.
  3. Now flip the board end-over-end in the pitch axis a complete 360 degrees, then undo the flip back to normal
  4. Now wave the board around in the air as if you were actually flying around outside, back and forth, side to side, up and down.
  5. Stop when the yellow light stops blinking and returns to normal,

And that’s the end of the calibration.

Verifying the Calibration

Now that you are calibrated, the compass indicator in the MultiWii Config GUI should operate accurately as a normal compass. Try to rotate your copter through different directions and there should be no twitching, quick jumps in heading, or reversals.

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.


Eg treadway 7th May 2017 - 1:02 am

My x16 has on motor that will not run at all it only beeps, I’ve replaced motor and esc checked wiring and solder joints, according to multimeter this motor has no current going through signal wires,would this be a calabraition issue?

Novella 27th May 2014 - 6:37 am

Sweet blog! I found it while browsing on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there!
Many thanks

Lucile 25th June 2014 - 8:23 pm

I like it whenever people get together and share ideas.
Great blog, continue the good work!

Dwayne 12th December 2013 - 1:54 pm

Hi Oscar, recently I’ve bought a multi copter controller(MegaWAP V2.0) from -link- wanting to try on my quadcopter and many problems have occurred so far. I don’t have any knowledge about coding and so I did some research on arduino and multiwii 2.2 for my quadcopter.I was told to use #define QUADX,#define MEGAWAP_V2_STD,#define BMA180,#define BMP085 and #define HMC5883 from config.h. Everything was working perfectly find until I open multiwii to test my controller. When I tested the rolling and pitching for the controller, the gyroscope and the readings for pitch and roll is wrong.When I roll right, the gyroscope shows a roll left and when I pitch up, the reading shows me a negative value. I then stumbled upon a source that tells me how to check whether my controller is working by looking at the accelerometer , magnetometer and gryo. I found out my mag roll, pitch and yaw readings are totally wrong. So I suspect they are the ones causing the problems but i do not know how to code them to make it right.
Can you please help me with my coding/calibration to make them work normally as i want to enjoy the flight of my quadcopter.
hope to see your reply soon
Dwayne J.

Oscar 13th December 2013 - 5:59 pm

I recommend getting the KK2.0, save you tons of trouble especially you are a beginner.