1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 11:59:51 +03:00

Merge branch 'master' into advanced-tuning-tab

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-01-23 22:30:32 +01:00
commit fea2505fde
6 changed files with 113 additions and 3 deletions

View file

@ -1930,5 +1930,41 @@
}, },
"presetApplyHead": { "presetApplyHead": {
"message": "Applies following settings:" "message": "Applies following settings:"
},
"gyroNotchHz1": {
"message": "First gyro notch filter freq."
},
"gyroNotchCutoff1": {
"message": "First gyro notch filter cutoff freq."
},
"gyroNotchHz2": {
"message": "Second gyro notch filter freq."
},
"gyroNotchCutoff2": {
"message": "Second gyro notch filter cutoff freq."
},
"gyroNotchHz1Help": {
"message": "Should be tuned to propeller harmonic frequency. Usually equals <i>[motor_frequency] * [propeller_blades_number]</i><br><br>Has to be above cutoff frequency<br><br><i>0</i> disables the filter"
},
"gyroNotchHz2Help": {
"message": "Should be tuned to motor frequency.<br><br>Has to be above cutoff frequency and below first gyro notch filter frequency.<br><br><i>0</i> disables the filter"
},
"gyroNotchCutoff1Help": {
"message": "Defines band of notch filter. <br><br>Has to be kept below notch filter frequency."
},
"gyroNotchCutoff2Help": {
"message": "Defines band of notch filter. <br><br>Has to be kept below notch filter frequency."
},
"dtermNotchHz": {
"message": "Dterm notch filter freq."
},
"dtermNotchCutoff": {
"message": "Dterm notch filter cutoff freq."
},
"dtermNotchHzHelp": {
"message": "Should be placed between first and second gyro notch filter frequency<br><br>Has to be above cutoff frequency<br><br><i>0</i> disables the filter"
},
"dtermNotchCutoffHelp": {
"message": "Defines band of filter. <br><br>Has to be kept below notch filter frequency."
} }
} }

View file

@ -252,7 +252,8 @@ var FC = {
yawPLimit: null, yawPLimit: null,
axisAccelerationLimitRollPitch: null, axisAccelerationLimitRollPitch: null,
axisAccelerationLimitYaw: null, axisAccelerationLimitYaw: null,
dtermSetpointWeight: null dtermSetpointWeight: null,
pidSumLimit: null
}; };
INAV_PID_CONFIG = { INAV_PID_CONFIG = {

View file

@ -221,5 +221,23 @@ GUI_control.prototype.fillSelect = function ($element, values, currentValue, uni
} }
}; };
GUI_control.prototype.simpleBind = function () {
$('input[data-simple-bind]').not('[data-simple-binded="true"]').each(function () {
var $this = $(this),
toBind = $this.data('simple-bind').split(".");
if (toBind.length !== 2 || window[toBind[0]][toBind[1]] === undefined) {
return;
}
$this.change(function () {
window[toBind[0]][toBind[1]] = $(this).val();
});
$this.val(window[toBind[0]][toBind[1]]);
$this.attr('data-simple-binded', true);
});
};
// initialize object into GUI variable // initialize object into GUI variable
var GUI = new GUI_control(); var GUI = new GUI_control();

View file

@ -846,6 +846,7 @@ var mspHelper = (function (gui) {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) { if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
PID_ADVANCED.dtermSetpointWeight = data.getUint8(9); PID_ADVANCED.dtermSetpointWeight = data.getUint8(9);
PID_ADVANCED.pidSumLimit = data.getUint16(10, true);
} }
PID_ADVANCED.axisAccelerationLimitRollPitch = data.getUint16(13, true); PID_ADVANCED.axisAccelerationLimitRollPitch = data.getUint16(13, true);
@ -1262,12 +1263,14 @@ var mspHelper = (function (gui) {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) { if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
buffer.push(PID_ADVANCED.dtermSetpointWeight); buffer.push(PID_ADVANCED.dtermSetpointWeight);
buffer.push(lowByte(PID_ADVANCED.pidSumLimit));
buffer.push(highByte(PID_ADVANCED.pidSumLimit));
} else { } else {
buffer.push(0); buffer.push(0);
buffer.push(0); // reserved
buffer.push(0); // reserved
} }
buffer.push(0); // reserved
buffer.push(0); // reserved
buffer.push(0); //BF: currentProfile->pidProfile.itermThrottleGain buffer.push(0); //BF: currentProfile->pidProfile.itermThrottleGain
buffer.push(lowByte(PID_ADVANCED.axisAccelerationLimitRollPitch)); buffer.push(lowByte(PID_ADVANCED.axisAccelerationLimitRollPitch));

View file

@ -219,6 +219,35 @@
</td> </td>
</tr> </tr>
<tr class="requires-v1_6">
<th data-i18n="gyroNotchHz1"></th>
<td>
<input type="number" data-simple-bind="FILTER_CONFIG.gyroNotchHz1" id="gyroNotchHz1" class="rate-tpa_input" step="1" min="0" max="500" /> Hz
<div class="helpicon cf_tip" data-i18n_title="gyroNotchHz1Help"></div>
</td>
</tr>
<tr class="requires-v1_6">
<th data-i18n="gyroNotchCutoff1"></th>
<td>
<input type="number" data-simple-bind="FILTER_CONFIG.gyroNotchCutoff1" id="gyroNotchCutoff1" class="rate-tpa_input" step="1" min="0" max="500" /> Hz
<div class="helpicon cf_tip" data-i18n_title="gyroNotchCutoff1Help"></div>
</td>
</tr>
<tr class="requires-v1_6">
<th data-i18n="gyroNotchHz2"></th>
<td>
<input type="number" data-simple-bind="FILTER_CONFIG.gyroNotchHz2" id="gyroNotchHz2" class="rate-tpa_input" step="1" min="0" max="500" /> Hz
<div class="helpicon cf_tip" data-i18n_title="gyroNotchHz2Help"></div>
</td>
</tr>
<tr class="requires-v1_6">
<th data-i18n="gyroNotchCutoff2"></th>
<td>
<input type="number" data-simple-bind="FILTER_CONFIG.gyroNotchCutoff2" id="gyroNotchCutoff2" class="rate-tpa_input" step="1" min="0" max="500" /> Hz
<div class="helpicon cf_tip" data-i18n_title="gyroNotchCutoff2Help"></div>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -239,6 +268,20 @@
<div class="helpicon cf_tip" data-i18n_title="yawLpfCutoffFrequencyHelp"></div> <div class="helpicon cf_tip" data-i18n_title="yawLpfCutoffFrequencyHelp"></div>
</td> </td>
</tr> </tr>
<tr class="requires-v1_6">
<th data-i18n="dtermNotchHz"></th>
<td>
<input type="number" data-simple-bind="FILTER_CONFIG.dtermNotchHz" id="dtermNotchHz" class="rate-tpa_input" step="1" min="0" max="500" /> Hz
<div class="helpicon cf_tip" data-i18n_title="dtermNotchHzHelp"></div>
</td>
</tr>
<tr class="requires-v1_6">
<th data-i18n="dtermNotchCutoff"></th>
<td>
<input type="number" data-simple-bind="FILTER_CONFIG.dtermNotchCutoff" id="dtermNotchCutoff" class="rate-tpa_input" step="1" min="0" max="500" /> Hz
<div class="helpicon cf_tip" data-i18n_title="dtermNotchCutoffHelp"></div>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View file

@ -231,6 +231,15 @@ TABS.pid_tuning.initialize = function (callback) {
} else { } else {
$('.requires-v1_4').hide(); $('.requires-v1_4').hide();
} }
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
$('.requires-v1_6').show();
} else {
$('.requires-v1_6').hide();
}
GUI.simpleBind();
// UI Hooks // UI Hooks
$('a.refresh').click(function () { $('a.refresh').click(function () {