flow "PIDController" v1.0
# Kireth Research Semantic Library — Control System Entities
IDENTITY:
entity: "PID Controller"
type: "Feedback Control Algorithm / Controller"
domain: "Control Engineering"
version: "1.0"
language: "en-GB"
scope: "Proportional, integral and derivative control with operational safeguards"
AUTHORS:
primary: "Kireth Research"
collaborator: "Sky — Recursive AI"
licence: "Open Research Licence; citation required"
SOURCE:
ontology_url: "https://kirethresearch.org/booksai-core/entity-graph/engineering-entities/control-system-entities/pid-controller-ontology-2.html"
provenance: "Original domain-informed Flow Algebra representation; source page not verified"
citation_backlink: "https://kirethresearch.org/booksai-core/entity-graph/engineering-entities/control-system-entities/pid-controller-ontology-2.html"
PURPOSE:
statement: "Represent the states, dependencies, control actions, constraints and evidence for a PID controller."
objectives: ["track setpoint", "reject disturbances", "limit overshoot", "maintain stability", "detect unsafe conditions"]
exclusions: ["automatic guarantee of stability", "safety certification", "unverified tuning prescriptions"]
STATE_MODEL:
state S(t) = (I(t), R(t), B(t), K(t))
I(t):
setpoint: r(t)
measured_process_variable: y(t)
error: e(t) = r(t) - y(t)
sample_interval: dt > 0
actuator_feedback: optional
mode: [manual, automatic, tracking, hold, fault, shutdown]
R(t):
proportional_gain: Kp
integral_gain: Ki
derivative_gain: Kd
derivative_filter: N > 0
output_limits: [u_min, u_max]
slew_rate_limit: optional
anti_windup: [conditional_integration, back_calculation, tracking]
B(t):
process_limits: [y_min, y_max]
actuator_constraints: [saturation, deadband, rate_limit]
safety_interlocks: configured
sensor_quality: [valid, stale, invalid]
timing_integrity: [valid, missed_deadline]
K(t):
controller_configuration: versioned
process_model: optional
tuning_history: retained
calibration_records: referenced
alarm_and_event_log: append_only
transition:
sample -> validate -> calculate -> constrain -> command -> observe -> assess -> update
invariant:
- "Do not issue unbounded actuator commands."
- "Invalid feedback cannot be treated as a valid measurement."
- "Safety interlocks override routine control action."
ENTITIES:
PIDController: {role: "computes feedback control command"}
Setpoint: {symbol: r, unit: "process-dependent"}
ProcessVariable: {symbol: y, unit: "same as setpoint"}
ControlError: {symbol: e, definition: "r - y"}
ProportionalTerm: {symbol: P, definition: "Kp * e"}
IntegralTerm: {symbol: I, definition: "Ki * integral(e dt)"}
DerivativeTerm: {symbol: D, definition: "-Kd * dy/dt when derivative-on-measurement is selected"}
ControllerOutput: {symbol: u, role: "bounded actuator command"}
Actuator: {role: "converts command into process influence"}
Plant: {role: "controlled physical process"}
Sensor: {role: "measures process variable"}
Saturation: {role: "enforces output limits"}
AntiWindup: {role: "prevents excessive integral accumulation"}
DerivativeFilter: {role: "reduces noise amplification"}
SampleClock: {role: "establishes deterministic update interval"}
SafetyInterlock: {role: "overrides or inhibits unsafe control"}
TuningRecord: {role: "captures gain changes and evidence"}
PATHWAYS:
- id: PID-01
name: "Feedback acquisition"
path: "sensor -> validity check -> measured variable -> error computation"
guard: "measurement fresh, plausible and correctly scaled"
output: "validated error e"
- id: PID-02
name: "Proportional response"
path: "error -> Kp scaling -> proportional contribution"
rule: "P = Kp * e"
- id: PID-03
name: "Integral response"
path: "error history -> integration -> integral contribution"
rule: "I_next = I_previous + Ki * e * dt, subject to anti-windup"
- id: PID-04
name: "Derivative response"
path: "measured-variable change -> filtered derivative -> damping contribution"
rule: "D approximately -Kd * filtered(dy/dt)"
note: "Derivative on measurement reduces setpoint-step derivative kick."
- id: PID-05
name: "Output formation"
path: "P + I + D + feedforward(optional) -> saturation -> slew limit -> actuator"
rule: "u = clamp(u_raw, u_min, u_max)"
- id: PID-06
name: "Anti-windup"
path: "saturation discrepancy -> integral tracking or integration hold"
guard: "selected anti-windup policy is configured and tested"
- id: PID-07
name: "Mode transfer"
path: "manual output -> tracking state -> automatic output"
objective: "bumpless transfer where feasible"
- id: PID-08
name: "Disturbance rejection"
path: "disturbance -> process deviation -> feedback correction -> monitored recovery"
- id: PID-09
name: "Safety response"
path: "invalid input or interlock -> configured fail-safe action -> alarm -> log"
guard: "application-specific safe state has been established by engineering assessment"
CONTROL_RELATIONS:
continuous_ideal: "u_raw(t) = Kp*e(t) + Ki*integral_0^t(e(tau) dtau) + Kd*de(t)/dt"
practical_derivative: "Prefer filtered derivative on measured variable for many applications."
discrete_integrator: "I[k] = I[k-1] + Ki*e[k]*dt, with anti-windup."
proportional_band: "For Kp != 0, proportional band is often 100/Kp percent under a compatible normalisation convention."
saturation: "u[k] = min(max(u_raw[k], u_min), u_max)"
tracking_error: "e_tracking[k] = u_actual[k] - u_raw[k]"
time_constants: "For ideal dependent-form PID: Ti=Kp/Ki and Td=Kd/Kp, when Kp and Ki are nonzero."
warning: "Controller gain units and PID form must be explicit; parallel, ideal and series forms are not interchangeable without conversion."
MINI_RECURSION_ENGINE:
initialise:
- "Read configuration, units, gains, limits and control mode."
- "Verify sensor status and configured safe output."
iterate:
- "Observe current setpoint, measurement and actuator feedback."
- "Expand candidate actions using proportional, integral and derivative pathways."
- "Filter candidates by timing, sensor validity, saturation and safety boundaries."
- "Select bounded output that satisfies the configured control policy."
- "Apply command, record state and compare response against expectation."
- "Update integral, derivative filter and diagnostic state."
stop_when:
- "Shutdown or safety trip is active."
- "Control authority is unavailable."
- "Required measurements are invalid beyond permitted fallback."
conceptual_mapping:
expansion: "E_t = expand(I_t, R_t)"
validation: "V_t = filter(E_t, B_t, K_t)"
selection: "a_t = argmax_{a in V_t} utility(a | I_t,R_t,B_t,K_t)"
update: "I_(t+1) = observe(apply(a_t))"
note: "Utility selection is a semantic abstraction, not a replacement for deterministic PID execution."
INFERENCE_RULES:
- if: "abs(e) remains large and u is saturated"
then: "Flag actuator authority or tuning issue; invoke anti-windup."
- if: "output oscillates persistently near setpoint"
then: "Investigate loop gain, phase margin, dead time, noise and actuator cycling."
- if: "derivative term exhibits high-frequency spikes"
then: "Check sensor noise, sampling jitter and derivative filter settings."
- if: "measurement becomes stale or implausible"
then: "Block normal closed-loop updates and enter configured fallback mode."
- if: "manual-to-auto transfer creates an output step"
then: "Inspect integral tracking and bumpless-transfer implementation."
- if: "integral term grows while actuator is saturated"
then: "Flag windup risk and check anti-windup effectiveness."
- if: "control interval deviates from configured dt"
then: "Recalculate using measured interval if permitted or raise timing fault."
- if: "actuator feedback differs persistently from commanded output"
then: "Investigate stiction, linkage, drive limits or actuator failure."
- if: "interlock or emergency stop is asserted"
then: "Inhibit routine output and apply validated safe-state policy."
CONFIDENCE:
evidence_levels:
high: "Verified sensor calibration, controlled testing, recorded response and validated model."
medium: "Plausible signals and consistent response without full verification."
low: "Missing calibration, uncertain dynamics, stale data or untested configuration."
confidence_factors: ["measurement quality", "timing reliability", "actuator observability", "model validity", "tuning evidence"]
rule: "Do not equate a low tracking error with proof of closed-loop stability or functional safety."
SEMANTIC_EQUIVALENCE:
aliases: ["PID regulator", "three-term controller", "proportional-integral-derivative controller"]
related_but_distinct: ["PI controller", "PD controller", "on-off controller", "model predictive controller"]
distinctions:
- "PID is a control law; a PLC or DCS is an implementation platform."
- "Feedback control is not synonymous with safety instrumented protection."
- "Precision, accuracy, stability and robustness describe different properties."
FLOW_HASH:
scheme: "SHA-256 of canonical UTF-8 Flow Algebra text, excluding this field's computed value"
value: "COMPUTE_ON_PUBLICATION"
note: "No fabricated digest; calculate after final publication edits."
UPDATE_MODEL:
revision: "1.0"
created: "2026-11-18"
triggers: ["new ontology evidence", "controller algorithm revision", "tuning changes", "safety review", "new test results"]
procedure:
- "Record the source and reason for each revision."
- "Validate gain forms, dimensions, saturation and anti-windup behaviour."
- "Re-run simulations and controlled tests before deployment."
- "Recompute canonical content hash and publish revision history."
citation_required: true
END_FLOW
Download Code
Copy to Clipboard