1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Constrained D-term transition upper-bound (#5701)

This commit is contained in:
Andrey Mironov 2018-04-16 16:45:25 +03:00 committed by GitHub
parent f53d79d13f
commit f24941feb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = (