ahrs_int_cmpl_quat

AHRS using complementary filter in fixed point. Propagation is done in quaternion representation. By default uses magnetometer for heading for rotorcrafts. For fixedwing firmware AHRS_GRAVITY_UPDATE_COORDINATED_TURN is enabled by default and magnetometer disabled (needs GPS). To measure attitude angles, gyrometers measurements are integrated. The result of integration is accurate for short term, but gyro bias is accumulated, which results in long term errors (drift). On the other hand, accelerometers can be used to infer pitch/roll angles utilizing gravity vector measurement, but they suffer from noise due to vibrations. The measurement is then only accurate when averaged over a long term. Also, accelerometers alone are unable to give accurate angles when the vehicle is accelerating. Complementary filter takes advantage of both sensors, using a low-pass filter on accelerometer readings and high pass filter on gyrometers readings, to estimate attitude angles. - No danger of gimbal lock, since quaternions are used. - The arithmetic is fixed point and is thus suitable if the processor (on your board) has no FPU. - Estimates the gyro bias.

Configures

Name

Value

Description

USE_MAGNETOMETER

TRUE

set to FALSE to disable magnetometer

AHRS_ALIGNER_LED

1

LED number to indicate AHRS alignment, none to disable (default is board dependent)

Defines

Name

Value

Description

AHRS_MAG_UPDATE_ALL_AXES

FALSE|TRUE

Use magnetometer to update all axes and not only yaw

AHRS_USE_GPS_HEADING

FALSE|TRUE

Use GPS course to update heading

AHRS_FLOATING_HEADING

FALSE|TRUE

If no GPS and no Mag is available, define AHRS_FLOATING_HEADING to silent warnings.

AHRS_GRAVITY_UPDATE_COORDINATED_TURN

FALSE|TRUE

Compensation of centrifugal force via GPS speed (to fly in circles with a fixedwing)

AHRS_GPS_SPEED_IN_NEGATIVE_Z_DIRECTION

FALSE|TRUE

AHRS_GRAVITY_UPDATE_COORDINATED_TURN assumes the GPS speed is in the X axis direction. Quadshot, DelftaCopter and other hybrids can have the GPS speed in the negative Z direction

AHRS_PROPAGATE_LOW_PASS_RATES

apply a low pass filter on rotational velocity

AHRS_BIAS_UPDATE_HEADING_THRESHOLD

5.0

don’t update gyro bias if heading deviation is above this threshold in degrees

AHRS_HEADING_UPDATE_GPS_MIN_SPEED

5.0

Don’t update heading from GPS course if GPS ground speed is below is this threshold in m/s

AHRS_GRAVITY_HEURISTIC_FACTOR

30

Default is 30. Reduce accelerometer cut-off frequency when the vehicle is accelerating: norm(ax,ay,az) ~ 9,81 m/s2. WARNING: when the IMU is not well damped, the norm of accelerometers never equals to 9,81 m/s2. As a result, the GRAVITY_HEURISTIC_FACTOR will reduce the accelerometer bandwith even if the vehicle is not accelerating. Set to 0 in case of vibrations

AHRS_ICQ_IMU_ID

ABI_BROADCAST

ABI sender id of IMU to use

AHRS_ICQ_MAG_ID

ABI_BROADCAST

ABI sender id of magnetometer to use

AHRS_ICQ_GPS_ID

GPS_MULTI_ID

ABI sender id of GPS to use

Depends

  • ahrs_common
  • @imu
  • @mag|@gps

Provides

  • ahrs