Repository navigation
feat(sensors): log the gyro filter state for tuning analysis - #29064
Draft
isak-aslund wants to merge 4 commits into
Draft
isak-aslund wants to merge 4 commits into
isak-aslund wants to merge 4 commits into
Conversation
The log shows the motor RPM and the gyro FFT peaks, but not where the dynamic notch filters actually are: notches are parked at the minimum frequency, only one is updated per cycle and harmonics above Nyquist are disabled. gyro_filter_status publishes the applied filter chain at 100 Hz so a log can show whether the notches sit on the noise. Left out on CONSTRAINED_FLASH builds. Signed-off-by: Isak Åslund <isak.aslund@airolit.com>
The high-rate profile already logs the filtered gyro, the rate controller and the ESC RPM for filter and rate tuning; the raw gyro comes from the gyro FIFO profile. Signed-off-by: Isak Åslund <isak.aslund@airolit.com>
SIH_GYRO_VIB and SIH_ACCEL_VIB add vibration at each motor's frequency and two harmonics, growing with rpm squared, so the gyro filters can be tested in SITL. Both default to 0. Signed-off-by: Isak Åslund <isak.aslund@airolit.com>
Contributor
🔎 Flash and RAM Analysis
px4_fmu-v2 — Bloaty section/symbol breakdownpx4_fmu-v5x — Bloaty section/symbol breakdownpx4_fmu-v6x — Bloaty section/symbol breakdownUpdated: 2026-10-09T23:37:25 |
Contributor
|
No broken links found in changed files. |
…status The filter cutoffs, notch bandwidths and static notches are parameters, the gyro and its rate are in sensor_selection and vehicle_imu_status, and the FFT notch width follows from sensor_gyro_fft, all already logged. Only the notch frequencies change at runtime. Signed-off-by: Isak Åslund <isak.aslund@airolit.com>
Contributor
|
I don't think we should publish the message at 100Hz by default, I'd put it behind a parameter. Since you're really only going to be doing this during testing, on an already tuned vehicle it's an unnecessary burden |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A PX4 log doesn't show where the dynamic notch filters were during a flight. Notches are parked at
IMU_GYRO_DNF_MINwhen RPM is low or missing, only one is updated per axis per cycle, and harmonics above Nyquist are disabled, so the position can't be rebuilt reliably fromesc_status. This PR publishes the applied filter state so a log shows whether the notches sit on the motor noise. It's the PX4 part of RFC #29065; the Flight Review side is PX4/flight_review#349.gyro_filter_status, published byVehicleAngularVelocityat 100 Hz, with only what changes at runtime: every RPM notch frequency (per harmonic and ESC, X axis; PX4 applies the same RPM notches to all axes) and the FFT notch frequencies per axis. Notch widths, cutoffs and static notches are parameters, and the gyro and its rate are insensor_selectionandvehicle_imu_status, so they aren't repeated. Left out onCONSTRAINED_FLASHbuilds; about 1 KB flash on fmu-v6x.SDLOG_PROFILEbit 4), oneadd_optional_topicline, with a note in the filter tuning docs.SIH_GYRO_VIB/SIH_ACCEL_VIBadd vibration at each motor's frequency and two harmonics to the SIH IMU, so the filters can be tested in SITL. Both default to 0.Tested in SITL with the SIH quadrotor (1 kHz gyro, RPM and FFT notches, simulated vibration, offboard throttle sweep and per-axis excitation). Builds for
px4_fmu-v6xandpx4_sitl. Not yet flown on hardware.Angular velocity spectrogram in Flight Review with the new data, same colour scale: gyro before filtering (left), with the notches over time (middle), after filtering (right):
Created on behalf of Isak Åslund with Claude (Claude Code): filter state topic, logging, SIH vibration, SITL testing and write-up.