1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 13:25:24 +03:00

Add Dynamic Notch Max Hz

Remove white spaces

Remove white space2

Revert and add suggested changes

Some cosmetic changes

MinHz Changes

Fix MinHz Max
This commit is contained in:
Asizon 2020-02-05 12:11:02 +01:00
parent 2925646d82
commit e3041286a3
5 changed files with 39 additions and 2 deletions

View file

@ -3433,6 +3433,9 @@
"pidTuningDynamicNotchMinHz": { "pidTuningDynamicNotchMinHz": {
"message": "Dynamic Notch Min Hz" "message": "Dynamic Notch Min Hz"
}, },
"pidTuningDynamicNotchMaxHz": {
"message": "Dynamic Notch Max Hz"
},
"pidTuningDynamicNotchRangeHelp": { "pidTuningDynamicNotchRangeHelp": {
"message": "The dynamic notch has three frequency ranges in which it can operate: LOW(80-330hz) for lower revving quads like 6+ inches, MEDIUM(140-550hz) for a normal 5 inch quad, HIGH(230-800hz) for very high revving 2.5-3 inch quads. AUTO option selects the range depending on the value of the Gyro Dynamic Lowpass 1 Filter's max cutoff frequency." "message": "The dynamic notch has three frequency ranges in which it can operate: LOW(80-330hz) for lower revving quads like 6+ inches, MEDIUM(140-550hz) for a normal 5 inch quad, HIGH(230-800hz) for very high revving 2.5-3 inch quads. AUTO option selects the range depending on the value of the Gyro Dynamic Lowpass 1 Filter's max cutoff frequency."
}, },
@ -3443,7 +3446,10 @@
"message": "Q factor adjust how narrow or wide the dynamic notch filters are. Higher value makes it narrower and more precise and lower value makes it wider and broader. Having a really low value will greatly increase filter delay." "message": "Q factor adjust how narrow or wide the dynamic notch filters are. Higher value makes it narrower and more precise and lower value makes it wider and broader. Having a really low value will greatly increase filter delay."
}, },
"pidTuningDynamicNotchMinHzHelp": { "pidTuningDynamicNotchMinHzHelp": {
"message": "Defines the lowest dynamic notch center frequency below which the dynamic notch will not go." "message": "Set this to the lowest incoming noise frequency that is needed to be controlled by the dynamic notch."
},
"pidTuningDynamicNotchMaxHzHelp": {
"message": "Set this to the highest incoming noise frequency that is needed to be controlled by the dynamic notch."
}, },
"pidTuningRpmFilterGroup": { "pidTuningRpmFilterGroup": {
"message": "Gyro RPM Filter", "message": "Gyro RPM Filter",

View file

@ -416,6 +416,7 @@ var FC = {
dyn_notch_width_percent: 0, dyn_notch_width_percent: 0,
dyn_notch_q: 0, dyn_notch_q: 0,
dyn_notch_min_hz: 0, dyn_notch_min_hz: 0,
dyn_notch_max_hz: 0,
gyro_rpm_notch_harmonics: 0, gyro_rpm_notch_harmonics: 0,
gyro_rpm_notch_min_hz: 0, gyro_rpm_notch_min_hz: 0,
}; };

View file

@ -1078,6 +1078,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
FILTER_CONFIG.gyro_rpm_notch_harmonics = data.readU8(); FILTER_CONFIG.gyro_rpm_notch_harmonics = data.readU8();
FILTER_CONFIG.gyro_rpm_notch_min_hz = data.readU8(); FILTER_CONFIG.gyro_rpm_notch_min_hz = data.readU8();
} }
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
FILTER_CONFIG.dyn_notch_max_hz = data.readU16();
}
} }
} }
} }
@ -2007,6 +2010,9 @@ MspHelper.prototype.crunch = function(code) {
.push8(FILTER_CONFIG.gyro_rpm_notch_harmonics) .push8(FILTER_CONFIG.gyro_rpm_notch_harmonics)
.push8(FILTER_CONFIG.gyro_rpm_notch_min_hz); .push8(FILTER_CONFIG.gyro_rpm_notch_min_hz);
} }
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
buffer.push16(FILTER_CONFIG.dyn_notch_max_hz);
}
} }
break; break;
case MSPCodes.MSP_SET_PID_ADVANCED: case MSPCodes.MSP_SET_PID_ADVANCED:

View file

@ -349,10 +349,17 @@ TABS.pid_tuning.initialize = function (callback) {
} else { } else {
$('.dynamicNotch').hide(); $('.dynamicNotch').hide();
} }
$('.dynamicNotchRange').toggle(semver.lt(CONFIG.apiVersion, "1.43.0"));
$('.pid_filter select[name="dynamicNotchRange"]').val(FILTER_CONFIG.dyn_notch_range); $('.pid_filter select[name="dynamicNotchRange"]').val(FILTER_CONFIG.dyn_notch_range);
$('.pid_filter input[name="dynamicNotchWidthPercent"]').val(FILTER_CONFIG.dyn_notch_width_percent); $('.pid_filter input[name="dynamicNotchWidthPercent"]').val(FILTER_CONFIG.dyn_notch_width_percent);
$('.pid_filter input[name="dynamicNotchQ"]').val(FILTER_CONFIG.dyn_notch_q); $('.pid_filter input[name="dynamicNotchQ"]').val(FILTER_CONFIG.dyn_notch_q);
$('.pid_filter input[name="dynamicNotchMinHz"]').val(FILTER_CONFIG.dyn_notch_min_hz); $('.pid_filter input[name="dynamicNotchMinHz"]').val(FILTER_CONFIG.dyn_notch_min_hz);
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
$('.pid_filter input[name="dynamicNotchMinHz"]').attr("max","250");
$('.pid_filter input[name="dynamicNotchMaxHz"]').val(FILTER_CONFIG.dyn_notch_max_hz);
} else {
$('.dynamicNotchMaxHz').hide();
}
$('.rpmFilter').toggle(MOTOR_CONFIG.use_dshot_telemetry); $('.rpmFilter').toggle(MOTOR_CONFIG.use_dshot_telemetry);
@ -753,6 +760,10 @@ TABS.pid_tuning.initialize = function (callback) {
FILTER_CONFIG.gyro_rpm_notch_harmonics = rpmFilterEnabled ? parseInt($('.pid_filter input[name="rpmFilterHarmonics"]').val()) : 0; FILTER_CONFIG.gyro_rpm_notch_harmonics = rpmFilterEnabled ? parseInt($('.pid_filter input[name="rpmFilterHarmonics"]').val()) : 0;
FILTER_CONFIG.gyro_rpm_notch_min_hz = parseInt($('.pid_filter input[name="rpmFilterMinHz"]').val()); FILTER_CONFIG.gyro_rpm_notch_min_hz = parseInt($('.pid_filter input[name="rpmFilterMinHz"]').val());
} }
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
FILTER_CONFIG.dyn_notch_max_hz = parseInt($('.pid_filter input[name="dynamicNotchMaxHz"]').val());
}
} }
function showAllPids() { function showAllPids() {

View file

@ -1123,7 +1123,7 @@
</div> </div>
</th> </th>
</tr> </tr>
<tr class="newFilter dynamicNotch"> <tr class="newFilter dynamicNotch dynamicNotchRange">
<td> <td>
<select name="dynamicNotchRange"> <select name="dynamicNotchRange">
<!-- Populated on execution --> <!-- Populated on execution -->
@ -1177,6 +1177,19 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr class="newFilter dynamicNotch dynamicNotchMaxHz">
<td>
<input type="number" name="dynamicNotchMaxHz" step="1" min="200" max="1000"/>
</td>
<td>
<div>
<label>
<span i18n="pidTuningDynamicNotchMaxHz"></span>
</label>
<div class="helpicon cf_tip" i18n_title="pidTuningDynamicNotchMaxHzHelp" />
</div>
</td>
</tr>
</table> </table>
</div> </div>