[][src]Struct pid::Pid

pub struct Pid<T: FloatCore> {
    pub kp: T,
    pub ki: T,
    pub kd: T,
    pub p_limit: T,
    pub i_limit: T,
    pub d_limit: T,
    pub output_limit: T,
    pub setpoint: T,
    // some fields omitted
}

Fields

kp: T

Proportional gain.

ki: T

Integral gain.

kd: T

Derivative gain.

p_limit: T

Limit of contribution of P term: (-p_limit <= P <= p_limit)

i_limit: T

Limit of contribution of I term (-i_limit <= I <= i_limit)

d_limit: T

Limit of contribution of D term (-d_limit <= D <= d_limit)

output_limit: T

Limit of output (-output_limit <= output <= output_limit)

setpoint: T

Implementations

impl<T> Pid<T> where
    T: FloatCore
[src]

pub fn new(
    kp: T,
    ki: T,
    kd: T,
    p_limit: T,
    i_limit: T,
    d_limit: T,
    output_limit: T,
    setpoint: T
) -> Self
[src]

pub fn reset_integral_term(&mut self)[src]

Resets the integral term back to zero. This may drastically change the control output.

pub fn next_control_output(&mut self, measurement: T) -> ControlOutput<T>[src]

Given a new measurement, calculates the next control output.

Panics

If a setpoint has not been set via update_setpoint().

Trait Implementations

impl<T: Clone + FloatCore> Clone for Pid<T>[src]

impl<T: Copy + FloatCore> Copy for Pid<T>[src]

impl<T: Debug + FloatCore> Debug for Pid<T>[src]

impl<T: Eq + FloatCore> Eq for Pid<T>[src]

impl<T: Ord + FloatCore> Ord for Pid<T>[src]

impl<T: PartialEq + FloatCore> PartialEq<Pid<T>> for Pid<T>[src]

impl<T: PartialOrd + FloatCore> PartialOrd<Pid<T>> for Pid<T>[src]

impl<T: FloatCore> StructuralEq for Pid<T>[src]

impl<T: FloatCore> StructuralPartialEq for Pid<T>[src]

Auto Trait Implementations

impl<T> Send for Pid<T> where
    T: Send

impl<T> Sync for Pid<T> where
    T: Sync

impl<T> Unpin for Pid<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.