0% found this document useful (0 votes)
11 views

PID Algorithm

This document discusses the PID algorithm which has been used for process control since the 1930s. It remains the foundation for most basic control applications. The document defines key terms, explains proportional control and how it generates an output proportional to the error. Proportional control alone results in an offset between the process variable and setpoint at steady state.

Uploaded by

Mahmoud Mohammad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

PID Algorithm

This document discusses the PID algorithm which has been used for process control since the 1930s. It remains the foundation for most basic control applications. The document defines key terms, explains proportional control and how it generates an output proportional to the error. Proportional control alone results in an offset between the process variable and setpoint at steady state.

Uploaded by

Mahmoud Mohammad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 108

Process Control

Advanced Topics

3. PID Algorithm

Alexandria University - Chemical Engineering Department


3. PID Algorithm
• The PID (proportional, integral, derivative) algorithm has been
around since the 1930s.

• While many DCS vendors have attempted to introduce other


more e ective algorithms PID remains the foundation of almost
all basic control applications.

• The basic form of the algorithm is generally well covered by


academic institutions. Its introduction here follows a similar
approach but extends it to draw attention to some of the more
practical issues.

• Importantly it also addresses the many modi cations on o er in


most DCS, many of which are undervalued by industry unaware
of their advantages.

2
ff
fi
ff
3.1 Definitions
Before proceeding, we must ensure that we de ne the key
terminology. In Chapter 2 we de ned PV (the process variable that
we wish to control, also called controlled variable CV) and MV (the
manipulated variable). The reader should note that some texts use
this abbreviation to mean ‘measured value’, i.e. what we call PV.

On the other hand, classical texts in control theory use u or c(t)


for the controller input and y or m(t) for the controller output. In
this course, we are using all sets of terms as you need to be
comfortable reading and understanding literature written in any
set of terms.

We will also use M to represent the controller output, which will


normally be the same as MV. To these de nitions we have also
added the set-point SP (i.e. the target for PV ).

3
fi
fi
fi
3.1 Definitions
The error (E) is de ned as the deviation from SP but its de nition
varies between DCS. Our de nition in this chapter is

Most texts and some systems de ne error as SP – PV.

Misinterpreting the de nition will result in the controller taking


corrective action in the direction opposite to that it should,
worsening the error and driving the control valve fully closed or
fully open.

4
fi
fi
fi
fi
fi
3.2 Proportional Action
The principle behind proportional control is to keep the controller
output (M) in proportion to the error (E).

Kc is the controller gain (occasionally called the controller


sensitivity) and is a tuning constant set by the control engineer.

The term C is necessary since it is unlikely to be the case that


zero error coincides with zero controller output. In some control
systems the value of C may be adjusted by the process operator,
in which case it is known as manual reset. Its purpose will be
explained later in this section.

5
3.2 Proportional Action

The process gain (Kp) may be positive or negative but the


controller gain (Kc) is always entered into the control system as an
absolute value.

The control algorithm therefore includes an additional engineer‐


de ned parameter known as action. If set to direct the controller
output will increase as the PV increases; if set to reverse, output
decreases as PV increases.

If we consider our red heater example,


we would want the controller to reduce
the fuel rate if the temperature increases
and so we would need to set the action to
reverse.

6
fi
fi
3.2 Proportional Action
In other words, if the process gain is positive,
the controller should be reverse acting; if the
process gain is negative, it should be direct PV
acting. This de nition is consistent with the
concept of negative feedback where the
product of all the gain terms in a control loop
(known as the loop gain) must be negative. MV

If feedback is positive the controller will quickly saturate, moving


the MV to its minimum or maximum value, with probably a
disastrous e ect on the PV. The de nition is also consistent with
that adopted by the ISA but is not used by all DCS vendors and is
rare in textbooks.

Some base the action on increasing E, rather than PV. If they also
de ne error as SP – PV, then our heater temperature controller
would need to be con gured as direct acting.
7
fi
ff
fi
fi
fi
3.2 Proportional Action

Confusion can also arise if the controller is manipulating a control


valve. Valves are con gured to either fail open or fail closed on
loss of signal – depending on which is less hazardous.

The signal actually sent to a ‘fail open’ valve therefore needs to be


reverse acting.

Some texts take this into account when specifying the action of
the controller. However, most DCS di erentiate between the
output from the controller, which is displayed to the operator, and
what is sent to the valve.

To the operator and the controller all outputs represent the fraction
(or percentage) that the valve is open. Any reversal required is
performed after this. Under these circumstances, valve action
need not be taken into account when specifying controller action.
8
fi
ff
3.2 Proportional Action
Full Position Form

The controller as speci ed in the equation above is known as the


full position form in that it generates the actual controller output.
A more useful form is the incremental or velocity form which
generates the change in controller output (ΔM). We can convert
the controller to this form by considering two consecutive scans. If
En is the current error and En−1 is the error at the previous scan
then

Subtracting gives

9
fi
3.2 Proportional Action

The advantage of this version is,

• rstly, that it eliminates C which is usually not a constant and


would require adjustment as process conditions vary.

• Secondly, the controller will have bumpless initialisation. When


any controller is switched from manual to automatic mode it
should cause no disturbance to the process.
With the full position version it would be necessary to rst
calculate C to ensure that M is equal to the current value of the
MV.

10
fi
fi
3.2 Proportional Action

Since the velocity form generates increments it will always start


from the current MV and therefore requires no special logic.

It also results in bumpless tuning, so that tuning constants may


be changed with the controller in automatic mode.

Some full position controllers require the controller to be rst


switched to manual and, after retuning, returned to automatic to
force re‐initialisation.

11

fi
3.2 Proportional Action

Some systems require the proportional band (PB) rather than


gain.

This is de ned as:


Proportional Band PB

“the percentage change in error required to move the output


100%”. Conversion between the two is straightforward.

12
fi
3.2 Proportional Action

Example: A temperature transmitter has a range from 100 to


300°C, and the set point of the controller is at 200°C.

A 100% PB means that as the controlled variable varies by


100% of its range, the controller output varies by 100% of its
range.

A 50% PB means that as the controlled variable varies by 50%


of its range, the controller output varies by 100% of its range.

A 200% PB means a very small controller gain, or sensitivity to


errors.

13
3.2 Proportional Action

14
3.2 Proportional Action

While it will respond to changes in PV, the main purpose of


proportional action is to generate a proportional kick whenever
the SP is changed. If we assume PV is constant then

15
3.2 Proportional Action
Remembering that for our red heater example
the controller is reverse acting, the controller
will thus make a step increase to fuel ow
proportional to the increase in temperature SP.

This is a one‐o change because ΔSP will be PV


zero for future scans until another change is
made to SP.
MV

Kc=2

16
ff
fi
fl
3.2 Proportional Action
Of course, increasing the fuel will cause the temperature
to rise and reduce the error – so the controller output will
only remain at this new value until the process deadtime PV
has expired. The full trend is shown in the gure below

MV

17
fi
3.2 Proportional Action
This demonstrates the main limitation of proportional
control in that an o set will always exist at steady state.
The PV will never reach SP except at initial conditions.
The o set can be reduced by increasing Kc but with increasing
oscillatory behaviour. These oscillations, on any process, become
unstable before
o set can be
reduced to zero.

18
ff
ff
ff
3.2 Proportional Action - Example

Consider the liquid-level control loop shown. The design operating


conditions are fi = f = 150 gpm and h = 4 ft. Let us also assume
that for the outlet valve to deliver 150 gpm, the signal to it must be
50%CO.

19
3.2 Proportional Action - Example
If the inlet ow fi(t) increases, the response of the system with a
proportional controller is shown. The controller returns the
controlled variable to a steady value but not to the set point
required. The di erence between the set point and the new steady
state is the o set. The proportional controller is not “intelligent
enough” to drive the controlled variable back to set point. The new
steady-state value satis es the controller.

20
fl
ff
ff
fi
3.2 Proportional Action - Example
The obvious question is: Why does this o set occur? Let us now
look at a simple explanation to this question. Consider again the
liquid-level control system shown in with the same operating
conditions as those given previously, that is, fi = f = = 150 gpm, h
= 4 ft, and with a required signal to the valve of 50%CO to deliver
150 gpm. Assume now that the inlet ow increases up to 170 gpm.

When this happens the


liquid level increases and
the controller will in turn
increase its output to open
the valve to bring the level
back down. To reach a PV
steady operation, the outlet u
ow must now be 170 gpm.
MV
y

21
fl
fl
ff
3.2 Proportional Action - Example
To deliver this new ow, the outlet valve must be open more than
before, when it needed to deliver 150 gpm. Because the valve is
fail-closed, let us assume that the new signal to the valve required
to deliver 170 gpm is 60%. That is, the output from the controller
must be 60%. Constant Variable

To obtain this 10% from the


second term, the error term
must not be zero at steady
state. This required steady-
state error is the o set. PV M
u
MV
y

22
ff
fl
3.2 Proportional Action - Example
Constant Variable

Two points need to be stressed.


1. The magnitude of the o set depends on the value of the
controller gain. Because the second term must have a value of
+10%CO, the values are:

We must remember that above a certain KC, most processes go


unstable. However, the controller equation does not show this.

23
ff
3.2 Proportional Action - Example
Constant Variable

Two points need to be stressed.

2. It seems that all a proportional controller is doing is reaching a


steady state operating condition. Once a steady state is
reached, the controller is satis ed. The amount of deviation from
the set point, or o set, depends on the controller gain.

24
ff
fi
3.3 Integral Action
The main purpose of integral (or reset) action is to eliminate o set.

It continues to change the controller output for as long as an error


exists. It does this by making the rate of change of output
proportional to the error, i.e.

Ti (or i) is known as the integral time (or reset time) and is the
means by which the engineer can dictate how much integral action
is taken. Some manufacturers use the reciprocal of reset time, the
reset rate .

The above equation is already in the velocity form, integrating


gives us the form that gives “integral” action its name.

25
𝝉
ff
3.3 Integral Action
Converting the equation to its discrete form (where ts is the
controller scan interval) gives

While proportional action is based on the current error, we can see


that integral action is based on (the sum of) past errors.
Converting the equation to the incremental form gives

In most systems the controller scan interval is expressed in


seconds, while tuning constants such as Ti are often in minutes.
The above equation and the others that follow therefore should
then include a factor of 60 for conversion to consistent units. For
simplicity we have omitted it.
26
3.3 Integral Action
Combining with the promotional control equation gives
proportional plus integral (PI) control

Integral Control Proportional Control

I
P

Proportional Integral Control

27
3.3 Integral Action

Kc = 1

For a constant error, the rate of change of output is constant.

The change made by integral action will eventually match that


of the initial proportional action. The time taken to ‘repeat’ the
proportional action is Ti. 28
3.3 Integral Action

In this example Ti is about 5


minutes. In many DCS Ti will
have the units of minutes,
but some systems use hours
or seconds. Others de ne
the tuning constant in
repeats per minute, i.e. the
reciprocal of Ti as we have Kc = 1
de ned it.

In the form of the algorithm we are using, higher values of Ti


give less integral action. We therefore have to be careful with
the use of zero as a tuning constant. Fortunately most
systems recognise this as a special case and disable integral
action, rather than attempt to make an in nite change.
29
fi
fi
fi
3.3 Integral Action

Again the trend in


the previous gure
is only valid until
the deadtime
expires, after which
the behaviour will
be as shown here.

Even a very small amount of integral action will eliminate o set.


Attempting to remove it too quickly will, as with any control action,
cause oscillatory behaviour. However, this can be compensated for
by reducing Kc. 30
fi
ff
3.4 Derivative Action
For most situations a PI controller is adequate. Indeed, many
engineers will elect not to include derivative action to simplify
tuning the controller by trial‐and‐error. A two‐dimensional search
for optimum parameters is considerably easier than a three‐
dimensional one.

However, in most situations, the performance of even an optimally


tuned PI controller can be substantially improved by the addition
of derivative action.

Derivative action is intended to be anticipatory in nature; indeed, in


older texts, it was called this. It anticipates by taking action if it
detects a rapid change in error. The error may be very small (even
zero) but, if changing quickly, it will surely be large in the future.

31
3.4 Derivative Action
Derivative action attempts to prevent this by changing the output
in proportion to the rate of change of error, i.e.

Td (or d )is known as the derivative time and is the means by


which the engineer can dictate how much derivative action is
taken. Converting the equation to its discrete form, gives

Writing it for the previous scan interval

And subtracting

32
𝝉
3.4 Derivative Action
In order to demonstrate the e ect of derivative action we will
formulate a proportional plus derivative (PD) controller. This
probably has no practical application but including integral action
would make the trends very di cult to interpret.

Proportional Control

P Derivative Control

Proportional Derivative Control

33
ff
ffi
3.4 Derivative Action Proportional Derivative Control

Not a step
change to the
SP, instead it
has been
ramped.

The initial step change in the output is not then the result of P action
but the D action responding to the change, from zero, in the rate of
change of error. The subsequent ramping of the output is due to the
P action responding to the ramping error.
34
3.4 Derivative Action Proportional Derivative Control

Shown is the
response of
this controller,
up to the point
where the
deadtime
expires.

The P action will eventually change the output by the same amount as
the initial D action. The time taken for this is Td which, like Ti , can be
expressed in units such as minutes or repeats per minute, depending
on the DCS.
35
3.4 Derivative Action Proportional Derivative Control

Also shown in
green is what the
controller
response would
be without D
action, i.e. P‐only.

It can be seen that D action takes action immediately and that the P
action takes Td minutes to do. In e ect it has anticipated the need for
corrective action, even though the error was zero at the time.

36
ff
3.4 Derivative Action
We have seen that P action is based on current error and I on past
errors.

D is e ectively based on future error.

This anticipatory nature is bene cial if the process deadtime is large; it


helps compensate for the delay between the change in PV and the
cause of the disturbance.
Processes with a long deadtime,
or more speci cally processes
with a large θ/τ ratio, are
relatively few.
Thus most controllers, when
responding to a change in SP, do
not obviously bene t from the
addition of derivative action.

37
ff
fi
fi
fi
3.4 Derivative Action
Indeed, if the θ/τ ratio is small, instability can be caused by relatively
small amounts of D action. However, we will demonstrate later that D
action permits Kc to be increased and so can be very useful in
speeding the recovery from a load change – even if the θ/τ ratio is
close to zero.
It is often said that D action should only be used in temperature
controllers. It is true that temperatures, such as those on the outlet of
a red heater and on distillation column trays, will often exhibit
signi cantly more deadtime than measurements such as ow, level
and pressure. However this is not universally the case, as illustrated
in the gure
Manipulating the bypass of the stream on which
we wish to install a temperature controller, in this
case around the tube side of the exchanger, will
provide an almost immediate response. Indeed, if
accurate control of temperature is a priority, this
would be preferred to the alternative
con guration of bypassing the shell side.

38
fi
fi
fi
fi
fl
3.4 Derivative Action
While there are temperatures with a very short deadtime there will
be other measurements (like levels !!) that, under certain
circumstances, show a long deadtime.

The full PID equation that we have developed so far is thus

This form of the equation, however, exhibits a problem known as


derivative spike. Consider how the derivative action responds to a
change in SP. If, before the change, the process is at steady state
and at SP then

The change of SP will introduce an error (E) and so the change in


output due to the derivative action will be
D
39
3.4 Derivative Action

The change of SP will introduce an error (E) and so the change in


output due to the derivative action will be
D
Assuming the process deadtime is longer than the controller scan
interval then, at the next scan, the PV will not yet have responded to
this change and so both En and En−1 will now have the value E. The
D action will then be a change of the same magnitude but opposite
in direction, i.e.
D -
Until the process deadtime expires the values of En, En−1 and En−2
will all be E and so the D action will be zero.

Bearing in mind that Td will be of the order of minutes and ts in


seconds the magnitude of ΔMD is likely to be large, possibly
even full scale, and is likely to cause a noticeable process upset.
Derivative action is not intended to respond to SP changes.
40
3.4 Derivative Action
D

Remembering that we have de ned error as PV – SP, then

If there are no SP changes, then

And we can rewrite the PID controller as

41
fi
3.4 Derivative Action

This derivative‐on‐PV version (sometimes also described as PI‐D)


will no longer cause a derivative spike when there is a change in SP.
But the response of derivative action to load changes is una ected.

In many DCS this modi cation is standard. Others o er both this


and the derivative‐on‐E versions as options.

It is common for this algorithm to include some form of ltering to


reduce the impact of the spike but, even with this in place, there is
no reason why the engineer should ever use the derivative‐on‐E
version if the derivative‐on‐PV version is available.
42
fi
ff
fi
ff
3.4 Derivative Action

While this modi ed algorithm deals with the problem of a spike


resulting from a SP change, it will still produce spikes if there are
steps in the PV. These can result if the measurement is
discontinuous.

The most common example is some types of on‐stream analysers,


such as chromatographs. The sample‐and‐hold technique these
employ will exhibit a staircase trend as the PV changes. Each step
in the staircase will generate a spike.

This is a particular issue because analysers tend to be a signi cant


contributor to deadtime and thus the composition controller would
bene t from the use of D action.

43
fi
fi
fi
3.4 Derivative Action

The problem can also arise from the use of digital eld transmitters,
even if the analog‐to‐ digital conversion is done to a high resolution,
say, to 0.1% of range.

The resulting 0.1% steps as the PV changes can be ampli ed by


one or two orders of magnitude by the derivative action. Care
should therefore be taken in the selection of such transmitters if they
are to be installed in situations where derivative action would be
bene cial.

44
fi
fi
fi
3.4 Derivative Action

This gure
shows the
performance of
the full PID
controller as
described in the
above equation.

As might be expected, the response becomes more oscillatory as Td


is increased. Perhaps more surprising is that reducing Td also
causes an oscillatory response. This is because the addition of D
action permits an increase in Kc, so the oscillation observed by
removing the D action is caused by excessive P action.
45
fi
3.4 Derivative Action

If measurement noise is present then we need to be cautious with


the application of D action.

While the amplitude of the noise may be very small, it will cause a
high rate of change of the PV. Derivative action will therefore amplify
this.

We can illustrate this by assuming the noise is a sinusoidal signal


with amplitude A and frequency f. If the process is steady and at SP
then the error (E) will be given by

46
3.4 Derivative Action

Di erentiating with respect to time (t)

shows that the change in output caused by the D action will also
be sinusoidal (shifted in phase), with the same frequency, but
ampli ed by 2πf.

The higher the frequency, the greater will be the ampli cation.
The possible presence of noise is perhaps another reason why
there may be a reluctance to use D action. However modern DCS
provide a range of ltering techniques which can permit it to be
applied e ectively.
47
ff
fi
ff
fi
fi
3.4 Derivative Action

This gure shows the bene t of including D action. The open loop
response was produced by making a step change to the MV of the
same magnitude as that ultimately made by the controllers.
48
fi
fi
3.4 Derivative Action
By applying the methods detailed
earlier, the reader can con rm that
this is a long deadtime process
with a θ/τ ratio of about 2.7.
The closed loop responses were
placed by overlaying their trends
so that the change in SP is at the
same point in time as the start of
the open loop test.
With such a process an optimally tuned PID controller will
outperform an optimally tuned PI controller by reaching SP in about
30% less time.

Given that it is impossible for any controller to reach SP before the


deadtime has elapsed, this is a substantial improvement.

As a general rule, D action will make a noticeable improvement to


the response to SP changes if the θ/τ ratio is greater than 0.5. We
will show later that it bene ts the response to load changes at
much lower values of θ/τ.
49
fi
fi
3.5. Proportional‐on‐PV Controller
The most misunderstood and most underutilised version of the
PID algorithm is the proportional‐on‐PV (or I‐PD) type. Taking
the algorithm developed previously we modify the proportional
action so that it is based on PV rather than E.

In the same way that changing the D action from using PV


instead of E, this change will stop the P action responding to
changes in SP.
50
3.5. Proportional‐on‐PV Controller
This would appear to undermine the main purpose of P action by
eliminating the proportional kick it would otherwise produce
whenever the SP is changed. Indeed, only the integral action will
now respond to the SP change, producing a much gentler
ramping function.

The absence of the


initial proportional kick
can be seen on the
trend of the MV and
results in the PV taking
much longer to reach
its new SP.

51
3.5. Proportional‐on‐PV Controller

Many believe therefore that this


algorithm should be applied on
processes where the MV
should be adjusted slowly.
However, if this performance
were required, it could be
achieved by tuning the more
conventional proportional‐on‐
error algorithm.

Conversely it is important to
recognise that the proporional‐
on‐PV algorithm can be
Proportional-on-PV algorithm

re‐tuned to compensate for the retuned for SP change


lack of the P kick and so
respond well to SP changes.
52
3.5. Proportional‐on‐PV Controller

M
Let us examine the behaviour
of each part of the I proportional-on-error
proportional-on-error
control algorithm in response P
to the SP change above.

The proportional kick is clear with the proportional part of the


controller returning to zero as the error returns to zero.

The derivative action is the greatest as the PV peaks, and so


permits more proportional and integral action to be used. It too
returns to zero as the rate of change of PV returns to zero.

53
3.5. Proportional‐on‐PV Controller
proportional-on-error
The gure below shows the same M
disturbance but with the
proportional-on-PV algorithm. Note I
that the vertical scale is much larger
than that in the gure above.
As expected, there is no proportional P
kick and, since the action is now based
on PV, the proportional part does not D
return to zero.

It can be confusing that the proportional proportional-on-PV


part reduces as the SP is increased but
this is because the controller must be I
con gured as reverse acting. The
integral action compensates for this so M
that there is a net increase in controller
output.

D
The derivative action behaves in almost
the same way as in the proportional- P
on-error case, but the correction is
larger because of the higher controller
gain. 54
fi
fi
fi
3.5. Proportional‐on‐PV Controller
proportional-on-error
M
It was shown earlier that the I
performance of a retuned proportional-
on-PV controller would, on a real
process, be indistinguishable from the P
original proportional-on-error controller.
D

Compensation for the loss of the proportional-on-PV


proportional kick has been achieved I
mainly by substantially increasing the
controller gain. This causes the integral M
action to ramp the MV much faster.
D

55
3.5. Proportional‐on‐PV Controller
proportional-on-error
M
I

proportional-on-PV
I
retuned proportional-on-PV

But achieving similar performance D


begs the questions as to why the
proportional-on-PV algorithm is P
included in most DCS and when it
should be used. 56
3.5. Proportional‐on‐PV Controller

Rather than consider SP changes, we should give more attention to


load changes. Load changes are process disturbances which cause
the PV to move away from the SP.

On our red heater, for example, changes in feed ow rate or heater


inlet temperature would cause such a deviation.

Most controllers experience many more load changes than SP


changes. A heater outlet temperature controller may operate for days
or weeks with no change to its SP. But it is likely to experience many
process disturbances in the meantime.

Load changes impact the error di erently to SP changes since their


e ect must pass through the process and is subject to the process
lag. Rather than in the case of a SP change, when the error changes
as a step, it will accumulate more gradually.
ff
fi
ff
fl
3.5. Proportional‐on‐PV Controller
This gure shows the performance of the two controllers, both tuned
for SP changes, subjected to a load change. The change could, for
example, be an increase in feed ow rate. The open loop trend
shows what would happen with no temperature control in place.

Response to a load change

58
fi
fl
3.5. Proportional‐on‐PV Controller
Switching the algorithm between proportional-on-error and
proportional-on-PV has no a ect on the way it responds to load
changes. The di erence we see is due to the di erence in tuning.
The more tightly tuned algorithm deviates from SP by less than half
and the duration of the upset is also halved.

This opportunity for substantial improvement is often overlooked by


control engineers.

Preoccupied with tuning Response to a load change


controllers for SP
changes they rarely
appreciate how much
faster the controller can
be made to react to
process disturbances.

59
ff
ff
ff
3.5. Proportional‐on‐PV Controller

This gure shows the breakdown of the Response to a load change


control action for the load tuning case
above. Since the SP is constant, the
response would be the same for both
the proportional-on-error and
proportional -on-PV algorithms.

M
I
Response to a load change (both algorithms)

D
60
fi
3.5. Proportional‐on‐PV Controller
Response to a load change

It is important to recognise that the M (both algorithms)


process cannot bene t from the tuning I
change if applied to the proportional-on-
error algorithm. The e ect of doing so is P
shown in the gure below
D

Response to a SP change

(proportional-on-error algorithm)

61
fi
fi
ff
3.5. Proportional‐on‐PV Controller
Even if SP changes are rare, when they
are made, the controller will now react far
too quickly. In our example the MV has
overshot its steady-state change by
Response to a SP change

over 200 %. In our red heater example, (proportional-on-error algorithm)


this would likely cause a serious upset to
fuel combustion.
We also have to consider which algorithm
and tuning combination should be used if
the controller is the secondary of a cascade. Such controllers are
subject to SP changes when the SP of the primary is changed but
also when the primary takes corrective action during a load change.
Unlike a primary, a secondary controller will be subject to frequent
SP changes. Theoretically this would suggest that the proportional-
on-error algorithm should be used in the secondary, since this will
marginally outperform the proportional-on-PV version. One could
make the same argument if a MVC is installed, since the controllers
it manipulates e ectively become secondaries of a cascade.
62
ff
fi
3.5. Proportional‐on‐PV Controller

The most commonly used measure for control performance is


integral over time of absolute error (ITAE).
The higher the value of ITAE, the poorer the controller is at
eliminating the error.

Impact of switching from proportional-on-PV

to proportional-on-error

Both algorithms have been tuned

for SP changes.

63
3.5. Proportional‐on‐PV Controller
As expected the proportional-on-PV algorithm does not perform as
well as the proportional-on-error algorithm for SP changes.
While this might at rst appear signi cant, it should be compared
against the impact it has when the process is subjected to a load
change.
Impact of switching from proportional-on-PV

to proportional-on-error

Both algorithms have been tuned

for SP changes.

64
fi
fi
3.5. Proportional‐on‐PV Controller
Secondaries of cascades generally have a very small / ratio and so
the improvement in the response to load changes, from selecting the
proportional-on-PV algorithm, is likely to be around 600 %. The
price we pay for this is around a 10 % increase in ITAE when the SP
is changed.

We must also consider the case when the primary


controller is out of
service. The secondary
will then experience Impact of switching from proportional-on-PV

mainly load changes and to proportional-on-error


would bene t from this
decision.

Further, in the interest Both algorithms have been tuned

of standardisation, for SP changes.


universally adopting the
same algorithm would
be advantageous.
65
fi
𝜽
𝝉
3.5. Proportional‐on‐PV Controller
Some DCS have the option of automatically switching between the
two algorithms as the cascade is switched between auto and
manual.

While this might seem a good idea it is advisable to disable this


feature. The DCS does not make the necessary change to tuning
constants when it switches algorithm.

Of course it would possible to add this feature as a customisation


but that would involve maintaining two sets of tuning.

Impact of switching from proportional-on-PV

Given that one set is likely to be to proportional-on-error

used rarely, there is a danger of it


not being updated to re ect any
process or instrumentation Load change
changes.
SP change

/ 66
𝜽
𝝉
fl
3.5. Proportional‐on‐PV Controller

This switching also has an impact when step-testing the secondary


SP in order to develop tuning constants for the primary. If the
switching is enabled then the proportional-on-PV algorithm will be
used during step-testing but the proportional-on-error will be used
when the cascade is commissioned. This also applies when step-
testing for the later addition of a MVC.

After the primary (or MVC) is commissioned the dynamics could be


quite di erent from those found in the step-test and may cause
performance problems.
Impact of switching from proportional-on-PV

On systems where this facility to proportional-on-error

cannot be disabled, the


proportional-on-error version
must be used when the primary Load change
(or MVC) is in service and special
arrangements have to be made SP change
to ‘trick’ the DCS into using this
algorithm during step-testing.
/ 67
𝜽
𝝉
ff
3.5. Proportional‐on‐PV Controller
The gure does, however, show that, if a controller experiences an
equal split of SP and load changes, the advantage of the
proportional-on-PV algorithm tends to zero as the / ratio
becomes large.

Theoretically here we should use the proportional-on-error


algorithm if there are frequent SP changes. However, there are
techniques superior to the PID algorithm for processes with long
deadtimes.
Impact of switching from proportional-on-PV

to proportional-on-error

While these may not always be


applicable, the occasions on Load change
which the proportional-on-error
algorithm is justi ed will be very
rare. SP change

/ 68
𝜽
𝝉
fi
fi
𝜽
𝝉
3.5. Proportional‐on‐PV Controller
Some DCS include an algorithm described as the two degrees of
freedom controller. This has the form

where

The algorithm can also be described as having set point weighting.


The values of and β can be set by the engineer to a value in the
range 0 to 1.

Setting them both to 0 will give the controller as described earlier by


the equation

69
𝜶
3.5. Proportional‐on‐PV Controller

Setting them both to 0 will give the controller as described earlier by


the equation

while setting them both to 1 will give the recommended form of the
controller as described by the equation

70
3.5. Proportional‐on‐PV Controller

and β = 0

and β = 1

It is possible to use values between 0 and 1 but there is little bene t


in doing so.

Optimising the tuning, for both load and SP changes, will always
result in value for a of 1 (and higher if permitted). However this
ignores the requirement that the controller should handle both
disturbances well with the same tuning constants. For this to be
achievable, must be 0.

The optimised value for β will be that which generates the maximum
permitted derivative spike, i.e. β will be zero if no spike is permitted.
71
𝜶
𝜶
𝜶
𝜶
fi
3.5. Proportional‐on‐PV Controller
Another option available in some systems is an integral only
algorithm. This has the form

For SP changes this will respond identically to the proportional-on-


PV, derivative-on-PV PID algorithm – provided the value used for Ti
is that same as Kc/Ti in the PID algorithm.

In the same way that derivative action ampli es noise, integral action
attenuates it.

The full position discrete form of the algorithm, shows how integral
action is based on the sum of all previous values of the error. This
averages out any noise.

However, in the absence of proportional and derivative actions, the


algorithm will respond more slowly to load changes. So, while it was
once commonly used in ow controllers, it is di cult to see what
advantage it o ers. 72
ff
fl
fi
ffi
3.6. Bumpless Transfer and Windup Protection.
When implementing the control con guration for an application,
the requirements for normal operation of the controls take
precedence. However, capabilities are also required to address
the following:
• The transition from manual to automatic must be smooth
or “bumpless”.
The PID block provides for bumpless transfer from manual to
automatic.

But what about switching the


discharge ow controller in
the gure from automatic to
remote?

73
fi
fl
fi
3.6. Bumpless Transfer and Windup Protection.
To achieve a smooth transition, functions in addition to those
illustrated in the gure are required. Similar requirements apply to
all control con gurations and usually increase in complexity with
the complexity of the control con guration
• The PID controller must not be allowed to wind up. Windup is
a phenomenon associated with the reset (intergal) mode and is
often referred to as reset windup. The PID block invokes
windup protection when the controller output is driven to either
of the controller output limits. However, there are external
factors that can result in windup. The condition for windup to
occur is stated as follows:
Reset windup occurs in a controller when changes in the
controller output have no e ect on the process variable.

Reset windup protection is an option that must


be bought in analog controllers; however, it is a
standard feature in DCS controller.
74
fi
fi
ff
fi
3.6. Bumpless Transfer and Windup Protection.

Using this cascade control as an example, suppose that the


measurement range of the discharge ow controller is 0 to 100
gpm, but when the control valve is fully open, the discharge ow
is 70 gpm. Does increasing the set point above 70 gpm have
any e ect on the ow?
Once the control valve is fully
open, additional increases
have no e ect on the variable
being controlled. The
condition for windup exists in
the vessel level controller.
Reset windup occurs any time a controller is not in charge, such
as when a manual bypass valve is open or when there is
insu cient manipulated variable power. It also typically occurs in
batch processes, in cascade control, and when a nal control
element is driven by more than one controller, as in override
control schemes. 75
ffi
ff
ff
fl
fl
fi
fl
3.6. Bumpless Transfer and Windup Protection.

76
3.6. Bumpless Transfer and Windup Protection.

There are three capabilities for avoiding such windup: 



• Integral tracking

• External reset

• Inhibit increase/inhibit decrease


Implementations of the PID block must provide at least one of
these, but con guring such features is not normally represented
on P&I diagrams.

The logic required to address these issues can easily exceed the
logic for the normal control functions. Ignoring the requirements
for bumpless transfer and windup protection will have
consequences.

77
fi
3.6. Bumpless Transfer and Windup Protection.

Rarely do consequences arise during normal production


operations, but commonly arise when situations such as the
following occur:

• During startup and shutdown.

• The process is driven to a limiting condition, such as


maximum heat transfer in an exchanger or operating a red
heater at the minimum ring rate.

• Temporary disruptions to production operations, such as


operating a column on total re ux (feed is stopped, but boil-up
and re ux continue).

• Switching between modes of operation, such as regenerating


the catalyst in a uidized bed.

78
fl
fl
fi
fl
fi
3.7. TUNING FEEDBACK CONTROLLERS
Probably 80 to 90% of feedback controllers are tuned by
instrument technicians or control engineers based on their
previous experience. For the 10 to 20% of cases where no
previous experience exists, or for personnel without previous
experience, there exist several organized techniques to obtain
an “initial guess ” close to the “optimum” settings.

To use these organized procedures, we must rst obtain the


characteristics of the process. Then, using these
characteristics, the tunings are calculated using simple
formulas.

There are two ways to obtain the process characteristics, and


consequently, we divide the tuning procedures into two types:
on-line and o -line.

79
ff
fi
3.7. TUNING FEEDBACK CONTROLLERS - Online Tuning
ultimate period ultimate gain

Some tuning rules are based on the idea of ultimate gain and
ultimate period. The gure plots the closed loop response for
a unit step change in the set-point of a rst order plus dead
time process for a P only controller as the controller gain is
increased. 80
fi
fi
3.7. TUNING FEEDBACK CONTROLLERS - Online Tuning

Notice that as the controller gain


is increased, the steady state
o set reduces. Also, the
response becomes faster. For
larger gains the closed loop
response is oscillatory. As the
gain is increased further,
sustained oscillations result.

Any further increase in the controller gain results in an unstable


system with the oscillations increasing in magnitude with time.
The controller gain for which the closed loop response exhibits
sustained oscillations corresponds to the transition from a
stable to an unstable closed loop response. This controller gain
at which the closed loop system borders on instability is
referred to as the ultimate gain, KU. The period of the
sustained oscillations is known as the ultimate period, PU.
81
ff
3.7. TUNING FEEDBACK CONTROLLERS - Online Tuning
The empirical tuning rules recommend the controller gain to be a
fraction of the KU and the reset time and derivative time as
fractions (multiples) of PU. Two popular tuning rules are the Zeigler-
Nichols and Tyreus-Luyben .
P PI PID
Ziegler-Nichols
KC KU/2 KU/2.2 KU/1.7
Empirical Tuning Procedures τI -- PU/1.2 PU/2
Zeigler Nichols (Aggressive) τD -- -- PU/8
Tyreus -Luyben
Tyreus Luyben (Loose)
KC -- KU/3.2 KU/2.2
τI 2.2PU 2.2PU

τD -- -- PU/6.3
82

3.7. TUNING FEEDBACK CONTROLLERS - Online Tuning


For a given ultimate gain and ultimate period, the controller gain is
the least for a PI controller. This is due to the “seeking behaviour”
caused by I action for zero o set. The closed loop system thus
goes unstable for a lower controller gain implying that it should be
lower.
P PI PID
The controller gain is the
maximum for a PID Ziegler-Nichols
controller due to the KC KU/2 KU/2.2 KU/1.7
stabilizing e ect of D
action.

τI -- PU/1.2 PU/2
τD -- -- PU/8
As discussed before, D
action is however used Tyreus -Luyben
rarely in practice due to KC -- KU/3.2 KU/2.2
noise ampli cation. The PI
algorithm is most τI 2.2PU 2.2PU
commonly used in the
industry. τD -- -- PU/6.3
83
fi
ff
ff
3.7. TUNING FEEDBACK CONTROLLERS - Online Tuning

The tuning rules show that Zeigler-Nichols (ZN) tuning is more


aggressive than the Tyreus-Luyben (TL) tuning.

Application of the ZN tuning rule can cause process upsets such


as a distillation column ooding due to a sudden large increase in
the vapour boil-up caused by a controller. The more conservative
TL tuning rule is preferred in the process industry for a smooth and
bumpless handling of transients avoiding large and sudden
changes in the control input.
Obtaining the ultimate gain and period of a control loop by
increasing the controller gain causes the process to be driven
towards instability.

Considering the hazardous nature of chemicals processed in any


chemical plant, such a methodology for tuning loops must be
avoided.
Alternative methods are needed that can be used for proper tuning.
84
fl
3.7. TUNING FEEDBACK CONTROLLERS - Online Tuning
Alternative methods are needed that can be used for proper tuning.
An example is the auto-tune variation (ATV) method.
The method consists of putting a relay at the error signal that
toggles the process input by ±h% on detecting a zero crossing.
The action of the relay causes the process input to toggle around
the steady state by ±h% for every zero crossing in the error signal
corresponding to the output crossing the set-point. Sustained
oscillations result and the system ends up in a limit cycle as
depicted in this.
PU

ZN or TL settings can h
be used for calculation
of tuning parameters. a

4h
KU =

85
3.7. TUNING FEEDBACK CONTROLLERS - Offline Tuning
The data required for the o ine tuning techniques are obtained
from the step testing method presented in Chapter 2, that is, Kp,
, and to (or ).

Remember that K must be in %TO/%CO, and and to in time


units consistent with those used in the controller to be tuned.

These three terms describe the characteristics of the process.


Once the data are obtained, an empirical method can be applied.
For example, ZN settings can be obtained from the following
formulas:
P PI PID
Ziegler-Nichols
KC
τI --
τD -- -- 86
𝜏
𝜽
ffl
𝝉
3.7. TUNING FEEDBACK CONTROLLERS - Offline Tuning

We previously mentioned that the dead time has an adverse e ect


on the controllability of processes. Furthermore, the larger the
dead time with respect to the time constant, the less aggressive
the controller will have to be tuned.

The ZN tuning formulas clearly show this dependence on dead


time. The formulas show that the larger the to/ ratio, the smaller
the KC.
The ZN method was developed for to/ < 1.0. For ratios greater
than 1.0, the tunings obtained by this method become very
conservative.
P PI PID
Ziegler-Nichols
KC
τI --
τD -- -- 87
𝝉
𝝉
ff
3.7. Rules of Thumb for Controller Tuning

Almost all control loops in the process industry are one of the
following

• Flow control loop

• Pressure control loop

• Level control loop

• Temperature control loop

• Product quality control loop

Some heuristics are discussed for tuning these loops that re ect
common industrial practice.

Depending on the application, exceptions to these heuristics are


always possible.

88

fl
3.7.1. Flow Loops
Flow loops are the most common loops in the process industries.

Their dynamic response is rather fast.

Consider the loop shown in the gure. Assume that the controller
is in manual and a step change in controller output is induced.

The response of the ow is almost instantaneous; the only


dynamic element is the control valve.

The two-point method of


Chapter 2, used to obtain a
FOPDT approximation of the
response, shows that the dead-
time term is very close to zero,
to (or )≈ 0 min.

89
𝜽
fl
fi
3.7.1. Flow Loops
to (or )≈ 0 min.
In every tuning equation for controller gain, the dead time appears
in the denominator of the equation. Thus the results would show a
need for an in nite controller gain, but the signal from the ow
sensor is often noisy due to turbulent ow so that a large
proportional band (150% or more) is required. Analysis of these
types of fast processes indicates that the controller needed is an I
only.
Because pure I controllers were not available when only analog
instrumentation was available, a PI controller was used with very
small P and a large I action.

Today, this practice is still followed. The following is o ered as a


rule of thumb for ow loops:
Conservative tuning: KC = 0.1, I = 0.1 min

Aggressive tuning: KC = 0.2, I = 0.05 min


90
𝜽
fi
fl
𝝉
𝝉
fl
ff
fl
3.7.1. Flow Loops Conservative tuning: KC = 0.1, I = 0.1 min

to (or )≈ 0 min. Aggressive tuning: KC = 0.2, I = 0.05 min

Note what these tunings o er. Consider the equation for a PI


controller,

The conservative tunings provide a P action, KC = 0.1, and an I


action, KC/ I = 0.1/0.1 = 1.0, or 10 times more integral action than
proportional action. The aggressive tunings provide 20 times more
I action than P action. Thus the PI controller is used to
approximate an integral controller.
In Chapter 4 we discuss cascade control. Flow loops are
commonly used as “slave loops” in cascade control. In these
cases, ow controllers with a gain of 0.9 give better overall
response. Remember this when you read Chapter 4.

91
𝜽
fl
𝜏
ff
𝝉
𝝉
3.7.2. Level Loops.

Level loops present two interesting characteristics.

The rst characteristic is that as mentioned earlier, very often


levels are integrating processes. In this case it is impossible to
obtain a response to approximate it with a FOPDT model.

That is, it is impossible to obtain Kp, , and to, and therefore we


cannot use any tuning equation presented thus far.

Those levels processes that are not integrating processes but


rather, self-regulating processes can be approximated by a
FOPDT model, as shown in this chapter.

The second characteristic of level loops is that there are two


possible control objectives. To explain these control objectives,
consider the gure in the next slide.

92
fi
fi
𝜏
3.7.2. Level Loops.
If the input ow varies as shown in the gure, to control the level
tightly at set point the output ow must also vary, as shown. We
referred to this as tight level control. However, the changes in
output ow will act as disturbances to the downstream process
unit. If this unit is a reactor, separation column, lter, and so on,
the disturbance may have a major e ect on its performance.

Tight level control.

93
fl
fl
fl
ff
fi
fi
3.7.2. Level Loops.
Often, it is desired to smooth the ow feeding the downstream
unit. To accomplish this objective, the level in the tank must be
allowed to “ oat” between a high and a low level. Thus, the
objective is not to control the level tightly but rather, to smooth the
output ow with some consideration of the level. We referred to
this objective as average level control. Let us look at how to tune
the level controller for each objective.

Average level control.


Tight level control.

94
fl
fl
fl
Tight level control.
3.7.2. Level Loops.
Tight level control.
If the level process happens to be self-regulated, that is, if it is
possible to obtain Kp, , and to, the tuning techniques already
presented in this chapter can be used.
If the level process is integrating, the following equation for a
proportional controller is proposed:

where, A is the cross-sectional area of tank (length2),

V the time constant of the valve (time),

KV the valve’s gain [length3/(time · %CO)], and

KT the transmitter’s gain (%TO/length).


95
𝝉
𝜏
3.7.2. Level Loops.
Tight level control.
If the level process is integrating, the following equation for a
proportional controller is proposed:

The transmitter’s gain can be calculated by

The valve’s gain can be approximated by

96
3.7.2. Level Loops.
Tight level control.
If the level process is integrating, the following equation for a
proportional controller is proposed:

The time constant of the valve, V depends on several things, such


as the size of the actuator, whether a positioner is used or not, and
so on.

Anywhere between 3 and 10 seconds (0.05 to 0.17 minutes) could


be used.

97
𝝉
3.7.2. Level Loops.
Average level control.
To review what we had previously said, the objective of average level
control is to smooth the output ow from the tank. To accomplish
this objective, the level in the tank must be allowed to “ oat”
between a high and a low level.

Obviously, the larger the di erence between the high and low levels,
the more “capacitance” is provided, and the more smoothing of the
ow is obtained.

There are two ways to tune a


proportional controller for Average level control.
average level control.

98
fl
ff
fl
fl
3.7.2. Level Loops.
Average level control.

The rst way says: The ideal averaging level controller is a


proportional controller with the set point at 50%TO, the output bias
at 50%CO, and the gain set at 1%CO/%TO.

The tuning obtained in this


case results in that the level
in the tank will vary the full
span of the transmitter as
the valve goes from wide
open to completely closed.

Thus the full capacitance


provided by the transmitter
is used.

99
fi
3.7.2. Level Loops.
Average level control.
To explain the second way to tune the controller: The gure shows
two deviations, D1 and D2. D1 indicates the expected ow deviation
from the average ow. D2 indicates the allowed level deviation from
set point.
With this information we can
now write the tuning
equation:

100
fl
fl
fi
3.7.2. Level Loops.
Average level control.
The equation is composed of two ratios, and both ratios
must be dimensionless. This equation allows you to
(1) use less than the span of the
transmitter if it is necessary for
some reason, and

(2) take into consideration the


variations in input ow.

101
fl
3.7.2. Level Loops.
Average level control.

For best results, the level should be allowed to


vary as much as possible and D2 made as
large as possible; this is a decision for the
engineer. D1 depends on the process.

The equation was developed so that once the


engineer decides on D2, this limit is not
violated, while providing smoothing of the
output ow.

102
fl
3.7.2. Level Loops.
Average level control.
Note that the use of PI controllers for level control of surge
capacities is not recommended, as a change in the inlet ow
would require that the outlet ow increase above the inlet ow
before becoming equal to the inlet ow in order to bring the level
back to its set-point (zero o set).

The ow disturbance thus gets


magni ed downstream. This
magni cation would only worsen
for a series of interconnected
units defeating the very purpose
of providing surge capacity for
attenuating ow disturbances.

103
fl
fi
fi
fl
ff
fl
fl
fl
fl
3.7.3. Pressure Loops
The dynamics of pressure can be very fast ( ow like) or slow (level
like) depending on the process system. For example, the pressure
dynamics are extremely fast for a valve throttling the vapour outlet
line from a tank. On the other hand, the dynamics are slow for the
cooling water ow adjusting the pressure in a condenser due to
the heat transfer and water ow lag.
PI controllers are usually used for pressure loops with a small
proportional band (10-20%) and integral time (0.2-2 mins) for
tight pressure control.

Tight pressure control is usually desired in most processing


situations. For example, in distillation columns, the pressure
must be controlled tightly as large pressure deviations would
require compensation of the temperature controller set-points
that ensure inferential product quality control. Similarly, most gas
phase reactors are designed for near maximum pressure
operation for maximum reaction rates so that large pressure
deviations are not acceptable.
104
fl
fl
fl
3.7.4. Temperature Loops

Temperature loops are moderately slow due to sensor lags and


heat transfer lags.

PI and PID controllers are often used.

In most processing situations, tight temperature control is


desired so that the proportional band is low (2-20%). The integral
time is usually set to about the same value as the process time
constant.

In situations where derivative action is used for faster closed loop


response, the derivative time constant is set to about one-fourth
the process time constant or less depending on the transmitter
signal noise.

105
3.7.5. Quality Loops
Composition control loops are usually applied for maintaining the
product quality. In terms of relative importance, these loops are
probably the most crucial for process pro tability.
If the product quality shows large variability, the process must be
operated at a mean product quality that is signi cantly better than
the quality speci cation to ensure the production of on-spec or
better quality product all the time.

This results in a quality giveaway


adversely a ecting the process
pro tability. The quality giveaway
can be reduced by ensuring tight
product quality control.

106
fi
ff
fi
fi
fi
3.7.5. Quality Loops
Typical composition measurements involve large dead-times or
lags. For example the dead-time introduced by a gas-
chromatograph can vary from a few minutes to an hour. Some
compositions may be measured once a shift or once a day
through laborious analytical measurements.

Of all the measurements, analytical composition measurements


are the most expensive and unreliable. The product speci cations
increasingly require the measurement of ppm / ppb levels of trace
impurities so that a logarithmic scale is more appropriate in many
situations.

Product quality measurements are typically used to make small /


incremental adjustments in the set-point of a loop. The frequency
of the changes may vary from once a day to once every hour etc.
Whenever PID controllers are applicable, a large proportional band
is used (100-2000%). A large reset time (0.1 – 2 hrs) must be used
due to the lag introduced by the composition measurement as well
as the usually slow process dynamics.
107

fi
End of Chapter 3

You might also like