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:
parent
aeaf1acf4d
commit
e1a8a80584
2 changed files with 11 additions and 10 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue