32 #ifndef NUMBER_OF_GAINSETS
33 #error You must define the number of gainsets to use this module!
36 #ifndef SCHEDULING_VARIABLE_FRAC
37 #define SCHEDULING_VARIABLE_FRAC 0
38 #pragma message "SCHEDULING_VARIABLE_FRAC not specified!"
53 #define INT32_RATIO_FRAC 12
62 int32_t phi_p[NUMBER_OF_GAINSETS] = PHI_P;
63 int32_t phi_d[NUMBER_OF_GAINSETS] = PHI_D;
64 int32_t phi_i[NUMBER_OF_GAINSETS] = PHI_I;
65 int32_t phi_dd[NUMBER_OF_GAINSETS] = PHI_DD;
68 int32_t theta_p[NUMBER_OF_GAINSETS] = THETA_P;
69 int32_t theta_d[NUMBER_OF_GAINSETS] = THETA_D;
70 int32_t theta_i[NUMBER_OF_GAINSETS] = THETA_I;
71 int32_t theta_dd[NUMBER_OF_GAINSETS] = THETA_DD;
74 int32_t psi_p[NUMBER_OF_GAINSETS] = PSI_P;
75 int32_t psi_d[NUMBER_OF_GAINSETS] = PSI_D;
76 int32_t psi_i[NUMBER_OF_GAINSETS] = PSI_I;
77 int32_t psi_dd[NUMBER_OF_GAINSETS] = PSI_DD;
80 for (
int i = 0;
i < NUMBER_OF_GAINSETS;
i++) {
83 {phi_p[
i], theta_p[
i], psi_p[
i] },
84 {phi_d[
i], theta_d[
i], psi_d[
i] },
85 {phi_dd[
i], theta_dd[
i], psi_dd[
i] },
86 {phi_i[
i], theta_i[
i], psi_i[
i] },
87 {phi_ffd[
i], theta_ffd[
i], psi_ffd[
i] }
98 #if NUMBER_OF_GAINSETS > 1
104 if (section == NUMBER_OF_GAINSETS) {
break; }
114 }
else if (section == NUMBER_OF_GAINSETS) {
#define SCHEDULING_VARIABLE_FRAC
float scheduling_points[NUMBER_OF_GAINSETS]
void gain_scheduling_periodic(void)
Periodic function that interpolates between gain sets depending on the scheduling variable.
struct Int32AttitudeGains gainlibrary[NUMBER_OF_GAINSETS]
void set_gainset(int gainset)
void gain_scheduling_init(void)
Initialises periodic loop;.
Module that interpolates between gain sets, depending on the scheduling variable.
#define FLOAT_OF_BFP(_vbfp, _frac)
#define BFP_OF_REAL(_vr, _frac)
Paparazzi fixed point algebra.
Generic interface for radio control modules.
struct Int32AttitudeGains stabilization_gains
float g1[INDI_OUTPUTS][INDI_NUM_ACT]
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.