diff --git a/locales/en/messages.json b/locales/en/messages.json index 49e6b6e8..03d1469b 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -3122,6 +3122,15 @@ "pidTuningAcroTrainerAngleLimitHelp": { "message": "Adds a new angle limiting mode for pilots who are learning to fly in acro mode. The range valid is 10-80 and must be activated with a switch in the $t(tabAuxiliary.message) tab." }, + "pidTuningIntegratedYaw": { + "message": "Integrated Yaw" + }, + "pidTuningIntegratedYawCaution": { + "message": "CAUTION: if you enable this feature, you must adjust the YAW PID accordingly. More info here" + }, + "pidTuningIntegratedYawHelp": { + "message": "Integrated Yaw is a feature which corrects a fundamental issue with quad control: while the pitch and roll axis are controlled by the thrust differentials the props generate yaw is different. Integrated Yaw fixes this by integrating the output of the yaw pid before applying them to the mixer. This normalizes the way the pids work. You can now tune as any other axis. It requires use of absolute control since no I is needed with Integrated Yaw." + }, "configHelp2": { "message": "Arbitrary board rotation in degrees, to allow mounting it sideways / upside down / rotated etc. When running external sensors, use the sensor alignments (Gyro, Acc, Mag) to define sensor position independent from board orientation. " diff --git a/src/js/tabs/pid_tuning.js b/src/js/tabs/pid_tuning.js index edb7efdd..4ed1a574 100644 --- a/src/js/tabs/pid_tuning.js +++ b/src/js/tabs/pid_tuning.js @@ -330,6 +330,8 @@ TABS.pid_tuning.initialize = function (callback) { $('.dminGroup input[name="dMinGain"]').val(ADVANCED_TUNING.dMinGain); $('.dminGroup input[name="dMinAdvance"]').val(ADVANCED_TUNING.dMinAdvance); + $('input[id="useIntegratedYaw"]').prop('checked', ADVANCED_TUNING.useIntegratedYaw !== 0); + } else { $('.throttle_limit').hide(); @@ -338,8 +340,15 @@ TABS.pid_tuning.initialize = function (callback) { $('.dtermLowpass2TypeGroup').hide(); $('.dminGroup').hide(); + + $('.integratedYaw').hide(); } + $('input[id="useIntegratedYaw"]').change(function() { + var checked = $(this).is(':checked'); + $('#pidTuningIntegratedYawCaution').toggle(checked); + }).change(); + function adjustDMin(dElement, dMinElement) { var dValue = parseInt(dElement.val()); var dMinValue = parseInt(dMinElement.val()); @@ -653,6 +662,7 @@ TABS.pid_tuning.initialize = function (callback) { ADVANCED_TUNING.dMinGain = parseInt($('.dminGroup input[name="dMinGain"]').val()); ADVANCED_TUNING.dMinAdvance = parseInt($('.dminGroup input[name="dMinAdvance"]').val()); + ADVANCED_TUNING.useIntegratedYaw = $('input[id="useIntegratedYaw"]').is(':checked') ? 1 : 0; } } diff --git a/src/tabs/pid_tuning.html b/src/tabs/pid_tuning.html index cb738610..909d2e68 100644 --- a/src/tabs/pid_tuning.html +++ b/src/tabs/pid_tuning.html @@ -492,6 +492,23 @@ + + + + + + + + + + +
+ + + +