Merge pull request #1905 from Asizon/dynamicIdle

Dynamic Idle configurable
10.7.0-preview
Michael Keller 2020-03-06 08:23:12 +13:00 committed by GitHub
commit 94bd817aff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 6 deletions

View File

@ -3620,6 +3620,12 @@
"pidTuningThrottleBoostHelp": {
"message": "This feature allows throttle to be temporarily boosted on quick stick movements, which increases acceleration torque to the motors, providing a much faster throttle response."
},
"pidTuningIdleMinRpm": {
"message": "Dynamic Idle Value [rpm]"
},
"pidTuningIdleMinRpmHelp": {
"message": "Set this parameter to provide an rpm based floor-value as a safety net against motor desync.<br>A racer might prefer very good response and low rates - therefore a low idle_min_rpm and a high dshot_idle_value may be useful. Freestylers and LOS pilots will appreciate very low thrust at idle and might want to use less dshot_idle_value while using a bit more idle_min_rpm to avoid desyncs at high rates.<br><br>Visit this <a href=\"https://github.com/betaflight/betaflight/wiki/Tuning-Dynamic-Idle\"target=\"_blank\">wiki</a> entry for more info."
},
"pidTuningAcroTrainerAngleLimit": {
"message": "Acro Trainer Angle Limit"
},

View File

@ -460,6 +460,7 @@ var FC = {
integratedYawRelax: 0,
motorOutputLimit: 0,
autoProfileCellCount: 0,
idleMinRpm: 0,
};
ADVANCED_TUNING_ACTIVE = { ...ADVANCED_TUNING };

View File

@ -1146,6 +1146,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
if(semver.gte(CONFIG.apiVersion, "1.43.0")) {
ADVANCED_TUNING.motorOutputLimit = data.readU8();
ADVANCED_TUNING.autoProfileCellCount = data.readU8();
ADVANCED_TUNING.idleMinRpm = data.readU8();
}
}
}
@ -2079,7 +2080,8 @@ MspHelper.prototype.crunch = function(code) {
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
buffer.push8(ADVANCED_TUNING.motorOutputLimit)
.push8(ADVANCED_TUNING.autoProfileCellCount);
.push8(ADVANCED_TUNING.autoProfileCellCount)
.push8(ADVANCED_TUNING.idleMinRpm);
}
}
}

View File

@ -516,9 +516,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="motorPoles"]').val(MOTOR_CONFIG.motor_poles);
}
function hideMotorPoles() {
let motorPolesVisible = $("input[id='dshotBidir']").is(':checked') || $("input[name='ESC_SENSOR']").is(':checked');
$('div.motorPoles').toggle(motorPolesVisible);
function hideRpmFeatures() {
let rpmFeaturesVisible = $("input[id='dshotBidir']").is(':checked') || $("input[name='ESC_SENSOR']").is(':checked');
$('div.motorPoles').toggle(rpmFeaturesVisible);
}
$('#escProtocolTooltip').toggle(semver.lt(CONFIG.apiVersion, "1.42.0"));
@ -549,8 +549,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && digitalProtocol);
$('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
//trigger change dshotBidir and ESC_SENSOR to show/hide Motor Poles tab
$("input[id='dshotBidir']").change(hideMotorPoles).change();
$("input[name='ESC_SENSOR']").change(hideMotorPoles);
$("input[id='dshotBidir']").change(hideRpmFeatures).change();
$("input[name='ESC_SENSOR']").change(hideRpmFeatures);
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
$("input[id='unsyncedPWMSwitch']").change();

View File

@ -393,8 +393,10 @@ TABS.pid_tuning.initialize = function (callback) {
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
$('.pid_tuning input[name="motorLimit"]').val(ADVANCED_TUNING.motorOutputLimit);
$('.pid_tuning input[name="cellCount"]').val(ADVANCED_TUNING.autoProfileCellCount);
$('input[name="idleMinRpm-number"]').val(ADVANCED_TUNING.idleMinRpm);
} else {
$('.motorOutputLimit').hide();
$('.idleMinRpm').hide();
}
$('input[id="useIntegratedYaw"]').change(function() {
@ -776,6 +778,7 @@ TABS.pid_tuning.initialize = function (callback) {
FILTER_CONFIG.dyn_notch_max_hz = parseInt($('.pid_filter input[name="dynamicNotchMaxHz"]').val());
ADVANCED_TUNING.motorOutputLimit = parseInt($('.pid_tuning input[name="motorLimit"]').val());
ADVANCED_TUNING.autoProfileCellCount = parseInt($('.pid_tuning input[name="cellCount"]').val());
ADVANCED_TUNING.idleMinRpm = parseInt($('input[name="idleMinRpm-number"]').val());
}
}

View File

@ -499,6 +499,18 @@
</td>
</tr>
<tr class="idleMinRpm">
<td><input type="number" name="idleMinRpm-number" step="1" min="0" max="100"/></td>
<td colspan="1">
<div>
<label>
<span i18n="pidTuningIdleMinRpm"></span>
</label>
<div class="helpicon cf_tip" i18n_title="pidTuningIdleMinRpmHelp"></div>
</div>
</td>
</tr>
<tr class="absoluteControlGain">
<td><input type="number" name="absoluteControlGain-number" step="1" min="0" max="20"/></td>
<td colspan="1">