1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-21 15:25:22 +03:00

Add Thrust Linearization

Adds Thrust Linearization to the PID Tuning tab.
This commit is contained in:
Hans Christian Olaussen 2020-10-11 21:21:40 +02:00
parent 14d98c4dea
commit 55c106be61
5 changed files with 41 additions and 1 deletions

View file

@ -483,9 +483,21 @@ TABS.pid_tuning.initialize = function (callback) {
const checked = $(this).is(':checked');
$('.vbatSagCompensation .suboption').toggle(checked);
}).change();
// Thrust Linearization
const thrustLinearizationCheck = $('input[id="thrustLinearization"]');
thrustLinearizationCheck.prop('checked', FC.ADVANCED_TUNING.thrustLinearization !== 0);
$('input[name="thrustLinearValue"]').val(FC.ADVANCED_TUNING.thrustLinearization > 0 ? FC.ADVANCED_TUNING.thrustLinearization : 20);
thrustLinearizationCheck.change(function() {
const checked = $(this).is(':checked');
$('.thrustLinearization .suboption').toggle(checked);
}).change();
} else {
$('.ffInterpolateSp').hide();
$('.vbatSagCompensation').hide();
$('.thrustLinearization').hide();
}
$('input[id="useIntegratedYaw"]').change(function() {
@ -955,6 +967,7 @@ TABS.pid_tuning.initialize = function (callback) {
FC.ADVANCED_TUNING.ff_boost = parseInt($('input[name="ffBoost"]').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;
}
}