ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
iekf_config_t Struct Reference

#include <iekf.h>

Data Fields

float sigma_gyro
 rad/s, gyro white noise

 
float sigma_bias
 rad/s^2, bias random walk

 
float sigma_acc
 per-component std of the normalised vector

 
float sigma_mag
 
float acc_tol
 relative tolerance on the magnitude (gating)
 
float mag_tol
 
float p0_att
 initial attitude variance [rad^2]

 
float p0_bias
 initial bias variance [(rad/s)^2]

 
uint8_t estimate_bias
 
uint8_t adaptive
 
uint8_t tilt_comp_mag
 
float acc_nis_gate
 — robustness to external accelerations / magnetic disturbances —
 
float mag_nis_gate
 
float dip_tol
 
float infl_decay
 
uint8_t decouple
 1: acc corrects only roll/pitch, mag only yaw

 
uint8_t reset_jacobian
 1: transport P after the retraction (default)

 
uint8_t tangent_innov
 
float infl_max
 — protection against "lockout" of the NIS inflation — If the estimate is truly wrong, the innovation is large because of the estimate, not the measurement: NIS would inflate R forever and the filter would stop correcting (very slow convergence).
 
uint16_t lockout_updates
 e.g.
 
float lockout_p_bump
 rad^2, e.g.
 
uint16_t grace_updates
 e.g.
 
float persist_decay
 moving mean of the innovation: exp(-dt/tau), tau ~ 1 s
 
float persist_ratio
 |mean|^2 / mean(|e|^2) above which it is persistent, e.g.
 
float persist_min
 minimum |mean| (sine of the error), e.g.
 

Detailed Description

Definition at line 32 of file iekf.h.

Field Documentation

◆ sigma_gyro

float iekf_config_t::sigma_gyro

rad/s, gyro white noise

Definition at line 33 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_propagate_dtheta(), and tlm_build_init().

◆ sigma_bias

float iekf_config_t::sigma_bias

rad/s^2, bias random walk

Definition at line 34 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_propagate_dtheta(), and tlm_build_init().

◆ sigma_acc

float iekf_config_t::sigma_acc

per-component std of the normalised vector

Definition at line 35 of file iekf.h.

Referenced by iekf_default_config(), iekf_update_acc(), on_mag(), and tlm_build_init().

◆ sigma_mag

float iekf_config_t::sigma_mag

Definition at line 36 of file iekf.h.

Referenced by iekf_default_config(), iekf_update_mag_ex(), on_mag(), and tlm_build_init().

◆ acc_tol

float iekf_config_t::acc_tol

relative tolerance on the magnitude (gating)

Definition at line 37 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().

◆ mag_tol

float iekf_config_t::mag_tol

Definition at line 38 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_mag_ex(), and tlm_build_init().

◆ p0_att

float iekf_config_t::p0_att

initial attitude variance [rad^2]

Definition at line 39 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_init(), and tlm_build_init().

◆ p0_bias

float iekf_config_t::p0_bias

initial bias variance [(rad/s)^2]

Definition at line 40 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_init(), and tlm_build_init().

◆ estimate_bias

◆ adaptive

uint8_t iekf_config_t::adaptive

◆ tilt_comp_mag

uint8_t iekf_config_t::tilt_comp_mag

Definition at line 43 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_mag_ex(), and tlm_build_init().

◆ acc_nis_gate

float iekf_config_t::acc_nis_gate

— robustness to external accelerations / magnetic disturbances —

Definition at line 45 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().

◆ mag_nis_gate

float iekf_config_t::mag_nis_gate

Definition at line 47 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_mag_ex(), and tlm_build_init().

◆ dip_tol

float iekf_config_t::dip_tol

Definition at line 50 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_mag_ex(), and tlm_build_init().

◆ infl_decay

float iekf_config_t::infl_decay

Definition at line 54 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), tlm_build_init(), and vector_update().

◆ decouple

uint8_t iekf_config_t::decouple

1: acc corrects only roll/pitch, mag only yaw

Definition at line 56 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), iekf_update_mag_ex(), and tlm_build_init().

◆ reset_jacobian

uint8_t iekf_config_t::reset_jacobian

1: transport P after the retraction (default)

Definition at line 57 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), tlm_build_init(), and vector_update().

◆ tangent_innov

uint8_t iekf_config_t::tangent_innov

◆ infl_max

float iekf_config_t::infl_max

— protection against "lockout" of the NIS inflation — If the estimate is truly wrong, the innovation is large because of the estimate, not the measurement: NIS would inflate R forever and the filter would stop correcting (very slow convergence).

Hence:

  • the inflation is capped at infl_max (the correction never vanishes);
  • if the acc stays de-weighted for more than lockout_updates consecutive updates AND the innovation, seen in the WORLD frame, is persistent (its mean does not cancel out), it is an estimation error rather than an acceleration: P_aa += lockout_p_bump*I and the acc is trusted again for grace_updates updates. Why the world frame: with a correct gyro, a true attitude error stays fixed in the world frame, while the acceleration of a hand shaking the board oscillates with zero mean.
    e.g. 100

Definition at line 77 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), tlm_build_init(), and vector_update().

◆ lockout_updates

uint16_t iekf_config_t::lockout_updates

e.g.

120 (0.5 s at 240 Hz); 0 = off

Definition at line 78 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().

◆ lockout_p_bump

float iekf_config_t::lockout_p_bump

rad^2, e.g.

(10 deg)^2

Definition at line 79 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().

◆ grace_updates

uint16_t iekf_config_t::grace_updates

e.g.

60 (0.25 s)

Definition at line 80 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_reset_attitude(), iekf_update_acc(), and tlm_build_init().

◆ persist_decay

float iekf_config_t::persist_decay

moving mean of the innovation: exp(-dt/tau), tau ~ 1 s

Definition at line 81 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().

◆ persist_ratio

float iekf_config_t::persist_ratio

|mean|^2 / mean(|e|^2) above which it is persistent, e.g.

0.6

Definition at line 82 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().

◆ persist_min

float iekf_config_t::persist_min

minimum |mean| (sine of the error), e.g.

0.02 (~1 deg)

Definition at line 83 of file iekf.h.

Referenced by app_est_config(), iekf_default_config(), iekf_update_acc(), and tlm_build_init().


The documentation for this struct was generated from the following file: