pub struct PlaneTuneHoldConfig {
pub thrust: f32,
pub thrust_per_m: f32,
pub max_thrust_trim: f32,
pub thrust_time_constant_s: f32,
pub trim_airspeed_mps: f32,
pub pitch_per_mps: f32,
pub trim_time_constant_s: f32,
pub max_trim_rad: f32,
pub return_radius_m: f32,
pub turn_bank_rad: f32,
pub recover_to: FlightRegime,
}Expand description
PlaneTuneHold settings.
Fields§
§thrust: f32The thrust the hold flies, in [0, 1], before its altitude trim: the airframe’s cruise
thrust, or the thrust it flies level on.
thrust_per_m: f32How much the thrust trim adds per m below the altitude the hold started at (takes off above it), as a pilot holds height with the throttle. Higher: holds the height tighter, and moves the thrust under a pitch step more. 0 turns it off. Non-negative.
max_thrust_trim: f32The farthest the thrust trim moves the thrust from thrust.
Non-negative.
thrust_time_constant_s: f32How slowly the thrust trim follows the altitude, in s (a first-order time constant).
trim_airspeed_mps: f32The airspeed the pitch trim holds, in m/s: the plane stabilizer’s trim airspeed.
pitch_per_mps: f32How far the trim pitches the nose per m/s of airspeed off trim, in rad per m/s: down when slow, up when fast. Higher: holds the airspeed tighter, and stirs the phugoid.
trim_time_constant_s: f32How slowly the trim follows the airspeed, in s (a first-order time constant): slow enough that a probe’s few seconds don’t see it move.
max_trim_rad: f32The farthest the trim pitches the nose from where the hold started, in rad.
return_radius_m: f32Beyond this distance from where the hold started, the hold turns back toward it
between probes (allow_turn), in m.
turn_bank_rad: f32The bank of that turn, in rad.
recover_to: FlightRegimeWhat recover flies: a hover where the vehicle is
(FlightRegime::Copter, for a VTOL), or wings level (FlightRegime::Plane).
Implementations§
Source§impl PlaneTuneHoldConfig
impl PlaneTuneHoldConfig
Sourcepub fn new(thrust: f32, trim_airspeed_mps: f32) -> Self
pub fn new(thrust: f32, trim_airspeed_mps: f32) -> Self
A hold at thrust, trimming pitch toward trim_airspeed_mps by 1° per m/s over 5 s
and within 10° of the start (a pilot’s FBWA trim; the sim’s airplane held its airspeed
through a tune this way, and slowed past its minimum within a few steps without it,
#533), trimming thrust by 0.01 per m below the start over 10 s and within 0.1 (the
Alia 250 sank 0.2 m/s on its thrust alone, past the envelope’s 40 m within 3 minutes,
#534), turning back at 20° of bank beyond 600 m, and recovering wings level.
§Examples
use stable_flight::commanders::PlaneTuneHoldConfig;
let config = PlaneTuneHoldConfig::new(0.55, 18.0);
assert!(config.validate().is_ok());Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks that thrust is in [0, 1], its trim’s gain and limit non-negative, the
airspeed, gains, time constants, trim limit, and radius positive, and the turn’s bank
in (0, 60°].
Trait Implementations§
Source§impl Clone for PlaneTuneHoldConfig
impl Clone for PlaneTuneHoldConfig
impl Copy for PlaneTuneHoldConfig
Source§impl Debug for PlaneTuneHoldConfig
impl Debug for PlaneTuneHoldConfig
Source§impl PartialEq for PlaneTuneHoldConfig
impl PartialEq for PlaneTuneHoldConfig
impl StructuralPartialEq for PlaneTuneHoldConfig
Auto Trait Implementations§
impl Forget for PlaneTuneHoldConfig
impl Freeze for PlaneTuneHoldConfig
impl Move for PlaneTuneHoldConfig
impl RefUnwindSafe for PlaneTuneHoldConfig
impl Send for PlaneTuneHoldConfig
impl Sync for PlaneTuneHoldConfig
impl Unpin for PlaneTuneHoldConfig
impl UnsafeUnpin for PlaneTuneHoldConfig
impl UnwindSafe for PlaneTuneHoldConfig
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.