Trait pid_control::Controller [] [src]

pub trait Controller {
    fn update(&mut self, value: f64, delta_t: f64) -> f64;
    fn set_target(&mut self, target: f64);
    fn target(&self) -> f64;
    fn reset(&mut self);
}

A generic controller interface.

A controller is fed timestamped values and calculates an adjusted value based on previous readings.

Many controllers possess a set of adjustable parameters as well as a set of input-value dependant state variables.

Required Methods

Record a measurement from the plant.

Records a new values. delta_t is the time since the last update in seconds.

Adjust set target for the plant.

The controller will usually try to adjust its output (from update) in a way that results in the plant approaching target.

Retrieve target value.

Reset internal state.

Resets the internal state of the controller; not to be confused with its parameters.

Implementors