pub struct PidController { /* private fields */ }Expand description
A standard PID controller with output clamping and integral anti-windup.
Call PidController::update once per control tick with setpoint, measurement, and dt.
Implementations§
Source§impl PidController
impl PidController
Sourcepub fn new(gains: PidGains, output_limits: (f64, f64)) -> PidController
pub fn new(gains: PidGains, output_limits: (f64, f64)) -> PidController
Create a new controller with the given gains and output clamp. Integral wind-up is
clamped to the same range as the output by default - see Self::with_integral_limits
to widen/narrow that independently.
Sourcepub fn with_integral_limits(self, integral_limits: (f64, f64)) -> PidController
pub fn with_integral_limits(self, integral_limits: (f64, f64)) -> PidController
Override the integral anti-windup clamp independently of the output clamp.
Trait Implementations§
Source§impl Clone for PidController
impl Clone for PidController
Source§fn clone(&self) -> PidController
fn clone(&self) -> PidController
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 moreAuto Trait Implementations§
impl Freeze for PidController
impl RefUnwindSafe for PidController
impl Send for PidController
impl Sync for PidController
impl Unpin for PidController
impl UnsafeUnpin for PidController
impl UnwindSafe for PidController
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more