mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 21:35:33 +03:00
Remove VBat PID Compensation
Some api version check fixes Remove blanck line More api version fixes Remove extra parentesix Removing more parentexis Rebase fixing
This commit is contained in:
parent
c59f49d160
commit
d2ef89b6a3
3 changed files with 117 additions and 121 deletions
|
@ -1095,6 +1095,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
FC.ADVANCED_TUNING_ACTIVE = { ...FC.ADVANCED_TUNING };
|
FC.ADVANCED_TUNING_ACTIVE = { ...FC.ADVANCED_TUNING };
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_PID_ADVANCED:
|
case MSPCodes.MSP_PID_ADVANCED:
|
||||||
|
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
|
||||||
FC.ADVANCED_TUNING.rollPitchItermIgnoreRate = data.readU16();
|
FC.ADVANCED_TUNING.rollPitchItermIgnoreRate = data.readU16();
|
||||||
FC.ADVANCED_TUNING.yawItermIgnoreRate = data.readU16();
|
FC.ADVANCED_TUNING.yawItermIgnoreRate = data.readU16();
|
||||||
FC.ADVANCED_TUNING.yaw_p_limit = data.readU16();
|
FC.ADVANCED_TUNING.yaw_p_limit = data.readU16();
|
||||||
|
@ -1167,6 +1168,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FC.ADVANCED_TUNING_ACTIVE = { ...FC.ADVANCED_TUNING };
|
FC.ADVANCED_TUNING_ACTIVE = { ...FC.ADVANCED_TUNING };
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SENSOR_CONFIG:
|
case MSPCodes.MSP_SENSOR_CONFIG:
|
||||||
|
@ -2035,19 +2037,19 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_PID_ADVANCED:
|
case MSPCodes.MSP_SET_PID_ADVANCED:
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
|
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
|
||||||
buffer.push16(FC.ADVANCED_TUNING.rollPitchItermIgnoreRate)
|
buffer.push16(FC.ADVANCED_TUNING.rollPitchItermIgnoreRate)
|
||||||
.push16(FC.ADVANCED_TUNING.yawItermIgnoreRate)
|
.push16(FC.ADVANCED_TUNING.yawItermIgnoreRate)
|
||||||
.push16(FC.ADVANCED_TUNING.yaw_p_limit)
|
.push16(FC.ADVANCED_TUNING.yaw_p_limit)
|
||||||
.push8(FC.ADVANCED_TUNING.deltaMethod)
|
.push8(FC.ADVANCED_TUNING.deltaMethod)
|
||||||
.push8(FC.ADVANCED_TUNING.vbatPidCompensation);
|
.push8(FC.ADVANCED_TUNING.vbatPidCompensation);
|
||||||
|
|
||||||
|
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, "1.40.0")) {
|
if (semver.gte(FC.CONFIG.apiVersion, "1.40.0")) {
|
||||||
buffer.push8(FC.ADVANCED_TUNING.feedforwardTransition);
|
buffer.push8(FC.ADVANCED_TUNING.feedforwardTransition);
|
||||||
} else {
|
} else {
|
||||||
buffer.push8(FC.ADVANCED_TUNING.dtermSetpointTransition);
|
buffer.push8(FC.ADVANCED_TUNING.dtermSetpointTransition);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.push8(Math.min(FC.ADVANCED_TUNING.dtermSetpointWeight, 254))
|
buffer.push8(Math.min(FC.ADVANCED_TUNING.dtermSetpointWeight, 254))
|
||||||
.push8(FC.ADVANCED_TUNING.toleranceBand)
|
.push8(FC.ADVANCED_TUNING.toleranceBand)
|
||||||
.push8(FC.ADVANCED_TUNING.toleranceBandReduction)
|
.push8(FC.ADVANCED_TUNING.toleranceBandReduction)
|
||||||
|
@ -2110,13 +2112,6 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// only supports 1 version pre bf 3.0
|
|
||||||
else {
|
|
||||||
buffer.push16(FC.ADVANCED_TUNING.rollPitchItermIgnoreRate)
|
|
||||||
.push16(FC.ADVANCED_TUNING.yawItermIgnoreRate)
|
|
||||||
.push16(FC.ADVANCED_TUNING.yaw_p_limit)
|
|
||||||
.push8(FC.ADVANCED_TUNING.deltaMethod)
|
|
||||||
.push8(FC.ADVANCED_TUNING.vbatPidCompensation);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_SENSOR_CONFIG:
|
case MSPCodes.MSP_SET_SENSOR_CONFIG:
|
||||||
|
|
|
@ -64,6 +64,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
$('#content').load("./tabs/pid_tuning.html", process_html);
|
$('#content').load("./tabs/pid_tuning.html", process_html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const vbatpidcompensationIsUsed = semver.gte(FC.CONFIG.apiVersion, "1.16.0") && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44);
|
||||||
|
|
||||||
function pid_and_rc_to_form() {
|
function pid_and_rc_to_form() {
|
||||||
self.setProfile();
|
self.setProfile();
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
|
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
|
||||||
|
@ -106,9 +108,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
$('.pid_tuning input[name="rc_expo"]').attr("rowspan", "3");
|
$('.pid_tuning input[name="rc_expo"]').attr("rowspan", "3");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
|
$('.vbatpidcompensation').toggle(vbatpidcompensationIsUsed);
|
||||||
$('input[id="vbatpidcompensation"]').prop('checked', FC.ADVANCED_TUNING.vbatPidCompensation !== 0);
|
$('input[id="vbatpidcompensation"]').prop('checked', FC.ADVANCED_TUNING.vbatPidCompensation !== 0);
|
||||||
}
|
|
||||||
|
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
|
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
|
||||||
$('#pid-tuning .delta select').val(FC.ADVANCED_TUNING.deltaMethod);
|
$('#pid-tuning .delta select').val(FC.ADVANCED_TUNING.deltaMethod);
|
||||||
|
@ -822,7 +823,7 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
FC.FILTER_CONFIG.dterm_lowpass_hz = parseInt($('.pid_filter input[name="dtermLowpassFrequency"]').val());
|
FC.FILTER_CONFIG.dterm_lowpass_hz = parseInt($('.pid_filter input[name="dtermLowpassFrequency"]').val());
|
||||||
FC.FILTER_CONFIG.yaw_lowpass_hz = parseInt($('.pid_filter input[name="yawLowpassFrequency"]').val());
|
FC.FILTER_CONFIG.yaw_lowpass_hz = parseInt($('.pid_filter input[name="yawLowpassFrequency"]').val());
|
||||||
|
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
|
if (vbatpidcompensationIsUsed) {
|
||||||
const element = $('input[id="vbatpidcompensation"]');
|
const element = $('input[id="vbatpidcompensation"]');
|
||||||
const value = element.is(':checked') ? 1 : 0;
|
const value = element.is(':checked') ? 1 : 0;
|
||||||
let analyticsValue = undefined;
|
let analyticsValue = undefined;
|
||||||
|
|
|
@ -588,7 +588,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr class="vbatpidcompensation">
|
||||||
<td><input type="checkbox" id="vbatpidcompensation" class="toggle" /></td>
|
<td><input type="checkbox" id="vbatpidcompensation" class="toggle" /></td>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<span i18n="pidTuningVbatPidCompensation"></span>
|
<span i18n="pidTuningVbatPidCompensation"></span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue