Skip to main content

PidConfig

Struct PidConfig 

Source
pub struct PidConfig<T: Float> {
Show 17 fields pub kp: T, pub ki: T, pub kd: T, pub output_max: T, pub output_min: T, pub output_rate_limit: Option<T>, pub p_limit: T, pub i_limit: T, pub d_limit: T, pub antiwindup_mode: AntiWindupMode, pub antiwindup_gain: T, pub derivative_mode: DerivativeMode, pub derivative_filter_coeff: T, pub max_dt: T, pub min_dt: T, pub setpoint_ramping: bool, pub setpoint_ramp_rate: T,
}
Expand description

Configuration for the PID controller

Fields§

§kp: T

Proportional gain

§ki: T

Integral gain

§kd: T

Derivative gain

§output_max: T

Maximum allowed output

§output_min: T

Minimum allowed output

§output_rate_limit: Option<T>

Maximum rate of change of output (per second)

§p_limit: T

Proportional term limit

§i_limit: T

Integral term limit (anti-windup)

§d_limit: T

Derivative term limit

§antiwindup_mode: AntiWindupMode

Anti-windup strategy

§antiwindup_gain: T

Back-calculation gain (for BackCalculation mode)

§derivative_mode: DerivativeMode

Derivative filtering mode

§derivative_filter_coeff: T

Derivative filter coefficient (0.0 to 1.0, typically 0.1-0.3)

§max_dt: T

Maximum allowed time step (seconds) - for safety

§min_dt: T

Minimum allowed time step (seconds) - prevents division issues

§setpoint_ramping: bool

Enable setpoint ramping (smooth setpoint changes)

§setpoint_ramp_rate: T

Setpoint ramp rate (units per second)

Trait Implementations§

Source§

impl<T: Clone + Float> Clone for PidConfig<T>

Source§

fn clone(&self) -> PidConfig<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy + Float> Copy for PidConfig<T>

Source§

impl<T: Debug + Float> Debug for PidConfig<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Float> Default for PidConfig<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for PidConfig<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for PidConfig<T>
where T: RefUnwindSafe,

§

impl<T> Send for PidConfig<T>
where T: Send,

§

impl<T> Sync for PidConfig<T>
where T: Sync,

§

impl<T> Unpin for PidConfig<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for PidConfig<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for PidConfig<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.