pub struct YawControllerConfig {
pub gains: Gains,
pub max_integral: f32,
pub max_rate_radps: f32,
}Expand description
Configures the yaw controller with PID gains and operational limits.
This structure defines the control parameters that determine how the yaw controller responds to heading errors, including responsiveness, stability, and maximum rates.
Fields§
§gains: GainsPID gains that determine controller responsiveness.
p- Proportional gain: controls response strength relative to current error.i- Integral gain: eliminates steady-state errors over time.d- Derivative gain: provides damping to reduce overshoot and oscillation.
max_integral: f32Maximum absolute value of the integrated heading error, in rad·s.
Prevents integral windup by limiting accumulated error, which could otherwise cause significant overshoot and control instability.
max_rate_radps: f32Maximum angular rate in radians/second for yaw.
Limits the output commands to physically achievable rates and prevents excessive control demands that could destabilize the system.
Implementations§
Source§impl YawControllerConfig
impl YawControllerConfig
Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks the config: max_integral and max_rate_radps must be non-negative and finite.
§Examples
use stable_flight::controllers::YawControllerConfig;
assert!(YawControllerConfig::default().validate().is_ok());
let bad = YawControllerConfig { max_rate_radps: f32::NAN, ..Default::default() };
assert!(bad.validate().is_err());Trait Implementations§
Source§impl Clone for YawControllerConfig
impl Clone for YawControllerConfig
impl Copy for YawControllerConfig
Source§impl Debug for YawControllerConfig
impl Debug for YawControllerConfig
Source§impl Default for YawControllerConfig
impl Default for YawControllerConfig
Source§impl PartialEq for YawControllerConfig
impl PartialEq for YawControllerConfig
impl StructuralPartialEq for YawControllerConfig
Auto Trait Implementations§
impl Forget for YawControllerConfig
impl Freeze for YawControllerConfig
impl Move for YawControllerConfig
impl RefUnwindSafe for YawControllerConfig
impl Send for YawControllerConfig
impl Sync for YawControllerConfig
impl Unpin for YawControllerConfig
impl UnsafeUnpin for YawControllerConfig
impl UnwindSafe for YawControllerConfig
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.