1
0
Fork 0
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:
ctzsnooze 2020-07-07 15:11:17 +10:00
parent 41fa8754bc
commit 9a65b766a2
3 changed files with 3 additions and 2 deletions

View file

@ -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) {