[−][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)
output_limit: T
Limit of output (-output_limit <= output <= output_limit)
setpoint: T
Implementations
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,
output_limit: T,
setpoint: T
) -> Self
[src]
kp: T,
ki: T,
kd: T,
p_limit: T,
i_limit: T,
d_limit: T,
output_limit: T,
setpoint: T
) -> Self
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]
pub fn clone(&self) -> Pid<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
pub fn cmp(&self, other: &Pid<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: PartialEq + FloatCore> PartialEq<Pid<T>> for Pid<T>
[src]
impl<T: PartialOrd + FloatCore> PartialOrd<Pid<T>> for Pid<T>
[src]
pub fn partial_cmp(&self, other: &Pid<T>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Pid<T>) -> bool
[src]
pub fn le(&self, other: &Pid<T>) -> bool
[src]
pub fn gt(&self, other: &Pid<T>) -> bool
[src]
pub fn ge(&self, other: &Pid<T>) -> bool
[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,
T: Send,
impl<T> Sync for Pid<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Pid<T> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,