mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Replaced use of power function
This commit is contained in:
parent
0b6ff0de10
commit
9e2fd0e51c
3 changed files with 4 additions and 4 deletions
|
@ -263,10 +263,10 @@ void pidController(const pidProfile_t *pidProfile, uint16_t max_angle_inclinatio
|
|||
dynC = c[axis];
|
||||
if (setpointRate[axis] > 0) {
|
||||
if ((setpointRate[axis] - previousSetpoint[axis]) < previousSetpoint[axis])
|
||||
dynC = dynC * powerf(rcInput[axis], 2) * relaxFactor[axis] + dynC * (1-relaxFactor[axis]);
|
||||
dynC = dynC * sq(rcInput[axis]) * relaxFactor[axis] + dynC * (1-relaxFactor[axis]);
|
||||
} else if (setpointRate[axis] < 0) {
|
||||
if ((setpointRate[axis] - previousSetpoint[axis]) > previousSetpoint[axis])
|
||||
dynC = dynC * powerf(rcInput[axis], 2) * relaxFactor[axis] + dynC * (1-relaxFactor[axis]);
|
||||
dynC = dynC * sq(rcInput[axis]) * relaxFactor[axis] + dynC * (1-relaxFactor[axis]);
|
||||
}
|
||||
}
|
||||
const float rD = dynC * setpointRate[axis] - PVRate; // cr - y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue