IMU and Compass Configuration
This section describes flight controller installation orientation compensation and attitude checks in PX4, as well as orientation configuration and verification after connecting…
5 min read · English documentationThis section describes flight controller installation orientation compensation and attitude checks in PX4, as well as orientation configuration and verification after connecting a magnetometer through an external interface.
Warning:
All propellers must be removed during debugging. If any displayed direction does not match the physical movement, do not advance the throttle or attempt takeoff.
Standard Flight Controller Installation

- Install the FlyCore-FC as close to the center of the frame as possible. Before installation, install the battery, gimbal, and other payloads that will be used during flight, and balance the aircraft's center of gravity.
- When securing the flight controller with vibration-damping material, keep the flight controller board parallel to the aircraft's horizontal plane, and ensure that the wiring harness does not restrict movement of the vibration dampers.
- The default installation has the flight controller facing upward, with the orientation mark on the board pointing toward the nose.
- For mechanical installation and vibration-damping requirements, see the FlyCore Structural Installation Guide.
Nonstandard Installation Orientation Compensation
Prerequisites
- QGC is connected to the FlyCore-FC.
- The flight controller's actual installation orientation relative to the aircraft's forward, right, and down directions has been identified.
- The current parameters have been exported, and all propellers have been removed.
Configuration Steps
- In QGC, go to Vehicle Setup (gear icon) > Sensors > Orientations.
- Under AutoPilot Orientation, select the rotation parameter that matches the actual installation.

| Actual installation | Description | Orientation parameter |
|---|---|---|
| Rotated 90° clockwise horizontally | The arrow points toward the right side of the aircraft | ROTATION_YAW_90 |
| Rotated 180° horizontally | The arrow points toward the tail | ROTATION_YAW_180 |
| Rotated 90° counterclockwise horizontally | The arrow points toward the left side of the aircraft | ROTATION_YAW_270 |
| Installed upside down | The front side faces downward, while the arrow still points toward the nose | ROTATION_ROLL_180 |
After completing the basic orientation setting, perform QGC level calibration if a slight mechanical leveling error remains. After saving and restarting, return to the parameter page and verify the orientation setting.
Handheld Check
- Connect the flight controller to QGC through USB Type-C or a data link.
- Open the QGC Fly view and observe the attitude indicator and 3D model.
- Raise the nose: the attitude indicator's horizon reference line should move downward, and the blue area should increase.

- Return the aircraft to level, then press the right arm downward: the attitude indicator's horizon reference line should tilt to the left, while the small red arrow should tilt to the right.

External Magnetometer
The FlyCore-FC does not have an onboard magnetometer. When magnetic heading is required for a mission, a supported external magnetometer can be connected to the I2C1 or I2C4 interface through I2C (a communication bus used to connect low-speed sensors). After completing the wiring, check the sensor detection status, installation orientation, and heading change direction in sequence, and then perform calibration.
Warning:
All propellers must be removed during debugging. Power off the flight controller before wiring, connecting or disconnecting the magnetometer, or adjusting the wire order.
Hardware Wiring
The magnetometer pin definitions for I2C1 and I2C4 are identical:

Sensor Check
-
With the propellers removed, power on the flight controller and connect it to QGC.
-
In QGC, go to Analyze Tools > MAVLink Console to open the MAVLink console.
-
Run the following command in the console:
qmc5883p status -
Observe the sensor status information printed in the console. Confirm that the QMC5883P driver is running, the sensor data updates normally, and communication errors are not continuously increasing.

If the console reports that the driver is not running, the device cannot be found, or communication errors are continuously increasing, check the interface selection, SDA and SCL wire order, power supply, connector contact, and whether the current firmware includes the QMC5883P driver, in that order. Do not proceed with orientation verification or calibration while the sensor status is abnormal.
Installation Orientation and Rotation Verification

Install the magnetometer as far as possible from main power cables, ESCs, motors, buzzers, magnets, and other high-current or strong-magnetic-field sources. It is recommended to install the magnetometer with its front side facing upward and the module's orientation mark shown in the figure pointing toward the nose. In this installation, use the orientation Roll 180°, Yaw 90°.
Magnetometer Calibration
Before calibration, move away from vehicles, steel structures, metal tables, magnets, high-power electrical equipment, and underground reinforcing steel. Secure the magnetometer and its wiring harness in their final flight configuration, and keep the motors stopped. When conditions permit, use a telemetry link to connect QGC to reduce magnetic interference from the USB cable.
-
Open QGC and connect to the flight controller, then go to Vehicle Setup > Sensors.
-
Select Compass, confirm that the external magnetometer orientation is set correctly, and then start calibration.
-
Follow the QGC prompts to place the aircraft in each specified orientation in sequence.
-
When an orientation icon turns yellow, slowly rotate the aircraft around the indicated axis. After data collection is complete, the corresponding icon will turn green.

-
Complete all orientations and wait for QGC to display Calibration complete.
-
Restart the flight controller, then check the sensor status, heading, and rotation direction again.

Note:
A magnetometer is not mandatory. If the system has been configured and verified with a reliable heading source such as dual-antenna RTK or external vision/VIO, the magnetometer may be omitted. However, you must confirm that the EKF2 heading configuration is correct and that no related warnings are present.
