pub struct PidConfig {
pub kp: f32,
pub ki: f32,
pub kd: f32,
pub setpoint_weight_b: f32,
pub derivative_filter_n: f32,
pub kb: f32,
pub output_min: f32,
pub output_max: f32,
}Expand description
Tuning and limits for a PidController.
Fields§
§kp: f32Proportional gain.
ki: f32Integral gain (per second).
kd: f32Derivative gain (seconds).
setpoint_weight_b: f32Setpoint weight b on the proportional term (b·setpoint − measurement).
1.0 is classic PID; lower values (≈0.7) reduce overshoot on setpoint
changes while keeping full disturbance rejection.
derivative_filter_n: f32Derivative filter divisor N (the filter time constant is (Kd/Kp)/N).
Typical range 2..=20; higher N filters less. Must be > 0.
kb: f32Back-calculation anti-windup gain. 0.0 disables anti-windup. A common
starting point is Kb ≈ Ki (anti-windup time constant 1/Kb).
output_min: f32Lower saturation bound on the output.
output_max: f32Upper saturation bound on the output.
Trait Implementations§
impl Copy for PidConfig
impl StructuralPartialEq for PidConfig
Auto Trait Implementations§
impl Freeze for PidConfig
impl RefUnwindSafe for PidConfig
impl Send for PidConfig
impl Sync for PidConfig
impl Unpin for PidConfig
impl UnsafeUnpin for PidConfig
impl UnwindSafe for PidConfig
Blanket Implementations§
Source§impl<T> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
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