32 #include "physical_constants.h"
35 #include "vbarsettings.h"
42 static float bound(
float val,
float range);
46 float gyro_gain = 1.0f;
59 if (settings->VbarGyroSuppress > 0.0f) {
60 gyro_gain = (1.0f - fabsf(command) * settings->VbarGyroSuppress / 100.0f);
61 gyro_gain = (gyro_gain < 0.0f) ? 0.0
f : gyro_gain;
68 *output = command * settings->VbarSensitivity[axis] +
81 float cy = cosf(z_gyro * DEG2RAD * dT);
82 float sy = sinf(z_gyro * DEG2RAD * dT);
85 float vbar_roll = sy * vbar_integral[1] + cy * vbar_integral[0];
87 vbar_integral[1] = vbar_pitch;
88 vbar_integral[0] = vbar_roll;
96 static float bound(
float val,
float range)
100 }
else if(val > range) {
int stabilization_virtual_flybar(float gyro, float command, float *output, float dT, bool reinit, uint32_t axis, struct pid *pid, VbarSettingsData *settings)
static float bound(float val, float range)
Private methods.
static volatile FlightStatsSettingsData settings
static float vbar_integral[MAX_AXES]
Private variables.
int stabilization_virtual_flybar_pirocomp(float z_gyro, float dT)
Attitude stabilization module.
Includes PiOS and core architecture components.
float pid_apply_setpoint(struct pid *pid, struct pid_deadband *deadband, const float setpoint, const float measured)