pub struct DcMotorFeedforward { /* private fields */ }
Expand description
Ideal DC motor feedforward controller.
This is a open-loop velocity controller that computes the voltage to maintain an idealized DC motor in a certain state.
The controller is implemented according to the following model:
`V = Kₛ sign(ω) + Kᵥ ω + Kₐ α``
Implementations§
Source§impl DcMotorFeedforward
impl DcMotorFeedforward
Sourcepub fn new(ks: f64, kv: f64, ka: f64, target_acceleration: f64) -> Self
pub fn new(ks: f64, kv: f64, ka: f64, target_acceleration: f64) -> Self
Creates a new DcMotorFeedforward
with the given constants and target.
§Parameters
ks
- Feedforward constant for static friction compensation.kv
- Feedforward constant for velocity compensation.ka
- Feedforward constant for acceleration compensation.target_acceleration
- Feedforward constant for the target acceleration.
Sourcepub const fn constants(&self) -> (f64, f64, f64)
pub const fn constants(&self) -> (f64, f64, f64)
Get the current PID gains as a tuple (ks
, kv
, ka
).
Sourcepub const fn set_constants(&mut self, ks: f64, kv: f64, ka: f64)
pub const fn set_constants(&mut self, ks: f64, kv: f64, ka: f64)
Sets the PID gains to provided values.
Trait Implementations§
Source§impl ControlLoop for DcMotorFeedforward
impl ControlLoop for DcMotorFeedforward
Auto Trait Implementations§
impl Freeze for DcMotorFeedforward
impl RefUnwindSafe for DcMotorFeedforward
impl Send for DcMotorFeedforward
impl Sync for DcMotorFeedforward
impl Unpin for DcMotorFeedforward
impl UnwindSafe for DcMotorFeedforward
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