DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

compass calibration - what does it do ?

boblui

Well-Known Member
Joined
May 11, 2020
Messages
1,464
Reactions
1,208
Location
Hong Kong
From the way the calibration is done, my imagination is to calibrate the gain of the compass in the X , Y , Z directions so that their readings are the same under the same magnetic field. Is my understanding correct ?
 
it aligns the drones flight system to the magnetic north, not true north. Sometimes it needs to be re aligned due to a given locations interferences, such as metal around the area, maybe some magnetic interference etc., so the drones flight system needs to be 'refreshed' for one of the better words. Also, if you travel a distance away from the last flight, it may need 'refreshing'.
This is my understanding anyway. Perhaps others can chime in as well.
 
Last edited:
it aligns the drones flight system to the magnetic north .....

This has been my understanding in the past but after giving it a second thought, I can't see why this can be achieved by spinning the craft around each axis. The only purpose I could think of is exposing the compasses in the X, Y, Z directions to the same magnetic field strength and check if they are giving the same measurement results, if not, a correction factor will be computed and applied to the future measurement results.

If this is really how it works, then it will be OK to do calibration at location with magnetic interference because all it needs is a local magnetic field with constant strength and direction. Whether it is lined up with the earth's magnetic field doesn't matter. I know this is opposite to the understanding of the majority ( including myself in the past ) but it makes sense to me.
 
From the way the calibration is done, my imagination is to calibrate the gain of the compass in the X , Y , Z directions so that their readings are the same under the same magnetic field. Is my understanding correct ?
Compass calibration is probably the most misunderstood aspect of drone flying.
Much of what you'll read about it in this forum is incorrect.

Your drone has magnetic fields of it's own associated with the motors and electrical currents.
Those magnetic fields have the undesirable effect of deflecting the compass so that it doesn't properly read the earth's magnetic field and do its jpb properly.

The only thing that compass calibration does is to identify and measure the magnetic fields which are part of the drone, so they can be ignored.
 
... Your drone has magnetic fields of it's own associated with the motors and electrical currents.
...The only thing that compass calibration does is to identify and measure the magnetic fields which are part of the drone, so they can be ignored.

it can be done for static magnetic fields generated by the magnets in the motors but how can it be achieved for varying magnetic field generated by electric currents ? Bear in mind that the motors are all off during calibration.
 
Last edited:
it can be done for static magnetic fields generated by the magnets in the motors but how can it be achieved for varying magnetic field generated by electric currents ? Bear in mind that the motors are all off during calibration.
Excellent point!
 
it can be done for static magnetic fields generated by the magnets in the motors but how can it be achieved for varying magnetic field generated by electric currents ? Bear in mind that the motors are all off during calibration.

It has nothing to do with magnetic fields generated by the motor currents - the purpose is solely to measure the static magnetic field due to the aircraft, which is subsequently subtracted from the measured total magnetic field in flight, leaving just the components of the earth's magnetic field.

 
it can be done for static magnetic fields generated by the magnets in the motors but how can it be achieved for varying magnetic field generated by electric currents ? Bear in mind that the motors are all off during calibration.

I agree with you about static magnetic fields but not only in the motors as well on yours surroundings, it happens to me once calibration unsuccessfull repeatedly because I was standing next to a pile of metal sheets, as soon as I walk away calibration success at first attempt, same is true if you are close to railroad tracks or your vehicle, so, look at your surroundings, stay away from strong magnetic fields.
 
...If this is really how it works, then it will be OK to do calibration at location with magnetic interference because all it needs is a local magnetic field with constant strength and direction...
You need to be away from magnetic interference (ferrous metals) when you calibrate and when you launch because once it rises up and away from the interference the magnetic values will change. This has led to uncontrolled flights and crashes. Always confirm before flight that the "radar" pointer indicating the direction the AC is pointed and the actual direction agree before launching.
 
If this is really how it works, then it will be OK to do calibration at location with magnetic interference because all it needs is a local magnetic field with constant strength and direction. Whether it is lined up with the earth's magnetic field doesn't matter. I know this is opposite to the understanding of the majority ( including myself in the past ) but it makes sense to me.
You need to be away from magnetic interference (ferrous metals) when you calibrate and when you launch because once it rises up and away from the interference the magnetic values will change. This has led to uncontrolled flights and crashes. Always confirm before flight that the "radar" pointer indicating the direction the AC is pointed and the actual direction agree before launching.

These are two different questions and issues. In theory, yes, you can calibrate in any external magnetic field since the process isn't measuring the external field, it's measuring the internal field. But two caveats:
  1. It has to be a constant external field as seen by the aircraft during the calibration process, but many local external fields will vary over short distances and not satisfy that requirement;
  2. It cannot be so strong that it swamps the measurement of the aircraft's internal magnetic field.
Separately, but most importantly, while you can calibrate in the presence of an external local field, you absolutely should not take off in such a situation, because the compass will incorrectly initialize the IMU yaw value.
 
Last edited:
  • Like
Reactions: boblui
When you calibrate the compass you do so in both the horizontal and vertical planes this is sufficient for the Hall Effect sensor to determine magnetic north. The vertical measurement allows the sensor to detect if it is located in the Northern or Southern Hemisphere - don’t forget GPS isn’t needed to determine North.

When you get a good GPS position the navigation system can then apply the correct offset to determine True North.

If there is a stronger than normal magnetic field detected, caused by iron, rebar in concrete, metal fence, car or even overhead powerlines, the compass should warn you with ‘Magnetic Interference’ displayed. Move location away from the source and calibration should complete.

the Inertial Measurement Unit (IMU) uses microscopic capacitors on equally microscopic cantilevers that bend under movement in the X,Y & Z planes. A processor in the IMU reads the change in capacitance as the cantilevers move in each plane and calculates its position in 3-dimensional space at the point the IMU calibrated itself on startup and takes the compass reading to determine which way it is pointing.

At this point the navigation system still doesn’t know where it is other than north or south of the equator. That is enough for the drone to fly by remote control similar to a model aircraft and keep itself and the gimbal level to the horizon.

Adding GPS into the mix gives the drone a position within the global coordinate system used to find any point on earth (except the north or south poles!) and also it’s altitude.

A barometric pressure sensor onboard gives an additional ‘reasonably’ accurate altitude reading, which is used if GPS isn’t available.

So the compass calibration is important as it is the reference for pointing North. The earth’s magnetic field varies throughout the world and even between relatively close locations. Magnetic North is constantly on the move, though very slowly, and if you live, like me in Australia, you have the world’s largest known source of iron ore sat beneath us, which very easily affects compass readings.
 
  • Like
Reactions: mereflyer
When you calibrate the compass you do so in both the horizontal and vertical planes this is sufficient for the Hall Effect sensor to determine magnetic north. The vertical measurement allows the sensor to detect if it is located in the Northern or Southern Hemisphere - don’t forget GPS isn’t needed to determine North.

It's a MEMS device, not a Hall Effect sensor, and the calibration itself has nothing to do with detecting magnetic north - see post #7.
When you get a good GPS position the navigation system can then apply the correct offset to determine True North.

If there is a stronger than normal magnetic field detected, caused by iron, rebar in concrete, metal fence, car or even overhead powerlines, the compass should warn you with ‘Magnetic Interference’ displayed. Move location away from the source and calibration should complete.

If the total field strength is outside a range of expected values (too weak or too strong) or if the inclination is wrong then the interference message is triggered.
the Inertial Measurement Unit (IMU) uses microscopic capacitors on equally microscopic cantilevers that bend under movement in the X,Y & Z planes. A processor in the IMU reads the change in capacitance as the cantilevers move in each plane and calculates its position in 3-dimensional space at the point the IMU calibrated itself on startup and takes the compass reading to determine which way it is pointing.

At this point the navigation system still doesn’t know where it is other than north or south of the equator. That is enough for the drone to fly by remote control similar to a model aircraft and keep itself and the gimbal level to the horizon.

Adding GPS into the mix gives the drone a position within the global coordinate system used to find any point on earth (except the north or south poles!) and also it’s altitude.

Interesting observation - does GNSS not report position at the poles, or is the longitude simply indeterminate and reporting randomly?
A barometric pressure sensor onboard gives an additional ‘reasonably’ accurate altitude reading, which is used if GPS isn’t available.

The FC doesn't use GPS altitude - just the barometer and accelerometers.
So the compass calibration is important as it is the reference for pointing North. The earth’s magnetic field varies throughout the world and even between relatively close locations. Magnetic North is constantly on the move, though very slowly, and if you live, like me in Australia, you have the world’s largest known source of iron ore sat beneath us, which very easily affects compass readings.

I'm not completely clear what you are saying there, but it's important to be clear that the compass calibration is not related to any aspects of the external magnetic field, whether due to the earth or other sources.
 
Do you know for a fact that DJI are using a MEMS-based compass? They are very susceptible to vibration, which is why we don’t use them in our products. On the tiny scale they are built, a quad copter vibrates a lot.

I would be interested in what DJI use, if they have counted vibration issues.
 
Do you know for a fact that DJI are using a MEMS-based compass? They are very susceptible to vibration, which is why we don’t use them in our products. On the tiny scale they are built, a quad copter vibrates a lot.

I would be interested in what DJI use, if they have counted vibration issues.

The earlier models did, according to DJI. I couldn't find much definitive on the current components, apart from some indications that they may now be using magneto-resistive devices.
 
The Poles are an issue with GPS/Navigation as all the lines of longitude become a single point. And Gyro’s have a diminishing rotational component to work with.
Fortunately for us few would venture to those cold extremes with our Mavics and the need to keep batteries warm.

Thanks Sar104 on the heads-up on the magneto-resistive sensors, we just ordered some samples from Freescale (NXP) to try on one of our smaller products. NXP provide the eCompass ‘chip’ for many of Apple’s iPhones. We’d previously been using Bosch’s MPU range but had drift issues with the earlier versions. Interesting to see how these perform.

Thanks.
 
OK here's my story. I just had my drone replaced by DJI due to Compass error and IMU defect. I tested it in the back yard first with great results. Next I placed it on my concrete front step and lifted off to about 40 meters. It was just hovering there and suddenly took off over my roof and out of sight. I grabbed the sticks and regained control and was amazed just how far it had flown; approx. 300 Meters! I was very concerned and thought that this drone would also have to be returned defective. Then I happen to come across a posting pointing to an app that measures EMF (electromagnetic field), I downloaded the app and immediately went to my step to check for EMF. It was there folks and the meter went RED! It varied in strength as I moved it across my step and I realized I had found my problem. So lets not "knock" this information or analyze it to pieces. My Mini 2 did not pick up this magnetic interference before lifting off however the EMF Detector App did. I will continue using this since it's a great tool to have and could save your drone from a flyaway. Thanks for reading.
 
OK here's my story. I just had my drone replaced by DJI due to Compass error and IMU defect. I tested it in the back yard first with great results. Next I placed it on my concrete front step and lifted off to about 40 meters. It was just hovering there and suddenly took off over my roof and out of sight. I grabbed the sticks and regained control and was amazed just how far it had flown; approx. 300 Meters! I was very concerned and thought that this drone would also have to be returned defective. Then I happen to come across a posting pointing to an app that measures EMF (electromagnetic field), I downloaded the app and immediately went to my step to check for EMF. It was there folks and the meter went RED! It varied in strength as I moved it across my step and I realized I had found my problem. So lets not "knock" this information or analyze it to pieces. My Mini 2 did not pick up this magnetic interference before lifting off however the EMF Detector App did. I will continue using this since it's a great tool to have and could save your drone from a flyaway. Thanks for reading.

If you had checked the compass heading on the aircraft before taking off then you would have noticed that it was incorrect. The aircraft is often unable to detect the problem since it just measures the local magnetic field and uses that to initialize the IMU. But you can easily see the problem by comparing the displayed heading with the direction that the aircraft is actually facing.

EMF is generally not the problem, since very few electromagnetic fields come with a static magnetic field component. Are you sure that the app wasn't measuring the magnetic field? The issue was most likely due to magnetized rebar in the concrete. Magnetometer apps are one way to detect local field distortion, but the most direct method, that will always work, is the one I described above.

If you haven't looked at this thread then it might contain some useful background information:

A short explanation of compass function, calibration and errors. | DJI Mavic Drone Forum (mavicpilots.com)
 
So lets not "knock" this information or analyze it to pieces. My Mini 2 did not pick up this magnetic interference before lifting off however the EMF Detector App did. I will continue using this since it's a great tool to have and could save your drone from a flyaway. Thanks for reading.
Your eyes do the same job without any app.
Any structural concrete is full of steel reinforcing.
Just avoid launching from reinforced concrete structures.
 
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Forum statistics

Threads
130,978
Messages
1,558,529
Members
159,967
Latest member
rapidair