1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Smoother Iterm Ignore transition

This commit is contained in:
borisbstyle 2016-05-30 19:47:53 +02:00
parent 754982f480
commit 23b0e79eff
2 changed files with 3 additions and 4 deletions

View file

@ -106,8 +106,7 @@ uint16_t getDynamicKi(int axis, const pidProfile_t *pidProfile) {
resetRate = (axis == YAW) ? pidProfile->yawItermIgnoreRate : pidProfile->rollPitchItermIgnoreRate;
uint32_t dynamicFactor = (1 << 8) - constrain((ABS(gyroADC[axis]) << 6) / resetRate, 0, 1 << 8);
uint32_t dynamicFactor = ((resetRate << 16) / (resetRate + ABS(gyroADC[axis]))) >> 8;
dynamicKi = (pidProfile->I8[axis] * dynamicFactor) >> 8;
return dynamicKi;