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.
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:
- Begin by rotating the copter 360 degrees passing through North, East, South and West.
- Now flip the board over 360 degrees in the roll axis, then undo the flip back to normal.
- Now flip the board end-over-end in the pitch axis a complete 360 degrees, then undo the flip back to normal
- 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.
- 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.