CONTROL
LOGIC
INSTRUMENTATION ENGINEERING
INSTRUMENTATION ENGINEERING
SUBHAJIT DAS
Controller
A controller is a core component in a closed-loop control system that
compares the measured process variable (PV) with the setpoint (SP)
and generates a corrective output to minimize the error.
INSTRUMENTATION ENGINEERING
Devices are located far from the control
room (in the field).
✓ Controllers are core to automatic process regulation
✓ They adjust valves, dampers, motors, VFDs based on real-
time sensor data
✓ Control logic (P, PI, PID) resides inside DCS controller cards
✓ Standardization ensures interoperability, tuning
consistency, and safety
✓ Used in almost every loop: flow, pressure, temperature, level
SUBHAJIT DAS
Control Logic
Control logic is the set of rules or calculations executed by a
controller (in a DCS, PLC, or other automation system) to make
decisions and generate output actions based on input signals and
process conditions.
P, PI, and PID controllers are standardized forms of control logic
used in almost all industrial control systems to maintain process
INSTRUMENTATION ENGINEERING
variables like temperature, pressure, flow, and level within desired
limits.
Devices are located far from the control
room (in the field).
P, PI, and PID control logic directly determines the output signal sent
to the Final Control Element (FCE) — such as a control valve, VFD,
damper, or heater — in order to adjust the process and bring the
measured value (PV) closer to the setpoint (SP).
SUBHAJIT DAS
Considering
INSTRUMENTATION ENGINEERING
System = 2 nd Order
Devices are located far from the control
room (in the field).
Input = Step Input
SUBHAJIT DAS
Proportional (P) Control Logic
P stands for Proportional Control Logic, where the controller output
is directly proportional to the error between setpoint (SP) and
process variable (PV).
Signal Flow Path in DCS-Based Plant
INSTRUMENTATION ENGINEERING
Field Device → Junction Box → Field Terminal Assembly → Input Card →
Controller Card (P Logic) → Output Card → Junction Box → Final
Control Element (e.g., Control Valve)
DevicesWhereare located
Is Logic Executed ?far from the control
room
The P control algorithm (in the
runs inside field).card, written as a
the controller
firmware-based function block as per IEC 61131-3 standard.
What is Proportional Control?
The controller produces an output directly proportional to the
control error:
SUBHAJIT DAS
Proportional (P) Control Logic
PV
Time SP Error Kp Output (%) Comment
(Sensor)
0s 100 90 10 2 20 Initial correction
1s 100 94 6 2 12 Output reduced
INSTRUMENTATION ENGINEERING
2s 100 96 4 2 8 PV approaching SP
Devices
3s 100 are
97.6 located
2.4 2far from
4.8 the control
Output still positive
room (in the field).
4s 100 98.5 1.5 2 3 Small correction
5s 100 99.1 0.9 2 1.8 System stabilizing
6s 100 99.55 0.45 2 0.9 Near steady state
7s 100 99.75 0.25 2 0.5 Very close to setpoint
SUBHAJIT DAS
Proportional (P) Control Logic
Steady-state is the behavior of the
system as time approaches infinity
— that is, after all transient effects
have decayed and the system
The controller
response becomes constant or
is trying to
predictable.
make PV
(Process
INSTRUMENTATION ENGINEERING
variable) = SP
Devices are located far from the control
room (in the field). Error
calculated by
controller
Instant change from Step Input
SP = Set point is old SP to new SP
given by the
Process
Engineer Slowly changing Ramp Input
setpoint over time
P controller reacts fast but leaves residual error (called offset).
SUBHAJIT DAS
Bias
In a controller (especially Proportional (P) controllers), the bias is the
baseline output when error = 0.
INSTRUMENTATION ENGINEERING
Devices
Why Is Bias are Used?
located far from the control
✓ To prevent total shutdown when error becomes zero (e.g., you still
want 50% valveroom (ina the
open to hold steadyfield).
flow).
✓ To maintain known initial operating conditions.
✓ To avoid controller output jumping to zero when e(t) = 0.
✓ In real-world control loops, if bias is not set, a Proportional-only
controller will send 0% output (4 mA) when error = 0.
This behavior is undesirable, as it causes the final control element
to shut, even though the process may require a nonzero steady-
state value to maintain the setpoint.
SUBHAJIT DAS
Proportional Integral
A proportional–integral (PI) controller combines proportional control
and integral control. It provides both an immediate response to an
error (through the proportional term) and a correction based on the
accumulation of past errors (through the integral term), thereby
eliminating steady-state error.
INSTRUMENTATION ENGINEERING
Devices are located far from the control
room (in the field).
The integral component of a PI controller removes the residual steady-
state error that a proportional controller alone cannot eliminate. It
continuously sums the error and drives the steady-state error to zero.
SUBHAJIT DAS
Proportional Integral
Why the PI controller keeps summing past errors, even when the
present error is small and why this is necessary ?
INSTRUMENTATION ENGINEERING
Devices are
As error reduces, located farAsfrom
Proportional the
the P-term control
shrinks, the I-term
term decreases (because it's continues to grow, compensating
room
directly based on current error)(in the field).
for the decreasing P-term.
This keeps pushing the output up
(or down) to eliminate the
remaining offset between SP and
PV.
A PI controller can reach zero error, but due to accumulated integral
action, it may continue to output a signal, which can cause the
process variable (PV) to overshoot the setpoint (SP). This is a classic
scenario that leads to what's called "integral windup" or overshoot
due to integral action.
SUBHAJIT DAS
Assumptions:
1. SP (Setpoint) = 100 m³/h
2. Initial PV (Process Variable) = 90 m³/h 3. Initial Valve Position = 50%
MV
PV Error ∑Error Valve
Time (s) SP P-Term I-Term (Output Comment
(m³/h) e(t)e(t) (cum.) Position
%)
Initial
0 100 90 10 10 20 5 25 75%
correction
1 100 94 6 16 12 8 20 70% PV rising
Still
2 100 96.5 3.5 19.5 7 9.75 16.75 66.75%
correcting
3 100 98.5 1.5 21 3 10.5 13.5 63.50% Almost there
Error gone -
4 100 100 0 21 0 10.5 10.5 60.50% integral still
active
Overshoot
5 100 100.7 -0.7 20.3 -1.4 10.15 8.75 58.75%
begins
Still
6 100 100.5 -0.5 19.8 -1 9.9 8.9 58.90% overshooting
slightly
PV falling
7 100 100.2 -0.2 19.6 -0.4 9.8 9.4 59.40%
toward SP
8 100 100 0 19.6 0 9.8 9.8 59.80% Steady again
Proportional Integral
INSTRUMENTATION ENGINEERING
Devices are located far from the control
room (in the field).
This plot is a theoretical simulation based on an idealized second-
order plant and a PI controller with chosen gains
✓ In a real plant, there are deviations from the ideal:
✓ Higher-order dynamics or nonlinearities (valve stiction, friction,
dead time)
✓ Measurement noise (sensor quantization, electrical
interference)
✓ Actuator limitations (valve deadband, maximum ramp rate)
✓ Disturbances (load changes, pressure fluctuations)
SUBHAJIT DAS
Proportional Integral Derivative
Derivative term reacts to the rate of change of error.
✓ Reduces overshoot by applying corrective action earlier.
✓ Improves stability by adding damping, like a shock absorber.
INSTRUMENTATION ENGINEERING
✓ Speeds up settling time → avoids repeated oscillations
Initially
1. Error is large → Proportional term gives a strong immediate output.
2. Error is sustained → Integral term starts building up based on past
errors to eliminate steady-state error.
As PV rises and approaches SP
1. Error reduces now → Current Error−Previous Error becomes
negative.
2. This means the error is decreasing.
Then comes the Derivative term:
1. This produces a negative output.
2. Without D-action, the I-term may push PV beyond the setpoint →
overshoot.
3. The D-term anticipates this by sensing how quickly the error is
shrinking, and applies a braking force.
4. Result: Smoother approach, less overshoot, faster settling.
SUBHAJIT DAS
Proportional Integral Derivative
INSTRUMENTATION ENGINEERING
✓ P gives stability but leaves an error.
✓ PI corrects the error but may overshoot.
✓ PID corrects the error and damps the overshoot using the derivative.
SUBHAJIT DAS
Integral Windup
Integral Windup
So, D becomes inactive when The controller “winds up” the I-
error stops changing. term when error persists, but
once the error vanishes, it
doesn’t forget what it built up
INSTRUMENTATION ENGINEERING
earlier — and this can cause
overshoot or instability.
❑ But if previously: Overshoot due to integral
✓ Error was large windup can be mitigated by
✓ Integral term had using anti-windup logic.
accumulated a lot of past Derivative action also helps
error reduce overshoot by damping
the rate of error change
Even when error is zero, the controller
still outputs:
That large I-term continues to drive the final control element (e.g.,
valve) unnecessarily.
This pushes PV beyond SP → overshoot occurs.
SUBHAJIT DAS
INSTRUMENTATION ENGINEERING
A lot to know !!!!!!!!!!!!!
A lot to discuss !!!!!!!!!!!!!
Comment down if you have
more to share !
SUBHAJIT DAS