From fc997dd0d53d1b7d114d18059d57e136ca63515c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beat=20K=C3=BCng?= <beat-kueng@gmx.net>
Date: Thu, 25 Oct 2018 07:46:27 +0200
Subject: [PATCH] mc_att_control: reduce minimum required dt

2ms is not enough to run at 1kHz
---
 src/modules/mc_att_control/mc_att_control_main.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp
index 1b8d9ecef8..8877e4e2ab 100644
--- a/src/modules/mc_att_control/mc_att_control_main.cpp
+++ b/src/modules/mc_att_control/mc_att_control_main.cpp
@@ -703,9 +703,9 @@ MulticopterAttitudeControl::run()
 			float dt = (now - last_run) / 1e6f;
 			last_run = now;
 
-			/* guard against too small (< 2ms) and too large (> 20ms) dt's */
-			if (dt < 0.002f) {
-				dt = 0.002f;
+			/* guard against too small (< 0.2ms) and too large (> 20ms) dt's */
+			if (dt < 0.0002f) {
+				dt = 0.0002f;
 
 			} else if (dt > 0.02f) {
 				dt = 0.02f;
-- 
GitLab