From 025ed36cc3f00418d7f9ef26efa6371a20c52a39 Mon Sep 17 00:00:00 2001 From: AJ Christensen Date: Fri, 26 Jan 2018 17:05:59 +1300 Subject: [PATCH] BetaFlight rates: re-add RF_RATE_INCREMENTAL multiplier * By my understanding, when rcRate ended up being larger than 2.0, it was affected by this additional multiplier in calculateSetpointRate, line 101 of the previous implementation --- src/main/fc/fc_rc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/fc/fc_rc.c b/src/main/fc/fc_rc.c index df91a84bc..dfe4df3fb 100644 --- a/src/main/fc/fc_rc.c +++ b/src/main/fc/fc_rc.c @@ -93,7 +93,10 @@ float applyBetaflightRates(const int axis, float rcCommandf, const float rcComma rcCommandf = rcCommandf * power3(rcCommandfAbs) * expof + rcCommandf * (1 - expof); } - const float rcRate = currentControlRateProfile->rcRates[axis] / 100.0f; + float rcRate = currentControlRateProfile->rcRates[axis] / 100.0f; + if (rcRate > 2.0f) { + rcRate += RC_RATE_INCREMENTAL * (rcRate - 2.0f); + } float angleRate = 200.0f * rcRate * rcCommandf; if (currentControlRateProfile->rates[axis]) { const float rcSuperfactor = 1.0f / (constrainf(1.0f - (rcCommandfAbs * (currentControlRateProfile->rates[axis] / 100.0f)), 0.01f, 1.00f));