pub enum PidClamp {
Fixed(f64, f64),
Dynamic,
}Expand description
A BlockKind::Pid’s anti-windup bound: fixed at model-build time, or read fresh from the
graph every step. Fixed is every existing use of Pid before this variant existed —
unchanged behavior, one input (the error signal) as always. Dynamic is for a controller
whose achievable output range genuinely depends on other, still-evolving state (e.g. a
current-loop PID commanding a pole voltage that can’t physically exceed roughly half the
DC bus voltage, itself still rising during a soft-start ramp) — a Fixed bound sized for
the final steady-state range is badly oversized early on, so the PID’s own anti-windup never
engages even though the real plant is already saturated far below that fixed bound,
producing sustained, hard-to-diagnose windup-driven oscillation (worked example: an
elspice-pwl-pfc-three-phase-vsc experiment’s own three-phase active-front-end current loop,
in the sibling internal-archive repo). Dynamic reads two extra inputs beyond
the error signal, in order (clamp_lo, clamp_hi), evaluated fresh every step exactly like
any other block input — see BlockInstance’s own doc comment for the resulting input
count.
Variants§
Fixed(f64, f64)
A fixed (lo, hi) anti-windup bound, set once at model-build time.
Dynamic
The anti-windup bound is read fresh from two extra block inputs every step.