33 #include "../config/anglerate.h"
88 #define IS_PID_CONTROLLER_FP_BASED(pidController) (pidController == PID_CONTROLLER_LUX_FLOAT)
104 static inline int16_t anglerate_get_roll(
struct anglerate *
self) {
return self->output.axis[0]; }
105 static inline int16_t anglerate_get_pitch(
struct anglerate *
self) {
return self->output.axis[1]; }
106 static inline int16_t anglerate_get_yaw(
struct anglerate *
self) {
return self->output.axis[2]; }
void anglerate_set_pid_axis_scale(struct anglerate *self, uint8_t axis, int32_t scale)
Definition: anglerate.c:313
int16_t user[3]
user input command
Definition: anglerate.h:62
uint8_t type
Definition: fat_standard.h:67
void anglerate_enable_antiwindup(struct anglerate *self, bool on)
Definition: anglerate.c:308
biquad_t deltaFilterState[3]
Definition: anglerate.h:55
void(* update)(struct anglerate *self, float dT)
Definition: anglerate.h:58
float axis_I[3]
Definition: anglerate.h:44
uint8_t level_percent[2]
Definition: anglerate.h:81
void anglerate_update(struct anglerate *self, float dT)
Definition: anglerate.c:299
int16_t axis[3]
Definition: anglerate.h:39
float deltaStatef[3][DTERM_AVERAGE_COUNT]
Definition: anglerate.h:66
void anglerate_set_algo(struct anglerate *self, pid_controller_type_t type)
Definition: anglerate.c:270
int32_t ITermLimit[3]
Definition: anglerate.h:52
struct instruments * ins
Definition: anglerate.h:84
void anglerate_reset_rate_i(struct anglerate *self)
Definition: anglerate.c:290
uint8_t PIDweight[3]
Definition: anglerate.h:50
void anglerate_init(struct anglerate *self, struct instruments *ins, const struct config *config)
int32_t ITermAngle[2]
Definition: anglerate.h:69
uint8_t pidScale[3]
Definition: anglerate.h:70
void anglerate_enable_plimit(struct anglerate *self, bool on)
Definition: anglerate.c:303
float lastITermf[3]
Definition: anglerate.h:53
float ITermLimitf[3]
Definition: anglerate.h:53
#define DTERM_AVERAGE_COUNT
Definition: anglerate.h:43
int16_t body_angles[3]
Definition: anglerate.h:61
const struct pid_controller_output * anglerate_get_output_ptr(struct anglerate *self)
Definition: anglerate.c:295
int16_t body_rates[3]
Definition: anglerate.h:60
int16_t pitch
Definition: accelerometer.h:52
uint16_t max_angle_inclination
Definition: anglerate.h:79
void anglerate_set_level_percent(struct anglerate *self, uint8_t roll, uint8_t pitch)
Definition: anglerate.c:341
uint8_t z
set the acc deadband for z-Axis, this ignores small accelerations
Definition: accelerometer.h:52
float lastRateForDelta[3]
Definition: anglerate.h:65
pid_controller_type_t
Definition: anglerate.h:59
Definition: accelerometer.h:38
int16_t yaw
Definition: sensors.h:31
void anglerate_input_user(struct anglerate *self, int16_t roll, int16_t pitch, int16_t yaw)
Definition: anglerate.c:335
Definition: anglerate.h:38
int16_t scale
Definition: mixer.h:14
float axis_P[3]
Definition: anglerate.h:43
void anglerate_set_pid_axis_weight(struct anglerate *self, uint8_t axis, int32_t weight)
Definition: anglerate.c:318
bool _delta_state_set
Definition: anglerate.h:78
float axis_D[3]
Definition: anglerate.h:45
struct pid_controller_output output
Definition: anglerate.h:76
int32_t lastRateForDeltai[3]
Definition: anglerate.h:73
int32_t deltaStatei[3][DTERM_AVERAGE_COUNT]
Definition: anglerate.h:74
void anglerate_reset_angle_i(struct anglerate *self)
Definition: anglerate.c:285
void anglerate_input_body_rates(struct anglerate *self, int16_t x, int16_t y, int16_t z)
Definition: anglerate.c:323
uint8_t flags
Definition: anglerate.h:82
void anglerate_input_body_angles(struct anglerate *self, int16_t roll, int16_t pitch, int16_t yaw)
Definition: anglerate.c:329
int32_t lastITerm[3]
Definition: anglerate.h:52
const struct config * config
Definition: anglerate.h:85
Definition: instruments.h:11
Definition: anglerate.h:48
int16_t roll
Definition: accelerometer.h:51