diff --git a/src/main/fc/config.c b/src/main/fc/config.c index 0a82618daf..71b82eff1d 100755 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -627,7 +627,7 @@ void createDefaultConfig(master_t *config) config->boardAlignment.yawDegrees = 0; config->accelerometerConfig.acc_hardware = ACC_DEFAULT; // default/autodetect config->rcControlsConfig.yaw_control_direction = 1; - config->gyroConfig.gyroMovementCalibrationThreshold = 32; + config->gyroConfig.gyroMovementCalibrationThreshold = 48; // xxx_hardware: 0:default/autodetect, 1: disable config->compassConfig.mag_hardware = 1; diff --git a/src/main/sensors/gyro.c b/src/main/sensors/gyro.c index 9d0a488809..ad6afffbe7 100644 --- a/src/main/sensors/gyro.c +++ b/src/main/sensors/gyro.c @@ -79,6 +79,8 @@ static void *notchFilter1[3]; static filterApplyFnPtr notchFilter2ApplyFn; static void *notchFilter2[3]; +#define DEBUG_GYRO_CALIBRATION 3 + static const extiConfig_t *selectMPUIntExtiConfig(void) { #if defined(MPU_INT_EXTI) @@ -367,6 +369,9 @@ static void performGyroCalibration(uint8_t gyroMovementCalibrationThreshold) if (isOnFinalGyroCalibrationCycle()) { float dev = devStandardDeviation(&var[axis]); + + DEBUG_SET(DEBUG_GYRO, DEBUG_GYRO_CALIBRATION, lrintf(dev)); + // check deviation and startover in case the model was moved if (gyroMovementCalibrationThreshold && dev > gyroMovementCalibrationThreshold) { gyroSetCalibrationCycles();