Largely, the more sophisticated the model, the better the controller performance will be.
The simplest model, already discussed, is the Zeigler-Nichols delay plus lag model. This can be used in either open or closed loop form. The original open loop ZN parameters have already been described and will not be further discussed here. In practice the ZN open loop settings are unduly conservative. Higher gains (smaller proportional band) should be used with most processes.
Closed loop tuning, Zeigler-Nichols style, with full amplitude continuous oscillation, is not a satisfactory approach for most actual processes! However, it is perfectly satisfactory for use on a simulated process. Other methods with reduced amplidude oscillation or with the process under partial control are more suitable for use on-line and form the basis of a number of self tuning controllers.
Some processes cannot be tuned directly by open loop methods because they do not have a stable steady state. Such systems are said to be open loop unstable. A simple example of this is level control where in the absence of some sort of feedback, a vessel will either run dry or overfill. A rather different approach is required for such loops.
The notes below describe tuning methods for single loops. For tuning multiloop systems each loop should be tuned separately, with all other loops disconnected, i.e. without control. In general, tunings obtained this way will have to be modified to allow for loop interactions, see multiloop control systems.
Described below are a number of open loop tuning methods. First a couple of correlations are shown based on the ZN open loop response. Then a method for tuning systems with no steady state is described.
A number of alternative models to the delay plus lag have been proposed for both open and closed loop tuning, e.g. delay plus two lags, three lags, etc. Howver, the Zeigler-Nichols model is in fact perfectly satisfactory, but better controller parameters may be derived for it.
For a model system with delay time Td and first order lag T1, the fractional dead time Tf is defined as:
Tf = Td/(Td + T1)
= controller gain * process gain
= controller reset time / (Td
+ T1)
Settings for PI controllers have been proposed by Lopez ( see ref 2) and Cianconne and Marlin (see ref 1). Estimates of their values, taken from published graphs, are given in the table below.
These settings appear to be much more satisfactory than the simple Z-N settings which are also shown in the table below.
| Ciancone | Lopez | ZN (open) | ||||
|---|---|---|---|---|---|---|
| Tf | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| 0 | 1.1 | 0.23 | 5.8 | 0.4 | - | - |
| 0.1 | 1.1 | 0.23 | 5.8 | 0.5 | 8.1 | 0.33 |
| 0.2 | 1.8 | 0.23 | 3.1 | 0.6 | 3.6 | 0.66 |
| 0.3 | 1.1 | 0.72 | 2.1 | 0.7 | 2.1 | 1.0 |
| 0.4 | 1.0 | 0.72 | 1.7 | 0.8 | 1.35 | 1.32 |
| 0.5 | 0.8 | 0.70 | 0.91 | 0.9 | 0.9 | 1.65 |
| 0.6 | 0.59 | 0.67 | - | - | 0.67 | 1.98 |
| 0.7 | 0.42 | 0.60 | - | - | 0.43 | 2.31 |
| 0.8 | 0.32 | 0.53 | - | - | 0.25 | 2.64 |
These settings were obtained by minimising the integral of the absolute value or square of the error following a disturbance.
Analysis of the open loop response of a first order process gives the following parameters:
Hence evaluate the fractional dead time and from this the controller parameters using the three correlations in the table above.
= 1.8
= 0.23
= 3.1
= 0.6
= 3.6
= 0.66
These are best tuned using a closed loop procedure. If a step change is used in open loop, then the equivalent time delay is easily identified. However, at the end of the time delay period the process output will rise (or fall) continuously until some physical limit is reached.
The average rate of change during this time, normalised by dividing by the size of the input step, may be taken as the reciprocal of an equivalent first order timeconstant and used to estimate parameters using Z-N or either of the above methods.
A difficulty arises is determining the steady state gain of this kind of process, since it has no steady state. In fact the time constant as calculated above already includes a sensitivity which is somewhat equivalent to process gain.
Now we will move on to show a couple of closed loop methods. First the basic Zeigler Nichols method and then a simple closed loop tuning procedure with damped oscillation.
The classic closed-loop Zeigler Nichols tuning procedure is to advance the gain of proportional only controller until the process is oscillating continuously at a constant amplitude.
The gain required to achieve this
(the ultimate gain,
) and the period
of oscillation
(the critical period, Pu) provide parameters from
which controller
settings are derived as shown below.
| Controller Type | Gain | Reset | Derivative |
|---|---|---|---|
| P | /2 |
- | - |
| PI | /2.2 |
Pu/1.2 | - |
| PID | /1.7 |
Pu/2 | Pu/8 |
Note that it is not necessary here to estimate the steady state process gain as the controller gain, or proportional band, settings are exressed in terms of that actually set on the controller to make the plant oscillate.
Allowing a real process to oscillate between anything but rather tight limits is clearly not likely to be acceptable except for control loops which are noncritical. Two alternatives are therefore used.
The first of these is similar in principle to fitting an open loop model to a delay plus lag, except that it is mathematically a bit more complicated. A simplified approach is discussed below.
The second approach is applied to self tuning controllers.
Obtain a controller setting which keeps the process within acceptable limits.
Use only proportional action. Note the gain setting on the controller,
.
Disturb the process with a step change. This is most conveniently done by changing the controller setpoint. The behaviour of the process will be similar to the figure.
Damped response of process under non-optimal proportional control
. It is also oscillating rather more slowly, since
increasing the gain of a controller speeds up the response of the
process to which it is attached.
The period of oscillation, Pd, e.g. the time between successive peaks or troughs, will thus be slightly greater than Pu, but not much. Hence we can say that typically:
We can estimate the increase in gain required to cause the system to oscillate continuously if we know the amount which the oscillation decays between half cycles. This would be the ratio between the amplitude of e.g. the first peak and that of the trough which follows it. This is not so easy to estimate, as the zero point of the sinusoidal respose may not be obvious. Instead take the ratios of peak-to-trough and following trough-to-peak distances. The gain would need to be increased in proportion to this ratio to cause steady oscillation.
In the response shown above the proportional controller had a gain of 1.5.
There are 4 complete sinusoids in about 18 time units, so
Pu = 0.95 * 4.5 = 4.28
The first peak to trough distance is about (340-80) = 260 units
The following trough to peak is (80-260) = - 180 units
The ratio of their magnitudes is thus 180/260 = 0.69
The gain should be increased by this factor, i.e:
=
/0.69 = 1.5/0.69 = 2.17
Hence the ZN PI controller settings are:
/2.2 = 2.17/2.2 = 0.99
Reset = Pu / 1.2 = 4.28/1.2 = 3.57
Another way to make a process oscillate is to use a control system which is intrinsically oscillatory. An on-off control system has this property, which is why it is seldom used in chemical process control.
However, restricting the size of change which the controller can produce will restrict the amplitude of the oscillations. These can thus be small enough not to upset the process, or its operators!
This controller has a parameter deadzone, which defines the minimum change in the measured variable required to produce a change in output. The other parameter defines the size of the output of the controller. This is set to be + output/2 when the controller is on and - output/2 when it is off.
The algorithm for the on-off controller is as follows.
error = setpoint - measurement if (error>deadzone) adjustment = output / 2 if (error<deadzone) adjustment = - output /2
The size of output can be quite small, although it must be enough to swing the measured variable across the range of the deadzone. This latter must be larger than any noise in the process.
This controller will oscillate at a period equal to Pu. (Actually if the output is too close to the value required to swing the measurement across the whole deadzone, the period will be slightly longer. It should be enough to cover 4 or 5 times the deadzone.)
If the observed amplitude of the oscillations (maximum to minimum) is a the ultimate gain of the process can be shown to be:
= (4 * output) / (
* a)
Other information required by the program is a value for the controller deadzone = 0.01.
Now let us run the experiment with the output of the controller restricted to 4. This gives the following response.
From this response we can determine the value of a, the observed amplitude of the oscillations and the period of oscillation.
and hence evaluate the ultimate gain and the tuning parameters.
= (4 * 4)/(
* 3.1) = 1.64
Now let's try the same process again this time restricting the controller output to 10.
From this response we can determine the value of a, the observed amplitude of the oscillations and the period of oscillation.
and hence evaluate the ultimate gain and the tuning parameters.
= (4 * 10)/(
* 7.75) = 1.64
As you can see the two examples give the same values for the tuning parameters. How well do these values actually control the process at a setpoint of 0.5?
This approach can form the basis of a self tuning controller which
is switched into on-off or relay mode to determine Pu and
and hence tuning parameters
which then get set into the controller.
Real controllers differ from the ideal ones used in most exercises in several ways:
The first two points have been discussed earlier.
True derivative action is neither possible nor desirable. If a true derivative controller saw a step change in a measurement it would have to produce an infinite output. Thus a small but sharp noise spike, very common on practical electrical measurements, could produce a very large, sudden and spurious, change in a process adjustment. this is obviously highly undesirable, and so the derivative term on any controller must be modified to prevent this happening.
Derivative action is sometimes omitted altogether. In previous tuning examples we have use only PI control. In practice derivative action should be used only when very precise control is required on measurements which are known to be reliable. If in doubt, use PI only.
All real controllers use what is called compensated rate action. This introduces another parameter which is used to damp the derivative action to minimise the effect of noise spikes.
Most controllers nowadays are implemented digitally. To obtain derivatives a computer based controller would require numerical differentiation. This is an unsatisfactory procedure, since it also introduces noise. The rate compensated controller is described entirely by o.d.es, and so is implemented using only numerical integration.
Here is the theory of the compensated controller.
We require:
Without performing numerical differentiation.
Let:
Solve for z by numerical integration.
Then for small
:
is called the rate compensation parameter, and
can either have a fixed value or be made, e.g. 0.1 * deadtime of
process.
This corresponds to a form of filtering of the derivative term which prevents it goint to infinity in the presence of a step disturbance.
Consider what will happen if for any reason an error persists in a controller measurement. A simple integral action integrator would just keep on building up to a larger and larger value. If later the measurement error is removed, the integral is still there and will take about as long as the original error persisted before it unwinds back to a sensible value.
To prevent this happening. the size of the integral has to be limited. Either an arbitrary maximum may be set, or else integration may be turned off in certain circumstances. These would typicaly be when eithet the measurement or controller output reach the limit of their ranges.
The phenomenon is called windup, and the solution anti-windup.
To illustrate these points, we provide a Fortran 90 subroutine used to simulate a PID controller. This was used in off line simulations, but could equally well be implemented in a process control computer to run a process in real time.
subroutine control_pid (in,out,setpoint,pband,Ti,Td,reset,rate)
! Proportional+integral+derivative control
! pband is proportional band, Ti, Td integral, deriv action times
! reset holds integral ; rate holds compensation LPF
! *** must be distinct variables
! *** must not be changed by calling program!!
! out must be given a value at time zero to initialize integration
! all variables scaled 0-100
! setpoint must be in this scale too!
! If pband is negative, the controller is reverse acting
use times
doubleprecision :: in,out,setpoint,pband,Ti,Td,rate,reset
intent (in) :: in,setpoint,pband,Ti,Td
intent (inout) :: out,reset,rate
doubleprecision :: xin, xout, error, gain, action, alpha, edot,TTi
!
TTi=Ti
if (Ti<=0d0) TTi=1d20
gain=abs(100/pband)
action=1 ; if (pband<0d0) action=-1
alpha=0.1*Td ! rate compensation parameter
call scale100 (in,xin) ; call scale100(out,xout)
error=(setpoint-xin)*action
if (time<=0d0) then ! set initial conditions
reset=xout/gain-error
rate=0
end if
if ((xout<100d0) .and. (xout>0d0)) reset=reset+deltat*error/TTi
! .... antiwindup check
! Derivative stuff...
edot=0 ! default
if (alpha>0d0) then
call solve_ode1 (rate,error,1d0/alpha)
edot=(error-rate/alpha)/alpha
end if
! Finally...
xout = gain*(error + reset + Td*edot)
call scale100 (xout,out)
return
end