EK2_ parameters

54 parameters in the EK2_ family. ArduCopter 4.7 only — other vehicles share many of these names but not always the same ranges or meanings.

EK2_ABIAS_P_NSE

Accelerometer bias stability (m/s^3)

This noise controls the growth of the vertical accelerometer delta velocity bias state error estimate. Increasing it makes accelerometer bias estimation faster and noisier.

Units

m/s/s/s

Range

0.00001 to 0.005

User level

Advanced

EK2_ACC_P_NSE

Accelerometer noise (m/s^2)

This control disturbance noise controls the growth of estimated error due to accelerometer measurement errors excluding bias. Increasing it makes the flter trust the accelerometer measurements less and other measurements more.

Units

m/s/s

Range

0.01 to 1.0

Increment

0.01

User level

Advanced

EK2_ALT_M_NSE

Altitude measurement noise (m)

This is the RMS value of noise in the altitude measurement. Increasing it reduces the weighting of the baro measurement and will make the filter respond more slowly to baro measurement errors, but will make it more sensitive to GPS and accelerometer errors.

Units

m

Range

0.1 to 10.0

Increment

0.1

User level

Advanced

EK2_ALT_SOURCE

Primary altitude sensor source

Primary height sensor used by the EKF. If a sensor other than Baro is selected and becomes unavailable, then the Baro sensor will be used as a fallback. NOTE: The EK2_RNG_USE_HGT parameter can be used to switch to range-finder when close to the ground in conjunction with EK2_ALT_SOURCE = 0 or 2 (Baro or GPS).

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Values

Value

Meaning

0

Use Baro

1

Use Range Finder

2

Use GPS

3

Use Range Beacon

EK2_BCN_DELAY

Range beacon measurement delay (msec)

This is the number of msec that the range beacon measurements lag behind the inertial measurements. It is the time from the end of the optical flow averaging period and does not include the time delay due to the 100msec of averaging within the flow sensor.

Units

ms

Range

0 to 127

Increment

10

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

EK2_BCN_I_GTE

Range beacon measurement gate size

This sets the percentage number of standard deviations applied to the range beacon measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_BCN_M_NSE

Range beacon measurement noise (m)

This is the RMS value of noise in the range beacon measurement. Increasing it reduces the weighting on this measurement.

Units

m

Range

0.1 to 10.0

Increment

0.1

User level

Advanced

EK2_CHECK_SCALE

GPS accuracy check scaler (%)

This scales the thresholds that are used to check GPS accuracy before it is used by the EKF. A value of 100 is the default. Values greater than 100 increase and values less than 100 reduce the maximum GPS error the EKF will accept. A value of 200 will double the allowable GPS error.

Units

%

Range

50 to 200

User level

Advanced

EK2_EAS_I_GATE

Airspeed measurement gate size

This sets the percentage number of standard deviations applied to the airspeed measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_EAS_M_NSE

Equivalent airspeed measurement noise (m/s)

This is the RMS value of noise in equivalent airspeed measurements used by planes. Increasing it reduces the weighting of airspeed measurements and will make wind speed estimates less noisy and slower to converge. Increasing also increases navigation errors when dead-reckoning without GPS measurements.

Units

m/s

Range

0.5 to 5.0

Increment

0.1

User level

Advanced

EK2_ENABLE

Enable EKF2

This enables EKF2. Enabling EKF2 only makes the maths run, it does not mean it will be used for flight control. To use it for flight control set AHRS_EKF_TYPE=2. A reboot or restart will need to be performed after changing the value of EK2_ENABLE for it to take effect.

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Values

Value

Meaning

0

Disabled

1

Enabled

EK2_FLOW_DELAY

Optical Flow measurement delay (msec)

This is the number of msec that the optical flow measurements lag behind the inertial measurements. It is the time from the end of the optical flow averaging period and does not include the time delay due to the 100msec of averaging within the flow sensor.

Units

ms

Range

0 to 127

Increment

10

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

EK2_FLOW_I_GATE

Optical Flow measurement gate size

This sets the percentage number of standard deviations applied to the optical flow innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_FLOW_M_NSE

Optical flow measurement noise (rad/s)

This is the RMS value of noise and errors in optical flow measurements. Increasing it reduces the weighting on these measurements.

Units

rad/s

Range

0.05 to 1.0

Increment

0.05

User level

Advanced

EK2_FLOW_USE

Optical flow use bitmask

Controls if the optical flow data is fused into the 24-state navigation estimator OR the 1-state terrain height estimator.

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Values

Value

Meaning

0

None

1

Navigation

2

Terrain

EK2_GBIAS_P_NSE

Rate gyro bias stability (rad/s/s)

This state process noise controls growth of the gyro delta angle bias state error estimate. Increasing it makes rate gyro bias estimation faster and noisier.

Units

rad/s/s

Range

0.00001 to 0.001

User level

Advanced

EK2_GLITCH_RAD

GPS glitch radius gate size (m)

This controls the maximum radial uncertainty in position between the value predicted by the filter and the value measured by the GPS before the filter position and velocity states are reset to the GPS. Making this value larger allows the filter to ignore larger GPS glitches but also means that non-GPS errors such as IMU and compass can create a larger error in position before the filter is forced back to the GPS position.

Units

m

Range

10 to 100

Increment

5

User level

Advanced

EK2_GPS_CHECK

GPS preflight check

This is a 1 byte bitmap controlling which GPS preflight checks are performed. Set to 0 to bypass all checks. Set to 255 perform all checks. Set to 3 to check just the number of satellites and HDoP. Set to 31 for the most rigorous checks that will still allow checks to pass when the copter is moving, eg launch from a boat.

User level

Advanced

Bitmask

Value

Meaning

0

NSats

1

HDoP

2

speed error

3

position error

4

yaw error

5

pos drift

6

vert speed

7

horiz speed

EK2_GPS_TYPE

GPS mode control

This controls use of GPS measurements : 0 = use 3D velocity & 2D position, 1 = use 2D velocity and 2D position, 2 = use 2D position, 3 = Inhibit GPS use - this can be useful when flying with an optical flow sensor in an environment where GPS quality is poor and subject to large multipath errors.

User level

Advanced

Values

Value

Meaning

0

GPS 3D Vel and 2D Pos

1

GPS 2D vel and 2D pos

2

GPS 2D pos

3

No GPS

EK2_GSCL_P_NSE

Rate gyro scale factor stability (1/s)

This noise controls the rate of gyro scale factor learning. Increasing it makes rate gyro scale factor estimation faster and noisier.

Units

Hz

Range

0.000001 to 0.001

User level

Advanced

EK2_GSF_RST_MAX

Maximum number of resets to the EKF-GSF yaw estimate allowed

Sets the maximum number of times the EKF2 will be allowed to reset its yaw to the estimate from the EKF-GSF yaw estimator. No resets will be allowed unless the use of the EKF-GSF yaw estimate is enabled via the EK2_GSF_USE_MASK parameter.

Range

1 to 10

Increment

1

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

EK2_GSF_RUN_MASK

Bitmask of which EKF-GSF yaw estimators run

A bitmask of which EKF2 instances run an independant EKF-GSF yaw estimator to provide a backup yaw estimate that doesn’t rely on magnetometer data. This estimator uses IMU, GPS and, if available, airspeed data. EKF-GSF yaw estimator data for the primary EKF2 instance will be logged as GSF0 and GSF1 messages. Use of the yaw estimate generated by this algorithm is controlled by the EK2_GSF_USE_MASK and EK2_GSF_RST_MAX parameters. To run the EKF-GSF yaw estimator in ride-along and logging only, set EK2_GSF_USE_MASK to 0.

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Bitmask

Value

Meaning

0

FirstEKF

1

SecondEKF

2

ThirdEKF

3

FourthEKF

4

FifthEKF

5

SixthEKF

EK2_GSF_USE_MASK

Bitmask of which EKF-GSF yaw estimators are used

1 byte bitmap of which EKF2 instances will use the output from the EKF-GSF yaw estimator that has been turned on by the EK2_GSF_RUN_MASK parameter. If the inertial navigation calculation stops following the GPS, then the vehicle code can request EKF2 to attempt to resolve the issue, either by performing a yaw reset if enabled by this parameter by switching to another EKF2 instance.

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Bitmask

Value

Meaning

0

FirstEKF

1

SecondEKF

2

ThirdEKF

3

FourthEKF

4

FifthEKF

5

SixthEKF

EK2_GYRO_P_NSE

Rate gyro noise (rad/s)

This control disturbance noise controls the growth of estimated error due to gyro measurement errors excluding bias. Increasing it makes the flter trust the gyro measurements less and other measurements more.

Units

rad/s

Range

0.0001 to 0.1

Increment

0.0001

User level

Advanced

EK2_HGT_DELAY

Height measurement delay (msec)

This is the number of msec that the Height measurements lag behind the inertial measurements.

Units

ms

Range

0 to 250

Increment

10

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

EK2_HGT_I_GATE

Height measurement gate size

This sets the percentage number of standard deviations applied to the height measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_HRT_FILT

Height rate filter crossover frequency

Specifies the crossover frequency of the complementary filter used to calculate the output predictor height rate derivative.

Units

Hz

Range

0.1 to 30.0

EK2_IMU_MASK

Bitmask of active IMUs

1 byte bitmap of IMUs to use in EKF2. A separate instance of EKF2 will be started for each IMU selected. Set to 1 to use the first IMU only (default), set to 2 to use the second IMU only, set to 3 to use the first and second IMU. Additional IMU’s can be used up to a maximum of 6 if memory and processing resources permit. There may be insufficient memory and processing resources to run multiple instances. If this occurs EKF2 will fail to start.

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Bitmask

Value

Meaning

0

FirstIMU

1

SecondIMU

2

ThirdIMU

3

FourthIMU

4

FifthIMU

5

SixthIMU

EK2_MAGB_P_NSE

Body magnetic field process noise (gauss/s)

This state process noise controls the growth of body magnetic field state error estimates. Increasing it makes magnetometer bias error estimation faster and noisier.

Units

Gauss/s

Range

0.00001 to 0.01

User level

Advanced

EK2_MAGE_P_NSE

Earth magnetic field process noise (gauss/s)

This state process noise controls the growth of earth magnetic field state error estimates. Increasing it makes earth magnetic field estimation faster and noisier.

Units

Gauss/s

Range

0.00001 to 0.01

User level

Advanced

EK2_MAG_CAL

Magnetometer default fusion mode

This determines when the filter will use the 3-axis magnetometer fusion model that estimates both earth and body fixed magnetic field states, when it will use a simpler magnetic heading fusion model that does not use magnetic field states and when it will use an alternative method of yaw determination to the magnetometer. The 3-axis magnetometer fusion is only suitable for use when the external magnetic field environment is stable. EK2_MAG_CAL = 0 uses heading fusion on ground, 3-axis fusion in-flight, and is the default setting for Plane users. EK2_MAG_CAL = 1 uses 3-axis fusion only when manoeuvring. EK2_MAG_CAL = 2 uses heading fusion at all times, is recommended if the external magnetic field is varying and is the default for rovers. EK2_MAG_CAL = 3 uses heading fusion on the ground and 3-axis fusion after the first in-air field and yaw reset has completed, and is the default for copters. EK2_MAG_CAL = 4 uses 3-axis fusion at all times. NOTE: The fusion mode can be forced to 2 for specific EKF cores using the EK2_MAG_MASK parameter. NOTE: limited operation without a magnetometer or any other yaw sensor is possible by setting all COMPASS_USE, COMPASS_USE2, COMPASS_USE3, etc parameters to 0 with COMPASS_ENABLE set to 1. If this is done, the EK2_GSF_RUN and EK2_GSF_USE masks must be set to the same as EK2_IMU_MASK.

User level

Advanced

Values

Value

Meaning

0

When flying

1

When manoeuvring

2

Never

3

After first climb yaw reset

4

Always

EK2_MAG_EF_LIM

EarthField error limit

This limits the difference between the learned earth magnetic field and the earth field from the world magnetic model tables. A value of zero means to disable the use of the WMM tables.

Units

mGauss

Range

0 to 500

User level

Advanced

EK2_MAG_I_GATE

Magnetometer measurement gate size

This sets the percentage number of standard deviations applied to the magnetometer measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_MAG_MASK

Bitmask of active EKF cores that will always use heading fusion

1 byte bitmap of EKF cores that will disable magnetic field states and use simple magnetic heading fusion at all times. This parameter enables specified cores to be used as a backup for flight into an environment with high levels of external magnetic interference which may degrade the EKF attitude estimate when using 3-axis magnetometer fusion. NOTE : Use of a different magnetometer fusion algorithm on different cores makes unwanted EKF core switches due to magnetometer errors more likely.

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Bitmask

Value

Meaning

0

FirstEKF

1

SecondEKF

2

ThirdEKF

3

FourthEKF

4

FifthEKF

5

SixthEKF

EK2_MAG_M_NSE

Magnetometer measurement noise (Gauss)

This is the RMS value of noise in magnetometer measurements. Increasing it reduces the weighting on these measurements.

Units

Gauss

Range

0.01 to 0.5

Increment

0.01

User level

Advanced

EK2_MAX_FLOW

Maximum valid optical flow rate

This sets the magnitude maximum optical flow rate in rad/sec that will be accepted by the filter

Units

rad/s

Range

1.0 to 4.0

Increment

0.1

User level

Advanced

EK2_NOAID_M_NSE

Non-GPS operation position uncertainty (m)

This sets the amount of position variation that the EKF allows for when operating without external measurements (eg GPS or optical flow). Increasing this parameter makes the EKF attitude estimate less sensitive to vehicle manoeuvres but more sensitive to IMU errors.

Units

m

Range

0.5 to 50.0

User level

Advanced

EK2_OGN_HGT_MASK

Bitmask control of EKF reference height correction

When a height sensor other than GPS is used as the primary height source by the EKF, the position of the zero height datum is defined by that sensor and its frame of reference. If a GPS height measurement is also available, then the height of the WGS-84 height datum used by the EKF can be corrected so that the height returned by the getLLH() function is compensated for primary height sensor drift and change in datum over time. The first two bit positions control when the height datum will be corrected. Correction is performed using a Bayes filter and only operates when GPS quality permits. The third bit position controls where the corrections to the GPS reference datum are applied. Corrections can be applied to the local vertical position or to the reported EKF origin height (default).

Reboot required

Yes — the change takes effect after a reboot.

User level

Advanced

Bitmask

Value

Meaning

0

Correct when using Baro height

1

Correct when using range finder height

2

Apply corrections to local position

EK2_OPTIONS

Optional EKF behaviour

optional EKF2 behaviour. Disabling external navigation prevents use of external vision data in the EKF2 solution

User level

Advanced

Bitmask

Value

Meaning

0

DisableExternalNavigation

EK2_POSNE_M_NSE

GPS horizontal position measurement noise (m)

This sets the GPS horizontal position observation noise. Increasing it reduces the weighting of GPS horizontal position measurements.

Units

m

Range

0.1 to 10.0

Increment

0.1

User level

Advanced

EK2_POS_I_GATE

GPS position measurement gate size

This sets the percentage number of standard deviations applied to the GPS position measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_RNG_I_GATE

Range finder measurement gate size

This sets the percentage number of standard deviations applied to the range finder innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_RNG_M_NSE

Range finder measurement noise (m)

This is the RMS value of noise in the range finder measurement. Increasing it reduces the weighting on this measurement.

Units

m

Range

0.1 to 10.0

Increment

0.1

User level

Advanced

EK2_RNG_USE_HGT

Range finder switch height percentage

Range finder can be used as the primary height source when below this percentage of its maximum range (see RNGFND*_MAX). This will not work unless Baro or GPS height is selected as the primary height source vis EK2_ALT_SOURCE = 0 or 2 respectively. This feature should not be used for terrain following as it is designed for vertical takeoff and landing with climb above the range finder use height before commencing the mission, and with horizontal position changes below that height being limited to a flat region around the takeoff and landing point.

Units

%

Range

-1 to 70

Increment

1

User level

Advanced

EK2_RNG_USE_SPD

Range finder max ground speed

The range finder will not be used as the primary height source when the horizontal ground speed is greater than this value.

Units

m/s

Range

2.0 to 6.0

Increment

0.5

User level

Advanced

EK2_TAU_OUTPUT

Output complementary filter time constant (centi-sec)

Sets the time constant of the output complementary filter/predictor in centi-seconds.

Units

cs

Range

10 to 50

Increment

5

User level

Advanced

EK2_TERR_GRAD

Maximum terrain gradient

Specifies the maximum gradient of the terrain below the vehicle assumed when it is fusing range finder or optical flow to estimate terrain height.

Range

0 to 0.2

Increment

0.01

User level

Advanced

EK2_VELD_M_NSE

GPS vertical velocity measurement noise (m/s)

This sets a lower limit on the speed accuracy reported by the GPS receiver that is used to set vertical velocity observation noise. If the model of receiver used does not provide a speed accurcy estimate, then the parameter value will be used. Increasing it reduces the weighting of the GPS vertical velocity measurements.

Units

m/s

Range

0.05 to 5.0

Increment

0.05

User level

Advanced

EK2_VELNE_M_NSE

GPS horizontal velocity measurement noise (m/s)

This sets a lower limit on the speed accuracy reported by the GPS receiver that is used to set horizontal velocity observation noise. If the model of receiver used does not provide a speed accurcy estimate, then the parameter value will be used. Increasing it reduces the weighting of the GPS horizontal velocity measurements.

Units

m/s

Range

0.05 to 5.0

Increment

0.05

User level

Advanced

EK2_VEL_I_GATE

GPS velocity innovation gate size

This sets the percentage number of standard deviations applied to the GPS velocity measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_WIND_PSCALE

Height rate to wind process noise scaler

This controls how much the process noise on the wind states is increased when gaining or losing altitude to take into account changes in wind speed and direction with altitude. Increasing this parameter increases how rapidly the wind states adapt when changing altitude, but does make wind velocity estimation noiser.

Range

0.0 to 1.0

Increment

0.1

User level

Advanced

EK2_WIND_P_NSE

Wind velocity process noise (m/s^2)

This state process noise controls the growth of wind state error estimates. Increasing it makes wind estimation faster and noisier.

Units

m/s/s

Range

0.01 to 1.0

Increment

0.1

User level

Advanced

EK2_YAW_I_GATE

Yaw measurement gate size

This sets the percentage number of standard deviations applied to the magnetometer yaw measurement innovation consistency check. Decreasing it makes it more likely that good measurements will be rejected. Increasing it makes it more likely that bad measurements will be accepted.

Range

100 to 1000

Increment

25

User level

Advanced

EK2_YAW_M_NSE

Yaw measurement noise (rad)

This is the RMS value of noise in yaw measurements from the magnetometer. Increasing it reduces the weighting on these measurements.

Units

rad

Range

0.05 to 1.0

Increment

0.05

User level

Advanced