From f24941feb7b794f70bd5aada1d5bc3941b6962a5 Mon Sep 17 00:00:00 2001 From: Andrey Mironov Date: Mon, 16 Apr 2018 16:45:25 +0300 Subject: [PATCH] Constrained D-term transition upper-bound (#5701) --- src/main/flight/pid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 82e26abb3c..81a28cdead 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -618,7 +618,7 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an // -----calculate D component if (axis != FD_YAW) { // no transition if relaxFactor == 0 - float transition = relaxFactor > 0 ? getRcDeflectionAbs(axis) * relaxFactor : 1; + float transition = relaxFactor > 0 ? MIN(1.f, getRcDeflectionAbs(axis) * relaxFactor) : 1; // Divide rate change by deltaT to get differential (ie dr/dt) const float delta = (