diff --git a/locales/en/messages.json b/locales/en/messages.json index cda9f6f3..aa289e95 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -1256,7 +1256,7 @@ "message": "With this parameter, D Setpoint Weight can be reduced near the center of the sticks, which results in smoother end of flips and rolls.
The value represents a point of stick deflection: 0 - stick centered, 1 - full deflection. When the stick is above that point, Setpoint Weight is kept constant at its configured value. When the stick is positioned below that point, Setpoint Weight is reduced proportionally, reaching 0 at the stick center position.
Value of 1 gives maximum smoothing effect, while value of 0 keeps the Setpoint Weight fixed at its configured value over the whole stick range." }, "pidTuningDtermSetpointHelp": { - "message": "This parameter determines the stick accelerating effect within derivative component.
Value of 0 equals to old Measuemenent method where D only tracks gyro, while value of 1 equals to old Error method with equal gyro and stick tracking ratio.
Lower value equals to slower/smoother stick response, while higher value provides more stick acceleration response.
Note that RC interpolation is recommended to be enabled with higher values to prevent control kicks making noise." + "message": "This parameter determines the stick accelerating effect within derivative component.
Value of 0 equals to old Measuemenent method where D only tracks gyro, while value of 1.27 equals to old Error method with equal gyro and stick tracking ratio.
Lower value equals to slower/smoother stick response, while higher value provides more stick acceleration response.
Note that RC interpolation is recommended to be enabled with higher values to prevent control kicks making noise.
Since BF3.4.0 you can set value up to 20 by entering it manually in the number box or through the CLI." }, "pidTuningDtermSetpointTransitionWarning": { "message": "$t(warningTitle.message):<\/strong> The use of a D Setpoint transition greater than 0 and less than 0.1 is highly discouraged. Doing may lead instability and reduced stick responsiveness as the sticks cross the centre point.<\/span>" diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 3067f42c..d48f71ec 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -864,6 +864,9 @@ MspHelper.prototype.process_data = function(dataHandler) { ADVANCED_TUNING.itermThrottleThreshold = data.readU16(); ADVANCED_TUNING.itermAcceleratorGain = data.readU16(); } + if (semver.gte(CONFIG.apiVersion, "1.39.0")) { + ADVANCED_TUNING.dtermSetpointWeight = data.readU16(); + } } break; case MSPCodes.MSP_SENSOR_CONFIG: @@ -1479,7 +1482,7 @@ MspHelper.prototype.crunch = function(code) { .push8(ADVANCED_TUNING.deltaMethod) .push8(ADVANCED_TUNING.vbatPidCompensation) .push8(ADVANCED_TUNING.dtermSetpointTransition) - .push8(ADVANCED_TUNING.dtermSetpointWeight) + .push8(Math.min(ADVANCED_TUNING.dtermSetpointWeight, 254)) .push8(ADVANCED_TUNING.toleranceBand) .push8(ADVANCED_TUNING.toleranceBandReduction) .push8(ADVANCED_TUNING.itermThrottleGain) @@ -1493,6 +1496,9 @@ MspHelper.prototype.crunch = function(code) { buffer.push16(ADVANCED_TUNING.itermThrottleThreshold) .push16(ADVANCED_TUNING.itermAcceleratorGain); } + if (semver.gte(CONFIG.apiVersion, "1.39.0")) { + buffer.push16(ADVANCED_TUNING.dtermSetpointWeight); + } } // only supports 1 version pre bf 3.0 else { diff --git a/src/js/tabs/pid_tuning.js b/src/js/tabs/pid_tuning.js index 743040f3..a055d9f8 100755 --- a/src/js/tabs/pid_tuning.js +++ b/src/js/tabs/pid_tuning.js @@ -516,6 +516,10 @@ TABS.pid_tuning.initialize = function (callback) { $('.tab-pid_tuning .pidTuningFeatures').hide(); } + if (semver.lt(CONFIG.apiVersion, "1.39.0")) { + $('input[name="dtermSetpoint-number"]').attr('max', '2.54'); + } + // translate to user-selected language i18n.localizePage(); diff --git a/src/tabs/pid_tuning.html b/src/tabs/pid_tuning.html index 267aa287..6cd85bef 100755 --- a/src/tabs/pid_tuning.html +++ b/src/tabs/pid_tuning.html @@ -294,7 +294,7 @@ - +