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

Control hook points, already called by the estimation task at the right rates. More...

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

Go to the source code of this file.

Data Structures

struct  ctrl_rate_in_t
 
struct  ctrl_att_in_t
 

Functions

void ctrl_init (void)
 
void ctrl_rate_step (const ctrl_rate_in_t *in)
 960 Hz
 
void ctrl_attitude_step (const ctrl_att_in_t *in)
 240 Hz
 

Detailed Description

Control hook points, already called by the estimation task at the right rates.

In phase 1 they are empty ("weak" definitions in control_hooks.c): to add control, just redefine them, without touching the task or the estimator.

Order within a 960 Hz step (see app_main.c): IEKF propagation -> ctrl_rate_step() -> [every 4 steps] acc update -> ctrl_attitude_step() -> [when available] mag update ctrl_rate_step() runs right after the propagation, before the corrections, to minimise the gyro -> motors latency.

Definition in file control_hooks.h.

Function Documentation

◆ ctrl_init()

void ctrl_init ( void  )

Definition at line 7 of file control_hooks.c.

Referenced by ImuTask().

Here is the caller graph for this function:

◆ ctrl_rate_step()

void ctrl_rate_step ( const ctrl_rate_in_t *  in)

960 Hz

Definition at line 8 of file control_hooks.c.

Referenced by on_step().

Here is the caller graph for this function:

◆ ctrl_attitude_step()

void ctrl_attitude_step ( const ctrl_att_in_t *  in)

240 Hz

Definition at line 9 of file control_hooks.c.

Referenced by on_acc_window().

Here is the caller graph for this function: