From dc452ced0041c1ebda216af676fa257b9346e503 Mon Sep 17 00:00:00 2001 From: Thorsten Laux Date: Thu, 24 May 2018 15:26:08 +0200 Subject: [PATCH] rename pid_ff --- src/main/flight/pid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 40e06a8498..5d2f6367bb 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -638,13 +638,13 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an pidData[axis].D = pidCoefficient[axis].Kd * delta * tpaFactor; - const float pid_ff = + const float pidFeedForward = pidCoefficient[axis].Kd * dynCd * transition * (currentPidSetpoint - previousPidSetpoint[axis]) * tpaFactor / dT; - if ((pidData[axis].P > 0) == (pid_ff > 0)) { - if (ABS(pid_ff) > ABS(pidData[axis].P)) { + if ((pidData[axis].P > 0) == (pidFeedForward > 0)) { + if (ABS(pidFeedForward) > ABS(pidData[axis].P)) { pidData[axis].P = 0; - pidData[axis].D += pid_ff; + pidData[axis].D += pidFeedForward; } }