pub struct PidController {
pub kp: f32,
pub ki: f32,
pub kd: f32,
/* private fields */
}
Expand description
A proportional–integral–derivative controller.
This controller is used to smoothly move motors to a certain point, and allows for feedback-based power adjustments. This is desirable over just setting the motor power, as it can be tuned to make the motor stop in exactly the right position without overshooting.
Fields§
§kp: f32
Proportional constant. This is multiplied by the error to get the proportional component of the output.
ki: f32
Integral constant. This accounts for the past values of the error.
kd: f32
Derivative constant. This allows you to change the motor behavior based on the rate of change of the error (predicting future values).
Implementations§
Trait Implementations§
Source§impl Clone for PidController
impl Clone for PidController
Source§fn clone(&self) -> PidController
fn clone(&self) -> PidController
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PidController
impl Debug for PidController
impl Copy for PidController
Auto Trait Implementations§
impl Freeze for PidController
impl RefUnwindSafe for PidController
impl Send for PidController
impl Sync for PidController
impl Unpin 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