From 036ef86a90990c0452710ac7b28817f9c50e7da5 Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Fri, 21 Feb 2020 11:45:03 +0100 Subject: [PATCH 1/2] Warning message for high rates sonar Move to variable sonar issues --- locales/en/messages.json | 3 +++ src/js/tabs/pid_tuning.js | 5 +++++ src/tabs/pid_tuning.html | 3 +++ 3 files changed, 11 insertions(+) diff --git a/locales/en/messages.json b/locales/en/messages.json index e460eff7..c6d5efd8 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -1746,6 +1746,9 @@ "message": "Is an additional pushing term (spring) based on stick input. FF helps the P-term push the craft for commanded stick moves.

The P-term pushes based on the difference between the commanded Setpoint (deg/sec) and the gyro reading of current rotational rate (deg/sec). FF pushes based on the commanded change of the sticks alone.

Higher values (gains) will result in a more sharp machine response to stick input.
Too high of values may result in some overshoot, increased motor heat, and motor saturation (where motors can not keep up with the desired rate of change).
Lower or zero (0) values will result in a slower and smoother response to stick inputs.", "description": "Feedforward Term helpicon message on PID table titlebar" }, + "pidTuningMaxRateWarning": { + "message": "Warning: very high rates can result in desyncs from rapid decelerations." + }, "pidTuningRcRate": { "message": "RC Rate" }, diff --git a/src/js/tabs/pid_tuning.js b/src/js/tabs/pid_tuning.js index d3da0be9..5f623d80 100644 --- a/src/js/tabs/pid_tuning.js +++ b/src/js/tabs/pid_tuning.js @@ -2100,6 +2100,11 @@ TABS.pid_tuning.updateRatesLabels = function() { {value: parseInt(maxAngularVelPitch), balloon: function() {drawBalloonLabel(stickContext, maxAngularVelPitch, curveWidth, rateScale * (maxAngularVel - parseInt(maxAngularVelPitch)), 'right', BALLOON_COLORS.pitch, balloonsDirty);}}, {value: parseInt(maxAngularVelYaw), balloon: function() {drawBalloonLabel(stickContext, maxAngularVelYaw, curveWidth, rateScale * (maxAngularVel - parseInt(maxAngularVelYaw)), 'right', BALLOON_COLORS.yaw, balloonsDirty);}} ]; + // show warning message if any axis angular velocity exceeds 1800d/s + const MAX_RATE_WARNING = 1800; + const warningRates = (parseInt(maxAngularVelRoll) > MAX_RATE_WARNING || parseInt(maxAngularVelPitch) > MAX_RATE_WARNING || parseInt(maxAngularVelYaw) > MAX_RATE_WARNING); + $('.maxRateWarning').toggle(warningRates); + // and sort them in descending order so the largest value is at the top always balloons.sort(function(a,b) {return (b.value - a.value)}); diff --git a/src/tabs/pid_tuning.html b/src/tabs/pid_tuning.html index aaf3b01f..4b524d81 100644 --- a/src/tabs/pid_tuning.html +++ b/src/tabs/pid_tuning.html @@ -608,6 +608,9 @@