mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 09:45:37 +03:00
Fix late stabilisation with zerothrtottle stabilisation feature
This commit is contained in:
parent
474fb0aaa3
commit
58d310b208
1 changed files with 5 additions and 5 deletions
|
@ -485,7 +485,7 @@ void updateMagHold(void)
|
||||||
void processRx(void)
|
void processRx(void)
|
||||||
{
|
{
|
||||||
static bool armedBeeperOn = false;
|
static bool armedBeeperOn = false;
|
||||||
static bool wasAirmodeIsActivated;
|
static bool airmodeIsActivated;
|
||||||
|
|
||||||
calculateRxChannelsAndUpdateFailsafe(currentTime);
|
calculateRxChannelsAndUpdateFailsafe(currentTime);
|
||||||
|
|
||||||
|
@ -509,21 +509,21 @@ void processRx(void)
|
||||||
throttleStatus_e throttleStatus = calculateThrottleStatus(&masterConfig.rxConfig, masterConfig.flight3DConfig.deadband3d_throttle);
|
throttleStatus_e throttleStatus = calculateThrottleStatus(&masterConfig.rxConfig, masterConfig.flight3DConfig.deadband3d_throttle);
|
||||||
|
|
||||||
if (isAirmodeActive() && ARMING_FLAG(ARMED)) {
|
if (isAirmodeActive() && ARMING_FLAG(ARMED)) {
|
||||||
if (rcCommand[THROTTLE] >= masterConfig.rxConfig.airModeActivateThreshold) wasAirmodeIsActivated = true; // Prevent Iterm from being reset
|
if (rcCommand[THROTTLE] >= masterConfig.rxConfig.airModeActivateThreshold) airmodeIsActivated = true; // Prevent Iterm from being reset
|
||||||
} else {
|
} else {
|
||||||
wasAirmodeIsActivated = false;
|
airmodeIsActivated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In airmode Iterm should be prevented to grow when Low thottle and Roll + Pitch Centered.
|
/* In airmode Iterm should be prevented to grow when Low thottle and Roll + Pitch Centered.
|
||||||
This is needed to prevent Iterm winding on the ground, but keep full stabilisation on 0 throttle while in air */
|
This is needed to prevent Iterm winding on the ground, but keep full stabilisation on 0 throttle while in air */
|
||||||
if (throttleStatus == THROTTLE_LOW && !wasAirmodeIsActivated) {
|
if (throttleStatus == THROTTLE_LOW && !airmodeIsActivated) {
|
||||||
pidResetErrorGyroState();
|
pidResetErrorGyroState();
|
||||||
if (currentProfile->pidProfile.zeroThrottleStabilisation)
|
if (currentProfile->pidProfile.zeroThrottleStabilisation)
|
||||||
pidStabilisationState(PID_STABILISATION_ON);
|
pidStabilisationState(PID_STABILISATION_ON);
|
||||||
else
|
else
|
||||||
pidStabilisationState(PID_STABILISATION_OFF);
|
pidStabilisationState(PID_STABILISATION_OFF);
|
||||||
} else {
|
} else {
|
||||||
if (currentProfile->pidProfile.zeroThrottleStabilisation || wasAirmodeIsActivated) pidStabilisationState(PID_STABILISATION_ON);
|
pidStabilisationState(PID_STABILISATION_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When armed and motors aren't spinning, do beeps and then disarm
|
// When armed and motors aren't spinning, do beeps and then disarm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue