Merge pull request #110 from mikeller/move_yaw_jump_prevention

Moved yaw jump prevention to separate row. Added help text.
10.3.x-maintenance
borisbstyle 2016-08-09 15:36:04 +02:00 committed by GitHub
commit 9d2a3a3d01
3 changed files with 39 additions and 12 deletions

View File

@ -1590,6 +1590,12 @@
"pidTuningBasic": {
"message": "Basic/Acro"
},
"pidTuningYawJumpPrevention": {
"message": "Yaw Jump Prevention"
},
"pidTuningYawJumpPreventionHelp": {
"message": "Keeps the craft from jumping up at the end of yaws."
},
"pidTuningLevel": {
"message": "Angle/Horizon"
},

View File

@ -77,9 +77,9 @@
<tr class="ROLL">
<!-- 0 -->
<td bgcolor="#FF8080"></td>
<td><input type="number" name="p" step="1" min="0" max="255" /></td>
<td><input type="number" name="i" step="1" min="0" max="255" /></td>
<td><input type="number" name="d" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="p" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="i" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="d" step="1" min="0" max="255" /></td>
<td rowspan="2" style="background-color:white;">
<input type="number" name="rc_rate" step="0.01" min="0" max="2.5" />
<div class="bracket"></div>
@ -94,21 +94,31 @@
<tr class="PITCH">
<!-- 1 -->
<td bgcolor="#80FF80"></td>
<td><input type="number" name="p" step="1" min="0" max="255" /></td>
<td><input type="number" name="i" step="1" min="0" max="255" /></td>
<td><input type="number" name="d" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="p" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="i" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="d" step="1" min="0" max="255" /></td>
<td class="pitch_rate"><input type="number" name="pitch_rate" step="0.01" min="0" max="1.00" /></td>
</tr>
<tr class="YAW">
<!-- 2 -->
<td bgcolor="#8080FF"></td>
<td><input type="number" name="p" step="1" min="0" max="255" /></td>
<td><input type="number" name="i" step="1" min="0" max="255" /></td>
<td><input type="number" name="d" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="p" step="1" min="0" max="255" /></td>
<td class="pid_data"><input type="number" name="i" step="1" min="0" max="255" /></td>
<td></td>
<td rowspan="1"><input type="number" name="rc_rate_yaw" step="0.01" min="0" max="2.5" /></td>
<td><input type="number" name="yaw_rate" step="0.01" min="0" max="2.55" /></td>
<td><input type="number" name="rc_yaw_expo" step="0.01" min="0" max="1" /></td>
</tr>
<tr class="YAW_JUMP_PREVENTION">
<td colspan = 3>
<div>
<div i18n="pidTuningYawJumpPrevention" style="float:left;"></div>
<div class="helpicon cf_tip" i18n_title="pidTuningYawJumpPreventionHelp"></div>
</div>
</td>
<td class="pid_data"><input type="number" name="d" step="1" min="0" max="255" /></td>
<td colspan=3></td>
</tr>
</table>
</div>
<div id="pid_optional" class="gui_box grey topspacer pid_tuning">

View File

@ -120,6 +120,10 @@ TABS.pid_tuning.initialize = function (callback) {
case 1:
$(this).val(PIDs[2][i++]);
break;
}
});
$('.pid_tuning .YAW_JUMP_PREVENTION input').each(function () {
switch (i) {
case 2:
$(this).val(PIDs[2][i++]);
break;
@ -272,17 +276,20 @@ TABS.pid_tuning.initialize = function (callback) {
// Fill in the data from PIDs array
// Catch all the changes and stuff the inside PIDs array
var i = 0;
$('table.pid_tuning tr.ROLL input').each(function () {
$('table.pid_tuning tr.ROLL .pid_data input').each(function () {
PIDs[0][i++] = parseFloat($(this).val());
});
i = 0;
$('table.pid_tuning tr.PITCH input').each(function () {
$('table.pid_tuning tr.PITCH .pid_data input').each(function () {
PIDs[1][i++] = parseFloat($(this).val());
});
i = 0;
$('table.pid_tuning tr.YAW input').each(function () {
$('table.pid_tuning tr.YAW .pid_data input').each(function () {
PIDs[2][i++] = parseFloat($(this).val());
});
$('table.pid_tuning tr.YAW_JUMP_PREVENTION .pid_data input').each(function () {
PIDs[2][i++] = parseFloat($(this).val());
});
@ -966,11 +973,15 @@ TABS.pid_tuning.checkUpdateProfile = function (updateRateProfile) {
TABS.pid_tuning.updatePidControllerParameters = function () {
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
if ($('.tab-pid_tuning select[name="controller"]').val() === '0') {
$('.pid_tuning .YAW_JUMP_PREVENTION').show();
$('#pid-tuning .delta').show();
$('#pid-tuning .ptermSetpoint').hide();
$('#pid-tuning .dtermSetpoint').hide();
} else {
$('.pid_tuning .YAW_JUMP_PREVENTION').hide();
$('#pid-tuning .ptermSetpoint').show();
$('#pid-tuning .dtermSetpoint').show();