mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 06:45:12 +03:00
Added selection of dterm lowpass filter type
This commit is contained in:
parent
667c4d5af3
commit
bc86e8bc18
5 changed files with 140 additions and 102 deletions
|
@ -1879,6 +1879,12 @@
|
||||||
"pidTuningFilterSettings": {
|
"pidTuningFilterSettings": {
|
||||||
"message": "Filter Settings"
|
"message": "Filter Settings"
|
||||||
},
|
},
|
||||||
|
"pidTuningDTermLowpassType": {
|
||||||
|
"message": "D-Term Lowpass Filter"
|
||||||
|
},
|
||||||
|
"pidTuningDTermLowpassTypeTip": {
|
||||||
|
"message": "Select D-Term lowpass filter type to use. Default is BIQUAD"
|
||||||
|
},
|
||||||
"pidTuningDTermLowpassFrequency": {
|
"pidTuningDTermLowpassFrequency": {
|
||||||
"message": "D Term Lowpass Frequency [Hz]"
|
"message": "D Term Lowpass Frequency [Hz]"
|
||||||
},
|
},
|
||||||
|
|
1
js/fc.js
1
js/fc.js
|
@ -313,6 +313,7 @@ var FC = {
|
||||||
dterm_notch_cutoff: 0,
|
dterm_notch_cutoff: 0,
|
||||||
gyro_soft_notch_hz_2: 0,
|
gyro_soft_notch_hz_2: 0,
|
||||||
gyro_soft_notch_cutoff_2: 0,
|
gyro_soft_notch_cutoff_2: 0,
|
||||||
|
dterm_filter_type: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_TUNING = {
|
ADVANCED_TUNING = {
|
||||||
|
|
|
@ -788,6 +788,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
FILTER_CONFIG.gyro_soft_notch_hz_2 = data.readU16();
|
FILTER_CONFIG.gyro_soft_notch_hz_2 = data.readU16();
|
||||||
FILTER_CONFIG.gyro_soft_notch_cutoff_2 = data.readU16();
|
FILTER_CONFIG.gyro_soft_notch_cutoff_2 = data.readU16();
|
||||||
}
|
}
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
FILTER_CONFIG.dterm_filter_type = data.readU8();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_PID_ADVANCED:
|
case MSPCodes.MSP_SET_PID_ADVANCED:
|
||||||
|
@ -1388,6 +1391,9 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
buffer.push16(FILTER_CONFIG.gyro_soft_notch_hz_2)
|
buffer.push16(FILTER_CONFIG.gyro_soft_notch_hz_2)
|
||||||
.push16(FILTER_CONFIG.gyro_soft_notch_cutoff_2)
|
.push16(FILTER_CONFIG.gyro_soft_notch_cutoff_2)
|
||||||
}
|
}
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
buffer.push8(FILTER_CONFIG.dterm_filter_type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_PID_ADVANCED:
|
case MSPCodes.MSP_SET_PID_ADVANCED:
|
||||||
|
|
|
@ -434,6 +434,21 @@
|
||||||
<p i18n="tuningHelp"></p>
|
<p i18n="tuningHelp"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="dtermfiltertype cf_column twothird">
|
||||||
|
<div class="profile single-field" style="width:200px; margin-bottom: 0px;">
|
||||||
|
<div class="helpicon cf_tip" i18n_title="pidTuningDTermLowpassTypeTip" style="margin-top: 5px;"></div>
|
||||||
|
<div class="head" i18n="pidTuningDTermLowpassType"></div>
|
||||||
|
<div class="bottomarea">
|
||||||
|
<select name="dtermFilterType">
|
||||||
|
<option value="0" class="PT1">PT1</option>
|
||||||
|
<option value="1" class="BIQUAD">BIQUAD</option>
|
||||||
|
<option value="2" class="FIR">FIR</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="cf_column twothird">
|
<div class="cf_column twothird">
|
||||||
<div class="gui_box grey topspacer pid_filter">
|
<div class="gui_box grey topspacer pid_filter">
|
||||||
<table class="pid_titlebar new_rates">
|
<table class="pid_titlebar new_rates">
|
||||||
|
|
|
@ -258,6 +258,12 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
} else {
|
} else {
|
||||||
$('.pid_sensitivity').hide();
|
$('.pid_sensitivity').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
$('.profile select[name="dtermFilterType"]').val(FILTER_CONFIG.dterm_filter_type);
|
||||||
|
} else {
|
||||||
|
$('.dtermfiltertype').hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_to_pid_and_rc() {
|
function form_to_pid_and_rc() {
|
||||||
|
@ -368,6 +374,10 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
ADVANCED_TUNING.levelAngleLimit = parseInt($('.pid_tuning input[name="angleLimit"]').val());
|
ADVANCED_TUNING.levelAngleLimit = parseInt($('.pid_tuning input[name="angleLimit"]').val());
|
||||||
ADVANCED_TUNING.levelSensitivity = parseInt($('.pid_tuning input[name="sensitivity"]').val());
|
ADVANCED_TUNING.levelSensitivity = parseInt($('.pid_tuning input[name="sensitivity"]').val());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
FILTER_CONFIG.dterm_filter_type = $('.profile select[name="dtermFilterType"]').val();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showAllPids() {
|
function showAllPids() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue