Although real PID controllers use algorithms which are very similar to the 'theoretical' one I've been using up to now, there are several differences in the way real controllers operate. The topics covered in this section are: dimensionless gain; proportional bandwidth; integral windup; implementation of derivative action; other practical considerations; and the use of the StrathPID controller.
The controller gain we've been using up to now has always had dimensions of 'controller output units/controller input units'. Most (if not all) practical controllers use dimensionless gains, where the input and output signals are made dimensionless be expressing them as a percentage of their range. For example, imagine a proportional temperature controller which moves its control signal (an output to a valve) by 2mA for every 5 degC change in temperature. Assume the temperature instrument has measurement limits of -20 to 150 degC and that the controller output has limits of 4-20mA. Using the gain definition we've been using up to now, the controller gain is 2mA/5degC = 0.4 mA/degC. Using the dimensionless gain expression, the gain becomes:
To convert between from dimensioned to dimensionless gain you need to multiply the dimensioned gain by 'Input range'/'Output range'.
The simulation work you'll be doing from now on will use a controller which uses this dimensionless gain. All that you'll have to do is supply the input and output limits (which are problem dependant) and then controller will do the rest. The controller is described below.
Electrical and Electronic engineers like the term 'bandwidth' and when they made up the bulk of control engineers, the term was carried over into control engineering. The controller bandwidth is just an alternative way of expressing the controller gain. The bandwidth is the range over which the error must move to move the output of a proportional controller over its full range. Low bandwidths are therefore equivalent to high gain. If dimensionless controller gain is being used there is a simple conversion between gain and bandwidth:
The bandwidth, or proportional band, is a rather old-fashioned way of expressing controller gain, but can still be found on even modern control systems - you need to be aware of what it means.
The controllers we've been using up to now have had no constraints at all on their output values (other than the numerical capacity of VisSim). Real controllers obviously do, since a valve can't close any more than fully closed and can't open any more than fully open. This doesn't cause any problems for proportional and derivative actions, but does cause difficulties for integral action. The problem that integral action suffers from is called 'integral windup' or 'reset windup'.
A movie demonstrating the effect of reset windup is here and the VisSim model used in the demonstration is here.
There are a number of ways of protecting a controller from windup. The method used in the StrathPID controller is to switch off the integration whenever the output limits are exceeded, and to switch it back on when the output returns to within its range. YOU NEVER NEED TO WORRY ABOUT THE INTERNAL MECHANISM A CONTROLLER USES. Windup protection is built into controllers and is invisible to users. The only time you need to take special care about windup is when setting up cascade controllers.
It isn't possible to obtain the derivative of a signal directly from an instantaneous measurement. As a result, most controllers obtain the derivative of a signal by passing it through a first-order 'filter' (a first-order differential equation):
where = a manufacturer's adjustable 'filter constant', with a value in the range [0,1], but normally set between 0.1 and 0.2.
= Derivative time constant
y = the output of the derivative element.
This equation can be manipulated to obtain an expression which is 'physically realisable', i.e. it is possible to implement:
You saw in an earlier section how sensitive derivative action is to noise in measurements. The filter in the derivative element provides a limited amount of noise resistance, but extra filtering is usually required.
Another modification that is often made to the derivative action in practical controllers is to take the derivative of only the measurement signal, and not the error. In the absence of setpoint changes this gives exactly the same result:
The reason for doing this is that it is quite possible to introduce sudden changes in the setpoint (e.g. a step), that will produce very large error derivatives (infinite for a step). If these are used for control they will cause the control valve to suddenly move to its limit and then back (when the derivative becomes reasonable). This isn't particularly desirable!
Although we won't be covering these any further in the course you should be aware that they are a consideration if you are applying a controller for real.
In the remainder of the simulation work for this course you will be using a more realistic controller than the simple arrangements we've been using up to now. The controller is contained in the file 'StrathPID.vsm' which you will find in the 'StrathModels' subdirectory or click here. To use the StrathPID controller in your simulations you'll need to follow the following procedure:
the controller is containing in the compound block in the centre. It has three input signals: the setpoint; the measurement; and a special anti-windup input for cascade control loops. The controller has two outputs: the controller output for connection to the manipulated variable; and an anti-windup output.
The bits you are interested in this diagram are those with brown labels against them - these allow you to set-up the various controller parameters, they are:
- Controller gain. This is the dimensionless controller gain
- Integral time constant: Just what it says. The dimensions of this time constant are the same as the time dimension you used in building your simulation model. In real controllers the time dimensions are usually minutes. To 'switch-off' integral action just set this time constant to a very large value (e.g. 1e+6).
- Derivative time constant. Again this has the same time dimensions as your simulation model, but in real controllers is usually in minutes. To switch off derivative action set this to zero.
- Derivative filter constant. This is the 'alpha' factor used in creating a realisable method of calculating the error derivative - I would recommend that you don't touch this.
- Direction of control action. Rather than switch signs on the formation of the error, to change the direction of control action you need to change the sign on this variable. A value of 1 produces a direct acting controller, and a value of -1 produces a reverse acting controller. Any other values will muck up the controller gain!
- The Bias term lets you set the initial controller output. If you leave this at zero and connect the controller to a simulation input that should be non-zero at steady-state then you'll end up getting a huge start-up transient when you start the simulation as the controller tries to find the correct output. You should always start simulations with a short period of 'steady-state' operation prior to introducing any disturbance or setpoint changes. If you see the outputs moving significantly during this period it means that the simulation isn't starting at steady-state and that any results you get will be incorrect.
- The output minimum and maximum values do two things: they limit the output signal; and they scale the dimensionless gain. You should set these limits to the limits specified in your simulation brief.
- The input minimum and maximum limits are used to scale the dimensionless gain. You should be provided with values for these in your simulation brief ( in a real situation you would use the real instrument limits obtained from the instrument engineers).