Skip to content

Commit 1aa54e6

Browse files
authored
RC filter update (#852)
1 parent b0449b4 commit 1aa54e6

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,7 @@ <h5 class="modal-title-revision"></h5>
19471947
<label>Setpoint Hz</label>
19481948
<input type="text" step="1" min="0" max="255" />
19491949
</td>
1950-
<td name="rcSmoothingFeedforwardHz">
1950+
<td name="rcSmoothingFeedforwardHz" id="rcSmoothingFeedforwardHz">
19511951
<label>Feedforward Hz</label>
19521952
<input type="text" step="1" min="0" max="255" />
19531953
</td>
@@ -1968,7 +1968,7 @@ <h5 class="modal-title-revision"></h5>
19681968
<label>Setpoint</label>
19691969
<input type="text" step="1" min="0"/>
19701970
</td>
1971-
<td name='rcSmoothingActiveCutoffsFf'>
1971+
<td name='rcSmoothingActiveCutoffsFf' id="rcSmoothingActiveCutoffsFf">
19721972
<label>Feedforward</label>
19731973
<input type="text" step="1" min="0"/>
19741974
</td>

src/header_dialog.js

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ export function HeaderDialog(dialog, onSave) {
623623
name: "rc_smoothing_active_cutoffs_ff",
624624
type: FIRMWARE_TYPE_BETAFLIGHT,
625625
min: "4.3.0",
626-
max: "999.9.9",
626+
max: "4.5.999",
627627
},
628628
{
629629
name: "rc_smoothing_active_cutoffs_sp",
@@ -1572,6 +1572,21 @@ export function HeaderDialog(dialog, onSave) {
15721572

15731573
$(".dshot_bidir_required").toggle(sysConfig.dshot_bidir == 1);
15741574

1575+
// RC Smoothing
1576+
if (activeSysConfig.firmwareType === FIRMWARE_TYPE_BETAFLIGHT) {
1577+
if (semver.gte(activeSysConfig.firmwareVersion, "4.6.0")) {
1578+
$("#rcSmoothingFeedforwardHz").hide();
1579+
$("#rcSmoothingActiveCutoffsFf").hide();
1580+
setParameter("rcSmoothingActiveCutoffsSp", sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[0], 0);
1581+
setParameter("rcSmoothingActiveCutoffsThr", sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[1], 0);
1582+
} else if (semver.gte(activeSysConfig.firmwareVersion, "4.3.0")) {
1583+
setParameter("rcSmoothingFeedforwardHz", sysConfig.rc_smoothing_feedforward_hz, 0);
1584+
setParameter("rcSmoothingActiveCutoffsFf", sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[0], 0);
1585+
setParameter("rcSmoothingActiveCutoffsSp", sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[1], 0);
1586+
setParameter("rcSmoothingActiveCutoffsThr", sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[2], 0);
1587+
}
1588+
}
1589+
15751590
if (semver.gte(activeSysConfig.firmwareVersion, "4.5.0")) {
15761591
setParameter("rcSmoothingRxSmoothed", sysConfig.rc_smoothing_rx_smoothed, 0);
15771592
$("#rcSmoothingRxSmoothed").show();
@@ -1597,11 +1612,6 @@ export function HeaderDialog(dialog, onSave) {
15971612
sysConfig.rc_smoothing_mode,
15981613
RC_SMOOTHING_MODE
15991614
);
1600-
setParameter(
1601-
"rcSmoothingFeedforwardHz",
1602-
sysConfig.rc_smoothing_feedforward_hz,
1603-
0
1604-
);
16051615
setParameter(
16061616
"rcSmoothingSetpointHz",
16071617
sysConfig.rc_smoothing_setpoint_hz,
@@ -1622,21 +1632,6 @@ export function HeaderDialog(dialog, onSave) {
16221632
sysConfig.rc_smoothing_auto_factor_throttle,
16231633
0
16241634
);
1625-
setParameter(
1626-
"rcSmoothingActiveCutoffsFf",
1627-
sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[0],
1628-
0
1629-
);
1630-
setParameter(
1631-
"rcSmoothingActiveCutoffsSp",
1632-
sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[1],
1633-
0
1634-
);
1635-
setParameter(
1636-
"rcSmoothingActiveCutoffsThr",
1637-
sysConfig.rc_smoothing_active_cutoffs_ff_sp_thr[2],
1638-
0
1639-
);
16401635
} else if (
16411636
activeSysConfig.firmwareType === FIRMWARE_TYPE_BETAFLIGHT &&
16421637
semver.gte(activeSysConfig.firmwareVersion, "3.4.0")

0 commit comments

Comments
 (0)