Conversation
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
left a comment
There was a problem hiding this comment.
The docs look factually accurate and reasonably organized to me. Just have some grammar nits.
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
I applied your diffs :) Thanks for the quick review |
| output = filter.last_value() | ||
| ``` | ||
|
|
||
| ## Sample Rate Matters |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
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.