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.
5 comments
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?
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
I like it whenever people get together and share ideas.
Great blog, continue the good work!
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.
I recommend getting the KK2.0, save you tons of trouble especially you are a beginner.