mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Added validation checks for interpolation settings, made throttle boost conditional.
This commit is contained in:
parent
91013da2cc
commit
a373204d7a
5 changed files with 29 additions and 2 deletions
|
@ -294,7 +294,9 @@ void pidInitFilters(const pidProfile_t *pidProfile)
|
|||
pt1FilterInit(&ptermYawLowpass, pt1FilterGain(pidProfile->yaw_lowpass_hz, dT));
|
||||
}
|
||||
|
||||
#if defined(USE_THROTTLE_BOOST)
|
||||
pt1FilterInit(&throttleLpf, pt1FilterGain(pidProfile->throttle_boost_cutoff, dT));
|
||||
#endif
|
||||
#if defined(USE_ITERM_RELAX)
|
||||
if (itermRelax) {
|
||||
for (int i = 0; i < XYZ_AXIS_COUNT; i++) {
|
||||
|
@ -345,8 +347,10 @@ static FAST_RAM_ZERO_INIT float crashGyroThreshold;
|
|||
static FAST_RAM_ZERO_INIT float crashSetpointThreshold;
|
||||
static FAST_RAM_ZERO_INIT float crashLimitYaw;
|
||||
static FAST_RAM_ZERO_INIT float itermLimit;
|
||||
#if defined(USE_THROTTLE_BOOST)
|
||||
FAST_RAM_ZERO_INIT float throttleBoost;
|
||||
pt1Filter_t throttleLpf;
|
||||
#endif
|
||||
static FAST_RAM_ZERO_INIT bool itermRotation;
|
||||
|
||||
#if defined(USE_SMART_FEEDFORWARD)
|
||||
|
@ -411,7 +415,9 @@ void pidInitConfig(const pidProfile_t *pidProfile)
|
|||
crashSetpointThreshold = pidProfile->crash_setpoint_threshold;
|
||||
crashLimitYaw = pidProfile->crash_limit_yaw;
|
||||
itermLimit = pidProfile->itermLimit;
|
||||
#if defined(USE_THROTTLE_BOOST)
|
||||
throttleBoost = pidProfile->throttle_boost * 0.1f;
|
||||
#endif
|
||||
itermRotation = pidProfile->iterm_rotation;
|
||||
#if defined(USE_SMART_FEEDFORWARD)
|
||||
smartFeedforward = pidProfile->smart_feedforward;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue