1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00

fixes for ff_boost

1.  Excludes yaw from ff_boost.
2.  Removes suppression for 3x greater up-steps in FF to reduce boost glitching around zero sticks
3.  Spike detection gets cleaner passband and tighter rejection above threshold; higher threshold is now possible with better suppression of large spikes.
This commit is contained in:
ctzsnooze 2019-09-10 19:08:20 +10:00
parent aeaf1acf4d
commit e1a8a80584
2 changed files with 11 additions and 10 deletions

View file

@ -66,15 +66,16 @@ FAST_CODE_NOINLINE float interpolatedSpApply(int axis, bool newRcFrame, ffInterp
const float ffBoostFactor = pidGetFfBoostFactor();
float clip = 1.0f;
float boostAmount = 0.0f;
if (ffBoostFactor != 0.0f) {
if (pidGetSpikeLimitInverse()) {
clip = 1 / (1 + fabsf(setpointAcceleration * pidGetSpikeLimitInverse()));
clip *= clip;
}
// prevent kick-back spike at max deflection
if (fabsf(rawSetpoint) < 0.95f * ffMaxRate[axis] || fabsf(setpointSpeed) > 3.0f * fabsf(prevSetpointSpeed[axis])) {
boostAmount = ffBoostFactor * setpointAcceleration;
if ((axis == FD_ROLL)||(axis == FD_PITCH)) {
if (ffBoostFactor != 0.0f) {
if (pidGetSpikeLimitInverse()) {
clip = 1 / (1 + (setpointAcceleration * setpointAcceleration * pidGetSpikeLimitInverse()));
clip *= clip;
}
// prevent kick-back spike at max deflection
if (fabsf(rawSetpoint) < 0.95f * ffMaxRate[axis]) {
boostAmount = ffBoostFactor * setpointAcceleration;
}
}
}
prevSetpointSpeed[axis] = setpointSpeed;

View file

@ -213,7 +213,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
.idle_pid_limit = 200,
.idle_max_increase = 150,
.ff_interpolate_sp = FF_INTERPOLATE_AVG,
.ff_spike_limit = 40,
.ff_spike_limit = 60,
.ff_max_rate_limit = 100,
.ff_boost = 15,
);