pub struct PidController { /* private fields */ }Expand description
A discrete-time PID controller with filtered derivative-on-measurement and back-calculation anti-windup. See the module docs for the rationale.
Implementations§
Source§impl PidController
impl PidController
Sourcepub fn new(cfg: PidConfig) -> Self
pub fn new(cfg: PidConfig) -> Self
Creates a controller resting at output_max (full performance).
Sourcepub fn update(&mut self, setpoint: f32, measurement: f32, dt: f32) -> f32
pub fn update(&mut self, setpoint: f32, measurement: f32, dt: f32) -> f32
Advances the controller one discrete step and returns the saturated
output. dt is the elapsed time in seconds since the previous call; a
non-positive dt is a no-op that returns the last output.
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> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
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