Skip to main content

PID Controller

The PID controller performs PID control based on measured values and set values in transient calculations, and outputs control quantities to the target device through an actuator. Steady state calculations and transient physics initial fields do not execute the controller.

Component Appearance and Location​

Expand Controller in the component library on the left and find "PID Controller".

Created with Fabric.js 5.3.0

Ports and Connections​

Port KeyTypeDirectionInterface NameDisplay Conditions
pvCONTROLinputPV measured valuealways show
spCONTROLinputSP external setpointWhen "Control target setting method" is "External SP setting"
cvCONTROLoutputCV absolute control volumealways show

The PV terminal receives the process measurement value, the SP terminal can receive the external set value, and the CV terminal outputs the absolute control value. When measuring physical quantities and operating target devices, they should be connected through a measurement instrument and an actuator respectively.

Parameter List​

Control Mode

NamekeyTypeDefault / OptionsDescription
Setpoint ModeSetPointSourcechoiceFixed Setpoint / External SPPID executes only in transients; steady-state retains wiring/configuration. Fixed SP uses panel; external SP reads its port. PV is measured input, CV output to actuation.
Control SetpointSetPointreal0Editable fixed transient SP. Must share PV quantity and scale, with units from measurement adapter.
Control Action DirectionControlActionchoiceAutomatic / Direct / ReverseDirect increases CV when PV<SP; reverse decreases it. Automatic detects response to limited CV probes at transient startup.
Proportional Gain KcKcreal1Nonnegative transient proportional gain; larger is stronger and can oscillate. Direction comes from Control Action.
Integral Time Ti [s]Tireal10Transient integral time removes persistent error. Smaller is stronger and can oscillate/saturate. Zero disables integration.
Derivative Time Td [s]Tdreal0Transient derivative on PV changes, stronger for larger time, potentially amplifying noise. Zero disables derivative.

Sampling Settings

NamekeyTypeDefault / OptionsDescription
Sampling ModeSamplingModechoiceFollow Accepted Physical Steps (Compatible) / Fixed Sampling PeriodCompatible mode updates at each accepted physical-step end using actual duration. Fixed mode follows an independent absolute calendar. Legacy and non-explicit new settings retain compatible mode.
Sampling Period [s]SamplePeriodreal1Positive fixed sample interval, exactly representable as integer microseconds.
Sampling Phase [s]SamplePhasereal0Initial phase with 0≤phase<period. Zero gives the first normal update after one full period.

Operating Constraints

NamekeyTypeDefault / OptionsDescription
CV Lower LimitCVLowerLimitreal0Minimum absolute transient CV, in actuator units/scale; valve percentage often uses 0.
CV Upper LimitCVUpperLimitreal100Maximum absolute transient CV, strictly above lower limit, in actuator units; valve percentage often uses 100.

Parameter Guidance​

ParameterGuidance
Setpoint mode and valueFixed mode uses the panel value; External SP reads the SP port. SP and PV must share quantity, units, and reference.
Control actionDirect action increases CV when PV is below SP; reverse action decreases it. Automatic mode probes actuation at transient startup and determines direction from PV response.
Gain Kc, integral time Ti, derivative time TdAll are nonnegative. Kc sets proportional response; Ti and Td use seconds. Zero disables integral accumulation or derivative action respectively.
Sampling mode, period, phaseAccepted-physical-step mode uses actual step duration. Fixed-period mode follows an independent schedule. Period and phase in seconds must be exactly representable as integer microseconds. Period is positive and 0≤phase<period0\le\text{phase}<\text{period}.
CV lower and upper limitsLower must be below upper. Match actuator units and range, such as 0–100 for percentage opening.

Modeling Steps​

  1. Connect a measurement instrument to PV. Select SP source and connect external SP if used.
  2. Choose direction from the PV response to increasing CV. Automatic detection needs actuation headroom and a distinguishable startup response.
  3. Set sampling, Kc, Ti, Td, and CV limits.
  4. Connect CV to the actuator and enable the corresponding device signal control source.
  5. Run transient simulation and inspect controller and adapter results. Measurements and actuation

View Results​

  • Control values. Compare SP, PV, and Next Absolute CV to assess approach to setpoint.
  • PID terms. Compare P, I, D, and unlimited CVRaw to identify dominant action and saturation.
  • Timing and response. Executed CV for This Step applies to the interval just ended; Next Requested CV applies to the following interval. Inspect device or adapter actual values for opening or speed. Adapter Results

Professional Theory​

Action Direction and Discrete PID​

Let kk index samples, Δtk\Delta t_k be seconds since the previous valid sample, and σ=+1\sigma=+1 for direct or −1-1 for reverse action. Directed error eke_k and proportional term PkP_k are

ek=σ(SPk−PVk),Pk=Kcek.e_k=\sigma(SP_k-PV_k),\qquad P_k=K_c e_k.

For Ti>0T_i>0, candidate integral increment is KcekΔtk/TiK_c e_k\Delta t_k/T_i. Conditional integration provides anti-windup: if it pushes unlimited output farther beyond either limit, retain the previous integral state. With Ti=0T_i=0, accumulation stops but the baseline corresponding to initial CV remains included.

Derivative action uses PV changes with first-order filtering. For Td>0T_d>0,

αk=TdTd+10Δtk,Dk=αkDk−1−(1−αk)σKcTdPVk−PVk−1Δtk.\alpha_k=\frac{T_d}{T_d+10\Delta t_k}, \qquad D_k=\alpha_k D_{k-1}-(1-\alpha_k)\sigma K_c T_d \frac{PV_k-PV_{k-1}}{\Delta t_k}.

For Td=0T_d=0, derivative action is zero. An SP-only change affects error and proportional action; derivative action follows PV. Absolute CV is limited by

CVraw,k=Pk+Ik+Dk,CVk=min⁡ ⁣(CVmax⁡,max⁡ ⁣(CVmin⁡,CVraw,k)).CV_{\mathrm{raw},k}=P_k+I_k+D_k,\qquad CV_k=\min\!\left(CV_{\max},\max\!\left(CV_{\min},CV_{\mathrm{raw},k}\right)\right).

Initial CV and Sampling​

After the initial physical field is established, CV and PID memory initialize. A physical loop first uses the actuator applied value, then its actual value. If neither is available, use the midpoint of CV limits, also used in pure signal loops. The initial instant establishes the baseline; normal sampling starts afterward.

Following physical steps, SP and PV are read at each accepted step end to calculate the next request. With fixed sampling, zero phase gives the first normal sample one period after start; positive phase gives start plus phase. Subsequent updates follow the period, holding CV between samples. Control and result saving schedules are independent. Transient Control Timing

Applicability and Limits​

  • Transient feedback. Pure signal loops need an observable output destination such as an oscilloscope. Physical loops also require the device to use the adapter signal.
  • Direction. Direct action suits PV rising with CV; reverse suits PV falling with CV. Automatic direction is detected at initialization; reassess if process gain reverses.
  • Reachability. CV limits and device capacity constrain SP; network delay and actuator speed affect response.

Common Inspections​

  • Growing error or failed detection. Check PV, SP, actuation chain, and response direction.
  • CV stays limited. Compare CVRaw, limited CV, and actual actuation; check capacity, reachable SP, and PID parameters.
  • Unexpected sampling. Check mode, period, phase, sample index, and result times.
  • Device lags CV. Compare requested, applied, and actual values; check control source, stroke time, speed adjustment, and protections.