mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-21 23:35:22 +03:00
Merge pull request #267 from mikeller/move_rc_interpolation
Moved RC interpolation settings into receiver tab.
This commit is contained in:
commit
30a8261507
7 changed files with 134 additions and 92 deletions
|
@ -802,28 +802,31 @@
|
|||
"pidTuningPidSettings": {
|
||||
"message": "PID Controller Settings"
|
||||
},
|
||||
"pidTuningRcInterpolationHelp": {
|
||||
"message": "RC TX/RX systems are not as fast as PID loops. That means that PID loop has gaps in the information stream from RC systems. This option enables interpolation of the RC input during the times when no RC frames are received. The option also offers cleaner P and D behaviour as there are no ramps in control input."
|
||||
},
|
||||
"pidTuningRcInterpolationIntervalHelp": {
|
||||
"message": "Interpolation interval for manual RC interpolation mode in milliseconds"
|
||||
},
|
||||
"pidTuningRcInterpolation": {
|
||||
"receiverRcInterpolation": {
|
||||
"message": "RC Interpolation"
|
||||
},
|
||||
"pidTuningRcInterpolationOff": {
|
||||
"receiverRcInterpolationHelp": {
|
||||
"message": "RC TX/RX systems are not as fast as PID loops. That means that PID loop has gaps in the information stream from RC systems. This option enables interpolation of the RC input during the times when no RC frames are received. The option also offers cleaner P and D behaviour as there are no ramps in control input."
|
||||
},
|
||||
"receiverRcInterpolationIntervalHelp": {
|
||||
"message": "Interpolation interval for manual RC interpolation mode in milliseconds"
|
||||
},
|
||||
"receiverRcInterpolation": {
|
||||
"message": "RC Interpolation"
|
||||
},
|
||||
"receiverRcInterpolationOff": {
|
||||
"message": "Off"
|
||||
},
|
||||
"pidTuningRcInterpolationDefault": {
|
||||
"receiverRcInterpolationDefault": {
|
||||
"message": "Preset"
|
||||
},
|
||||
"pidTuningRcInterpolationAuto": {
|
||||
"receiverRcInterpolationAuto": {
|
||||
"message": "Auto"
|
||||
},
|
||||
"pidTuningRcInterpolationManual": {
|
||||
"receiverRcInterpolationManual": {
|
||||
"message": "Manual"
|
||||
},
|
||||
"pidTuningRcInterpolationInterval": {
|
||||
"receiverRcInterpolationInterval": {
|
||||
"message": "RC Interpolating Interval (ms)"
|
||||
},
|
||||
"pidTuningPtermSetpoint": {
|
||||
|
|
|
@ -264,25 +264,25 @@
|
|||
border-right: 0px solid #ccc;
|
||||
}
|
||||
|
||||
.tab-pid_tuning .compensation td {
|
||||
.tab-pid_tuning .pidTuningFeatures td {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.tab-pid_tuning .compensation td:first-child {
|
||||
.tab-pid_tuning .pidTuningFeatures td:first-child {
|
||||
width: 20%;
|
||||
padding-bottom: 6px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.tab-pid_tuning .compensation td:last-child {
|
||||
.tab-pid_tuning .pidTuningFeatures td:last-child {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.tab-pid_tuning .compensation td {
|
||||
.tab-pid_tuning .pidTuningFeatures td {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.tab-pid_tuning .compensation .slider input {
|
||||
.tab-pid_tuning .pidTuningFeatures .slider input {
|
||||
-webkit-appearance: slider-horizontal
|
||||
}
|
||||
|
||||
|
|
|
@ -240,45 +240,16 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="gui_box grey topspacer">
|
||||
<div class="gui_box grey topspacer pidTuningFeatures">
|
||||
<table class="pid_titlebar new_rates">
|
||||
<tr>
|
||||
<th i18n="pidTuningNonProfilePidSettings"></th>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="compensation">
|
||||
<table class="pidTuningFeatures new_rates">
|
||||
<tbody class="features pidTuning">
|
||||
<!-- table generated here -->
|
||||
</tbody>
|
||||
<tr class="rcInterpolation">
|
||||
<td>
|
||||
<select name="rcInterpolation-select">
|
||||
<option value="0" i18n="pidTuningRcInterpolationOff"/>
|
||||
<option value="1" i18n="pidTuningRcInterpolationDefault"/>
|
||||
<option value="2" i18n="pidTuningRcInterpolationAuto"/>
|
||||
<option value="3" i18n="pidTuningRcInterpolationManual"/>
|
||||
</select>
|
||||
</td>
|
||||
<td colspan=2>
|
||||
<div>
|
||||
<label>
|
||||
<span i18n="pidTuningRcInterpolation"></span>
|
||||
</label>
|
||||
<div class="helpicon cf_tip" i18n_title="pidTuningRcInterpolationHelp"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rcInterpolationInterval">
|
||||
<td><input type="number" class="nonProfile" name="rcInterpolationInterval-number" step="1" min="1" max="50"/></td>
|
||||
<td colspan=2>
|
||||
<div>
|
||||
<label>
|
||||
<span i18n="pidTuningRcInterpolationInterval"></span>
|
||||
</label>
|
||||
<div class="helpicon cf_tip" i18n_title="pidTuningRcInterpolationIntervalHelp"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="gui_box grey topspacer">
|
||||
|
|
|
@ -33,10 +33,6 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.2")) {
|
||||
return MSP.promise(MSPCodes.MSP_PID_ADVANCED);
|
||||
}
|
||||
}).then(function() {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
return MSP.promise(MSPCodes.MSP_RX_CONFIG);
|
||||
}
|
||||
}).then(function() {
|
||||
return MSP.promise(MSPCodes.MSP_RC_TUNING);
|
||||
}).then(function() {
|
||||
|
@ -256,17 +252,11 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
$('.pid_filter input[name="dTermNotchFrequency"]').val(FILTER_CONFIG.dterm_notch_hz);
|
||||
$('.pid_filter input[name="dTermNotchCutoff"]').val(FILTER_CONFIG.dterm_notch_cutoff);
|
||||
|
||||
$('select[name="rcInterpolation-select"]').val(RX_CONFIG.rcInterpolation);
|
||||
|
||||
$('input[name="rcInterpolationInterval-number"]').val(RX_CONFIG.rcInterpolationInterval);
|
||||
|
||||
$('input[name="ptermSetpoint-number"]').val(ADVANCED_TUNING.ptermSetpointWeight / 100);
|
||||
$('input[name="ptermSetpoint-range"]').val(ADVANCED_TUNING.ptermSetpointWeight / 100);
|
||||
|
||||
$('input[name="dtermSetpoint-number"]').val(ADVANCED_TUNING.dtermSetpointWeight / 100);
|
||||
$('input[name="dtermSetpoint-range"]').val(ADVANCED_TUNING.dtermSetpointWeight / 100);
|
||||
|
||||
self.updateRcInterpolationParameters();
|
||||
} else {
|
||||
$('.pid_filter .newFilter').hide();
|
||||
}
|
||||
|
@ -363,9 +353,6 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
}
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, '3.0.0')) {
|
||||
RX_CONFIG.rcInterpolation = parseInt($('select[name="rcInterpolation-select"]').val());
|
||||
RX_CONFIG.rcInterpolationInterval = parseInt($('input[name="rcInterpolationInterval-number"]').val());
|
||||
|
||||
ADVANCED_TUNING.ptermSetpointWeight = parseInt($('input[name="ptermSetpoint-number"]').val() * 100);
|
||||
ADVANCED_TUNING.dtermSetpointWeight = parseInt($('input[name="dtermSetpoint-number"]').val() * 100);
|
||||
|
||||
|
@ -454,7 +441,7 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
}
|
||||
|
||||
var useLegacyCurve = false;
|
||||
if (CONFIG.flightControllerIdentifier !== "BTFL" || semver.lt(CONFIG.flightControllerVersion, "2.8.0")) {
|
||||
if (!semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
|
||||
useLegacyCurve = true;
|
||||
}
|
||||
|
||||
|
@ -476,8 +463,10 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function process_html() {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.0") && !semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
BF_CONFIG.features.generateElements($('.tab-pid_tuning .features'));
|
||||
} else {
|
||||
$('.tab-pid_tuning .pidTuningFeatures').hide();
|
||||
}
|
||||
|
||||
// translate to user-selected language
|
||||
|
@ -604,9 +593,6 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
} else {
|
||||
$('.tab-pid_tuning .rate_profile').hide();
|
||||
|
||||
$('#pid-tuning .rcInterpolation').hide();
|
||||
$('#pid-tuning .rcInterpolationInterval').hide();
|
||||
|
||||
$('#pid-tuning .ptermSetpoint').hide();
|
||||
$('#pid-tuning .dtermSetpoint').hide();
|
||||
}
|
||||
|
@ -826,12 +812,6 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
self.updatePidControllerParameters();
|
||||
});
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
$('select[name="rcInterpolation-select"]').change(function () {
|
||||
self.updateRcInterpolationParameters();
|
||||
});
|
||||
}
|
||||
|
||||
// update == save.
|
||||
$('a.update').click(function () {
|
||||
form_to_pid_and_rc();
|
||||
|
@ -855,10 +835,6 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.2")) {
|
||||
return MSP.promise(MSPCodes.MSP_SET_PID_ADVANCED, mspHelper.crunch(MSPCodes.MSP_SET_PID_ADVANCED));
|
||||
}
|
||||
}).then(function () {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
return MSP.promise(MSPCodes.MSP_SET_RX_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_RX_CONFIG));
|
||||
}
|
||||
}).then(function () {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.1")) {
|
||||
return MSP.promise(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG));
|
||||
|
@ -1034,13 +1010,3 @@ TABS.pid_tuning.updatePidControllerParameters = function () {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
TABS.pid_tuning.updateRcInterpolationParameters = function () {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
if ($('select[name="rcInterpolation-select"]').val() === '3') {
|
||||
$('#pid-tuning .rcInterpolationInterval').show();
|
||||
} else {
|
||||
$('#pid-tuning .rcInterpolationInterval').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
float: right;
|
||||
position: relative;
|
||||
margin: 0px 0px 20px 0;
|
||||
width: 100%
|
||||
width: 100%;
|
||||
border-top-left-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
background-color: #DEDEDE;
|
||||
|
@ -304,6 +304,28 @@
|
|||
width: calc(100% - 10px);
|
||||
}
|
||||
|
||||
.tab-receiver .rcInterpolation td {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.tab-receiver .rcInterpolation td:first-child {
|
||||
width: 20%;
|
||||
padding-bottom: 6px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.tab-receiver .rcInterpolation td:last-child {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.tab-receiver .rcInterpolation td {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.tab-receiver .rcInterpolation .slider input {
|
||||
-webkit-appearance: slider-horizontal
|
||||
}
|
||||
|
||||
.tab-receiver .curves {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
|
|
|
@ -52,7 +52,43 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="gui_box grey topspacer">
|
||||
<div class="gui_box grey tunings topspacer rcInterpolation">
|
||||
<table class="rcInterpolation" width="100%">
|
||||
<tr>
|
||||
<th colspan=2 i18n="receiverRcInterpolation"></th>
|
||||
</tr>
|
||||
<tr class="rcInterpolation">
|
||||
<td>
|
||||
<select name="rcInterpolation-select">
|
||||
<option value="0" i18n="receiverRcInterpolationOff"/>
|
||||
<option value="1" i18n="receiverRcInterpolationDefault"/>
|
||||
<option value="2" i18n="receiverRcInterpolationAuto"/>
|
||||
<option value="3" i18n="receiverRcInterpolationManual"/>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<label>
|
||||
<span i18n="receiverRcInterpolation"></span>
|
||||
</label>
|
||||
<div class="helpicon cf_tip" i18n_title="receiverRcInterpolationHelp"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rcInterpolationInterval">
|
||||
<td><input type="number" class="nonProfile" name="rcInterpolationInterval-number" step="1" min="1" max="50"/></td>
|
||||
<td>
|
||||
<div>
|
||||
<label>
|
||||
<span i18n="receiverRcInterpolationInterval"></span>
|
||||
</label>
|
||||
<div class="helpicon cf_tip" i18n_title="receiverRcInterpolationIntervalHelp"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="gui_box grey tunings topspacer">
|
||||
<table class="pid_titlebar" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -36,7 +36,7 @@ TABS.receiver.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function load_rc_configs() {
|
||||
var next_callback = load_html;
|
||||
var next_callback = load_rx_config;
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
MSP.send_message(MSPCodes.MSP_RC_DEADBAND, false, false, next_callback);
|
||||
} else {
|
||||
|
@ -44,6 +44,15 @@ TABS.receiver.initialize = function (callback) {
|
|||
}
|
||||
}
|
||||
|
||||
function load_rx_config() {
|
||||
var next_callback = load_html;
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
MSP.send_message(MSPCodes.MSP_RX_CONFIG, false, false, next_callback);
|
||||
} else {
|
||||
next_callback();
|
||||
}
|
||||
}
|
||||
|
||||
function load_html() {
|
||||
$('#content').load("./tabs/receiver.html", process_html);
|
||||
}
|
||||
|
@ -77,6 +86,17 @@ TABS.receiver.initialize = function (callback) {
|
|||
|
||||
}
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
$('select[name="rcInterpolation-select"]').val(RX_CONFIG.rcInterpolation);
|
||||
$('input[name="rcInterpolationInterval-number"]').val(RX_CONFIG.rcInterpolationInterval);
|
||||
|
||||
$('select[name="rcInterpolation-select"]').change(function () {
|
||||
self.updateRcInterpolationParameters();
|
||||
}).change();
|
||||
} else {
|
||||
$('.tab-receiver div.rcInterpolation').hide();
|
||||
}
|
||||
|
||||
// generate bars
|
||||
var bar_names = [
|
||||
chrome.i18n.getMessage('controlAxisRoll'),
|
||||
|
@ -231,16 +251,30 @@ TABS.receiver.initialize = function (callback) {
|
|||
// catch rssi aux
|
||||
MISC.rssi_channel = parseInt($('select[name="rssi_channel"]').val());
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
RX_CONFIG.rcInterpolation = parseInt($('select[name="rcInterpolation-select"]').val());
|
||||
RX_CONFIG.rcInterpolationInterval = parseInt($('input[name="rcInterpolationInterval-number"]').val());
|
||||
}
|
||||
|
||||
function save_misc() {
|
||||
MSP.send_message(MSPCodes.MSP_SET_MISC, mspHelper.crunch(MSPCodes.MSP_SET_MISC), false, save_rc_configs);
|
||||
}
|
||||
|
||||
function save_rc_configs() {
|
||||
var next_callback = save_to_eeprom;
|
||||
var next_callback = save_rx_config;
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
MSP.send_message(MSPCodes.MSP_SET_RC_DEADBAND, mspHelper.crunch(MSPCodes.MSP_SET_RC_DEADBAND), false, next_callback);
|
||||
MSP.send_message(MSPCodes.MSP_SET_RC_DEADBAND, mspHelper.crunch(MSPCodes.MSP_SET_RC_DEADBAND), false, next_callback);
|
||||
} else {
|
||||
next_callback();
|
||||
next_callback();
|
||||
}
|
||||
}
|
||||
|
||||
function save_rx_config() {
|
||||
var next_callback = save_to_eeprom;
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
MSP.send_message(MSPCodes.MSP_SET_RX_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_RX_CONFIG), false, next_callback);
|
||||
} else {
|
||||
next_callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -447,3 +481,13 @@ TABS.receiver.cleanup = function (callback) {
|
|||
|
||||
if (callback) callback();
|
||||
};
|
||||
|
||||
TABS.receiver.updateRcInterpolationParameters = function () {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
if ($('select[name="rcInterpolation-select"]').val() === '3') {
|
||||
$('.tab-receiver .rcInterpolationInterval').show();
|
||||
} else {
|
||||
$('.tab-receiver .rcInterpolationInterval').hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue