Module pid

Module pid 

Source
Expand description

The pid module provides a standard (position form) PID controller.

Pid is a structure that implements the PidController trait, which provides methods for creating a new controller and updating the controller.

§Examples

use advanced_pid::{prelude::*, Pid, PidGain};

let gain = PidGain { kp: 1.0, ki: 0.3, kd: 0.1 };
let mut pid = Pid::new(gain.into());

let target = 1.0;
let actual = 0.0;
let dt = 1.0;

println!("{}", pid.update(target, actual, dt));

Structs§

Pid
Pid is a structure that implements the PidController trait.