Skip to content

Commit 92948e2

Browse files
authored
Merge branch 'master' into rfc_filters
2 parents d57ce5f + 7e08f9f commit 92948e2

File tree

5 files changed

+59
-15
lines changed

5 files changed

+59
-15
lines changed

locales/en/messages.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,6 +1791,18 @@
17911791
"pidTuningDtermSetpointTransition": {
17921792
"message": "D Setpoint transition"
17931793
},
1794+
"pidTuningFeedforwardMaxRateLimit": {
1795+
"message": "Max Rate Limit"
1796+
},
1797+
"pidTuningFeedforwardMaxRateLimitHelp": {
1798+
"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."
1799+
},
1800+
"pidTuningFeedforwardJitter": {
1801+
"message": "Jitter Reduction"
1802+
},
1803+
"pidTuningFeedforwardJitterHelp": {
1804+
"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."
1805+
},
17941806
"pidTuningDtermSetpoint": {
17951807
"message": "D Setpoint Weight"
17961808
},
@@ -4061,7 +4073,7 @@
40614073
"message": "Absolute Control"
40624074
},
40634075
"pidTuningAbsoluteControlGainHelp": {
4064-
"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)."
4076+
"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)."
40654077
},
40664078
"pidTuningThrottleBoost": {
40674079
"message": "Throttle Boost"

src/css/tabs/pid_tuning.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,12 @@
821821
}
822822

823823
.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:first-child {
824-
width: 20%;
824+
width: 6%;
825+
text-align: right;
826+
border-right: none;
827+
}
828+
.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:nth-child(2) {
829+
width: 14%;
825830
border-right: none;
826831
}
827832

@@ -830,7 +835,7 @@
830835
border-right: none;
831836
}
832837

833-
.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:nth-child(2),
838+
.tab-pid_tuning .tuningPIDSliders .pid_titlebar th:nth-child(3),
834839
.tab-pid_tuning .tuningFilterSliders .pid_titlebar th:nth-child(2) {
835840
width: 30px;
836841
}
@@ -901,7 +906,7 @@
901906
}
902907

903908
.tab-pid_tuning .subtab-pid .cf_column {
904-
min-width: 472px;
909+
min-width: 600px;
905910
flex: 1;
906911
}
907912

src/js/msp/MSPHelper.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,8 @@ MspHelper.prototype.process_data = function(dataHandler) {
11781178
FC.ADVANCED_TUNING.feedforward_averaging = data.readU8();
11791179
FC.ADVANCED_TUNING.feedforward_smooth_factor = data.readU8();
11801180
FC.ADVANCED_TUNING.feedforward_boost = data.readU8();
1181+
FC.ADVANCED_TUNING.feedforward_max_rate_limit = data.readU8();
1182+
FC.ADVANCED_TUNING.feedforward_jitter_factor = data.readU8();
11811183
FC.ADVANCED_TUNING.vbat_sag_compensation = data.readU8();
11821184
FC.ADVANCED_TUNING.thrustLinearization = data.readU8();
11831185
}
@@ -2150,6 +2152,8 @@ MspHelper.prototype.crunch = function(code) {
21502152
buffer.push8(FC.ADVANCED_TUNING.feedforward_averaging)
21512153
.push8(FC.ADVANCED_TUNING.feedforward_smooth_factor)
21522154
.push8(FC.ADVANCED_TUNING.feedforward_boost)
2155+
.push8(FC.ADVANCED_TUNING.feedforward_max_rate_limit)
2156+
.push8(FC.ADVANCED_TUNING.feedforward_jitter_factor)
21532157
.push8(FC.ADVANCED_TUNING.vbat_sag_compensation)
21542158
.push8(FC.ADVANCED_TUNING.thrustLinearization);
21552159
}

src/js/tabs/pid_tuning.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ TABS.pid_tuning.initialize = function (callback) {
519519
$('select[id="feedforwardAveraging"]').val(FC.ADVANCED_TUNING.feedforward_averaging);
520520
$('input[name="feedforwardSmoothFactor"]').val(FC.ADVANCED_TUNING.feedforward_smooth_factor);
521521
$('input[name="feedforwardBoost"]').val(FC.ADVANCED_TUNING.feedforward_boost);
522+
$('input[name="feedforwardMaxRateLimit"]').val(FC.ADVANCED_TUNING.feedforward_max_rate_limit);
523+
$('input[name="feedforwardJitterFactor"]').val(FC.ADVANCED_TUNING.feedforward_jitter_factor);
522524

523525
// Vbat Sag Compensation
524526
const vbatSagCompensationCheck = $('input[id="vbatSagCompensation"]');
@@ -544,6 +546,8 @@ TABS.pid_tuning.initialize = function (callback) {
544546
} else {
545547
$('.vbatSagCompensation').hide();
546548
$('.thrustLinearization').hide();
549+
$('.feedforwardMaxRateLimit').hide();
550+
$('.feedforwardJitterFactor').hide();
547551

548552
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) {
549553
$('.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) {
13421346
FC.ADVANCED_TUNING.feedforward_averaging = $('select[id="feedforwardAveraging"]').val();
13431347
FC.ADVANCED_TUNING.feedforward_smooth_factor = parseInt($('input[name="feedforwardSmoothFactor"]').val());
13441348
FC.ADVANCED_TUNING.feedforward_boost = parseInt($('input[name="feedforwardBoost"]').val());
1349+
FC.FILTER_CONFIG.dyn_lpf_curve_expo = parseInt($('.pid_filter input[name="dtermLowpassDynExpo"]').val());
13451350
FC.ADVANCED_TUNING.vbat_sag_compensation = $('input[id="vbatSagCompensation"]').is(':checked') ? parseInt($('input[name="vbatSagValue"]').val()) : 0;
13461351
FC.ADVANCED_TUNING.thrustLinearization = $('input[id="thrustLinearization"]').is(':checked') ? parseInt($('input[name="thrustLinearValue"]').val()) : 0;
13471352
FC.FILTER_CONFIG.dyn_lpf_curve_expo = parseInt($('.pid_filter input[name="dtermLowpassExpo"]').val());

src/tabs/pid_tuning.html

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@
174174
<tr>
175175
<th scope="col">
176176
<div i18n="pidTuningSliderPidsMode" class="sm-min"></div>
177+
</th>
178+
<th scope="col">
177179
<select id="sliderPidsModeSelect" class="sliderMode">
178180
<option value="0" i18n="pidTuningOptionOff"></option>
179181
<option value="1" i18n="pidTuningOptionRP"></option>
@@ -603,12 +605,19 @@
603605
<div class="helpicon cf_tip" i18n_title="pidTuningFeedforwardGroupHelp"></div>
604606
<span i18n="pidTuningFeedforwardGroup"></span>
605607

606-
<span class="feedforwardTransition suboption">
607-
<input type="number" name="feedforwardTransition-number" step="0.01" min="0.00" max="1.00"/>
608+
<span class="feedforwardJitterFactor suboption">
609+
<input type="number" name="feedforwardJitterFactor" step="1" min="0" max="20"/>
608610
<label>
609-
<span i18n="pidTuningFeedforwardTransition"></span>
611+
<span i18n="pidTuningFeedforwardJitter"></span>
612+
</label>
613+
<div class="helpicon cf_tip" i18n_title="pidTuningFeedforwardJitterHelp"></div>
614+
</span>
615+
616+
<span class="feedforwardOption feedforwardSmoothFactor suboption">
617+
<input type="number" name="feedforwardSmoothFactor" step="1" min="0" max="75" />
618+
<label for="feedforwardSmoothFactor">
619+
<span i18n="pidTuningFeedforwardSmoothFactor"></span>
610620
</label>
611-
<div class="helpicon cf_tip" i18n_title="pidTuningFeedforwardTransitionHelp"></div>
612621
</span>
613622

614623
<span class="feedforwardOption feedforwardAveraging suboption">
@@ -623,19 +632,28 @@
623632
</label>
624633
</span>
625634

626-
<span class="feedforwardOption feedforwardSmoothFactor suboption">
627-
<input type="number" name="feedforwardSmoothFactor" step="1" min="0" max="75" />
628-
<label for="feedforwardSmoothFactor">
629-
<span i18n="pidTuningFeedforwardSmoothFactor"></span>
630-
</label>
631-
</span>
632-
633635
<span class="feedforwardOption feedforwardBoost suboption">
634636
<input type="number" name="feedforwardBoost" step="1" min="0" max="50" />
635637
<label for="feedforwardBoost">
636638
<span i18n="pidTuningFeedforwardBoost"></span>
637639
</label>
638640
</span>
641+
642+
<span class="feedforwardMaxRateLimit suboption">
643+
<input type="number" name="feedforwardMaxRateLimit" step="1" min="0" max="150"/>
644+
<label>
645+
<span i18n="pidTuningFeedforwardMaxRateLimit"></span>
646+
</label>
647+
<div class="helpicon cf_tip" i18n_title="pidTuningFeedforwardMaxRateLimitHelp"></div>
648+
</span>
649+
650+
<span class="feedforwardTransition suboption">
651+
<input type="number" name="feedforwardTransition-number" step="0.01" min="0.00" max="1.00"/>
652+
<label>
653+
<span i18n="pidTuningFeedforwardTransition"></span>
654+
</label>
655+
<div class="helpicon cf_tip" i18n_title="pidTuningFeedforwardTransitionHelp"></div>
656+
</span>
639657
</td>
640658
</tr>
641659

0 commit comments

Comments
 (0)