pub struct AltitudeControllerConfig {
pub gains: Gains,
pub max_integral: f32,
pub hover_thrust: f32,
pub integration_band_m: f32,
}Expand description
Configures the AltitudeController.
Fields§
§gains: GainsPID gains from altitude error (m) to vertical acceleration (m/s², up).
max_integral: f32Maximum absolute value of the integrated altitude error, in m·s. Prevents integral windup by limiting error accumulation.
hover_thrust: f32Linear thrust (before the stabilizer’s thrust curve) that holds a level hover. The controller feeds it forward, so the integral only trims the residual. Airframe-specific.
integration_band_m: f32The integral accumulates only within this many meters of the target altitude. Wider:
trims a hover_thrust mismatch from farther off, but winds up over a long climb or
descent and overshoots the target. Must be positive and finite. Defaults to
DEFAULT_INTEGRATION_BAND_M.
Implementations§
Source§impl AltitudeControllerConfig
impl AltitudeControllerConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks the config: max_integral must be non-negative and finite, hover_thrust in
(0, 1], and integration_band_m positive and finite.
§Examples
use stable_flight::controllers::AltitudeControllerConfig;
assert!(AltitudeControllerConfig::default().validate().is_ok());
let bad = AltitudeControllerConfig { hover_thrust: 1.5, ..Default::default() };
assert!(bad.validate().is_err());Trait Implementations§
Source§impl Clone for AltitudeControllerConfig
impl Clone for AltitudeControllerConfig
impl Copy for AltitudeControllerConfig
Source§impl Debug for AltitudeControllerConfig
impl Debug for AltitudeControllerConfig
Source§impl Default for AltitudeControllerConfig
impl Default for AltitudeControllerConfig
Source§impl PartialEq for AltitudeControllerConfig
impl PartialEq for AltitudeControllerConfig
impl StructuralPartialEq for AltitudeControllerConfig
Auto Trait Implementations§
impl Forget for AltitudeControllerConfig
impl Freeze for AltitudeControllerConfig
impl Move for AltitudeControllerConfig
impl RefUnwindSafe for AltitudeControllerConfig
impl Send for AltitudeControllerConfig
impl Sync for AltitudeControllerConfig
impl Unpin for AltitudeControllerConfig
impl UnsafeUnpin for AltitudeControllerConfig
impl UnwindSafe for AltitudeControllerConfig
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.