mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
3D prevent negative arming // Reverse logic
This commit is contained in:
parent
801a385b6a
commit
a88fb685fa
1 changed files with 6 additions and 3 deletions
|
@ -785,6 +785,8 @@ void mixTable(void)
|
||||||
|
|
||||||
// Find min and max throttle based on condition. Use rcData for 3D to prevent loss of power due to min_check
|
// Find min and max throttle based on condition. Use rcData for 3D to prevent loss of power due to min_check
|
||||||
if (feature(FEATURE_3D)) {
|
if (feature(FEATURE_3D)) {
|
||||||
|
if (!ARMING_FLAG(ARMED)) throttlePrevious = rxConfig->midrc; // When disarmed set to mid_rc. It always results in positive direction after arming.
|
||||||
|
|
||||||
if ((rcData[THROTTLE] <= (rxConfig->midrc - flight3DConfig->deadband3d_throttle))) { // Out of band handling
|
if ((rcData[THROTTLE] <= (rxConfig->midrc - flight3DConfig->deadband3d_throttle))) { // Out of band handling
|
||||||
throttleMax = flight3DConfig->deadband3d_low;
|
throttleMax = flight3DConfig->deadband3d_low;
|
||||||
throttleMin = escAndServoConfig->minthrottle;
|
throttleMin = escAndServoConfig->minthrottle;
|
||||||
|
@ -818,6 +820,7 @@ void mixTable(void)
|
||||||
if ((mixReduction > (mixerConfig->airmode_saturation_limit / 100.0f)) && IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
|
if ((mixReduction > (mixerConfig->airmode_saturation_limit / 100.0f)) && IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
|
||||||
throttleMin = throttleMax = throttleMin + (throttleRange / 2);
|
throttleMin = throttleMax = throttleMin + (throttleRange / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
motorLimitReached = false;
|
motorLimitReached = false;
|
||||||
throttleMin = throttleMin + (rollPitchYawMixRange / 2);
|
throttleMin = throttleMin + (rollPitchYawMixRange / 2);
|
||||||
|
@ -832,10 +835,10 @@ void mixTable(void)
|
||||||
if (isFailsafeActive) {
|
if (isFailsafeActive) {
|
||||||
motor[i] = constrain(motor[i], escAndServoConfig->mincommand, escAndServoConfig->maxthrottle);
|
motor[i] = constrain(motor[i], escAndServoConfig->mincommand, escAndServoConfig->maxthrottle);
|
||||||
} else if (feature(FEATURE_3D)) {
|
} else if (feature(FEATURE_3D)) {
|
||||||
if (throttlePrevious >= (rxConfig->midrc + flight3DConfig->deadband3d_throttle)) {
|
if (throttlePrevious <= (rxConfig->midrc - flight3DConfig->deadband3d_throttle)) {
|
||||||
motor[i] = constrain(motor[i], flight3DConfig->deadband3d_high, escAndServoConfig->maxthrottle);
|
|
||||||
} else {
|
|
||||||
motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, flight3DConfig->deadband3d_low);
|
motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, flight3DConfig->deadband3d_low);
|
||||||
|
} else {
|
||||||
|
motor[i] = constrain(motor[i], flight3DConfig->deadband3d_high, escAndServoConfig->maxthrottle);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, escAndServoConfig->maxthrottle);
|
motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, escAndServoConfig->maxthrottle);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue