pub struct NotchConfig {
pub center_hz: f32,
pub bandwidth_hz: f32,
pub attenuation_db: f32,
}Expand description
Where a gyro notch cuts and how deep: one vibration tone, such as a motor’s, removed from the body rates before the low-pass, so the rate loop’s D doesn’t amplify it into the moments. A low-pass alone barely touches a tone just above its cutoff.
ArduPilot’s harmonic notch in its fixed mode (INS_HNTCH_FREQ, INS_HNTCH_BW,
INS_HNTCH_ATT, NotchFilter), described, not copied: a biquad whose band edges sit
geometrically about the center, center − bandwidth/2 below it, with a finite depth.
§Examples
use stable_flight::controllers::NotchConfig;
assert!(!NotchConfig::default().is_on());
let notch = NotchConfig { center_hz: 90.0, bandwidth_hz: 45.0, attenuation_db: 40.0 };
assert!(notch.validate().is_ok());Fields§
§center_hz: f32The tone cut, in Hz; 0 turns the notch off, and so does one at or past 0.48 of the sample rate. One under 0.52 of the bandwidth cuts at 0.52 of it. Non-negative and finite.
bandwidth_hz: f32Width of the band cut, in Hz: wider takes a tone that wanders, at more lag below the center (ArduPilot suggests half the center); 0 cuts nothing. Non-negative and finite.
attenuation_db: f32How deep the notch cuts at its center, in dB. Positive and finite: past 40 dB it cuts
hard rather than attenuating (ArduPilot’s INS_HNTCH_ATT default is 40).
Implementations§
Source§impl NotchConfig
impl NotchConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks each field’s stated requirement; each stands alone, so a param can change any one of them.
Trait Implementations§
Source§impl Clone for NotchConfig
impl Clone for NotchConfig
impl Copy for NotchConfig
Source§impl Debug for NotchConfig
impl Debug for NotchConfig
Source§impl Default for NotchConfig
impl Default for NotchConfig
Source§impl PartialEq for NotchConfig
impl PartialEq for NotchConfig
impl StructuralPartialEq for NotchConfig
Auto Trait Implementations§
impl Forget for NotchConfig
impl Freeze for NotchConfig
impl Move for NotchConfig
impl RefUnwindSafe for NotchConfig
impl Send for NotchConfig
impl Sync for NotchConfig
impl Unpin for NotchConfig
impl UnsafeUnpin for NotchConfig
impl UnwindSafe for NotchConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.