Skip to content

Add BiquadFilter documentation - #3351

Open
r4stered wants to merge 3 commits into
wpilibsuite:mainfrom
r4stered:biquad-docs
Open

r4stered wants to merge 3 commits into
wpilibsuite:mainfrom
r4stered:biquad-docs

Conversation

@r4stered

@r4stered r4stered commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Adds a page for the BiquadFilter class introduced in allwpilib #8814, covering when to prefer it over LinearFilter, how to choose a filter family, every design factory, and the sample-rate constraints.

Adds a page for the BiquadFilter class introduced in allwpilib #8814,
covering when to prefer it over LinearFilter, how to choose a filter
family, every design factory, and the sample-rate constraints that make
or break a design.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Au8wgUyNNdaVYck5ZcSQE

@calcmogul calcmogul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs look factually accurate and reasonably organized to me. Just have some grammar nits.

Comment thread source/docs/software/advanced-controls/filters/biquad-filter.rst Outdated
Comment thread source/docs/software/advanced-controls/filters/biquad-filter.rst Outdated
r4stered and others added 2 commits August 27, 2026 08:26
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
@r4stered

Copy link
Copy Markdown
Contributor Author

The docs look factually accurate and reasonably organized to me. Just have some grammar nits.

I applied your diffs :) Thanks for the quick review

output = filter.last_value()
```

## Sample Rate Matters

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels too late, as the magic number 50 already appears in all the code samples without explanation


There is also a practical reason the class works in small chunks instead of one big calculation. Sharp filters need a lot of math, and doing it all at once makes rounding errors pile up until the output goes haywire. Splitting the work into a chain of small filters keeps the numbers well-behaved.

## Some Words You'll Need

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are worth building into the Controls glossary


The ``notch`` factory removes one specific frequency and leaves everything else alone. Use it when something on your robot vibrates at a rate you can measure, such as a mechanical resonance or a wheel wobble at a steady speed. It takes no ``Kind`` and no order.

The ``qualityFactor`` argument, usually written Q, sets how narrow the notch is. A higher Q removes a narrower slice of frequencies. If you know the frequency you are trying to kill exactly, use a high Q. If it drifts around a bit, use a lower one so the notch is wide enough to catch it. There is more on this at [Q factor](https://en.wikipedia.org/wiki/Q_factor) on Wikipedia.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Q factor article on Wikipedia talks about a lot of different things, so I think students would get overwhelmed with this description and a link. Maybe it's better to do a numerical example of Q factor, and then reference wikipedia for more details

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.

3 participants