diff --git a/_locales/en/messages.json b/_locales/en/messages.json index a24f8b60..576d2baa 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1649,16 +1649,22 @@ "pidTuningGyroLowpassFrequencyHelp": { "message": "Gyro Soft Lowpass Frequency (Hz)" }, - "pidTuningGyroNotchFrequency": { - "message": "Gyro Notch Filter Frequency (Hz)" + "pidTuningGyroNotch1Frequency": { + "message": "Gyro Notch Filter 1 Frequency (Hz)" + }, + "pidTuningGyroNotch2Frequency": { + "message": "Gyro Notch Filter 2 Frequency (Hz)" }, "pidTuningGyroNotchFrequencyHelp": { "message": "Gyro Notch Filter Frequency in Hz (0 means disabled)" }, - "pidTuningGyroNotchCutoff": { - "message": "Gyro Notch Filter Cutoff Frequency (Hz)" - }, - "pidTuningGyroNotchCutoffHelp": { + "pidTuningGyroNotch1Cutoff": { + "message": "Gyro Notch Filter Cutoff 1 Frequency (Hz)" + }, + "pidTuningGyroNotch2Cutoff": { + "message": "Gyro Notch Filter Cutoff 2 Frequency (Hz)" + }, + "pidTuningGyroNotchCutoffHelp": { "message": "Gyro Notch Filter Cutoff Frequency in Hz (This is where notch filter starts. For example with notch filter 160 and notch hz of 260 it means the range is 160-360hz with most attenuation around center)" }, "pidTuningFilterSettings": { diff --git a/js/fc.js b/js/fc.js index bd237c23..6c533989 100644 --- a/js/fc.js +++ b/js/fc.js @@ -261,10 +261,12 @@ var FC = { gyro_soft_lpf_hz: 0, dterm_lpf_hz: 0, yaw_lpf_hz: 0, - gyro_soft_notch_hz: 0, - gyro_soft_notch_cutoff: 0, + gyro_soft_notch_hz_1: 0, + gyro_soft_notch_cutoff_1: 0, dterm_notch_hz: 0, - dterm_notch_cutoff: 0 + dterm_notch_cutoff: 0, + gyro_soft_notch_hz_2: 0, + gyro_soft_notch_cutoff_2: 0 }; ADVANCED_TUNING = { diff --git a/js/msp/MSPHelper.js b/js/msp/MSPHelper.js index 222c0f00..85e86cb9 100644 --- a/js/msp/MSPHelper.js +++ b/js/msp/MSPHelper.js @@ -591,13 +591,16 @@ MspHelper.prototype.process_data = function(dataHandler) { FILTER_CONFIG.dterm_lpf_hz = data.readU16(); FILTER_CONFIG.yaw_lpf_hz = data.readU16(); if (semver.gte(CONFIG.apiVersion, "1.20.0")) { - FILTER_CONFIG.gyro_soft_notch_hz = data.readU16(); - FILTER_CONFIG.gyro_soft_notch_cutoff = data.readU16(); + FILTER_CONFIG.gyro_soft_notch_hz_1 = data.readU16(); + FILTER_CONFIG.gyro_soft_notch_cutoff_1 = data.readU16(); FILTER_CONFIG.dterm_notch_hz = data.readU16(); FILTER_CONFIG.dterm_notch_cutoff = data.readU16(); + if (semver.gte(CONFIG.apiVersion, "1.21.0")) { + FILTER_CONFIG.gyro_soft_notch_hz_2 = data.readU16(); + FILTER_CONFIG.gyro_soft_notch_cutoff_2 = data.readU16(); + } } break; - case MSPCodes.MSP_SET_PID_ADVANCED: console.log("Advanced PID settings saved"); break; @@ -1124,10 +1127,14 @@ MspHelper.prototype.crunch = function(code) { .push16(FILTER_CONFIG.dterm_lpf_hz) .push16(FILTER_CONFIG.yaw_lpf_hz); if (semver.gte(CONFIG.apiVersion, "1.20.0")) { - buffer.push16(FILTER_CONFIG.gyro_soft_notch_hz) - .push16(FILTER_CONFIG.gyro_soft_notch_cutoff) + buffer.push16(FILTER_CONFIG.gyro_soft_notch_hz_1) + .push16(FILTER_CONFIG.gyro_soft_notch_cutoff_1) .push16(FILTER_CONFIG.dterm_notch_hz) .push16(FILTER_CONFIG.dterm_notch_cutoff); + if (semver.gte(CONFIG.apiVersion, "1.21.0")) { + buffer.push16(FILTER_CONFIG.gyro_soft_notch_hz_2) + .push16(FILTER_CONFIG.gyro_soft_notch_cutoff_2) + } } break; case MSPCodes.MSP_SET_PID_ADVANCED: diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index c9d34ba1..579e2110 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -444,12 +444,12 @@