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

Adjust dmin limit logic

Previously dmin values would reset to 0 if the user decreased the D value below the current setting for dmin on a given axis. Now adjust the max for the dmin value to be D - 1 and set the dmin value to that. Prevents unexpected resets of dmin to 0 when adjusting the D gains.
This commit is contained in:
Bruce Luckcuck 2019-04-14 11:30:57 -04:00
parent 2c7d47bbdc
commit 00c55d7fb5

View file

@ -357,11 +357,12 @@ TABS.pid_tuning.initialize = function (callback) {
var dValue = parseInt(dElement.val()); var dValue = parseInt(dElement.val());
var dMinValue = parseInt(dMinElement.val()); var dMinValue = parseInt(dMinElement.val());
if (dMinValue >= dValue) { var dMinLimit = dValue > 0 ? dValue - 1 : 0;
dMinElement.val(0); if (dMinValue > dMinLimit) {
dMinElement.val(dMinLimit);
} }
dMinElement.attr("max", dValue > 0? dValue - 1 : 0); dMinElement.attr("max", dMinLimit);
} }
$('.pid_tuning .ROLL input[name="d"]').change(function() { $('.pid_tuning .ROLL input[name="d"]').change(function() {