[−][src]Struct pid::Pid
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)
Methods
impl<T> Pid<T> where
T: FloatCore,
[src]
T: FloatCore,
pub fn new(kp: T, ki: T, kd: T, p_limit: T, i_limit: T, d_limit: T) -> Self
[src]
pub fn update_setpoint(&mut self, setpoint: T)
[src]
Sets the desired setpoint.
Must be called before the first invocation to next_control_output()
.
pub fn get_setpoint(&mut self) -> Option<T>
[src]
Returns the current setpoint.
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
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,