Compare commits
2 Commits
980d27ebfc
...
b176fc2788
Author | SHA1 | Date |
---|---|---|
Astro | b176fc2788 | |
Astro | b717ac5495 |
11
src/pid.rs
11
src/pid.rs
|
@ -6,12 +6,19 @@ use uom::si::{
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Parameters {
|
pub struct Parameters {
|
||||||
|
/// Gain coefficient for proportional term
|
||||||
pub kp: f32,
|
pub kp: f32,
|
||||||
|
/// Gain coefficient for integral term
|
||||||
pub ki: f32,
|
pub ki: f32,
|
||||||
|
/// Gain coefficient for derivative term
|
||||||
pub kd: f32,
|
pub kd: f32,
|
||||||
|
/// Output limit minimum
|
||||||
pub output_min: f32,
|
pub output_min: f32,
|
||||||
|
/// Output limit maximum
|
||||||
pub output_max: f32,
|
pub output_max: f32,
|
||||||
|
/// Integral clipping minimum
|
||||||
pub integral_min: f32,
|
pub integral_min: f32,
|
||||||
|
/// Integral clipping maximum
|
||||||
pub integral_max: f32
|
pub integral_max: f32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +26,8 @@ impl Default for Parameters {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Parameters {
|
Parameters {
|
||||||
kp: 1.5,
|
kp: 1.5,
|
||||||
ki: 0.1,
|
ki: 1.0,
|
||||||
kd: 150.0,
|
kd: 1.5,
|
||||||
output_min: 0.0,
|
output_min: 0.0,
|
||||||
output_max: 2.0,
|
output_max: 2.0,
|
||||||
integral_min: -10.0,
|
integral_min: -10.0,
|
||||||
|
|
Loading…
Reference in New Issue