pub struct FopdtConfig {
pub gain: f32,
pub time_constant_s: f32,
pub dead_time_s: f32,
pub tick_interval_s: f32,
pub noise_amplitude: f32,
}Expand description
Configuration for a FopdtProcess: the classic three parameters process control
literature uses to characterize a first-order-plus-dead-time (FOPDT) process, plus the
tick cadence and measurement noise needed to turn the continuous model into a discrete
one a Driver can serve one sample at a time.
Fields§
§gain: f32Process gain (Kp): steady-state change in PV per unit change in MV.
time_constant_s: f32Time constant (tau), in seconds: how quickly PV approaches its new steady state
after an MV change, absent dead time. 0.0 means an instantaneous response (PV
reaches its new steady state within a single tick).
dead_time_s: f32Dead time (theta), in seconds: how long PV takes to begin responding to an MV
change at all. Modeled as a whole number of ticks
(ceil(dead_time_s / tick_interval_s)), matching Model/ProcessModelOPC.py’s own
ndelay calculation. 0.0 disables the delay line entirely.
tick_interval_s: f32Simulated seconds advanced per FopdtProcess::step call. Deliberately unrelated to
real wall-clock time – a caller can call step (via SimulatorDriver::read) as
fast as the CPU allows, and the simulated clock still advances at this rate, which is
what lets an E2E test run an entire tuning cycle in milliseconds instead of the
minutes a real 800ms-tick MRFT test takes.
noise_amplitude: f32Amplitude of uniform noise (+/- noise_amplitude, in PV engineering units) added to
each computed sample, mirroring ProcessModelOPC.py’s noise_amp. 0.0 (the
default from FopdtConfig::new) disables noise entirely and skips drawing from
the RNG altogether, keeping every sample exactly reproducible run to run.
Implementations§
Source§impl FopdtConfig
impl FopdtConfig
Sourcepub fn new(
gain: f32,
time_constant_s: f32,
dead_time_s: f32,
tick_interval_s: f32,
) -> FopdtConfig
pub fn new( gain: f32, time_constant_s: f32, dead_time_s: f32, tick_interval_s: f32, ) -> FopdtConfig
A process configuration with no measurement noise. Chain
FopdtConfig::with_noise_amplitude to add some, or set the field directly.
Sourcepub fn with_noise_amplitude(self, noise_amplitude: f32) -> FopdtConfig
pub fn with_noise_amplitude(self, noise_amplitude: f32) -> FopdtConfig
Returns self with noise_amplitude set, for a fluent construction style.
Trait Implementations§
Source§impl Clone for FopdtConfig
impl Clone for FopdtConfig
Source§fn clone(&self) -> FopdtConfig
fn clone(&self) -> FopdtConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FopdtConfig
Source§impl Debug for FopdtConfig
impl Debug for FopdtConfig
Source§impl PartialEq for FopdtConfig
impl PartialEq for FopdtConfig
Source§fn eq(&self, other: &FopdtConfig) -> bool
fn eq(&self, other: &FopdtConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FopdtConfig
Auto Trait Implementations§
impl Freeze for FopdtConfig
impl RefUnwindSafe for FopdtConfig
impl Send for FopdtConfig
impl Sync for FopdtConfig
impl Unpin for FopdtConfig
impl UnsafeUnpin for FopdtConfig
impl UnwindSafe for FopdtConfig
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].