mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 12:55:14 +03:00
Add Thrust Linearization
Adds Thrust Linearization to the PID Tuning tab.
This commit is contained in:
parent
14d98c4dea
commit
55c106be61
5 changed files with 41 additions and 1 deletions
|
@ -3707,6 +3707,15 @@
|
|||
"pidTuningVbatSagValue": {
|
||||
"message": "%"
|
||||
},
|
||||
"pidTuningThrustLinearization": {
|
||||
"message": "Thrust Linearization"
|
||||
},
|
||||
"pidTuningThrustLinearizationHelp": {
|
||||
"message": "Compensates for the non-linear relationship between throttle and thrust by applying an inverse motor curve to the motor output. The amount of compensation can be varied between 0 and 150%."
|
||||
},
|
||||
"pidTuningThrustLinearValue": {
|
||||
"message": "%"
|
||||
},
|
||||
"pidTuningItermRotation": {
|
||||
"message": "I Term Rotation"
|
||||
},
|
||||
|
|
|
@ -466,6 +466,7 @@ const FC = {
|
|||
ff_smooth_factor: 0,
|
||||
ff_boost: 0,
|
||||
vbat_sag_compensation: 0,
|
||||
thrustLinearization: 0,
|
||||
};
|
||||
this.ADVANCED_TUNING_ACTIVE = { ...this.ADVANCED_TUNING };
|
||||
|
||||
|
|
|
@ -1166,6 +1166,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
FC.ADVANCED_TUNING.ff_smooth_factor = data.readU8();
|
||||
FC.ADVANCED_TUNING.ff_boost = data.readU8();
|
||||
FC.ADVANCED_TUNING.vbat_sag_compensation = data.readU8();
|
||||
FC.ADVANCED_TUNING.thrustLinearization = data.readU8();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2112,7 +2113,8 @@ MspHelper.prototype.crunch = function(code) {
|
|||
buffer.push8(FC.ADVANCED_TUNING.ff_interpolate_sp)
|
||||
.push8(FC.ADVANCED_TUNING.ff_smooth_factor)
|
||||
.push8(FC.ADVANCED_TUNING.ff_boost)
|
||||
.push8(FC.ADVANCED_TUNING.vbat_sag_compensation);
|
||||
.push8(FC.ADVANCED_TUNING.vbat_sag_compensation)
|
||||
.push8(FC.ADVANCED_TUNING.thrustLinearization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -611,6 +611,21 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="thrustLinearization">
|
||||
<td><input type="checkbox" id="thrustLinearization" class="toggle" /></td>
|
||||
<td colspan="2">
|
||||
<span i18n="pidTuningThrustLinearization"></span>
|
||||
<div class="helpicon cf_tip" i18n_title="pidTuningThrustLinearizationHelp"></div>
|
||||
|
||||
<span class="thrustLinearValue suboption">
|
||||
<input type="number" name="thrustLinearValue" step="1" min="1" max="150" />
|
||||
<label for="thrustLinearValue">
|
||||
<span i18n="pidTuningThrustLinearValue"></span>
|
||||
</label>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="smartfeedforward">
|
||||
<td><input type="checkbox" id="smartfeedforward" class="toggle" /></td>
|
||||
<td colspan="2">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue