|
272 | 272 | /> |
273 | 273 | </div> |
274 | 274 | </div> |
| 275 | + <div |
| 276 | + v-if="rpmFilterEnabled && hasExtendedRpmFilter" |
| 277 | + class="flex flex-wrap items-end gap-3 pl-8" |
| 278 | + > |
| 279 | + <div class="flex flex-col gap-1"> |
| 280 | + <span class="text-xs text-dimmed">{{ $t("pidTuningRpmQ") }}</span> |
| 281 | + <UInputNumber |
| 282 | + size="xs" |
| 283 | + orientation="vertical" |
| 284 | + class="w-16" |
| 285 | + v-model="gyro_rpm_notch_q" |
| 286 | + :step="1" |
| 287 | + :min="250" |
| 288 | + :max="3000" |
| 289 | + /> |
| 290 | + </div> |
| 291 | + <div v-for="i in gyro_rpm_notch_harmonics" :key="i" class="flex flex-col gap-1"> |
| 292 | + <span class="text-xs text-dimmed">{{ $t("pidTuningRpmWeight", { index: i }) }}</span> |
| 293 | + <UInputNumber |
| 294 | + size="xs" |
| 295 | + orientation="vertical" |
| 296 | + class="w-16" |
| 297 | + :model-value="gyro_rpm_notch_weights[i - 1]" |
| 298 | + @update:model-value="setRpmWeight(i - 1, $event)" |
| 299 | + :step="1" |
| 300 | + :min="0" |
| 301 | + :max="100" |
| 302 | + /> |
| 303 | + </div> |
| 304 | + <div class="flex flex-col gap-1"> |
| 305 | + <span class="text-xs text-dimmed">{{ $t("pidTuningRpmFadeRangeHz") }}</span> |
| 306 | + <UInputNumber |
| 307 | + size="xs" |
| 308 | + orientation="vertical" |
| 309 | + class="w-16" |
| 310 | + v-model="gyro_rpm_notch_fade_range_hz" |
| 311 | + :step="1" |
| 312 | + :min="0" |
| 313 | + :max="1000" |
| 314 | + /> |
| 315 | + </div> |
| 316 | + </div> |
275 | 317 | </div> |
276 | 318 | </template> |
277 | 319 |
|
@@ -535,6 +577,8 @@ import { |
535 | 577 | NON_EXPERT_SLIDER_MIN_DTERM, |
536 | 578 | NON_EXPERT_SLIDER_MAX_DTERM, |
537 | 579 | } from "@/composables/useTuningSliders"; |
| 580 | +import semver from "semver"; |
| 581 | +import { API_VERSION_1_48 } from "@/js/data_storage"; |
538 | 582 | import MSP from "@/js/msp"; |
539 | 583 | import MSPCodes from "@/js/msp/MSPCodes"; |
540 | 584 | import { mspHelper } from "@/js/msp/MSPHelper"; |
@@ -887,6 +931,7 @@ const gyro_notch2_cutoff = computed({ |
887 | 931 | }); |
888 | 932 |
|
889 | 933 | // RPM Filter |
| 934 | +const hasExtendedRpmFilter = computed(() => semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_48)); |
890 | 935 | const dshotTelemetryEnabled = computed(() => FC.MOTOR_CONFIG.use_dshot_telemetry ?? false); |
891 | 936 |
|
892 | 937 | const rpmFilterEnabled = computed({ |
@@ -915,6 +960,22 @@ const gyro_rpm_notch_min_hz = computed({ |
915 | 960 | set: (value) => (FC.FILTER_CONFIG.gyro_rpm_notch_min_hz = value), |
916 | 961 | }); |
917 | 962 |
|
| 963 | +const gyro_rpm_notch_fade_range_hz = computed({ |
| 964 | + get: () => FC.FILTER_CONFIG.gyro_rpm_notch_fade_range_hz ?? 0, |
| 965 | + set: (value) => (FC.FILTER_CONFIG.gyro_rpm_notch_fade_range_hz = value), |
| 966 | +}); |
| 967 | +
|
| 968 | +const gyro_rpm_notch_q = computed({ |
| 969 | + get: () => FC.FILTER_CONFIG.gyro_rpm_notch_q ?? 0, |
| 970 | + set: (value) => (FC.FILTER_CONFIG.gyro_rpm_notch_q = value), |
| 971 | +}); |
| 972 | +
|
| 973 | +const gyro_rpm_notch_weights = computed(() => FC.FILTER_CONFIG.gyro_rpm_notch_weights ?? [0, 0, 0]); |
| 974 | +
|
| 975 | +function setRpmWeight(index, value) { |
| 976 | + FC.FILTER_CONFIG.gyro_rpm_notch_weights[index] = value; |
| 977 | +} |
| 978 | +
|
918 | 979 | // Dynamic Notch Filter |
919 | 980 | const dynamicNotchEnabled = computed({ |
920 | 981 | get: () => FC.FILTER_CONFIG.dyn_notch_count !== 0, |
|
0 commit comments