diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 3cd477c239..fddd7fb63c 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1056,13 +1056,14 @@ const clivalue_t valueTable[] = { { "transient_throttle_limit", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 30 }, PG_PID_PROFILE, offsetof(pidProfile_t, transient_throttle_limit) }, #endif +#ifdef USE_DYN_IDLE { "idle_hz", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_hz) }, { "idle_adjustment_speed", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 25, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_adjustment_speed) }, { "idle_throttle", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_throttle) }, { "idle_p", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 10, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_p) }, { "idle_pid_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 10, 255 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_pid_limit) }, { "idle_max_increase", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 255 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_max_increase) }, - +#endif // PG_TELEMETRY_CONFIG #ifdef USE_TELEMETRY diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 626e04617e..a2b4331483 100644 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -575,7 +575,7 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs) } } else { static float motorRangeMinIncrease = 0; -#ifdef USE_RPM_FILTER +#ifdef USE_DYN_IDLE if (currentPidProfile->idle_hz) { static float oldMinRpm; const float maxIncrease = isAirmodeActivated() ? currentPidProfile->idle_max_increase * 0.001f : 0.04f; @@ -848,7 +848,9 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa throttle = pidCompensateThrustLinearization(throttle); #endif +#ifdef USE_DYN_IDLE throttle += currentPidProfile->idle_throttle * 0.001f; +#endif #if defined(USE_THROTTLE_BOOST) if (throttleBoost > 0.0f) { diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index ae936e64f2..7b8905ba1a 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -55,6 +55,7 @@ #define USE_DSHOT_TELEMETRY #define USE_DSHOT_TELEMETRY_STATS #define USE_RPM_FILTER +#define USE_DYN_IDLE #define I2C3_OVERCLOCK true #define USE_GYRO_DATA_ANALYSE #define USE_ADC @@ -83,6 +84,7 @@ #define USE_DSHOT_TELEMETRY #define USE_DSHOT_TELEMETRY_STATS #define USE_RPM_FILTER +#define USE_DYN_IDLE #define I2C3_OVERCLOCK true #define I2C4_OVERCLOCK true #define USE_GYRO_DATA_ANALYSE