1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

Merge pull request #2470 from Asizon/dyn_notch_count_bandwidth

This commit is contained in:
Michael Keller 2021-05-18 01:14:13 +12:00 committed by GitHub
commit c07529b6bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 63 additions and 6 deletions

View file

@ -1100,6 +1100,8 @@ MspHelper.prototype.process_data = function(dataHandler) {
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
FC.FILTER_CONFIG.dyn_lpf_curve_expo = data.readU8();
FC.FILTER_CONFIG.dyn_notch_count = data.readU8();
FC.FILTER_CONFIG.dyn_notch_bandwidth_hz = data.readU16();
}
}
}
@ -2071,7 +2073,9 @@ MspHelper.prototype.crunch = function(code) {
buffer.push16(FC.FILTER_CONFIG.dyn_notch_max_hz);
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
buffer.push8(FC.FILTER_CONFIG.dyn_lpf_curve_expo);
buffer.push8(FC.FILTER_CONFIG.dyn_lpf_curve_expo)
.push8(FC.FILTER_CONFIG.dyn_notch_count)
.push16(FC.FILTER_CONFIG.dyn_notch_bandwidth_hz);
}
}
break;

View file

@ -385,6 +385,8 @@ TABS.pid_tuning.initialize = function (callback) {
$('.pid_filter select[name="dynamicNotchRange"]').val(FC.FILTER_CONFIG.dyn_notch_range);
dynamicNotchWidthPercent_e.val(FC.FILTER_CONFIG.dyn_notch_width_percent);
dynamicNotchQ_e.val(FC.FILTER_CONFIG.dyn_notch_q);
$('.pid_filter input[name="dynamicNotchCount"]').val(FC.FILTER_CONFIG.dyn_notch_count);
$('.pid_filter input[name="dynamicNotchBandwidthHz"]').val(FC.FILTER_CONFIG.dyn_notch_bandwidth_hz);
$('.pid_filter input[name="dynamicNotchMinHz"]').val(FC.FILTER_CONFIG.dyn_notch_min_hz);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) {
$('.pid_filter input[name="dynamicNotchMinHz"]').attr("max","250");
@ -392,6 +394,14 @@ TABS.pid_tuning.initialize = function (callback) {
} else {
$('.dynamicNotchMaxHz').hide();
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('.dynamicNotchHelp').attr('title', i18n.getMessage('pidTuningMultiDynamicNotchFilterHelp'));
$('.dynamicNotchWidthPercent').hide();
$('.dynamicNotchQ').hide();
} else {
$('.dynamicNotchCount').hide();
$('.dynamicNotchBandwidthHz').hide();
}
$('.rpmFilter').toggle(FC.MOTOR_CONFIG.use_dshot_telemetry);
@ -991,6 +1001,8 @@ TABS.pid_tuning.initialize = function (callback) {
FC.FILTER_CONFIG.dyn_lpf_curve_expo = parseInt($('.pid_filter input[name="dtermLowpassDynExpo"]').val());
FC.ADVANCED_TUNING.vbat_sag_compensation = $('input[id="vbatSagCompensation"]').is(':checked') ? parseInt($('input[name="vbatSagValue"]').val()) : 0;
FC.ADVANCED_TUNING.thrustLinearization = $('input[id="thrustLinearization"]').is(':checked') ? parseInt($('input[name="thrustLinearValue"]').val()) : 0;
FC.FILTER_CONFIG.dyn_notch_count = parseInt($('.pid_filter input[name="dynamicNotchCount"]').val());
FC.FILTER_CONFIG.dyn_notch_bandwidth_hz = parseInt($('.pid_filter input[name="dynamicNotchBandwidthHz"]').val());
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {