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

Windowed accelerometer mean, compensated for rotation. More...

#include <stdint.h>
Include dependency graph for accwin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  accwin_t
 

Functions

void accwin_reset (accwin_t *w)
 
void accwin_add (accwin_t *w, const float acc[3])
 sample in the current body

 
void accwin_rotate (accwin_t *w, const float E[9])
 after every propagation

 
int accwin_mean (const accwin_t *w, float out[3])
 in the current body, 0 = OK

 

Detailed Description

Windowed accelerometer mean, compensated for rotation.

A plain mean of N samples taken while the body rotates is "smeared" over different orientations and lags by half a window (at 360 deg/s with a 4 ms window that is ~0.7 deg). Here every sample is brought into the body frame at the START of the window with the propagated rotation D, averaged, and the result is brought back into the CURRENT body frame:

a_mean = D_N' * (1/N) * sum_i D_i * a_i ,   D = E_1 E_2 ... E_k

The E are the rotation increments of the IEKF propagation (iekf.E_last), so the cost is a few 3x3 multiplications per sample.

Definition in file accwin.h.

Function Documentation

◆ accwin_reset()

void accwin_reset ( accwin_t *  w)

Definition at line 8 of file accwin.c.

References accwin_t::D.

Referenced by est_init(), on_acc_window(), and on_mag().

Here is the caller graph for this function:

◆ accwin_add()

void accwin_add ( accwin_t *  w,
const float  acc[3] 
)

sample in the current body

Definition at line 14 of file accwin.c.

References accwin_t::D, mat3_vec(), accwin_t::n, and accwin_t::sum.

Referenced by est_process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ accwin_rotate()

void accwin_rotate ( accwin_t *  w,
const float  E[9] 
)

after every propagation

Definition at line 22 of file accwin.c.

References accwin_t::D, and mat3_mul().

Referenced by on_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ accwin_mean()

int accwin_mean ( const accwin_t *  w,
float  out[3] 
)

in the current body, 0 = OK

Definition at line 29 of file accwin.c.

References accwin_t::D, mat3t_vec(), accwin_t::n, and accwin_t::sum.

Referenced by on_acc_window().

Here is the call graph for this function:
Here is the caller graph for this function: