1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 22:35:17 +03:00

Merge pull request #1295 from mikeller/remove_32k_gyro_support

Removed support for 32 kHz gyro mode.
This commit is contained in:
Michael Keller 2019-02-14 19:51:03 +13:00 committed by GitHub
commit afc6524e56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 9 deletions

View file

@ -1210,6 +1210,9 @@
"configurationLoopTimeHelp": {
"message": "<strong>Note:</strong> Make sure your FC is able to operate at these speeds! Check CPU and cycletime stability. Changing this may require PID re-tuning. TIP: Disable Accelerometer and other sensors to gain more performance."
},
"configurationLoopTimeNo32KhzHelp": {
"message": "$t(configurationLoopTimeHelp.message)<br><strong>Note about 32 kHz gyro gyro sampling mode:</strong> Support for 32 kHz gyro gyro sampling mode was added to Betaflight as an experimental feature. In the years that it was available, it has never shown that it has any advantage over 8 kHz gyro sampling mode, due to its susceptibility to vibrations, and its high noise level which require aggressive filtering, causing delays in the control loop. For this reason, <strong>support for 32 kHz gyro sampling mode has been dropped</strong> in Betaflight 4.0."
},
"configurationGPS": {
"message": "GPS"
},

View file

@ -919,7 +919,10 @@ MspHelper.prototype.process_data = function(dataHandler) {
PID_ADVANCED_CONFIG.digitalIdlePercent = data.readU16() / 100;
if (semver.gte(CONFIG.apiVersion, "1.25.0")) {
PID_ADVANCED_CONFIG.gyroUse32kHz = data.readU8();
let gyroUse32kHz = data.readU8();
if (semver.lt(CONFIG.apiVersion, "1.41.0")) {
PID_ADVANCED_CONFIG.gyroUse32kHz = gyroUse32kHz;
}
}
}
break;
@ -941,12 +944,15 @@ MspHelper.prototype.process_data = function(dataHandler) {
}
if (semver.gte(CONFIG.apiVersion, "1.39.0")) {
FILTER_CONFIG.gyro_hardware_lpf = data.readU8();
FILTER_CONFIG.gyro_32khz_hardware_lpf = data.readU8();
let gyro_32khz_hardware_lpf = data.readU8();
FILTER_CONFIG.gyro_lowpass_hz = data.readU16();
FILTER_CONFIG.gyro_lowpass2_hz = data.readU16();
FILTER_CONFIG.gyro_lowpass_type = data.readU8();
FILTER_CONFIG.gyro_lowpass2_type = data.readU8();
FILTER_CONFIG.dterm_lowpass2_hz = data.readU16();
if (semver.lt(CONFIG.apiVersion, "1.41.0")) {
FILTER_CONFIG.gyro_32khz_hardware_lpf = data.readU8();
}
}
}
break;
@ -1630,7 +1636,11 @@ MspHelper.prototype.crunch = function(code) {
buffer.push16(PID_ADVANCED_CONFIG.digitalIdlePercent * 100);
if (semver.gte(CONFIG.apiVersion, "1.25.0")) {
buffer.push8(PID_ADVANCED_CONFIG.gyroUse32kHz);
let gyroUse32kHz = 0;
if (semver.lt(CONFIG.apiVersion, "1.41.0")) {
gyroUse32kHz = PID_ADVANCED_CONFIG.gyroUse32kHz;
}
buffer.push8(gyroUse32kHz);
}
}
break;
@ -1651,8 +1661,12 @@ MspHelper.prototype.crunch = function(code) {
buffer.push8(FILTER_CONFIG.dterm_lowpass_type);
}
if (semver.gte(CONFIG.apiVersion, "1.39.0")) {
let gyro_32khz_hardware_lpf = 0;
if (semver.lt(CONFIG.apiVersion, "1.41.0")) {
gyro_32khz_hardware_lpf = FILTER_CONFIG.gyro_32khz_hardware_lpf;
}
buffer.push8(FILTER_CONFIG.gyro_hardware_lpf)
.push8(FILTER_CONFIG.gyro_32khz_hardware_lpf)
.push8(gyro_32khz_hardware_lpf)
.push16(FILTER_CONFIG.gyro_lowpass_hz)
.push16(FILTER_CONFIG.gyro_lowpass2_hz)
.push8(FILTER_CONFIG.gyro_lowpass_type)

View file

@ -445,7 +445,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
gyro_select_e.change();
};
if (semver.gte(CONFIG.apiVersion, "1.25.0")) {
if (semver.gte(CONFIG.apiVersion, "1.25.0") && semver.lt(CONFIG.apiVersion, "1.41.0")) {
gyroUse32kHz_e.prop('checked', PID_ADVANCED_CONFIG.gyroUse32kHz !== 0);
gyroUse32kHz_e.change(function () {
@ -464,13 +464,20 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
updateGyroDenom(8);
}
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
$('.systemconfigNote').html(i18n.getMessage('configurationLoopTimeNo32KhzHelp'));
} else {
$('.systemconfigNote').html(i18n.getMessage('configurationLoopTimeHelp'));
}
gyro_select_e.val(PID_ADVANCED_CONFIG.gyro_sync_denom);
gyro_select_e.change(function () {
var originalPidDenom = pid_select_e.val();
var pidBaseFreq = 8;
if (semver.gte(CONFIG.apiVersion, "1.25.0") && gyroUse32kHz_e.is(':checked')) {
if (semver.gte(CONFIG.apiVersion, "1.25.0") && semver.lt(CONFIG.apiVersion, "1.41.0") && gyroUse32kHz_e.is(':checked')) {
pidBaseFreq = 32;
}
@ -1023,7 +1030,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
PID_ADVANCED_CONFIG.gyro_sync_denom = parseInt(gyro_select_e.val());
PID_ADVANCED_CONFIG.pid_process_denom = parseInt(pid_select_e.val());
PID_ADVANCED_CONFIG.digitalIdlePercent = parseFloat($('input[name="digitalIdlePercent"]').val());
if (semver.gte(CONFIG.apiVersion, "1.25.0")) {
if (semver.gte(CONFIG.apiVersion, "1.25.0") && semver.lt(CONFIG.apiVersion, "1.41.0")) {
PID_ADVANCED_CONFIG.gyroUse32kHz = $('input[id="gyroUse32kHz"]').is(':checked') ? 1 : 0;
}

View file

@ -209,7 +209,7 @@ TABS.onboard_logging.initialize = function (callback) {
var loggingRates = [];
var pidRateBase = 8000;
if (PID_ADVANCED_CONFIG.gyroUse32kHz !== 0) {
if (semver.gte(CONFIG.apiVersion, "1.25.0") && semver.lt(CONFIG.apiVersion, "1.41.0") && PID_ADVANCED_CONFIG.gyroUse32kHz !== 0) {
pidRateBase = 32000;
}

View file

@ -55,7 +55,7 @@
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationLoopTimeHelp"></p>
<p class="systemconfigNote" i18n="configurationLoopTimeHelp"></p>
</div>
</div>
<div class="select gyroUse32kHz">