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!"
41 #define INT32_RATIO_FRAC 12
50 int32_t phi_p[NUMBER_OF_GAINSETS] = PHI_P;
51 int32_t phi_d[NUMBER_OF_GAINSETS] = PHI_D;
52 int32_t phi_i[NUMBER_OF_GAINSETS] = PHI_I;
53 int32_t phi_dd[NUMBER_OF_GAINSETS] = PHI_DD;
55 int32_t theta_p[NUMBER_OF_GAINSETS] = THETA_P;
56 int32_t theta_d[NUMBER_OF_GAINSETS] = THETA_D;
57 int32_t theta_i[NUMBER_OF_GAINSETS] = THETA_I;
58 int32_t theta_dd[NUMBER_OF_GAINSETS] = THETA_DD;
60 int32_t psi_p[NUMBER_OF_GAINSETS] = PSI_P;
61 int32_t psi_d[NUMBER_OF_GAINSETS] = PSI_D;
62 int32_t psi_i[NUMBER_OF_GAINSETS] = PSI_I;
63 int32_t psi_dd[NUMBER_OF_GAINSETS] = PSI_DD;
65 for (
int i = 0;
i < NUMBER_OF_GAINSETS;
i++) {
68 {phi_p[
i], theta_p[
i], psi_p[
i] },
69 {phi_d[
i], theta_d[
i], psi_d[
i] },
70 {phi_dd[
i], theta_dd[
i], psi_dd[
i] },
71 {phi_i[
i], theta_i[
i], psi_i[
i] }
82 #if NUMBER_OF_GAINSETS > 1
88 if (section == NUMBER_OF_GAINSETS) {
break; }
98 }
else if (section == NUMBER_OF_GAINSETS) {
114 g1 = *(((int32_t *) ga) +
i);
116 g2 = *(((int32_t *) gb) +
i);
121 *(((int32_t *) gblend) +
i) = (int32_t) gbl;
void set_gainset(int gainset)
#define FLOAT_OF_BFP(_vbfp, _frac)
float scheduling_points[NUMBER_OF_GAINSETS]
void gain_scheduling_init(void)
Initialises periodic loop;.
#define SCHEDULING_VARIABLE_FRAC
#define BFP_OF_REAL(_vr, _frac)
void gain_scheduling_periodic(void)
Periodic function that interpolates between gain sets depending on the scheduling variable...
Module that interpolates between gain sets, depending on the scheduling variable. ...
struct Int32AttitudeGains stabilization_gains
struct Int32AttitudeGains gainlibrary[NUMBER_OF_GAINSETS]
Paparazzi fixed point algebra.