1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +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;