mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Merge pull request #537 from MJ666/Harakiri_PID_fix
Harakiri PID controller fix
This commit is contained in:
commit
0da270351a
1 changed files with 3 additions and 3 deletions
|
@ -557,7 +557,7 @@ rollAndPitchTrims_t *angleTrim, rxConfig_t *rxConfig)
|
||||||
PTermACC = error * (float)pidProfile->P8[PIDLEVEL] * 0.008f;
|
PTermACC = error * (float)pidProfile->P8[PIDLEVEL] * 0.008f;
|
||||||
float limitf = (float)pidProfile->D8[PIDLEVEL] * 5.0f;
|
float limitf = (float)pidProfile->D8[PIDLEVEL] * 5.0f;
|
||||||
PTermACC = constrain(PTermACC, -limitf, +limitf);
|
PTermACC = constrain(PTermACC, -limitf, +limitf);
|
||||||
errorAngleIf[axis] = constrain(errorAngleIf[axis] + error * ACCDeltaTimeINS, -30.0f, +30.0f);
|
errorAngleIf[axis] = constrainf(errorAngleIf[axis] + error * ACCDeltaTimeINS, -30.0f, +30.0f);
|
||||||
ITermACC = errorAngleIf[axis] * (float)pidProfile->I8[PIDLEVEL] * 0.08f;
|
ITermACC = errorAngleIf[axis] * (float)pidProfile->I8[PIDLEVEL] * 0.08f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue