mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-22 07:45:29 +03:00
refactor Thrust Linear to initialise throttleCompensateAmount in pid_init.c
Maybe this could avoid recaculating throttleCompensateAmount every PID loop?
This commit is contained in:
parent
41fa8754bc
commit
9a65b766a2
3 changed files with 3 additions and 2 deletions
|
@ -375,6 +375,7 @@ void pidInitConfig(const pidProfile_t *pidProfile)
|
|||
|
||||
#ifdef USE_THRUST_LINEARIZATION
|
||||
pidRuntime.thrustLinearization = pidProfile->thrustLinearization / 100.0f;
|
||||
pidRuntime.throttleCompensateAmount = (1.0f - 0.5f * pidRuntime.thrustLinearization);
|
||||
#endif
|
||||
#if defined(USE_D_MIN)
|
||||
for (int axis = FD_ROLL; axis <= FD_YAW; ++axis) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue