mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Match rate limit for ptermSetpointRate
This commit is contained in:
parent
cab7b562d8
commit
cfa0d68679
1 changed files with 1 additions and 1 deletions
|
@ -202,7 +202,7 @@ void calculateSetpointRate(int axis, int16_t rc) {
|
|||
if (currentControlRateProfile->rates[axis]) {
|
||||
rcSuperfactor = 1.0f / (constrainf(1.0f - (ABS(rcCommandf) * (currentControlRateProfile->rates[axis] / 100.0f)), 0.01f, 1.00f));
|
||||
if (currentProfile->pidProfile.pidController == PID_CONTROLLER_BETAFLIGHT) {
|
||||
ptermSetpointRate[axis] = angleRate * rcSuperfactor;
|
||||
ptermSetpointRate[axis] = constrainf(angleRate * rcSuperfactor, -1998.0f, 1998.0f);
|
||||
if (currentProfile->pidProfile.ptermSRateWeight < 100 && axis != YAW) {
|
||||
const float pWeight = currentProfile->pidProfile.ptermSRateWeight / 100.0f;
|
||||
angleRate = angleRate + (pWeight * ptermSetpointRate[axis] - angleRate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue