mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Disable Airmode fully when airmode not active // Adjust default setpoints / pids
This commit is contained in:
parent
42cbbbb681
commit
d8f03693f7
1 changed files with 8 additions and 4 deletions
|
@ -573,12 +573,16 @@ void mixTable(pidProfile_t *pidProfile)
|
||||||
for (int i = 0; i < motorCount; i++) {
|
for (int i = 0; i < motorCount; i++) {
|
||||||
motorMix[i] /= motorMixRange;
|
motorMix[i] /= motorMixRange;
|
||||||
}
|
}
|
||||||
// Get the maximum correction by setting offset to center
|
// Get the maximum correction by setting offset to center when airmode enabled
|
||||||
|
if (isAirmodeActive()) {
|
||||||
throttle = 0.5f;
|
throttle = 0.5f;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (isAirmodeActive()) { // Only automatically adjust throttle during airmode scenario
|
||||||
float throttleLimitOffset = motorMixRange / 2.0f;
|
float throttleLimitOffset = motorMixRange / 2.0f;
|
||||||
throttle = constrainf(throttle, 0.0f + throttleLimitOffset, 1.0f - throttleLimitOffset);
|
throttle = constrainf(throttle, 0.0f + throttleLimitOffset, 1.0f - throttleLimitOffset);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now add in the desired throttle, but keep in a range that doesn't clip adjusted
|
// Now add in the desired throttle, but keep in a range that doesn't clip adjusted
|
||||||
// roll/pitch/yaw. This could move throttle down, but also up for those low throttle flips.
|
// roll/pitch/yaw. This could move throttle down, but also up for those low throttle flips.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue