1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 16:55:22 +03:00

Filtering configuration

This commit is contained in:
Pawel Spychalski (DzikuVx) 2016-11-19 20:17:23 +01:00
parent ea9efd4622
commit d503cb92c7
6 changed files with 184 additions and 37 deletions

View file

@ -40,6 +40,7 @@ var RXFAIL_CONFIG;
var ADVANCED_CONFIG;
var INAV_PID_CONFIG;
var PID_ADVANCED;
var FILTER_CONFIG;
var FC = {
isRatesInDps: function () {
@ -212,6 +213,12 @@ var FC = {
gyroSync: null
};
FILTER_CONFIG = {
gyroSoftLpfHz: null,
dtermLpfHz: null,
yawLpfHz: null
}
PID_ADVANCED = {
rollPitchItermIgnoreRate: null,
yawItermIgnoreRate: null,

View file

@ -1102,6 +1102,24 @@ var MSP = {
console.log("Advanced config saved");
break;
case MSP_codes.MSP_FILTER_CONFIG:
FILTER_CONFIG.gyroSoftLpfHz = data.getUint8(0, true);
FILTER_CONFIG.dtermLpfHz = data.getUint16(1, true);
FILTER_CONFIG.yawLpfHz = data.getUint16(3, true);
/*
sbufWriteU16(dst, 1); //masterConfig.gyro_soft_notch_hz_1
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_cutoff_1
sbufWriteU16(dst, 1); //BF: currentProfile->pidProfile.dterm_notch_hz
sbufWriteU16(dst, 1); //currentProfile->pidProfile.dterm_notch_cutoff
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_hz_2
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_cutoff_2
*/
break;
case MSP_codes.MSP_SET_FILTER_CONFIG:
console.log("Filter config saved");
break;
case MSP_codes.MSP_PID_ADVANCED:
PID_ADVANCED.rollPitchItermIgnoreRate = data.getUint16(0, true);
PID_ADVANCED.yawItermIgnoreRate = data.getUint16(2, true);
@ -1552,6 +1570,34 @@ MSP.crunch = function (code) {
buffer.push(0); //reserved
break;
case MSP_codes.MSP_SET_FILTER_CONFIG:
buffer.push(FILTER_CONFIG.gyroSoftLpfHz);
buffer.push(lowByte(FILTER_CONFIG.dtermLpfHz));
buffer.push(highByte(FILTER_CONFIG.dtermLpfHz));
buffer.push(lowByte(FILTER_CONFIG.yawLpfHz));
buffer.push(highByte(FILTER_CONFIG.yawLpfHz));
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
buffer.push(0);
break;
case MSP_codes.MSP_SET_PID_ADVANCED:
buffer.push(lowByte(PID_ADVANCED.rollPitchItermIgnoreRate));
buffer.push(highByte(PID_ADVANCED.rollPitchItermIgnoreRate));