Robot Control Library
rc_filter_t Struct Reference

Struct containing configuration and state of a SISO filter. More...

#include <rc/math/filter.h>

Data Fields

transfer function properties
int order
 transfer function order More...
 
double dt
 timestep in seconds More...
 
double gain
 Additional gain multiplier, usually 1.0. More...
 
rc_vector_t num
 numerator coefficients More...
 
rc_vector_t den
 denominator coefficients More...
 
saturation settings
int sat_en
 set to 1 by enable_saturation() More...
 
double sat_min
 lower saturation limit More...
 
double sat_max
 upper saturation limit More...
 
int sat_flag
 1 if saturated on the last step More...
 
soft start settings
int ss_en
 set to 1 by enbale_soft_start() More...
 
double ss_steps
 steps before full output allowed More...
 
dynamically allocated ring buffers
rc_ringbuf_t in_buf
 
rc_ringbuf_t out_buf
 
other
double newest_input
 shortcut for the most recent input More...
 
double newest_output
 shortcut for the most recent output More...
 
uint64_t step
 steps since last reset More...
 
int initialized
 initialization flag More...
 

Detailed Description

Struct containing configuration and state of a SISO filter.

Also points to dynamically allocated memory which make it necessary to use the allocation and free function in this API for proper use. The user can read and modify values directly from ths struct.

Examples:
rc_altitude.c, rc_balance.c, rc_test_bmp.c, rc_test_complementary_filters.c, and rc_test_filters.c.

Field Documentation

◆ order

int order

transfer function order

◆ dt

double dt

timestep in seconds

◆ gain

double gain

Additional gain multiplier, usually 1.0.

Examples:
rc_balance.c.

◆ num

numerator coefficients

◆ den

denominator coefficients

◆ sat_en

int sat_en

set to 1 by enable_saturation()

◆ sat_min

double sat_min

lower saturation limit

◆ sat_max

double sat_max

upper saturation limit

◆ sat_flag

int sat_flag

1 if saturated on the last step

◆ ss_en

int ss_en

set to 1 by enbale_soft_start()

◆ ss_steps

double ss_steps

steps before full output allowed

◆ in_buf

rc_ringbuf_t in_buf

◆ out_buf

rc_ringbuf_t out_buf

◆ newest_input

double newest_input

shortcut for the most recent input

◆ newest_output

double newest_output

shortcut for the most recent output

Examples:
rc_altitude.c.

◆ step

uint64_t step

steps since last reset

◆ initialized

int initialized

initialization flag


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