Expand description
SimulatorDriver: an in-process FOPDT (first-order-plus-dead-time) process model,
served through the Driver trait, for fully automated E2E tests (no Windows, no
Kepware, no external process) and demo mode.
Ported from Model/ProcessModelOPC.py, the Python model the legacy app’s hidden
OPCClass.Python test path shells out to (see AGENTS.md’s behavior-spec notes). This
module splits into three independent pieces:
FopdtProcess: the process itself – pure state advanced one tick at a time, with noDriver/async awareness at all.VirtualPid: a standalone position-form PID controller, for closed-loop validation (e.g. “do the constants a completed MRFT run just calculated actually control this process well?”) and demos. Not wired intoSimulatorDriver– the open-loop MRFT relay test drives the MV itself, so nothing here needs to close the loop automatically.SimulatorDriver: the thinDrivershell wrapping oneFopdtProcess.
Structs§
- Fopdt
Config - 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 aDrivercan serve one sample at a time. - Fopdt
Process - A first-order-plus-dead-time process model, advanced one tick at a time.
- Simulator
Driver - The
Driverimplementation for CI E2E tests and demo mode: an in-processFopdtProcessserved through exactly two tags – a PV tag (reading it advances the simulated clock by one tick) and an MV tag (reading it reports the last-written value without advancing anything; writing it records a new controller output). Any other tag isDriverError::InvalidTagValue;Driver::browseis alwaysDriverError::Unsupported, per that method’s own documented convention for drivers with no real tag tree. - Virtual
Pid - A standalone position-form PID controller, for closed-loop validation and demos (e.g.
“do the constants a completed MRFT run just calculated actually control this process
well?”). Deliberately not wired into
SimulatorDriver/Driverat all: theDrivertrait models open-loop tag I/O, and during an actual MRFT relay test the engine itself (bhtune_core::mrft::MrftEngine) drives the MV – nothing needs to close the loop automatically for that. This exists for whatever, later, wants to run this process in automatic mode instead (e.g. simulating a completed tune’s results before trusting them against a real DCS). - Virtual
PidConfig - Configuration for a
VirtualPid: a standard textbook position-form PID controller – proportional and integral on error, derivative on the measurement rather than the error (to avoid “derivative kick” on a setpoint change) – with output clamping and anti-reset-windup.