#[repr(C)]pub struct Coefficients {
pub kp: i32,
pub ki_period: i32,
pub derivative_decay: i32,
pub derivative_gain: i32,
pub position_gain: i32,
pub velocity_gain: i32,
pub reference_gain: i32,
pub output_min: i32,
pub output_max: i32,
pub integral_min: i32,
pub integral_max: i32,
}Expand description
C-layout signed Q8.24 coefficients and output/integral bounds.
Fields§
§kp: i32Proportional error gain, nonnegative.
ki_period: i32Integral gain times sample period, nonnegative.
derivative_decay: i32Filter decay in the inclusive interval [0, 2^24].
derivative_gain: i32Filtered derivative gain on the measurement difference, nonnegative.
position_gain: i32Discrete LQR position state feedback.
velocity_gain: i32Discrete LQR velocity state feedback; zero for the scalar thermal model.
reference_gain: i32Steady-state reference prefilter gain.
output_min: i32Minimum actuator command.
output_max: i32Maximum actuator command.
integral_min: i32Minimum PID integral state.
integral_max: i32Maximum PID integral state.
Implementations§
Source§impl Coefficients
impl Coefficients
Sourcepub fn validate(&self) -> Result<(), InvalidCoefficients>
pub fn validate(&self) -> Result<(), InvalidCoefficients>
Check bounds, nonnegative PID gains and stable derivative filter decay.
Trait Implementations§
Source§impl Clone for Coefficients
impl Clone for Coefficients
Source§fn clone(&self) -> Coefficients
fn clone(&self) -> Coefficients
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Coefficients
Source§impl Debug for Coefficients
impl Debug for Coefficients
impl Eq for Coefficients
Source§impl PartialEq for Coefficients
impl PartialEq for Coefficients
impl StructuralPartialEq for Coefficients
Auto Trait Implementations§
impl Freeze for Coefficients
impl RefUnwindSafe for Coefficients
impl Send for Coefficients
impl Sync for Coefficients
impl Unpin for Coefficients
impl UnsafeUnpin for Coefficients
impl UnwindSafe for Coefficients
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