Skip to content

Commit fba10a8

Browse files
authored
Add RPM Filter info to the Header (#376)
Add RPM Filter info to the Header
2 parents 17d42cb + 4eca576 commit fba10a8

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed

index.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,25 @@ <h5 class="modal-title-craft"></h5>
11971197
<input type="number" step="0.1" min="0" max="999.00" />
11981198
</td>
11991199
</tr>
1200+
1201+
<tr class='dshot_bidir_required'>
1202+
<td name='gyro_rpm_notch_harmonics'>
1203+
<label>RPM Notch
1204+
<br>Harmonics</label>
1205+
<input type="number" step="0.01" min="0" max="999.00" />
1206+
</td>
1207+
<td name="gyro_rpm_notch_q">
1208+
<label>RPM Notch
1209+
<br>Q</label>
1210+
<input type="number" step="0.1" min="0" max="999.00" />
1211+
</td>
1212+
<td name='gyro_rpm_notch_min'>
1213+
<label>RPM Notch
1214+
<br>Min(Hz)</label>
1215+
<input type="number" step="0.01" min="0" max="999.00" />
1216+
</td>
1217+
</tr>
1218+
12001219
</tbody>
12011220
</table>
12021221
<table class="parameter cf">
@@ -1267,6 +1286,25 @@ <h5 class="modal-title-craft"></h5>
12671286
<input type="number" step="0.1" min="0" max="999.00" />
12681287
</td>
12691288
</tr>
1289+
1290+
<tr class='dshot_bidir_required'>
1291+
<td name='dterm_rpm_notch_harmonics'>
1292+
<label>RPM Notch
1293+
<br>Harmonics</label>
1294+
<input type="number" step="0.01" min="0" max="999.00" />
1295+
</td>
1296+
<td name="dterm_rpm_notch_q">
1297+
<label>RPM Notch
1298+
<br>Q</label>
1299+
<input type="number" step="0.1" min="0" max="999.00" />
1300+
</td>
1301+
<td name='dterm_rpm_notch_min'>
1302+
<label>RPM Notch
1303+
<br>Min(Hz)</label>
1304+
<input type="number" step="0.01" min="0" max="999.00" />
1305+
</td>
1306+
</tr>
1307+
12701308
</tbody>
12711309
</table>
12721310
<table class="parameter cf">
@@ -1654,6 +1692,13 @@ <h5 class="modal-title-craft"></h5>
16541692
<label>Motor Rate</label>
16551693
<input type="number" step="1" min="0" max="32000" />
16561694
</td>
1695+
<td name="dshot_bidir">
1696+
<label>DSHOT Bidir</label>
1697+
<select>
1698+
<!-- list generated here -->
1699+
</select>
1700+
</td>
1701+
16571702
</tr>
16581703
</tbody>
16591704
</table>

js/flightlog_parser.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ var FlightLogParser = function(logData) {
233233
dterm_average_count:null, // DTerm Average Count
234234
rollPitchItermResetRate:null, // ITerm Reset rate for Roll and Pitch
235235
yawItermResetRate:null, // ITerm Reset Rate for Yaw
236+
dshot_bidir:null, // DShot bidir protocol enabled
236237
dterm_lpf_hz:null, // DTerm Lowpass Filter Hz
237238
dterm_lpf_dyn_hz:[null, null], // DTerm Lowpass Dynamic Filter Min and Max Hz
238239
dterm_lpf2_hz:null, // DTerm Lowpass Filter Hz 2
@@ -248,6 +249,12 @@ var FlightLogParser = function(logData) {
248249
gyro_lowpass2_hz:null, // Gyro Soft Lowpass Filter Hz 2
249250
gyro_notch_hz:null, // Gyro Notch Frequency
250251
gyro_notch_cutoff:null, // Gyro Notch Cutoff
252+
gyro_rpm_notch_harmonics:null, // Number of Harmonics in the gyro rpm filter
253+
gyro_rpm_notch_q:null, // Value of Q in the gyro rpm filter
254+
gyro_rpm_notch_min:null, // Min Hz for the gyro rpm filter
255+
dterm_rpm_notch_harmonics:null, // Number of Harmonics in the dterm rpm filter
256+
dterm_rpm_notch_q:null, // Value of Q in the dterm rpm filter
257+
dterm_rpm_notch_min:null, // Min Hz for the dterm rpm filter
251258
dterm_notch_hz:null, // Dterm Notch Frequency
252259
dterm_notch_cutoff:null, // Dterm Notch Cutoff
253260
acc_lpf_hz:null, // Accelerometer Lowpass filter Hz
@@ -585,6 +592,14 @@ var FlightLogParser = function(logData) {
585592
case "use_integrated_yaw":
586593
case "d_min_gain":
587594
case "d_min_advance":
595+
case "dshot_bidir":
596+
case "gyro_rpm_notch_harmonics":
597+
case "gyro_rpm_notch_q":
598+
case "gyro_rpm_notch_min":
599+
case "dterm_rpm_notch_harmonics":
600+
case "dterm_rpm_notch_q":
601+
case "dterm_rpm_notch_min":
602+
588603
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
589604
break;
590605

js/header_dialog.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ function HeaderDialog(dialog, onSave) {
8080
{name:'rc_smoothing_active_cutoffs_1', type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.0.0', max:'999.9.9'},
8181
{name:'rc_smoothing_active_cutoffs_2', type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.0.0', max:'999.9.9'},
8282
{name:'rc_interpolation_channels' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.0.0', max:'999.9.9'},
83+
{name:'gyro_rpm_notch_harmonics' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
84+
{name:'gyro_rpm_notch_q' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
85+
{name:'gyro_rpm_notch_min' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
86+
{name:'dterm_rpm_notch_harmonics' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
87+
{name:'dterm_rpm_notch_q' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
88+
{name:'dterm_rpm_notch_min' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
89+
{name:'dshot_bidir' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
90+
8391
];
8492

8593
function isParameterValid(name) {
@@ -553,6 +561,16 @@ function HeaderDialog(dialog, onSave) {
553561
setParameter('gyro_lowpass_hz' ,sysConfig.gyro_lowpass_hz,0);
554562
setParameter('gyro_lowpass2_hz' ,sysConfig.gyro_lowpass2_hz,0);
555563

564+
setParameter('gyro_rpm_notch_harmonics', sysConfig.gyro_rpm_notch_harmonics, 0);
565+
setParameter('gyro_rpm_notch_q' , sysConfig.gyro_rpm_notch_q , 0);
566+
setParameter('gyro_rpm_notch_min' , sysConfig.gyro_rpm_notch_min , 0);
567+
568+
setParameter('dterm_rpm_notch_harmonics', sysConfig.dterm_rpm_notch_harmonics, 0);
569+
setParameter('dterm_rpm_notch_q' , sysConfig.dterm_rpm_notch_q , 0);
570+
setParameter('dterm_rpm_notch_min' , sysConfig.dterm_rpm_notch_min , 0);
571+
572+
$('.dshot_bidir_required').toggle(sysConfig.dshot_bidir == 1);
573+
556574
renderSelect('rc_smoothing_type' ,sysConfig.rc_smoothing_type, RC_SMOOTHING_TYPE);
557575
renderSelect('rc_interpolation' ,sysConfig.rc_interpolation, RC_INTERPOLATION);
558576
setParameter('rc_interpolation_interval' ,sysConfig.rc_interpolation_interval,0);
@@ -595,15 +613,17 @@ function HeaderDialog(dialog, onSave) {
595613
setParameter('rate_limits_roll' , sysConfig.rate_limits[0], 0);
596614
setParameter('rate_limits_pitch' , sysConfig.rate_limits[1], 0);
597615
setParameter('rate_limits_yaw' , sysConfig.rate_limits[2], 0);
598-
$("rate_limits").show();
616+
$("#rate_limits").show();
599617
} else {
600618
$("#d_min").hide();
601-
$("rate_limits").hide();
619+
$("#rate_limits").hide();
602620
}
603621

604622
renderSelect('unsynced_fast_pwm' ,sysConfig.unsynced_fast_pwm, MOTOR_SYNC);
605623
renderSelect('fast_pwm_protocol' ,sysConfig.fast_pwm_protocol, FAST_PROTOCOL);
606624
setParameter('motor_pwm_rate' ,sysConfig.motor_pwm_rate,0);
625+
renderSelect('dshot_bidir' ,sysConfig.dshot_bidir, OFF_ON);
626+
607627
renderSelect('dterm_filter_type' ,sysConfig.dterm_filter_type, FILTER_TYPE);
608628
setParameter('ptermSRateWeight' ,sysConfig.ptermSRateWeight,2);
609629
setParameter('dtermSetpointWeight' ,sysConfig.dtermSetpointWeight,2);

0 commit comments

Comments
 (0)