diff --git a/locales/en/messages.json b/locales/en/messages.json index 7ad438cf..fe914fd2 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -1791,6 +1791,18 @@ "pidTuningDtermSetpointTransition": { "message": "D Setpoint transition" }, + "pidTuningFeedforwardMaxRateLimit": { + "message": "Max Rate Limit" + }, + "pidTuningFeedforwardMaxRateLimitHelp": { + "message": "Attenuates feedforward towards zero as the sticks move quickly towards maximum deflection (maximum set turn rate), eg at the start of a quick flip or roll, to minimise overshoot. Does nothing at the end of a flip or roll. Lower values make the attenuation start earlier. Usually this value does not require modification. The highest value consistent with acceptable overshoot at the start of rolls or flips is best." + }, + "pidTuningFeedforwardJitter": { + "message": "Jitter Reduction" + }, + "pidTuningFeedforwardJitterHelp": { + "message": "Jitter reduction reduces Feedforward when the sticks move slowly. This allows smooth, jitter-free flight when making smooth slow arcs, yet provides full feedforward without any delay when the sticks are moved quickly. A higher threshold value (10-12) is more useful for cinematic or HD freestyle purposes, and a slightly lower value (5) better for racing or higher speed RC links." + }, "pidTuningDtermSetpoint": { "message": "D Setpoint Weight" }, @@ -4061,7 +4073,7 @@ "message": "Absolute Control" }, "pidTuningAbsoluteControlGainHelp": { - "message": "This feature solves some underlying problems of $t(pidTuningItermRotation.message) and should hopefully replace it at some point. This feature accumulates the absolute gyro error in quad coordinates and mixes a proportional correction into the setpoint. For it to work you need to enable AirMode and $t(pidTuningItermRelax.message) (for $t(pidTuningItermRelaxAxesOptionRP.message)). If you combine this feature with $t(pidTuningIntegratedYaw.message), you can set $t(pidTuningItermRelax.message) enabled for $t(pidTuningItermRelaxAxesOptionRPY.message)." + "message": "This feature solves some underlying problems of $t(pidTuningItermRotation.message) and should hopefully replace it at some point. This feature accumulates the absolute gyro error in quad coordinates and mixes a proportional correction into the setpoint. For it to work you need to enable AirMode and $t(pidTuningItermRelax.message) (for $t(pidTuningOptionRP.message)). If you combine this feature with $t(pidTuningIntegratedYaw.message), you can set $t(pidTuningItermRelax.message) enabled for $t(pidTuningOptionRPY.message)." }, "pidTuningThrottleBoost": { "message": "Throttle Boost" diff --git a/src/css/tabs/pid_tuning.css b/src/css/tabs/pid_tuning.css index 344801fa..1fc7627c 100644 --- a/src/css/tabs/pid_tuning.css +++ b/src/css/tabs/pid_tuning.css @@ -821,7 +821,12 @@ } .tab-pid_tuning .tuningPIDSliders .pid_titlebar th:first-child { - width: 20%; + width: 6%; + text-align: right; + border-right: none; +} +.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:nth-child(2) { + width: 14%; border-right: none; } @@ -830,7 +835,7 @@ border-right: none; } -.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:nth-child(2), +.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:nth-child(3), .tab-pid_tuning .tuningFilterSliders .pid_titlebar th:nth-child(2) { width: 30px; } @@ -901,7 +906,7 @@ } .tab-pid_tuning .subtab-pid .cf_column { - min-width: 472px; + min-width: 600px; flex: 1; } diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index ba3f50a4..d8310968 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -1178,6 +1178,8 @@ MspHelper.prototype.process_data = function(dataHandler) { FC.ADVANCED_TUNING.feedforward_averaging = data.readU8(); FC.ADVANCED_TUNING.feedforward_smooth_factor = data.readU8(); FC.ADVANCED_TUNING.feedforward_boost = data.readU8(); + FC.ADVANCED_TUNING.feedforward_max_rate_limit = data.readU8(); + FC.ADVANCED_TUNING.feedforward_jitter_factor = data.readU8(); FC.ADVANCED_TUNING.vbat_sag_compensation = data.readU8(); FC.ADVANCED_TUNING.thrustLinearization = data.readU8(); } @@ -2150,6 +2152,8 @@ MspHelper.prototype.crunch = function(code) { buffer.push8(FC.ADVANCED_TUNING.feedforward_averaging) .push8(FC.ADVANCED_TUNING.feedforward_smooth_factor) .push8(FC.ADVANCED_TUNING.feedforward_boost) + .push8(FC.ADVANCED_TUNING.feedforward_max_rate_limit) + .push8(FC.ADVANCED_TUNING.feedforward_jitter_factor) .push8(FC.ADVANCED_TUNING.vbat_sag_compensation) .push8(FC.ADVANCED_TUNING.thrustLinearization); } diff --git a/src/js/tabs/pid_tuning.js b/src/js/tabs/pid_tuning.js index 61213024..025a4c6f 100644 --- a/src/js/tabs/pid_tuning.js +++ b/src/js/tabs/pid_tuning.js @@ -519,6 +519,8 @@ TABS.pid_tuning.initialize = function (callback) { $('select[id="feedforwardAveraging"]').val(FC.ADVANCED_TUNING.feedforward_averaging); $('input[name="feedforwardSmoothFactor"]').val(FC.ADVANCED_TUNING.feedforward_smooth_factor); $('input[name="feedforwardBoost"]').val(FC.ADVANCED_TUNING.feedforward_boost); + $('input[name="feedforwardMaxRateLimit"]').val(FC.ADVANCED_TUNING.feedforward_max_rate_limit); + $('input[name="feedforwardJitterFactor"]').val(FC.ADVANCED_TUNING.feedforward_jitter_factor); // Vbat Sag Compensation const vbatSagCompensationCheck = $('input[id="vbatSagCompensation"]'); @@ -544,6 +546,8 @@ TABS.pid_tuning.initialize = function (callback) { } else { $('.vbatSagCompensation').hide(); $('.thrustLinearization').hide(); + $('.feedforwardMaxRateLimit').hide(); + $('.feedforwardJitterFactor').hide(); if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) { $('.pid_tuning .ROLL input[name="f"]').val(FC.ADVANCED_TUNING.feedforwardRoll > 0 ? FC.ADVANCED_TUNING.feedforwardRoll : PID_DEFAULT[4]); @@ -1342,6 +1346,7 @@ TABS.pid_tuning.initialize = function (callback) { FC.ADVANCED_TUNING.feedforward_averaging = $('select[id="feedforwardAveraging"]').val(); FC.ADVANCED_TUNING.feedforward_smooth_factor = parseInt($('input[name="feedforwardSmoothFactor"]').val()); FC.ADVANCED_TUNING.feedforward_boost = parseInt($('input[name="feedforwardBoost"]').val()); + FC.FILTER_CONFIG.dyn_lpf_curve_expo = parseInt($('.pid_filter input[name="dtermLowpassDynExpo"]').val()); FC.ADVANCED_TUNING.vbat_sag_compensation = $('input[id="vbatSagCompensation"]').is(':checked') ? parseInt($('input[name="vbatSagValue"]').val()) : 0; FC.ADVANCED_TUNING.thrustLinearization = $('input[id="thrustLinearization"]').is(':checked') ? parseInt($('input[name="thrustLinearValue"]').val()) : 0; FC.FILTER_CONFIG.dyn_lpf_curve_expo = parseInt($('.pid_filter input[name="dtermLowpassExpo"]').val()); diff --git a/src/tabs/pid_tuning.html b/src/tabs/pid_tuning.html index 46580675..e11f2bec 100644 --- a/src/tabs/pid_tuning.html +++ b/src/tabs/pid_tuning.html @@ -174,6 +174,8 @@