From 1141cfa7c6bea43be9ec1efa53334662143f0073 Mon Sep 17 00:00:00 2001 From: bresch Date: Mon, 21 Sep 2020 14:04:41 +0200 Subject: [PATCH] ekf2_main: reduce update mag bias minimum learning time to 30s 120 seconds of learning time in 3D fusion mode was too long for most normal flights. The learned bias is usually really good after a shorter period and was not used to update the parameters. 30s seems to be a good compromise. --- src/modules/ekf2/EKF2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF2.cpp b/src/modules/ekf2/EKF2.cpp index 966162c9cd..8db7ea0a27 100644 --- a/src/modules/ekf2/EKF2.cpp +++ b/src/modules/ekf2/EKF2.cpp @@ -1131,7 +1131,7 @@ void EKF2::Run() } // Start checking mag bias estimates when we have accumulated sufficient calibration time - if (_total_cal_time_us > 120_s) { + if (_total_cal_time_us > 30_s) { // we have sufficient accumulated valid flight time to form a reliable bias estimate // check that the state variance for each axis is within a range indicating filter convergence const float max_var_allowed = 100.0f * _param_ekf2_magb_vref.get();