Re-calibrating the 3D-magnetometer (compass) of your AscTec UAV
The magnetometer on all AscTec UAVs is factory calibrated. Usually, there is no need to re-calibrate it. However, sometimes re-calibration may become necessary, for example if the system configuration has changed (e.g. if payloads were added) or if the compass had been exposed to extremely strong magnetic fields.
An indication for a bad compass calibration is a circular movement when the vehicle is supposed to hover in GPS mode. A magnetometer used to detect the magnetic field of the earth must be very sensitive. Metal or even magnetic parts close to the compass, as well as antennas or cables, can render all measurements unusable. Therefore please make sure that no additional payload is mounted close to the compass.
To recalibrate the compass of your AscTec UAV you will need the following items:
- The vehicle itself
A laptop running "AscTec AutoPilot Control v1.50" (or later versions)
- The AscTec AutoPilot USB interface or an X-Bee link.
- Please make sure you take everything outdoors, at least 10m away from buildings and/or metal objects, as the best calibration results can only be achieved in an environment without any magnetic interference!
- Connect the UAV to the AutoPilot Control software, select the correct COM-port and click on "Connect". The red and black dots in the "Status" field should turn green. If not, please check your connection and try again.
- Then hold the "shift"-button on your keyboard and click on "Tools -> Calibration". In the Magnetic Field Sensors tab click on "Start Calibration".
- Move the vehicle, such that each of the three perpendicular compass axes can "see" the maximum of the earth's magnetic field, both in positive and negative direction. The magnetic field vector is pointing roughly in the north-south direction and it is inclined about 70° in center Europe. Simply try to find the maximum and minimum values for mag_x, mag_y and mag_z by pointing each of the arms of the vehicle, and also the Z axis, along the magnetic field vector. The values are stored automatically. The bar graphs will help you to see if you are still able to find a value greater or smaller than the current maximum/minimum. Please note that the maximum/minimum of each of the three graphs usually is different to each other. Once you cannot find greater or smaller values any more in all directions, click on "Take measurement" and then on "Transmit to IMU". After that, restart the vehicle by turning it off and on again.
That’s it! Now you can check if the calibration succeeded: Point the vehicle due North and the yaw angle in the "Calculated IMU Data" window should be roughly 0 degrees. Turn the front arm of the vehicle to the East, and the yaw value should change to 90°, and so on.
Please also be aware that the magnetic declination, which is the difference between magnetic north and true north, might be significant at your location. There are several sources on the internet to check your declination. If it is more than approx. +-5 degrees, there is a parameter to adopt the vehicle to that declination. Setting the correct declination might improve stability in GPS mode.
The parameter can be accessed by holding the shift key, then clicking on "Tools -> Parameters", and then clicking "Get Values". There is one parameter called "mag_declination", most probably set to 2000 (= 2.000 degrees). If the declination at your location was e.g. -15 degrees, you need to set this parameter to -15000 and click on "Transmit Values" and then on "Write to FLASH".