For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fine tune magnetometer

Cyclops performance may benefit from an extended magnetometer calibration if there are issues with heading. Please use this guide to run the extended calibration.

Step 1: Standard compass calibration

First, calibrate the compass using the standard calibration tool in Mission Planner or QGC. This will create a baseline calibration that our software will use for the extended calibration.

Ensure that the external compass you are using is configured as Compass 1 and CUST_ROT_ENABLE is set to 0 (disabled).

Step 2: Compass extrinsics

After standard calibration, reboot the flight controller. Then connect to your Cyclops device over Ethernet via SSH.

ssh pi@192.168.218.100

Run the following two commands to start the extended mag cal tool.

source /opt/vns-sdk/venv/bin/activate
python3 /lib/vns-sdk/scripts/calibrate_compass_extrinsics.py

The script will prompt you to slowly rotate your airframe two times while connected, first with the wings level, and then with the nose down. This will output three values for your compass' custom rotation.

Do not disconnect from your Cyclops device until the extended calibration is complete.

Once you have these values, connect to your flight controller and set the following ArduPilot params:

ArduPilot Parameter
Value
Description

CUST_ROT_ENABLE

1

Enables custom rotations

COMPASS_ORIENT

101

Applies custom rotation values to Compass 1

CUST_ROT1_PITCH

(value from script)

Custom pitch value

CUST_ROT1_ROLL

(value from script)

Custom roll value

CUST_ROT1_YAW

(value from script)

Custom yaw value

Step 3: Final compass calibration

After these parameters are set, run a final compass calibration using the same standard calibration tool as in Step 1. This will use the new compass extrinsics to do a more refined calibration. Reboot the flight controller when finished.

Last updated