switch micro-optimizations
This commit is contained in:
parent
dc452ced00
commit
25cc445d7e
|
@ -641,7 +641,7 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an
|
|||
const float pidFeedForward =
|
||||
pidCoefficient[axis].Kd * dynCd * transition *
|
||||
(currentPidSetpoint - previousPidSetpoint[axis]) * tpaFactor / dT;
|
||||
if ((pidData[axis].P > 0) == (pidFeedForward > 0)) {
|
||||
if (pidData[axis].P * pidFeedForward > 0) {
|
||||
if (ABS(pidFeedForward) > ABS(pidData[axis].P)) {
|
||||
pidData[axis].P = 0;
|
||||
pidData[axis].D += pidFeedForward;
|
||||
|
|
Loading…
Reference in New Issue