pub struct DesignPlan {
pub identify: IdentifyConfig,
pub design: LoopShapingConfig,
pub rate_i_per_p: Option<f32>,
}Expand description
Gains for one loop from a fitted model of its axis, committed without steps: search from
them once every loop is designed (StagePlan::copter_design_search).
- Identify:
identifyexcites the axis on its rate loop’s setpoint (an angle loop’s probe runs on the rate loop under it) and fits aRateModel. The fit starts at the settle timeout even when the vehicle hasn’t settled: a loop that rings on its start gains only adds excitation (#356). A slow host may stop it 3 times in a row before the stage fails. - Design: a rate loop’s P and D by
design_rate, its I atrate_i_per_pof P; an angle loop’s P bydesign_angle_pon the rate loop’s committed gains, its I and D kept. A fit the design can’t use runs again; the third fails the stage (AutotuneAbort::Design). - Hold: the design flies until the vehicle holds the settle about the loop’s axis on
it. One that doesn’t within the settle timeout (
AutotuneEvent::Unsettled), or breaches the envelope, goes back and counts as an unusable fit. The design flies from then on (Outcome::Designed), but a failure before its loop’s search finishes puts the loop’s earlier gains back.
Fields§
§identify: IdentifyConfigThe excitation and fit.
design: LoopShapingConfigThe design’s margins and angle P range.
rate_i_per_p: Option<f32>A rate design’s I at this share of its P, in 1/s (SearchPlan::i_per_p); None
keeps the start’s I. Non-negative and finite.
Implementations§
Source§impl DesignPlan
impl DesignPlan
Sourcepub fn copter() -> Self
pub fn copter() -> Self
The copter defaults: COPTER_IDENTIFY, COPTER_LOOP_SHAPING, and rate I at
RATE_I_PER_P.
§Examples
use stable_flight::tuning::autotune::{COPTER_LOOP_SHAPING, DesignPlan};
assert_eq!(DesignPlan::copter().design, COPTER_LOOP_SHAPING);Sourcepub fn large_copter() -> Self
pub fn large_copter() -> Self
A full-size multirotor’s: COPTER_IDENTIFY, LARGE_COPTER_LOOP_SHAPING, and the
start’s rate I kept, as StagePlan::large_copter_search keeps it.
§Examples
use stable_flight::tuning::autotune::DesignPlan;
assert!(!DesignPlan::large_copter().design.cancel_lag);Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks the fit (IdentifyConfig::validate), the design
(LoopShapingConfig::validate), and rate_i_per_p.
Trait Implementations§
Source§impl Clone for DesignPlan
impl Clone for DesignPlan
impl Copy for DesignPlan
Source§impl Debug for DesignPlan
impl Debug for DesignPlan
Source§impl PartialEq for DesignPlan
impl PartialEq for DesignPlan
impl StructuralPartialEq for DesignPlan
Auto Trait Implementations§
impl Forget for DesignPlan
impl Freeze for DesignPlan
impl Move for DesignPlan
impl RefUnwindSafe for DesignPlan
impl Send for DesignPlan
impl Sync for DesignPlan
impl Unpin for DesignPlan
impl UnsafeUnpin for DesignPlan
impl UnwindSafe for DesignPlan
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.