Comments (9)
@rotorflight definately something has to be done, If any first order lpf will be set above nyquist/2, bad things might happen. Also pt1 filter might have it's own limitCutoff()
function.
from rotorflight-firmware.
The formula used in BF is incorrect. They have discussed it, and concluded that they did not want to fix it, as people are used to have it that way. Everybody would have needed to fix their configs after that.
The BF formula is for a continuous domain first order filter. When a continuous filter is converted into a discrete filter with Tustin/bilinear transform/zero order hold/etc, frequency warping happens. The cutoff formula must do frequency pre-warping to compensate.
Further, a discrete first order filter can't have cutoff above Nyquist / 2. (unlike the continuous first order).
If you try to use a freq higher than this, the gain will be incorrect.
from rotorflight-firmware.
See https://en.wikipedia.org/wiki/Bilinear_transform
Section "Frequency Warping"
from rotorflight-firmware.
@rotorflight thanks fo quick response, so that limitCutoff()
is probably wrong, there is
// 95% of Nyquist
return fminf(cutoff, 0.475f * sampleRate);
but should be
// 47.5% of Nyquist
return fminf(cutoff, 0.2375f * sampleRate);
I'm not sure if UI account this, it shouldn't allow to set any LPF above nyquist/2 too.
from rotorflight-firmware.
Only the first order LPF has this limit. Higher order LPFs can go up to Nyquist.
from rotorflight-firmware.
But we can add a limit in the 1st order gain calculation so that it is never higher than 0.99 or so.
from rotorflight-firmware.
I'll keep this issue open until the limit has been added.
from rotorflight-firmware.
Correction. Only the filters that are converted to digital domain with the "rectangular rule" (zero-order hold) rather than the "trapezoidal rule" or bi-linear transform has this problem. PTx filters and EWMAx are the only ones in RF like this.
Both types require the frequency pre-warping. However, PTx filters just can't go over Fs/4.
from rotorflight-firmware.
Fixed in devel branch.
from rotorflight-firmware.
Related Issues (20)
- Blackbox logging for ESC telemetry HOT 1
- Fix cell count does not affect configurator (potentially the internal calculation as well) HOT 1
- ESC Setup / programming (bidirectional telemetry) HOT 4
- Add RF specific tuning values to CMS HOT 9
- Tail kicking in hard pitch pumps
- ‘Corrupted’ throttle output with 760us throttle servo HOT 1
- Trim flight
- Add heading configuration option and magnetometer/compass telemetry HOT 2
- Forward Programming for Hobbywing Platinum V4 ESCs HOT 3
- Fix: set default gov_mode to OFF HOT 1
- Accumulated Governor Refactor Suggestions HOT 5
- Telemetry Reuse for Jeti HOT 5
- BB log / Auto delete, or overwrite, or rolling log so it is able to record always HOT 1
- ESC telemetry support for Castle ESCs
- ESC telemetry support for Graupner ESCs
- ESC telemetry support for Flycolor ESCs
- Improve Rx input filtering - response time and acceleration
- Cross-coupling gain and cutoff scaling HOT 1
- Accumulated HSI ideas
- Cumulative yaw improvements
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rotorflight-firmware.