mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
First attempt low throttle airmode oscillation fix
raise dc offset immediately Add airmode noise fix no filter when inactive and slightly more throttle hpf throttle to avoid large moves increasing throttle persistently fix ws fix ununsed variable and default to off include airmode throttle offset in loggingThrottle
This commit is contained in:
parent
966971c750
commit
e16ef1db4f
5 changed files with 66 additions and 0 deletions
|
@ -926,7 +926,13 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_AIRMODE_LPF
|
||||
const float unadjustedThrottle = throttle;
|
||||
throttle += pidGetAirmodeThrottleOffset();
|
||||
float airmodeThrottleChange = 0;
|
||||
#endif
|
||||
loggingThrottle = throttle;
|
||||
|
||||
motorMixRange = motorMixMax - motorMixMin;
|
||||
if (motorMixRange > 1.0f) {
|
||||
for (int i = 0; i < motorCount; i++) {
|
||||
|
@ -939,9 +945,16 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
|
|||
} else {
|
||||
if (airmodeEnabled || throttle > 0.5f) { // Only automatically adjust throttle when airmode enabled. Airmode logic is always active on high throttle
|
||||
throttle = constrainf(throttle, -motorMixMin, 1.0f - motorMixMax);
|
||||
#ifdef USE_AIRMODE_LPF
|
||||
airmodeThrottleChange = constrainf(unadjustedThrottle, -motorMixMin, 1.0f - motorMixMax) - unadjustedThrottle;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_AIRMODE_LPF
|
||||
pidUpdateAirmodeLpf(airmodeThrottleChange);
|
||||
#endif
|
||||
|
||||
if (featureIsEnabled(FEATURE_MOTOR_STOP)
|
||||
&& ARMING_FLAG(ARMED)
|
||||
&& !featureIsEnabled(FEATURE_3D)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue