Skip to main content

Crate use_control

Crate use_control 

Source
Expand description

Thin facade for the use-control workspace.

The crate reexports the focused control-system crates directly so consumers can opt into one dependency while still using the smaller APIs.

§Examples

use use_control::*;

let mut controller = PidController::new(PidGains {
    kp: 2.0,
    ki: 0.0,
    kd: 0.0,
})
.unwrap();
let output = controller.update(5.0, 3.0, 0.5).unwrap();
let signal = ControlSignal::new(output).unwrap().clamp(0.0, 10.0).unwrap();

assert_eq!(signal.value(), 4.0);
assert_eq!(classify_gain(0.8, 1.0).unwrap(), Stability::Stable);

Re-exports§

pub use use_control_error;
pub use use_control_signal;
pub use use_feedback;
pub use use_pid;
pub use use_setpoint;
pub use use_stability;
pub use use_system_response;

Structs§

ControlSignal
FeedbackLoop
PidController
PidGains
PidState
Setpoint
StepResponsePoint

Enums§

ControlErrorError
ControlSignalError
FeedbackDirection
FeedbackError
PidError
SetpointError
Stability
StabilityError
SystemResponseError

Functions§

absolute_error
clamp_signal
classify_gain
deadband
error
first_order_response
is_bounded
negative_feedback
percent_error
positive_feedback
relative_error
sample_first_order_response
saturate
settling_time
within_tolerance