1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

better idle defaults and don't set idle_throttle if not enabled

This commit is contained in:
Thorsten Laux 2019-07-28 10:41:03 +02:00
parent e39d5e7000
commit bca9f8a587
4 changed files with 13 additions and 3 deletions

View file

@ -585,6 +585,12 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs)
const float pidSum = constrainf(currentPidProfile->idle_p * 0.0001f * error, -currentPidProfile->idle_pid_limit, currentPidProfile->idle_pid_limit);
motorRangeMinIncrease = constrainf(motorRangeMinIncrease + pidSum * dT, 0.0f, maxIncrease);
oldMinRpm = minRpm;
DEBUG_SET(DEBUG_DYN_IDLE, 0, motorRangeMinIncrease * 1000);
DEBUG_SET(DEBUG_DYN_IDLE, 1, targetRpmChangeRate);
DEBUG_SET(DEBUG_DYN_IDLE, 2, error);
DEBUG_SET(DEBUG_DYN_IDLE, 3, minRpm);
}
#endif
@ -849,7 +855,9 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
#endif
#ifdef USE_DYN_IDLE
throttle += currentPidProfile->idle_throttle * 0.001f;
if (currentPidProfile->idle_hz) {
throttle += currentPidProfile->idle_throttle * 0.001f;
}
#endif
#if defined(USE_THROTTLE_BOOST)