mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
might work
improve remove const
This commit is contained in:
parent
acdccd5a16
commit
269fdd0a24
1 changed files with 7 additions and 3 deletions
|
@ -1454,11 +1454,15 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, timeUs_t currentTim
|
||||||
// -----calculate I component
|
// -----calculate I component
|
||||||
#ifdef USE_LAUNCH_CONTROL
|
#ifdef USE_LAUNCH_CONTROL
|
||||||
// if launch control is active override the iterm gains
|
// if launch control is active override the iterm gains
|
||||||
const float Ki = launchControlActive ? launchControlKi : pidCoefficient[axis].Ki;
|
float Ki = launchControlActive ? launchControlKi : pidCoefficient[axis].Ki;
|
||||||
#else
|
#else
|
||||||
const float Ki = pidCoefficient[axis].Ki;
|
float Ki = pidCoefficient[axis].Ki;
|
||||||
#endif
|
#endif
|
||||||
pidData[axis].I = constrainf(previousIterm + (Ki * dynCi + agGain) * itermErrorRate, -itermLimit, itermLimit);
|
// iterm_windup on yaw only
|
||||||
|
if (axis == FD_YAW) {
|
||||||
|
Ki *= dynCi;
|
||||||
|
}
|
||||||
|
pidData[axis].I = constrainf(previousIterm + (Ki + agGain) * itermErrorRate, -itermLimit, itermLimit);
|
||||||
|
|
||||||
// -----calculate pidSetpointDelta
|
// -----calculate pidSetpointDelta
|
||||||
float pidSetpointDelta = 0;
|
float pidSetpointDelta = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue