Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,9 @@
"configurationDigitalIdlePercent": {
"message": "Motor Idle Throttle Value [percent]"
},
"configurationDigitalIdlePercentDisabled": {
"message": "Motor Idle Throttle Value % is disabled because Dynamic Idle is enabled with value at {{dynamicIdle}}rpm in PID tuning tab"
},
"configurationDigitalIdlePercentHelp": {
"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."
},
Expand Down Expand Up @@ -4017,6 +4020,9 @@
"pidTuningIdleMinRpmHelp": {
"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."
},
"pidTuningIdleMinRpmDisabled": {
"message": "Dynamic Idle is disabled as Dshot Telemetry is disabled"
},
"pidTuningAcroTrainerAngleLimit": {
"message": "Acro Trainer Angle Limit"
},
Expand Down
11 changes: 11 additions & 0 deletions src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TABS.motors.initialize = function (callback) {
}

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

$('div.digitalIdlePercent').toggle(protocolConfigured && digitalProtocol);

$('input[name="digitalIdlePercent"]').prop('disabled', protocolConfigured && digitalProtocol && FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry);

if (FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry) {
const dynamicIdle = FC.ADVANCED_TUNING.idleMinRpm * 100;
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercentDisabled', { dynamicIdle }));
} else {
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercent'));
}

$('.escSensor').toggle(protocolConfigured && digitalProtocol);

$('div.checkboxDshotBidir').toggle(protocolConfigured && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42) && digitalProtocol);
Expand Down
8 changes: 7 additions & 1 deletion src/js/tabs/pid_tuning.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,13 @@ TABS.pid_tuning.initialize = function (callback) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) {
$('.pid_tuning input[name="motorLimit"]').val(FC.ADVANCED_TUNING.motorOutputLimit);
$('.pid_tuning input[name="cellCount"]').val(FC.ADVANCED_TUNING.autoProfileCellCount);
$('input[name="idleMinRpm-number"]').val(FC.ADVANCED_TUNING.idleMinRpm);
$('input[name="idleMinRpm-number"]').val(FC.ADVANCED_TUNING.idleMinRpm).prop('disabled', !FC.MOTOR_CONFIG.use_dshot_telemetry);

if (FC.MOTOR_CONFIG.use_dshot_telemetry) {
$('span.pidTuningIdleMinRpmDisabled').text(i18n.getMessage('pidTuningIdleMinRpm'));
} else {
$('span.pidTuningIdleMinRpmDisabled').text(i18n.getMessage('pidTuningIdleMinRpmDisabled'));
}
} else {
$('.motorOutputLimit').hide();
$('.idleMinRpm').hide();
Expand Down
4 changes: 2 additions & 2 deletions src/tabs/motors.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@
<div class="numberspacer">
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
</div>
<span i18n="configurationDigitalIdlePercent"></span>
<span class="digitalIdlePercentDisabled"></span>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
</label>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
</div>
<div class="number minthrottle">
<label>
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/pid_tuning.html
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@
<td colspan="2">
<div>
<label>
<span i18n="pidTuningIdleMinRpm"></span>
<span class="pidTuningIdleMinRpmDisabled"></span>
</label>
<div class="helpicon cf_tip" i18n_title="pidTuningIdleMinRpmHelp"></div>
</div>
Expand Down