Skip to content

Add Rate PID target/error filter FFT plots and LOG_BITMASK note#328

Open
amilcarlucas wants to merge 6 commits into
ArduPilot:mainfrom
amilcarlucas:PID_notch
Open

Add Rate PID target/error filter FFT plots and LOG_BITMASK note#328
amilcarlucas wants to merge 6 commits into
ArduPilot:mainfrom
amilcarlucas:PID_notch

Conversation

@amilcarlucas

Copy link
Copy Markdown
Contributor

Add two new frequency-domain graphs that visualise the effect of the ArduPilot rate PID input filters:

  • "Rate PID target filters": overlays the FFT of the unfiltered rate target (RATE.RDes/PDes/YDes) against the filtered target seen by the PID controller (PIDR/PIDP/PIDY.Tar), making the effect of the target filter (ATC_RAT_xxx_FLTT) visible.

  • "Rate PID error filters": overlays the FFT of the raw error (Tar - Act, before the error filter) against the filtered error used by the PID (PIDR/PIDP/PIDY.Err), making the effect of the error filter (ATC_RAT_xxx_FLTE) visible.

Both plots share the existing frequency-axis zoom/pan link and respect the amplitude/frequency scale controls. They are only shown when a Roll, Pitch, or Yaw axis is selected; hidden for PIQR/PIQP/PIQY, PIDS, and PIDA. RATE data is processed at its own sample rate (no interpolation onto PID timestamps).

Also adds a prominent notice at the top of the page reminding users that the PID bit of LOG_BITMASK must be enabled for any PID log messages to be present in the log.

@amilcarlucas

amilcarlucas commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

This is a complement to the only written documentation about the Ardupilot 4.5 PID notch filters

@andyp1per this should make it a lot easier for you and our users to tune the PID notch filters.

@IamPete1

Copy link
Copy Markdown
Member

I like the update to add the D FF properly. I'm not really a huge fan of mixing data between messages. They can be at a different rate, or at different points in time. If we did want to support notches correctly I would want to see all parameters tracked so changes split the log correctly. My preference would be to add new boxes to the exiting interface rather than add two new plots.

image

In the PID -> Inputs box there could be a check box for "Filtered target" and "Filtered error"

I'm not sure adding the center frequencies to the plots really helps.

From the ArduPilot side I would like to see the PID logs improved so they log the target both sides of the filter.

@amilcarlucas

Copy link
Copy Markdown
Contributor Author

It already shows filtered target and filtered error.

It is missing unfiltered target and unfiltered error. Both can be derived from information already present in the log.

The extra graphs contain extra usefull data at the bottom

@amilcarlucas

amilcarlucas commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

And regarding the Target, Actual and Error checkboxes, it is more complicated than that.
PID "Target" currently has different meanings depending on the message:

  • For RATE messages is the unfiltered target.
  • For PID messages it is the filtered target.

For PID Actual it might be similar.

And we want this tool to work for both ArduPilot 4.5, 4.6, 4.7 ... Even if we improve logging upstream, it will not fix the many legacy systems deployed out there.

I think this is a big step forward that should go in as it is. What do you think?

@IamPete1

Copy link
Copy Markdown
Member

Can you give a example where the new plots are useful?

@amilcarlucas

Copy link
Copy Markdown
Contributor Author

I added a third commit containing documentation explaining how these graphs are used to remove frame resonances.

Also adds a prominent notice at the top of the page reminding users
that the PID bit of LOG_BITMASK must be enabled for any PID log
messages to be present in the log.

Adds documentation and a signalflow graph
… note

Add two new frequency-domain graphs that visualise the effect of the
ArduPilot rate PID input filters:

- "Rate PID target filters": overlays the FFT of the unfiltered rate
  target (RATE.RDes/PDes/YDes) against the filtered target seen by the
  PID controller (PIDR/PIDP/PIDY.Tar), making the effect of the target
  filter (ATC_RAT_xxx_FLTT) visible.

- "Rate PID error filters": overlays the FFT of the raw error
  (Tar - Act, before the error filter) against the filtered error used
  by the PID (PIDR/PIDP/PIDY.Err), making the effect of the error
  filter (ATC_RAT_xxx_FLTE) visible.

Both plots share the existing frequency-axis zoom/pan link and respect
the amplitude/frequency scale controls. They are only shown when a
Roll, Pitch, or Yaw axis is selected; hidden for PIQR/PIQP/PIQY,
PIDS, and PIDA. RATE data is processed at its own sample rate
(no interpolation onto PID timestamps).

Also adds a prominent notice at the top of the page reminding users
that the PID bit of LOG_BITMASK must be enabled for any PID log
messages to be present in the log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants