Documentation/FlyCore i225U WikiEnglish · V1
Browse documentation
Advanced User Guide

Mounting Orientation and EKF3

Mounting orientation, GPS yaw, the external compass, and the EKF3 positioning sources jointly affect attitude and position estimation.

3 min read · English documentation

Mounting orientation, GPS yaw, the external compass, and the EKF3 positioning sources jointly affect attitude and position estimation.

image.png

Warning:

Incorrect configuration may cause reversed attitude, heading conflicts, failure to arm, or abnormal position control. After making changes, save the parameters, restart the flight controller, and perform physical verification with the propellers removed.

Official reference: ArduPilot EKF Source Selection. The official webpage may be updated. When using it, verify the parameter definitions for ArduPilot Copter 4.8.0.

Prerequisites

  • All propellers have been removed.
  • The current parameters have been exported and backed up.
  • The actual mounting orientations of the flight controller, primary and secondary antennas, and external compass (if used) have all been recorded.
  • Mission Planner can display the attitude, GPS, and EKF status.

1. Set the Mounting Orientation

For the standard mounting orientation:

image.png

AHRS_ORIENTATION = 0
  1. Whenever possible, keep the flight controller board parallel to the horizontal plane of the aircraft, with its orientation marker pointing toward the nose.
  2. If the flight controller must be rotated or mounted upside down due to structural constraints, select the AHRS_ORIENTATION in Mission Planner that matches the actual mounting orientation.
  3. After making changes, save the parameters and restart the flight controller.
  4. Perform accelerometer calibration again.

2. Verify Attitude and Heading

  1. Connect Mission Planner and observe the attitude display in the ground station.
  2. Raise the nose and confirm that the display shows the nose pitching up.
  3. Press the right arm downward and confirm that the display shows the left side tilting upward.
  4. Rotate the nose clockwise and confirm that the heading angle changes in the same direction.
  5. Point the nose in a known direction and verify the absolute heading value.
  6. Slowly rotate the aircraft through 360° and confirm that the heading changes continuously without sudden jumps.
  7. Check Messages and the EKF status and confirm that there are no persistent warnings.

If any direction is inconsistent, do not arm the aircraft. Recheck AHRS_ORIENTATION, the accelerometer calibration, COMPASS_ORIENT, and the dual-antenna baseline direction.

3. EKF3 Configuration

The default parameters are as follows:

AHRS_EKF_TYPE = 3
EK3_ENABLE    = 1

The primary source combination is:

Parameter Test Value Meaning in the Documentation
EK3_SRC1_POSXY 3 GPS is used for horizontal position
EK3_SRC1_POSZ 3 GPS is used for vertical position
EK3_SRC1_VELXY 3 GPS is used for horizontal velocity
EK3_SRC1_VELZ 3 GPS is used for vertical velocity
EK3_SRC1_YAW 2 GPS yaw is used for heading

4. Verify GPS Yaw and the Compass

Before using GPS yaw, confirm that:

  1. ANT1/ANT2 are connected correctly.
  2. GPS1_TYPE, GPS1_MB_TYPE, and GPS1_MB_OFS_* match the actual installation.
  3. GPS yaw is stable in an open outdoor environment.
  4. The heading changes in the correct direction when the aircraft rotates.
  5. There is no obvious conflict between the external compass and GPS yaw.

If a heading conflict occurs, first verify the GPS yaw primary and secondary antennas and baseline direction separately. Then verify the external compass's COMPASS_ORIENT, calibration quality, and surrounding magnetic interference.

5. Preflight EKF3 Checks

  • No persistent EKF warnings.
  • Stable GPS/RTK status.
  • The heading is stable and consistent with the actual direction.
  • The position estimate has no obvious jumps.
  • The accelerometer, gyroscope, and external compass (if used) show no abnormal indications.

Troubleshooting

Warning or Symptom Check First
EKF variance GPS status, vibration, compass interference, and sensor calibration
yaw inconsistent GPS yaw, compass orientation, and dual-antenna baseline direction
GPS glitch Antenna obstruction, multipath, differential link, and satellite count
Unable to arm PreArm reason in Messages, EKF status, and GPS status
Loiter drift RTK status, GPS yaw, vibration, motor output, and wind field

When an EKF warning occurs, do not disable the protection directly. Export the logs first and identify the cause.