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:
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();
|
const float ffBoostFactor = pidGetFfBoostFactor();
|
||||||
float clip = 1.0f;
|
float clip = 1.0f;
|
||||||
float boostAmount = 0.0f;
|
float boostAmount = 0.0f;
|
||||||
if (ffBoostFactor != 0.0f) {
|
if ((axis == FD_ROLL)||(axis == FD_PITCH)) {
|
||||||
if (pidGetSpikeLimitInverse()) {
|
if (ffBoostFactor != 0.0f) {
|
||||||
clip = 1 / (1 + fabsf(setpointAcceleration * pidGetSpikeLimitInverse()));
|
if (pidGetSpikeLimitInverse()) {
|
||||||
clip *= clip;
|
clip = 1 / (1 + (setpointAcceleration * setpointAcceleration * pidGetSpikeLimitInverse()));
|
||||||
}
|
clip *= clip;
|
||||||
|
}
|
||||||
// prevent kick-back spike at max deflection
|
// prevent kick-back spike at max deflection
|
||||||
if (fabsf(rawSetpoint) < 0.95f * ffMaxRate[axis] || fabsf(setpointSpeed) > 3.0f * fabsf(prevSetpointSpeed[axis])) {
|
if (fabsf(rawSetpoint) < 0.95f * ffMaxRate[axis]) {
|
||||||
boostAmount = ffBoostFactor * setpointAcceleration;
|
boostAmount = ffBoostFactor * setpointAcceleration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevSetpointSpeed[axis] = setpointSpeed;
|
prevSetpointSpeed[axis] = setpointSpeed;
|
||||||
|
|
|
@ -213,7 +213,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
.idle_pid_limit = 200,
|
.idle_pid_limit = 200,
|
||||||
.idle_max_increase = 150,
|
.idle_max_increase = 150,
|
||||||
.ff_interpolate_sp = FF_INTERPOLATE_AVG,
|
.ff_interpolate_sp = FF_INTERPOLATE_AVG,
|
||||||
.ff_spike_limit = 40,
|
.ff_spike_limit = 60,
|
||||||
.ff_max_rate_limit = 100,
|
.ff_max_rate_limit = 100,
|
||||||
.ff_boost = 15,
|
.ff_boost = 15,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue