ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
alt_ctrl.c File Reference
#include "alt_ctrl.h"
Include dependency graph for alt_ctrl.c:

Go to the source code of this file.

Functions

static float clampf (float v, float lo, float hi)
 
void alt_ctrl_init (alt_ctrl_t *c, float hover)
 
void alt_ctrl_reset (alt_ctrl_t *c, float integ)
 
float alt_ctrl_vz_sp (const alt_ctrl_t *c, float h_sp, float h, float up, float dn)
 
float alt_ctrl_step (alt_ctrl_t *c, float vz_sp, float vz, float ct, float dt)
 

Function Documentation

◆ clampf()

static float clampf ( float  v,
float  lo,
float  hi 
)
static

Definition at line 6 of file alt_ctrl.c.

Referenced by alt_ctrl_reset(), alt_ctrl_step(), and alt_ctrl_vz_sp().

Here is the caller graph for this function:

◆ alt_ctrl_init()

void alt_ctrl_init ( alt_ctrl_t *  c,
float  hover 
)

Definition at line 8 of file alt_ctrl.c.

References alt_ctrl_t::hover, alt_ctrl_t::i_lim, alt_ctrl_t::integ, alt_ctrl_t::ki_v, alt_ctrl_t::kp_h, alt_ctrl_t::kp_v, alt_ctrl_t::thr_max, and alt_ctrl_t::thr_min.

Referenced by fc_init().

Here is the caller graph for this function:

◆ alt_ctrl_reset()

void alt_ctrl_reset ( alt_ctrl_t *  c,
float  integ 
)

Definition at line 17 of file alt_ctrl.c.

References clampf(), alt_ctrl_t::i_lim, and alt_ctrl_t::integ.

Referenced by exec().

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

◆ alt_ctrl_vz_sp()

float alt_ctrl_vz_sp ( const alt_ctrl_t *  c,
float  h_sp,
float  h,
float  up,
float  dn 
)

Definition at line 19 of file alt_ctrl.c.

References clampf(), and alt_ctrl_t::kp_h.

Referenced by setpoints().

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

◆ alt_ctrl_step()

float alt_ctrl_step ( alt_ctrl_t *  c,
float  vz_sp,
float  vz,
float  ct,
float  dt 
)

Definition at line 24 of file alt_ctrl.c.

References clampf(), alt_ctrl_t::hover, alt_ctrl_t::i_lim, alt_ctrl_t::integ, alt_ctrl_t::ki_v, alt_ctrl_t::kp_v, alt_ctrl_t::thr_max, and alt_ctrl_t::thr_min.

Referenced by setpoints().

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