Skip to content

Commit

Permalink
Update FFT debug modes
Browse files Browse the repository at this point in the history
  • Loading branch information
KarateBrot committed Dec 29, 2021
1 parent 72a44db commit 9b20ae2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ <h5 class="modal-title-craft"></h5>
<input type="text" step="1" min="0" max="999.00" />
</td>
<td name="dynNotchMaxHz">
<label>>Max (Hz)</label>
<label>Max (Hz)</label>
<input type="text" step="1" min="0" max="999.00" />
</td>
</tr>
Expand Down
39 changes: 20 additions & 19 deletions js/flightlog_fields_presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,24 +243,24 @@ function FlightLogFieldPresenter() {
},
'FFT' : {
'debug[all]':'Debug FFT',
'debug[0]':'Gyro Scaled [dbg-axis]',
'debug[1]':'Gyro Pre-Dyn [dbg-axis]',
'debug[2]':'Gyro Downsampled [roll]',
'debug[3]':'FFT Center Index [roll]',
'debug[0]':'Gyro Pre-Dyn [dbg-axis]',
'debug[1]':'Gyro Post-Dyn [dbg-axis]',
'debug[2]':'Gyro Downsampled [dbg-axis]',
'debug[3]':'Not used',
},
'FFT_TIME' : {
'debug[all]':'Debug FFT TIME',
'debug[0]':'Active calc step',
'debug[1]':'Step duration',
'debug[2]':'Additional steps',
'debug[2]':'Not used',
'debug[3]':'Not used',
},
'FFT_FREQ' : {
'debug[all]':'Debug FFT FREQ',
'debug[0]':'Center Freq [roll]',
'debug[1]':'Center Freq [pitch]',
'debug[2]':'Gyro Pre-Dyn [dbg-axis]',
'debug[3]':'Gyro Scaled [dbg-axis]',
'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 [dbg-axis]',
},
'RX_FRSKY_SPI' : {
'debug[all]':'FrSky SPI Rx',
Expand Down Expand Up @@ -950,11 +950,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]': // 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 Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + " deg/s";
// debug 3 = not used
default:
return value.toFixed(0);
}
Expand All @@ -963,17 +963,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]': // pre-dyn notch gyro [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
16 changes: 8 additions & 8 deletions js/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ 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,
Expand All @@ -484,11 +484,11 @@ 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,
Expand Down

0 comments on commit 9b20ae2

Please sign in to comment.