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: f32The attitude step, in rad, held for step_duration_s.
step_duration_s: f32How long the step is held, in s.
max_rate_radps: f32The attitude loop’s rate limit, in rad/s.
max_moment: f32The moment the rate loop may command, normalized: full deflection less the trim and a margin.
max_integral: f32The rate loop’s integral limit, in rad of accumulated rate error.
static_trim: f32The trim the rate loop adds without its integral, normalized
(PlaneRateControllerConfig::trim):
the integral holds the rest of the model’s trim_moment.
max_overshoot: f32Largest overshoot, as a fraction of the step.
max_saturated_s: f32Longest 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: f32The 10–90% rise allowed, in time constants: a first-order response rises in 2.2.
Implementations§
Source§impl WingDesignConfig
impl WingDesignConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
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
impl Clone for WingDesignConfig
impl Copy for WingDesignConfig
Source§impl Debug for WingDesignConfig
impl Debug for WingDesignConfig
Source§impl PartialEq for WingDesignConfig
impl PartialEq for WingDesignConfig
impl StructuralPartialEq for WingDesignConfig
Auto Trait Implementations§
impl Forget for WingDesignConfig
impl Freeze for WingDesignConfig
impl Move for WingDesignConfig
impl RefUnwindSafe for WingDesignConfig
impl Send for WingDesignConfig
impl Sync for WingDesignConfig
impl Unpin for WingDesignConfig
impl UnsafeUnpin for WingDesignConfig
impl UnwindSafe for WingDesignConfig
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.