1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Further AIR MODE enhancements // Motor stop overules AIR MODE low throttle

reset iterm for motor stop

fix luxfloat
This commit is contained in:
borisbstyle 2015-12-07 10:00:11 +01:00
parent b0d3db2456
commit 763ff23ede
3 changed files with 11 additions and 11 deletions

View file

@ -161,10 +161,6 @@ 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. ----------
@ -173,6 +169,10 @@ 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;