状态估计的算法发展
参数调试
AHRS_EKF_USE: set to “1” to use the EKF, “0” to use DCM for attitude control and inertial nav (Copter-3.2.1) or ahrs dead reckoning (Plane) for position control. In Copter-3.3 (and higher) this parameter is forced to “1” and cannot be changed.
AHRS_EKF_TYPE: set to “2” to use EKF2 for attitude and position estimation, “3” for EKF3.
EK2_ENABLE, EK3_ENABLE: set to “1” to enable the EKF2 and/or EKF3 respectively.
EK2_IMU_MASK, EK3_IMU_MASK: a bitmask specifying which IMUs (i.e. accelerometer/gyro) to use. An EKF “core” (i.e. a single EKF instance) will be started for each IMU specified.
-
1: starts a single EKF core using the first IMU
-
2: starts a single EKF core using only the second IMU
-
3: starts two separate EKF cores using the first and second IMUs respectively
EK3_PRIMARY: selects which “core” or “lane” is used as the primary. A value of 0 selects the first IMU lane in the EK3_IMU_MASK, 1 the second, etc. Be sure that the selected primary lane exists. See Affinity and Lane Switching below.
其他常用参数
EK2_ALT_SOURCE which sensor to use as the primary altitude source
0 : use barometer (default)
1 : use range finder. Do not use this option unless the vehicle is being flown indoors where the ground is flat. For terrain following please see copter and plane specific terrain following instructions which do not require changing this parameter.
2 : use GPS. Useful when GPS quality is very good and barometer drift could be a problem. For example if the vehicle will perform long distance missions with altitude changes of >100m.
EK2_ALT_M_NSE: Default is “1.0”. Lower number reduces reliance on accelerometers, increases reliance on barometer.
EK2_GPS_TYPE: Controls how GPS is used.
0 : use 3D velocity & 2D position from GPS
1 : use 2D velocity & 2D position (GPS velocity does not contribute to altitude estimate)
2: use 2D position
3 : no GPS (will use optical flow only if available)
EK2_YAW_M_NSE: Controls the weighting between GPS and Compass when calculating the heading. Default is “0.5”, lower values will cause the compass to be trusted more (i.e. higher weighting to the compass)
亲和度、EKF lanes切换
有的飞控有冗余的IMU,每个IMU运行一个EKF3实例(线程,成为lane),但只有一个主lane作为AHRS的来源,某个IMU发生故障时可切换主lane.
参考
https://ardupilot.org/copter/docs/common-apm-navigation-extended-kalman-filter-overview.html
https://ardupilot.org/copter/docs/common-ek3-affinity-lane-switching.html
https://ardupilot.org/copter/docs/common-ekf-sources.html