pub struct StepConfig {
pub amplitude: f32,
pub duration_s: f32,
pub settle_band: f32,
pub filter_hz: f32,
}Expand description
Configures a StepProbe.
The amplitude is in the loop’s setpoint units (rad/s for a rate loop, rad for an angle
loop), so there is no Default: the caller picks it per loop.
Fields§
§amplitude: f32Step size and direction, in setpoint units: the setpoint is held at the measurement at the start plus this. Non-zero and finite.
duration_s: f32How long the step is held and measured, in seconds. Positive and finite: long enough to settle (a few rise times), short enough that a held rate step doesn’t tilt too far.
settle_band: f32Half-width of the band around the step the response must stay in to count as settled,
as a fraction of the step. In (0, 1).
filter_hz: f32Cutoff of the first-order low-pass on the measured response, in Hz; 0 turns it off. Non-negative and finite. It delays the response a little, the same for every step it measures.
Implementations§
Source§impl StepConfig
impl StepConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks every field’s stated requirement.
§Examples
use stable_flight::tuning::autotune::COPTER_RATE_STEP;
use stable_flight::tuning::StepConfig;
assert!(COPTER_RATE_STEP.validate().is_ok());
let bad = StepConfig { settle_band: 1.5, ..COPTER_RATE_STEP };
assert!(bad.validate().is_err());Trait Implementations§
Source§impl Clone for StepConfig
impl Clone for StepConfig
impl Copy for StepConfig
Source§impl Debug for StepConfig
impl Debug for StepConfig
Source§impl PartialEq for StepConfig
impl PartialEq for StepConfig
impl StructuralPartialEq for StepConfig
Auto Trait Implementations§
impl Freeze for StepConfig
impl RefUnwindSafe for StepConfig
impl Send for StepConfig
impl Sync for StepConfig
impl Unpin for StepConfig
impl UnsafeUnpin for StepConfig
impl UnwindSafe for StepConfig
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.