mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 23:05:15 +03:00
Added switches to enable/disable anti-gravity and dynamic filter to Configuration tab
Added inputs for changing anti-gravity settings to PID Tuning tab
This commit is contained in:
parent
bc86e8bc18
commit
830155a473
6 changed files with 60 additions and 6 deletions
|
@ -545,7 +545,7 @@
|
||||||
"message": "Configure via the BlackBox tab after enabling."
|
"message": "Configure via the BlackBox tab after enabling."
|
||||||
},
|
},
|
||||||
"featureESC_SENSOR": {
|
"featureESC_SENSOR": {
|
||||||
"message": "Use KISS ESC 24A telemetry as sensor"
|
"message": "Use KISS/BLHeli_32 ESC telemetry as sensor"
|
||||||
},
|
},
|
||||||
"featureCHANNEL_FORWARDING": {
|
"featureCHANNEL_FORWARDING": {
|
||||||
"message": "Forward aux channels to servo outputs"
|
"message": "Forward aux channels to servo outputs"
|
||||||
|
@ -571,6 +571,12 @@
|
||||||
"featureVTX": {
|
"featureVTX": {
|
||||||
"message": "Video Transmitter"
|
"message": "Video Transmitter"
|
||||||
},
|
},
|
||||||
|
"featureANTI_GRAVITY": {
|
||||||
|
"message": "Temporary boost I-Term on high throttle changes"
|
||||||
|
},
|
||||||
|
"featureDYNAMIC_FILTER": {
|
||||||
|
"message": "Dynamic gyro notch filtering"
|
||||||
|
},
|
||||||
"featureFAILSAFE": {
|
"featureFAILSAFE": {
|
||||||
"message": "Enable Failsafe Stage 2"
|
"message": "Enable Failsafe Stage 2"
|
||||||
},
|
},
|
||||||
|
@ -842,6 +848,14 @@
|
||||||
"pidTuningNonProfilePidSettings": {
|
"pidTuningNonProfilePidSettings": {
|
||||||
"message": "Profile independent PID Controller Settings"
|
"message": "Profile independent PID Controller Settings"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"pidTuningAntiGravityGain": {
|
||||||
|
"message": "Anti Gravity Gain"
|
||||||
|
},
|
||||||
|
"pidTuningAntiGravityThres": {
|
||||||
|
"message": "Anti Gravity Threshold"
|
||||||
|
},
|
||||||
|
|
||||||
"pidTuningPidSettings": {
|
"pidTuningPidSettings": {
|
||||||
"message": "PID Controller Settings"
|
"message": "PID Controller Settings"
|
||||||
},
|
},
|
||||||
|
|
|
@ -80,7 +80,14 @@ var Features = function (config) {
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 27, group: 'other', name: 'ESC_SENSOR'}
|
{bit: 27, group: 'other', name: 'ESC_SENSOR'}
|
||||||
)
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
features.push(
|
||||||
|
{bit: 28, group: 'other', name: 'ANTI_GRAVITY'},
|
||||||
|
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER'}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
js/fc.js
2
js/fc.js
|
@ -331,6 +331,8 @@ var FC = {
|
||||||
pidMaxVelocityYaw: 0,
|
pidMaxVelocityYaw: 0,
|
||||||
levelAngleLimit: 0,
|
levelAngleLimit: 0,
|
||||||
levelSensitivity: 0,
|
levelSensitivity: 0,
|
||||||
|
itermThrottleThreshold: 0,
|
||||||
|
itermAcceleratorGain: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
SENSOR_CONFIG = {
|
SENSOR_CONFIG = {
|
||||||
|
|
|
@ -810,11 +810,15 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
ADVANCED_TUNING.itermThrottleGain = data.readU8();
|
ADVANCED_TUNING.itermThrottleGain = data.readU8();
|
||||||
ADVANCED_TUNING.pidMaxVelocity = data.readU16();
|
ADVANCED_TUNING.pidMaxVelocity = data.readU16();
|
||||||
ADVANCED_TUNING.pidMaxVelocityYaw = data.readU16();
|
ADVANCED_TUNING.pidMaxVelocityYaw = data.readU16();
|
||||||
}
|
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
|
||||||
ADVANCED_TUNING.levelAngleLimit = data.readU8();
|
ADVANCED_TUNING.levelAngleLimit = data.readU8();
|
||||||
ADVANCED_TUNING.levelSensitivity = data.readU8();
|
ADVANCED_TUNING.levelSensitivity = data.readU8();
|
||||||
}
|
}
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
ADVANCED_TUNING.itermThrottleThreshold = data.readU16();
|
||||||
|
ADVANCED_TUNING.itermAcceleratorGain = data.readU16();
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SENSOR_CONFIG:
|
case MSPCodes.MSP_SENSOR_CONFIG:
|
||||||
SENSOR_CONFIG.acc_hardware = data.readU8();
|
SENSOR_CONFIG.acc_hardware = data.readU8();
|
||||||
|
@ -1414,6 +1418,10 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
buffer.push8(ADVANCED_TUNING.levelAngleLimit)
|
buffer.push8(ADVANCED_TUNING.levelAngleLimit)
|
||||||
.push8(ADVANCED_TUNING.levelSensitivity);
|
.push8(ADVANCED_TUNING.levelSensitivity);
|
||||||
}
|
}
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
buffer.push16(ADVANCED_TUNING.itermThrottleThreshold)
|
||||||
|
.push16(ADVANCED_TUNING.itermAcceleratorGain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// only supports 1 version pre bf 3.0
|
// only supports 1 version pre bf 3.0
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -326,6 +326,24 @@
|
||||||
</td>
|
</td>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="antigravity topspacer tpa">
|
||||||
|
<table class="cf">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th i18n="pidTuningAntiGravityGain"></th>
|
||||||
|
<th i18n="pidTuningAntiGravityThres"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 35px;">
|
||||||
|
<td><input type="number" name="itermAcceleratorGain" step="0.1" min="1" max="30" /></td>
|
||||||
|
<td><input type="number" name="itermThrottleThreshold" step="10" min="20" max="1000" /></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="gui_box grey topspacer">
|
<div class="gui_box grey topspacer">
|
||||||
<table class="pid_titlebar">
|
<table class="pid_titlebar">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
@ -261,8 +261,11 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
|
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
$('.profile select[name="dtermFilterType"]').val(FILTER_CONFIG.dterm_filter_type);
|
$('.profile select[name="dtermFilterType"]').val(FILTER_CONFIG.dterm_filter_type);
|
||||||
|
$('.antigravity input[name="itermThrottleThreshold"]').val(ADVANCED_TUNING.itermThrottleThreshold);
|
||||||
|
$('.antigravity input[name="itermAcceleratorGain"]').val(ADVANCED_TUNING.itermAcceleratorGain / 1000);
|
||||||
} else {
|
} else {
|
||||||
$('.dtermfiltertype').hide();
|
$('.dtermfiltertype').hide();
|
||||||
|
$('.antigravity').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +380,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
|
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
FILTER_CONFIG.dterm_filter_type = $('.profile select[name="dtermFilterType"]').val();
|
FILTER_CONFIG.dterm_filter_type = $('.profile select[name="dtermFilterType"]').val();
|
||||||
|
ADVANCED_TUNING.itermThrottleThreshold = parseInt($('.antigravity input[name="itermThrottleThreshold"]').val());
|
||||||
|
ADVANCED_TUNING.itermAcceleratorGain = parseInt($('.antigravity input[name="itermAcceleratorGain"]').val() * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue