|
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Implementation of complementary filters (first order, second order, and Butterworth variants) More...
Include dependency graph for complementary_filter.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | FirstOrderComplementary |
| First order complementary filter structure. More... | |
| struct | SecondOrderComplementary |
| Second order complementary filter structure. More... | |
| struct | Butterworth4Complementary |
| 4th order Butterworth complementary filter structure. More... | |
Typedefs | |
| typedef struct SecondOrderComplementary | Butterworth2Complementary |
Functions | |
| static void | init_first_order_complementary (struct FirstOrderComplementary *filter, float cut_off, float sample_time, float value) |
| Initialize the first order complementary filter. | |
| static float | update_first_order_complementary (struct FirstOrderComplementary *filter, float value_x, float value_y) |
| Update the first order complementary filter with new input values. | |
| static float | reset_first_order_complementary (struct FirstOrderComplementary *filter, float value) |
| Reset the first order complementary filter to a specific value. | |
| static float | get_first_order_complementary (const struct FirstOrderComplementary *filter) |
| Get current value of the first order complementary filter. | |
| static void | init_second_order_complementary (struct SecondOrderComplementary *filter, float cut_off, float Q, float sample_time, float value) |
| Initialize the second order complementary filter. | |
| static float | update_second_order_complementary (struct SecondOrderComplementary *filter, float value_x, float value_y) |
| Update the second order complementary filter with new input values. | |
| static float | reset_second_order_complementary (struct SecondOrderComplementary *filter, float value) |
| Reset the second order complementary filter to a specific value. | |
| static float | get_second_order_complementary (const struct SecondOrderComplementary *filter) |
| Get current value of the second order complementary filter. | |
| static void | init_butterworth_2_complementary (Butterworth2Complementary *filter, float cut_off, float sample_time, float value) |
| Initialize the Butterworth 2nd order low-pass complementary filter. | |
| static float | update_butterworth_2_complementary (Butterworth2Complementary *filter, float value_x, float value_y) |
| Update the Butterworth 2nd order low-pass complementary filter with new input values. | |
| static void | reset_butterworth_2_complementary (Butterworth2Complementary *filter, float value) |
| Reset the Butterworth 2nd order complementary filter to a specific value. | |
| static float | get_butterworth_2_complementary (const Butterworth2Complementary *filter) |
| Get current value of the Butterworth 2nd order low-pass complementary filter. | |
| static void | init_butterworth_4_complementary (Butterworth4Complementary *filter, float cut_off, float sample_time, float value) |
| Initialize the Butterworth 4th order low-pass complementary filter. | |
| static float | update_butterworth_4_complementary (Butterworth4Complementary *filter, float value_x, float value_y) |
| Update the Butterworth 4th order low-pass complementary filter with new input values. | |
| static void | reset_butterworth_4_complementary (Butterworth4Complementary *filter, float value) |
| Reset the Butterworth 4th order complementary filter to a specific value. | |
| static float | get_butterworth_4_complementary (const Butterworth4Complementary *filter) |
| Get current value of the Butterworth 4th order low-pass complementary filter. | |
Implementation of complementary filters (first order, second order, and Butterworth variants)
Provides structures and functions to initialize, update, reset, and get outputs from first order and second order complementary filters, as well as Butterworth complementary filters.
FIXME: This implementation of complementary filters forces user to first integrate or differentiate the signals outside of the filter before passing them in. Consider extending the filter to handle integration and differentiation internally. Maybe implement cascaded complementary filters for this purpose.
Definition in file complementary_filter.h.
| struct FirstOrderComplementary |
First order complementary filter structure.
This structure contains two first order low-pass filters, one for the high-pass path and one for the low-pass path.
Definition at line 49 of file complementary_filter.h.
Collaboration diagram for FirstOrderComplementary:| Data Fields | ||
|---|---|---|
| struct FirstOrderLowPass | x_lp_filter | |
| struct FirstOrderLowPass | y_lp_filter | |
| struct SecondOrderComplementary |
Second order complementary filter structure.
This structure contains two second order low-pass filters, one for the high-pass path and one for the low-pass path.
Definition at line 118 of file complementary_filter.h.
Collaboration diagram for SecondOrderComplementary:| Data Fields | ||
|---|---|---|
| struct SecondOrderLowPass | x_lp_filter | |
| struct SecondOrderLowPass | y_lp_filter | |
| struct Butterworth4Complementary |
4th order Butterworth complementary filter structure.
This structure contains two 4th order Butterworth low-pass filters, one for the high-pass path and one for the low-pass path.
Definition at line 243 of file complementary_filter.h.
Collaboration diagram for Butterworth4Complementary:| Data Fields | ||
|---|---|---|
| Butterworth4LowPass | x_lp_filter | |
| Butterworth4LowPass | y_lp_filter | |
Definition at line 184 of file complementary_filter.h.
|
inlinestatic |
Get current value of the Butterworth 2nd order low-pass complementary filter.
| filter | Complementary filter struct |
Definition at line 232 of file complementary_filter.h.
References get_second_order_complementary().
Referenced by get_butterworth_2_complementary_array(), get_butterworth_2_complementary_rates(), and get_butterworth_2_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Get current value of the Butterworth 4th order low-pass complementary filter.
| filter | Complementary filter struct |
Definition at line 293 of file complementary_filter.h.
References foo, get_butterworth_4_low_pass(), SecondOrderLowPass::i, Butterworth4LowPass::lp1, Butterworth4Complementary::x_lp_filter, and Butterworth4Complementary::y_lp_filter.
Referenced by get_butterworth_4_complementary_array(), get_butterworth_4_complementary_rates(), and get_butterworth_4_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Get current value of the first order complementary filter.
| filter | Complementary filter struct |
Definition at line 105 of file complementary_filter.h.
References foo, get_first_order_low_pass(), FirstOrderLowPass::last_in, FirstOrderComplementary::x_lp_filter, and FirstOrderComplementary::y_lp_filter.
Referenced by get_first_order_complementary_array(), get_first_order_complementary_rates(), and get_first_order_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Get current value of the second order complementary filter.
| filter | Complementary filter struct |
Definition at line 177 of file complementary_filter.h.
References foo, get_second_order_low_pass(), SecondOrderLowPass::i, SecondOrderComplementary::x_lp_filter, and SecondOrderComplementary::y_lp_filter.
Referenced by get_butterworth_2_complementary().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Initialize the Butterworth 2nd order low-pass complementary filter.
| filter | Complementary filter struct |
| cut_off | Time constant of the low-pass filter |
| sample_time | Sampling period |
| value | Initial value for filter history |
Definition at line 193 of file complementary_filter.h.
References foo, and init_second_order_complementary().
Referenced by init_butterworth_2_complementary_array(), and init_butterworth_2_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Initialize the Butterworth 4th order low-pass complementary filter.
| filter | Complementary filter struct |
| cut_off | Time constant of the low-pass filter |
| sample_time | Sampling period |
| value | Initial value for filter history |
Definition at line 255 of file complementary_filter.h.
References foo, init_butterworth_4_low_pass(), Butterworth4Complementary::x_lp_filter, and Butterworth4Complementary::y_lp_filter.
Referenced by init_butterworth_4_complementary_array(), and init_butterworth_4_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Initialize the first order complementary filter.
| filter | Complementary filter struct |
| cut_off | Time constant of the low-pass filter |
| sample_time | Sampling period |
| value | Initial value for filter history |
Definition at line 61 of file complementary_filter.h.
References foo, init_first_order_low_pass(), FirstOrderComplementary::x_lp_filter, and FirstOrderComplementary::y_lp_filter.
Referenced by init_first_order_complementary_array(), and init_first_order_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Initialize the second order complementary filter.
| filter | Complementary filter struct |
| cut_off | Time constant of the low-pass filter |
| Q | Q factor of the low-pass filter |
| sample_time | Sampling period |
| value | Initial value for filter history |
Definition at line 131 of file complementary_filter.h.
References foo, init_second_order_low_pass(), SecondOrderComplementary::x_lp_filter, and SecondOrderComplementary::y_lp_filter.
Referenced by init_butterworth_2_complementary().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Reset the Butterworth 2nd order complementary filter to a specific value.
| filter | Complementary filter struct |
| value | Value to reset the filter to |
Definition at line 222 of file complementary_filter.h.
References reset_second_order_complementary().
Referenced by reset_butterworth_2_complementary_array(), reset_butterworth_2_complementary_rates(), and reset_butterworth_2_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Reset the Butterworth 4th order complementary filter to a specific value.
| filter | Complementary filter struct |
| value | Value to reset the filter to |
Definition at line 282 of file complementary_filter.h.
References reset_butterworth_4_low_pass(), Butterworth4Complementary::x_lp_filter, and Butterworth4Complementary::y_lp_filter.
Referenced by reset_butterworth_4_complementary_array(), reset_butterworth_4_complementary_rates(), and reset_butterworth_4_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Reset the first order complementary filter to a specific value.
| filter | Complementary filter struct |
| value | Value to reset the filter to |
Definition at line 92 of file complementary_filter.h.
References reset_first_order_low_pass(), FirstOrderComplementary::x_lp_filter, and FirstOrderComplementary::y_lp_filter.
Referenced by reset_first_order_complementary_array(), reset_first_order_complementary_rates(), and reset_first_order_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Reset the second order complementary filter to a specific value.
| filter | Complementary filter struct |
| value | Value to reset the filter to |
Definition at line 163 of file complementary_filter.h.
References reset_second_order_low_pass(), SecondOrderComplementary::x_lp_filter, and SecondOrderComplementary::y_lp_filter.
Referenced by reset_butterworth_2_complementary().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Update the Butterworth 2nd order low-pass complementary filter with new input values.
| filter | Complementary filter struct |
| value_x | New input value from the high-pass path |
| value_y | New input value from the low-pass path |
Definition at line 211 of file complementary_filter.h.
References foo, and update_second_order_complementary().
Referenced by update_butterworth_2_complementary_array(), update_butterworth_2_complementary_rates(), and update_butterworth_2_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Update the Butterworth 4th order low-pass complementary filter with new input values.
| filter | Complementary filter struct |
| value_x | New input value from the high-pass path |
| value_y | New input value from the low-pass path |
Definition at line 269 of file complementary_filter.h.
References foo, SecondOrderLowPass::i, Butterworth4LowPass::lp1, update_butterworth_4_low_pass(), Butterworth4Complementary::x_lp_filter, and Butterworth4Complementary::y_lp_filter.
Referenced by update_butterworth_4_complementary_array(), update_butterworth_4_complementary_rates(), and update_butterworth_4_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Update the first order complementary filter with new input values.
| filter | Complementary filter struct |
| value_x | New input value from the high-pass path |
| value_y | New input value from the low-pass path |
Definition at line 76 of file complementary_filter.h.
References foo, FirstOrderLowPass::last_in, update_first_order_low_pass(), FirstOrderComplementary::x_lp_filter, and FirstOrderComplementary::y_lp_filter.
Referenced by update_first_order_complementary_array(), update_first_order_complementary_rates(), and update_first_order_complementary_vect3().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Update the second order complementary filter with new input values.
| filter | Complementary filter struct |
| value_x | New input value from the high-pass path |
| value_y | New input value from the low-pass path |
Definition at line 147 of file complementary_filter.h.
References foo, SecondOrderLowPass::i, update_second_order_low_pass(), SecondOrderComplementary::x_lp_filter, and SecondOrderComplementary::y_lp_filter.
Referenced by update_butterworth_2_complementary().
Here is the call graph for this function:
Here is the caller graph for this function: