diff --git a/locales/en/messages.json b/locales/en/messages.json index a0bf2d16..587737d5 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -3207,6 +3207,9 @@ "pidTuningItermRelaxTypeOptionSetpoint": { "message": "Setpoint" }, + "pidTuningItermRelaxCutoff": { + "message": "Cutoff:" + }, "pidTuningAbsoluteControlGain": { "message": "Absolute Control" }, diff --git a/src/css/tabs/pid_tuning.css b/src/css/tabs/pid_tuning.css index a689e4ba..037103e7 100644 --- a/src/css/tabs/pid_tuning.css +++ b/src/css/tabs/pid_tuning.css @@ -298,7 +298,8 @@ } .tab-pid_tuning table.compensation .suboption { - margin-left: 40px; + margin-left: 4%; + white-space: nowrap; } .tab-pid_tuning table.compensation .suboption select{ @@ -308,6 +309,12 @@ padding-left: 5px; } +.tab-pid_tuning table.compensation .suboption input{ + display: inline-block; + width: 45px; + padding-left: 5px; +} + .tab-pid_tuning .pidTuningFeatures td { padding: 5px; } @@ -515,7 +522,7 @@ } -.tab-pid_tuing .pid_titlebar td:first-child { +.tab-pid_tuning .pid_titlebar td:first-child { text-align: left; } diff --git a/src/js/fc.js b/src/js/fc.js index e7a3a320..02bc242c 100644 --- a/src/js/fc.js +++ b/src/js/fc.js @@ -400,6 +400,7 @@ var FC = { smartFeedforward: 0, itermRelax: 0, itermRelaxType: 0, + itermRelaxCutoff: 0, absoluteControlGain: 0, throttleBoost: 0, acroTrainerAngleLimit: 0, diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 921e0e38..56b52be1 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -1044,6 +1044,10 @@ MspHelper.prototype.process_data = function(dataHandler) { ADVANCED_TUNING.dMinAdvance = data.readU8(); ADVANCED_TUNING.useIntegratedYaw = data.readU8(); ADVANCED_TUNING.integratedYawRelax = data.readU8(); + + if(semver.gte(CONFIG.apiVersion, "1.42.0")) { + ADVANCED_TUNING.itermRelaxCutoff = data.readU8(); + } } } } @@ -1798,6 +1802,10 @@ MspHelper.prototype.crunch = function(code) { .push8(ADVANCED_TUNING.dMinAdvance) .push8(ADVANCED_TUNING.useIntegratedYaw) .push8(ADVANCED_TUNING.integratedYawRelax); + + if(semver.gte(CONFIG.apiVersion, "1.42.0")) { + buffer.push8(ADVANCED_TUNING.itermRelaxCutoff); + } } } } diff --git a/src/js/tabs/pid_tuning.js b/src/js/tabs/pid_tuning.js index 911d287b..7cf6e6ab 100644 --- a/src/js/tabs/pid_tuning.js +++ b/src/js/tabs/pid_tuning.js @@ -203,6 +203,7 @@ TABS.pid_tuning.initialize = function (callback) { itermRelaxCheck.prop('checked', ADVANCED_TUNING.itermRelax !== 0); $('select[id="itermrelaxAxes"]').val(ADVANCED_TUNING.itermRelax > 0 ? ADVANCED_TUNING.itermRelax : 1); $('select[id="itermrelaxType"]').val(ADVANCED_TUNING.itermRelaxType); + $('input[name="itermRelaxCutoff"]').val(ADVANCED_TUNING.itermRelaxCutoff); itermRelaxCheck.change(function() { var checked = $(this).is(':checked'); @@ -350,6 +351,9 @@ TABS.pid_tuning.initialize = function (callback) { if (semver.gte(CONFIG.apiVersion, "1.42.0")) { $('.smartfeedforward').hide(); + $('.itermRelaxCutoff').show(); + } else { + $('.itermRelaxCutoff').hide(); } $('input[id="useIntegratedYaw"]').change(function() { @@ -638,6 +642,7 @@ TABS.pid_tuning.initialize = function (callback) { ADVANCED_TUNING.itermRelax = $('input[id="itermrelax"]').is(':checked') ? $('select[id="itermrelaxAxes"]').val() : 0; ADVANCED_TUNING.itermRelaxType = $('input[id="itermrelax"]').is(':checked') ? $('select[id="itermrelaxType"]').val() : 0; + ADVANCED_TUNING.itermRelaxCutoff = parseInt($('input[name="itermRelaxCutoff"]').val()); ADVANCED_TUNING.absoluteControlGain = $('input[name="absoluteControlGain-number"]').val(); diff --git a/src/tabs/pid_tuning.html b/src/tabs/pid_tuning.html index ea8916ea..16e94cb6 100644 --- a/src/tabs/pid_tuning.html +++ b/src/tabs/pid_tuning.html @@ -488,6 +488,13 @@ + + + + +