1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Disable dynmaic idle if RPM filter is not enabled

The addition of previous checks of bidirectional DSHOT being enabled were not sufficient. Additionally RPM filter must also be active (harmonics > 0) for dynamic idle to determine the minimum motor RPM and function correctly.
This commit is contained in:
Bruce Luckcuck 2020-04-22 18:18:10 -04:00
parent bf9cc615c5
commit 5b3fd2d08f
2 changed files with 9 additions and 5 deletions

View file

@ -522,6 +522,14 @@ static void validateAndFixConfig(void)
&& motorConfig()->dev.useDshotTelemetry) {
motorConfigMutable()->dev.useDshotTelemetry = false;
}
#if defined(USE_DYN_IDLE)
if (!isRpmFilterEnabled()) {
for (unsigned i = 0; i < PID_PROFILE_COUNT; i++) {
pidProfilesMutable(i)->idle_min_rpm = 0;
}
}
#endif // USE_DYN_IDLE
#endif // USE_DSHOT_TELEMETRY
#endif // USE_DSHOT

View file

@ -355,11 +355,7 @@ void initEscEndpoints(void)
void mixerInitProfile(void)
{
#ifdef USE_DYN_IDLE
if (motorConfig()->dev.useDshotTelemetry) {
idleMinMotorRps = currentPidProfile->idle_min_rpm * 100.0f / 60.0f;
} else {
idleMinMotorRps = 0;
}
idleMaxIncrease = currentPidProfile->idle_max_increase * 0.001f;
idleP = currentPidProfile->idle_p * 0.0001f;
#endif