1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

AIR MODE Optimalisations // Disable retarded arm

enable level modes
This commit is contained in:
borisbstyle 2015-12-06 23:22:54 +01:00
parent fe5ec022de
commit 400fe14e30
6 changed files with 14 additions and 15 deletions

View file

@ -161,6 +161,10 @@ static void pidLuxFloat(pidProfile_t *pidProfile, controlRateConfig_t *controlRa
}
}
if (IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
AngleRate = AngleRate * rpy_limiting;
}
gyroRate = gyroADC[axis] * gyro.scale; // gyro output scaled to dps
// --------low-level gyro-based PID. ----------
@ -169,10 +173,6 @@ static void pidLuxFloat(pidProfile_t *pidProfile, controlRateConfig_t *controlRa
// multiplication of rcCommand corresponds to changing the sticks scaling here
RateError = AngleRate - gyroRate;
if (IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
RateError = RateError * rpy_limiting;
}
// -----calculate P component
PTerm = RateError * pidProfile->P_f[axis] * PIDweight[axis] / 100;
@ -283,16 +283,16 @@ static void pidRewrite(pidProfile_t *pidProfile, controlRateConfig_t *controlRat
}
}
if (IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
AngleRateTmp = AngleRateTmp * rpy_limiting;
}
// --------low-level gyro-based PID. ----------
// Used in stand-alone mode for ACRO, controlled by higher level regulators in other modes
// -----calculate scaled error.AngleRates
// multiplication of rcCommand corresponds to changing the sticks scaling here
RateError = AngleRateTmp - (gyroADC[axis] / 4);
if (IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
RateError = RateError * rpy_limiting;
}
// -----calculate P component
PTerm = (RateError * pidProfile->P8[axis] * PIDweight[axis] / 100) >> 7;