pub struct ServoConfig {
pub step_threshold_ns: f64,
pub panic_threshold_ns: f64,
pub allow_initial_step: bool,
pub max_frequency: f64,
pub init_samples: u32,
pub fll_samples: u32,
}Expand description
Configuration for the PI servo.
Fields§
§step_threshold_ns: f64Step threshold in nanoseconds. Offsets larger than this trigger a step. Default: 128_000_000 (128ms).
panic_threshold_ns: f64Panic threshold in nanoseconds. Offsets whose absolute value exceeds
this are rejected outright – neither slewed nor stepped – on the
assumption that any jump this large is a bug or a spoofed/corrupt
NTP reply rather than real drift. Must be greater than
step_threshold_ns. Default: 1_000_000_000 (1s).
allow_initial_step: boolAllow a single unrestricted step the first time the servo sees a
measurement, bypassing panic_threshold_ns on that first sample only.
Matches ntpd -g semantics: after a cold boot or long VM suspend the
real-world offset can legitimately exceed any sane steady-state panic
guard, and refusing to step would strand the clock forever. Once the
first step is performed, the panic clamp engages for all subsequent
samples. Default: true.
max_frequency: f64Maximum frequency adjustment in PPM. Default: 500.0.
init_samples: u32Number of initial samples to skip (for filter warmup). Default: 4.
fll_samples: u32Number of FLL samples before switching to PLL. Default: 8.
Trait Implementations§
Source§impl Clone for ServoConfig
impl Clone for ServoConfig
Source§fn clone(&self) -> ServoConfig
fn clone(&self) -> ServoConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more