Skip to content

Commit 662ff52

Browse files
authored
Auto merged - #2655 at Sat, 27 Nov 2021 09:17:08 GMT
RFC Dynamic Idle
2 parents 074c03f + 319bd85 commit 662ff52

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

locales/en/messages.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,9 @@
12901290
"configurationDigitalIdlePercent": {
12911291
"message": "Motor Idle Throttle Value [percent]"
12921292
},
1293+
"configurationDigitalIdlePercentDisabled": {
1294+
"message": "Motor Idle Throttle Value % is disabled because Dynamic Idle is enabled with value at {{dynamicIdle}}rpm in PID tuning tab"
1295+
},
12931296
"configurationDigitalIdlePercentHelp": {
12941297
"message": "The 'DShot idle' value is the percent of maximum throttle that is sent to the ESCs when the throttle at minimum stick position and the craft is armed. Increase it to gain more idle speed and avoid desyncs. Too high and the craft feels floaty."
12951298
},
@@ -4096,6 +4099,9 @@
40964099
"pidTuningIdleMinRpmHelp": {
40974100
"message": "Dynamic Idle improves control at low rpm and reduces risk of motor desyncs. It corrects problems caused by airflow speeding up or slowing down the props, improving PID authority, stability, motor braking and responsiveness. The Dynamic Idle rpm should be set to be about 20% below the rpm of your Dshot Idle value (see the $t(tabMotorTesting.message) tab). Usually there is no need to change your DShot idle value from defaults. For longer inverted hang time, DShot idle value and Minimum rpm should be lowered together.<br /><br />Visit <a href=\"https://github.com/betaflight/betaflight/wiki/Tuning-Dynamic-Idle\"target=\"_blank\" rel=\"noopener noreferrer\">this wiki entry</a> for more info."
40984101
},
4102+
"pidTuningIdleMinRpmDisabled": {
4103+
"message": "Dynamic Idle is disabled as Dshot Telemetry is disabled"
4104+
},
40994105
"pidTuningAcroTrainerAngleLimit": {
41004106
"message": "Acro Trainer Angle Limit"
41014107
},

src/js/tabs/motors.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ TABS.motors.initialize = function (callback) {
6161
}
6262

6363
MSP.promise(MSPCodes.MSP_STATUS)
64+
.then(() => MSP.promise(MSPCodes.MSP_PID_ADVANCED))
6465
.then(() => MSP.promise(MSPCodes.MSP_FEATURE_CONFIG))
6566
.then(() => MSP.promise(MSPCodes.MSP_MIXER_CONFIG))
6667
.then(() => FC.MOTOR_CONFIG.use_dshot_telemetry || FC.MOTOR_CONFIG.use_esc_sensor ? MSP.promise(MSPCodes.MSP_MOTOR_TELEMETRY) : true)
@@ -735,6 +736,16 @@ TABS.motors.initialize = function (callback) {
735736
divUnsyncedPWMFreq.toggle(protocolConfigured && !digitalProtocol);
736737

737738
$('div.digitalIdlePercent').toggle(protocolConfigured && digitalProtocol);
739+
740+
$('input[name="digitalIdlePercent"]').prop('disabled', protocolConfigured && digitalProtocol && FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry);
741+
742+
if (FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry) {
743+
const dynamicIdle = FC.ADVANCED_TUNING.idleMinRpm * 100;
744+
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercentDisabled', { dynamicIdle }));
745+
} else {
746+
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercent'));
747+
}
748+
738749
$('.escSensor').toggle(protocolConfigured && digitalProtocol);
739750

740751
$('div.checkboxDshotBidir').toggle(protocolConfigured && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42) && digitalProtocol);

src/js/tabs/pid_tuning.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,13 @@ TABS.pid_tuning.initialize = function (callback) {
454454
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) {
455455
$('.pid_tuning input[name="motorLimit"]').val(FC.ADVANCED_TUNING.motorOutputLimit);
456456
$('.pid_tuning input[name="cellCount"]').val(FC.ADVANCED_TUNING.autoProfileCellCount);
457-
$('input[name="idleMinRpm-number"]').val(FC.ADVANCED_TUNING.idleMinRpm);
457+
$('input[name="idleMinRpm-number"]').val(FC.ADVANCED_TUNING.idleMinRpm).prop('disabled', !FC.MOTOR_CONFIG.use_dshot_telemetry);
458+
459+
if (FC.MOTOR_CONFIG.use_dshot_telemetry) {
460+
$('span.pidTuningIdleMinRpmDisabled').text(i18n.getMessage('pidTuningIdleMinRpm'));
461+
} else {
462+
$('span.pidTuningIdleMinRpmDisabled').text(i18n.getMessage('pidTuningIdleMinRpmDisabled'));
463+
}
458464
} else {
459465
$('.motorOutputLimit').hide();
460466
$('.idleMinRpm').hide();

src/tabs/motors.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@
105105
<div class="numberspacer">
106106
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
107107
</div>
108-
<span i18n="configurationDigitalIdlePercent"></span>
108+
<span class="digitalIdlePercentDisabled"></span>
109+
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
109110
</label>
110-
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
111111
</div>
112112
<div class="number minthrottle">
113113
<label>

src/tabs/pid_tuning.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@
686686
<td colspan="2">
687687
<div>
688688
<label>
689-
<span i18n="pidTuningIdleMinRpm"></span>
689+
<span class="pidTuningIdleMinRpmDisabled"></span>
690690
</label>
691691
<div class="helpicon cf_tip" i18n_title="pidTuningIdleMinRpmHelp"></div>
692692
</div>

0 commit comments

Comments
 (0)