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

@ -184,8 +184,8 @@ static void resetPidProfile(pidProfile_t *pidProfile)
pidProfile->yaw_p_limit = YAW_P_LIMIT_MAX;
pidProfile->yaw_lpf_hz = 80;
pidProfile->rollPitchItermIgnoreRate = 900;
pidProfile->yawItermIgnoreRate = 35;
pidProfile->rollPitchItermIgnoreRate = 200;
pidProfile->yawItermIgnoreRate = 45;
pidProfile->dterm_lpf_hz = 110; // filtering ON by default
pidProfile->dynamic_pid = 1;

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;