1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

some small fixes to airspeed compensation in Stabilization

This commit is contained in:
Corvus Corax 2013-07-20 14:52:22 +02:00
parent 2ecbf4a846
commit 4f6c3c98e3

View File

@ -194,9 +194,9 @@ static void stabilizationTask(__attribute__((unused)) void *parameters)
#ifdef REVOLUTION
float speedScaleFactor;
// Scale PID coefficients based on current airspeed estimation - needed for fixed wing planes
if (settings.ScaleToAirspeed < 0.1f) {
AirspeedStateGet(&airspeedState);
if (settings.ScaleToAirspeed < 0.1f || airspeedState.CalibratedAirspeed<0.1f) {
// feature has been turned off
AirspeedStateGet(&airspeedState);
speedScaleFactor = 1.0f;
} else {
// scale the factor to be 1.0 at the specified airspeed (for example 10m/s) but scaled by 1/speed^2