FYI - The compass does not compensate for magnet declination. I have pasted below a response from one of the resident gurus, SAR104, posted earlier this year that explains it very well.I always recalibrate the compass at the beginning of every session no matter if it's 50 feet or 50 miles different. Magnetic lines of force are different than true north on a map known as magnetic declination. It varies throughout the world. Granted that a distance difference of a few miles shouldn't make any difference, but these magnetic lines are subject to change over time.
I have made it a practice to do three things prior to flight as part of my preflight.
1. Use a landing pad where practical.
2. Calibrate the compass.
3. Upon takeoff, hover at about 20 feet for about 15 seconds to give drone a good chance to "see" the landing area and memorize it.
Since I have started doing this, when doing a RTH the drone ALWAYS has landed within an inch or two of the takeoff position.
“It cannot account for declination (the difference between magnetic north and true north) or deviation (the difference between magnetic north and the local magnetic field due to nearby magnetic objects) because it has no way to know the direction of true north except by reference to the magnetic field. It computes declination based on location from a global model of the earth's magnetic field that is in the firmware. Deviation cannot be determined by any method, and is the cause of many compass/yaw errors and uncontrolled flight.
The compass calibration is simply to measure and subtract the magnetic field of the aircraft itself, leaving just the external field. It measures it during the calibration process by separating the components of the magnetic field that don't change as you rotate the aircraft (the aircraft's magnetic field since that rotates with the aircraft) from the components that do change - the external magnetic field - that is assumed to be the earth's magnetic field.”