Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FFT debug modes #554

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions js/flightlog_fields_presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,27 @@ function FlightLogFieldPresenter() {
'debug[2]':'Dyn Idle D [roll]',
'debug[3]':'Min RPM',
};
DEBUG_FRIENDLY_FIELD_NAMES.FFT = {
'debug[all]':'Debug FFT',
'debug[0]':'Gyro Pre Dyn Notch [dbg-axis]',
'debug[1]':'Gyro Post Dyn Notch [dbg-axis]',
'debug[2]':'Gyro Downsampled [dbg-axis]',
'debug[3]':'Not used',
};
DEBUG_FRIENDLY_FIELD_NAMES.FFT_TIME = {
'debug[all]':'Debug FFT TIME',
'debug[0]':'Active calc step',
'debug[1]':'Step duration',
'debug[2]':'Not used',
'debug[3]':'Not used',
};
DEBUG_FRIENDLY_FIELD_NAMES.FFT_FREQ = {
'debug[all]':'Debug FFT FREQ',
'debug[0]':'Notch 1 Center Freq [dbg-axis]',
'debug[1]':'Notch 2 Center Freq [dbg-axis]',
'debug[2]':'Notch 3 Center Freq [dbg-axis]',
'debug[3]':'Gyro Pre Dyn Notch [dbg-axis]',
};
} else if (semver.gte(firmwareVersion, '4.2.0')) {
DEBUG_FRIENDLY_FIELD_NAMES.FF_INTERPOLATED = {
'debug[all]':'Feedforward [roll]',
Expand Down Expand Up @@ -950,11 +971,11 @@ function FlightLogFieldPresenter() {
return value.toFixed(0) + "°C";
case 'FFT':
switch (fieldName) {
case 'debug[0]': // gyro pre-notch [for selected axis]
case 'debug[1]': // gyro post-notch [for selected axis]
return Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + "deg/s";
// debug 2 = sample average
// debug 3 = not used
case 'debug[0]': // gyro pre dyn notch [for gyro debug axis]
case 'debug[1]': // gyro post dyn notch [for gyro debug axis]
case 'debug[2]': // gyro pre dyn notch, downsampled for FFT [for gyro debug axis]
return Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + " deg/s";
// debug 3 = not used
default:
return value.toFixed(0);
}
Expand All @@ -963,17 +984,18 @@ function FlightLogFieldPresenter() {
case 'debug[0]':
return FlightLogFieldPresenter.presentEnum(value, FFT_CALC_STEPS);
case 'debug[1]':
case 'debug[2]':
return value.toFixed(0) + "\u03BCs";
return value.toFixed(0) + " \u03BCs";
// debug 2 = not used
// debug 3 = not used
default:
return value.toFixed(0);
}
case 'FFT_FREQ':
switch (fieldName) {
case 'debug[3]': // raw gyro [for debug axis]
return Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + "deg/s";
case 'debug[3]': // gyro pre dyn notch [for gyro debug axis]
return Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + " deg/s";
default:
return value.toFixed(0) + "Hz";
return value.toFixed(0) + " Hz";
}
case 'RTH':
switch(fieldName) {
Expand Down
20 changes: 10 additions & 10 deletions js/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@ GraphConfig.load = function(config) {
};
case 'FFT':
switch (fieldName) {
case 'debug[0]': // gyro scaled [for selected axis]
case 'debug[1]': // pre-dyn notch gyro [for selected axis]
case 'debug[2]': // pre-dyn notch gyro FFT downsampled [roll]
case 'debug[0]': // pre-dyn notch gyro [for gyro debug axis]
case 'debug[1]': // post-dyn notch gyro [for gyro debug axis]
case 'debug[2]': // pre-dyn notch gyro downsampled for FFT [for gyro debug axis]
return {
offset: 0,
power: 0.25,
power: 1.0,
inputRange: maxDegreesSecond(gyroScaleMargin), // Maximum grad/s + 20%
outputRange: 1.0
};
Expand All @@ -484,14 +484,14 @@ GraphConfig.load = function(config) {
}
case 'FFT_FREQ':
switch (fieldName) {
case 'debug[0]': // roll center freq
case 'debug[1]': // pitch center freq
return getCurveForMinMaxFields('debug[0]', 'debug[1]');
case 'debug[2]': // pre-dyn notch gyro [for selected axis]
case 'debug[3]': // raw gyro [for selected axis]
case 'debug[0]': // notch 1 center freq [for gyro debug axis]
case 'debug[1]': // notch 2 center freq [for gyro debug axis]
case 'debug[2]': // notch 3 center freq [for gyro debug axis]
return getCurveForMinMaxFields('debug[0]', 'debug[1]', 'debug[2]');
case 'debug[3]': // pre-dyn notch gyro [for gyro debug axis]
return {
offset: 0,
power: 0.25,
power: 1.0,
inputRange: maxDegreesSecond(gyroScaleMargin), // Maximum grad/s + 20%
outputRange: 1.0
};
Expand Down
8 changes: 6 additions & 2 deletions js/header_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,12 @@ function HeaderDialog(dialog, onSave) {
features.push(
{bit: 27, group: 'other', name: 'ESC_SENSOR', description: 'Use KISS ESC 24A telemetry as sensor'},
{bit: 28, group: 'other', name: 'ANTI_GRAVITY', description: 'Temporary boost I-Term on high throttle changes'},
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER', description: 'Dynamic gyro notch filtering'}
)
);
if (semver.lt(sysConfig.firmwareVersion, "4.3.0")) {
features.push(
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER', description: 'Dynamic gyro notch filtering'},
);
}
}

var radioGroups = [];
Expand Down