1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-22 15:55:48 +03:00

Soften the lower setpoint transition

This commit is contained in:
borisbstyle 2017-02-14 22:44:10 +01:00
parent ecc26428fb
commit a135e9cbb2
2 changed files with 2 additions and 2 deletions

View file

@ -174,7 +174,7 @@ static void resetPidProfile(pidProfile_t *pidProfile)
pidProfile->pidAtMinThrottle = PID_STABILISATION_ON;
pidProfile->levelAngleLimit = 55;
pidProfile->levelSensitivity = 55;
pidProfile->setpointRelaxRatio = 25;
pidProfile->setpointRelaxRatio = 20;
pidProfile->dtermSetpointWeight = 190;
pidProfile->yawRateAccelLimit = 10.0f;
pidProfile->rateAccelLimit = 0.0f;

View file

@ -271,7 +271,7 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an
} else {
float dynC = dtermSetpointWeight;
if (pidProfile->setpointRelaxRatio < 100) {
dynC *= MIN(getRcDeflectionAbs(axis) * relaxFactor, 1.0f);
dynC *= MIN(sq(getRcDeflectionAbs(axis)) * relaxFactor, 1.0f);
}
const float rD = dynC * currentPidSetpoint - gyroRate; // cr - y
// Divide rate change by dT to get differential (ie dr/dt)