1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00

simplify iterm calculation

This commit is contained in:
Nicola De Pasquale 2020-01-19 15:47:53 +01:00
parent 31d08f1515
commit dd81e49b75

View file

@ -1422,7 +1422,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, timeUs_t currentTim
#else #else
const float Ki = pidCoefficient[axis].Ki; const float Ki = pidCoefficient[axis].Ki;
#endif #endif
pidData[axis].I = constrainf(previousIterm + Ki * itermErrorRate * dynCi + agGain * itermErrorRate, -itermLimit, itermLimit); pidData[axis].I = constrainf(previousIterm + (Ki * dynCi + agGain) * itermErrorRate, -itermLimit, itermLimit);
// -----calculate pidSetpointDelta // -----calculate pidSetpointDelta
float pidSetpointDelta = 0; float pidSetpointDelta = 0;