Skip to main content

WingDesignConfig

Struct WingDesignConfig 

Source
pub struct WingDesignConfig {
    pub amplitude_rad: f32,
    pub step_duration_s: f32,
    pub max_rate_radps: f32,
    pub max_moment: f32,
    pub max_integral: f32,
    pub static_trim: f32,
    pub max_overshoot: f32,
    pub max_saturated_s: f32,
    pub time_constant_range_s: [f32; 2],
    pub rise_per_time_constant: f32,
}
Expand description

What the design holds a step on the model to, and the limits the model flies under.

Fields§

§amplitude_rad: f32

The attitude step, in rad, held for step_duration_s.

§step_duration_s: f32

How long the step is held, in s.

§max_rate_radps: f32

The attitude loop’s rate limit, in rad/s.

§max_moment: f32

The moment the rate loop may command, normalized: full deflection less the trim and a margin.

§max_integral: f32

The rate loop’s integral limit, in rad of accumulated rate error.

§static_trim: f32

The trim the rate loop adds without its integral, normalized (PlaneRateControllerConfig::trim): the integral holds the rest of the model’s trim_moment.

§max_overshoot: f32

Largest overshoot, as a fraction of the step.

§max_saturated_s: f32

Longest the moment may clip, in s.

§time_constant_range_s: [f32; 2]

The time constants the design may pick, in s, from the least to the most.

§rise_per_time_constant: f32

The 10–90% rise allowed, in time constants: a first-order response rises in 2.2.

Implementations§

Source§

impl WingDesignConfig

Source

pub fn validate(&self) -> Result<(), InvalidConfig>

Checks that every field is positive and finite (max_overshoot and max_saturated_s may be 0, max_moment at most 1) and the time constant range is in order.

§Examples
use stable_flight::tuning::WingDesignConfig;

let config = WingDesignConfig {
    amplitude_rad: 0.17,
    step_duration_s: 4.0,
    max_rate_radps: 1.0,
    max_moment: 0.8,
    max_integral: 2.0,
    static_trim: 0.0,
    max_overshoot: 0.05,
    max_saturated_s: 0.042,
    time_constant_range_s: [0.2, 1.5],
    rise_per_time_constant: 2.2,
};
assert!(config.validate().is_ok());
assert!(WingDesignConfig { max_moment: 1.5, ..config }.validate().is_err());

Trait Implementations§

Source§

impl Clone for WingDesignConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WingDesignConfig

Source§

impl Debug for WingDesignConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for WingDesignConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WingDesignConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.