10th IFAC Symposium Advances in Control Education The International Federation of Automatic Control August 28-30, 2013. Sheffield, UK
Saturation in Engineering Simulation Stanislav Vrána* . Bohumil Šulc** Czech Technical University in Prague, Faculty of mechanical Engineering Department of Instrumentation & Control Engineering, Prague, Czech Republic (Tel: +420 2 2435 2651*; e-mail:
[email protected]*,
[email protected]**)} Abstract: The wind-up effect is a phenomenon known mostly from implementing PI(D) controllers in real operation when saturation of the manipulated variable may occur and cause worse control results. Nowadays many publications exist on this topic where several anti wind-up mechanisms are presented and discussed. However, the wind-up phenomenon, i.e. the problem of continued integration after the output has become limited (saturated), is a problem appearing not only in connection with numerically calculated control actions of digital controllers, but also in computer models of controlled plants. In this field, existence of the wind-up effect is somehow missed. Results and conclusions obtained by such inaccurate simulation may be misleading. Surprisingly, occurrence of this situation is not so rare, because use of amplitude limiting blocks in simulation is considered to be the only necessary precaution. In education of many control engineers, information about wind-up effect in simulation is not sufficiently pointed out. In models of higher than first order, the same approach as the one used the filed of PI(D) controllers is not always correct. The publications focused on the solutions for this case seem to be rare, if any exist. This paper presents one possible approach to wind-up and anti wind-up mechanism in modeling and simulations. Keywords: control, integration, limit, modeling, saturation, simulation, tank, wind-up
controlled objects - plants are not preferred as an absolutely indispensible basis for simulation modelling. One of the important circumstances which should be considered in control system simulation of any kind is continuing integration. It appears as the wind-up phenomenon both in controller design and simulation of controlled system dynamics.
1. INTRODUCTION Achievements in control engineering for the several last decades have been mainly represented by a great development of control theory. Unfortunately, quite often the theory reflects ambitions of researchers to contribute with something that can be considered as a new, original discovery without any interest in practical use. Illustrative examples attached to papers in scientific journals remain to be the only useful inspiration for those who are trying to transfer theory into industrial practice.
upper supply limit 140 kPA
However, such examples are frequently demonstrations in which no serious respect to real operating conditions is taken into account and usually submit only idealised and simplified solutions. If existence of real limits, e.g. when using linear models, is not correctly taken in account, then the presented results may not necessarily be successful in a practical application and potential users may be strongly disappointed. The reason of such disappointment can be sometimes removed very easily by performing simulation with a full regard to substantial technical or physical limits, as is usual in engineering simulation.
wInd-up delay
integration stopped (AWP)
output u w=y
Tme lower unified signal limit 20 kPa lower supply limit 0 kPA
Fig. 1 Occurrence of wind-up demonstrated by step responses of a pneumatic PI controller considering the unified pneumatic signal 20 - 100 kPa
Engineering simulation has been undoubtedly becoming an irreplaceable tool in testing new theoretical design approaches. For engineering simulation it is typical that it pays the main attention to engineering exploitability of simulation experiments. Comparing alternatives, dimensioning elements, operational testing, operator| training, applying empirical knowledge etc. are areas where engineering interests are dominating. Precise, but complicated mathematical models of 978-3-902823-43-4/2013 © IFAC
upper unified signal limit 100 kPa
Pneumatic unified signal
100 %
In the controller design, the wind-up phenomenon accompanies more or less all designed or simulated control circuits. It concerns not only the controllers equipped with a component performing integral actions as a part of the control algorithm, but also it should be respected in models of the controlled plants. Basically, when in a control circuit some of the con102
10.3182/20130828-3-UK-2039.00062
10th IFAC ACE August 28-30, 2013. Sheffield, UK
trol circuit outputs becomes limited (saturated), it is important to pay attention to this situation otherwise there is danger that the gained results could be influenced by the wind-up effect (see the example in Fig. 1). For such cases, the anti-wind-up precautions have been introduced. It is necessary to equip both controllers and plant simulation models with the anti-wind-up. While the use of anti-wind-up is supposed, the accurately respecting the existing physical or technical limits in the simulation models of controlled plants is not frequent. Textbooks usually do not mention clearly the consequences of such omissions, in contrary they sometimes present results influenced by incorrect simulation. Students of control engineering should get more information about these problems.
of integration stopping slightly complicated to build, but it does not add new dynamics into a model and requires only setting the limits. y'
y
1 s
1/τ tau
1/τd tau_d
Fig. 3 Block scheme of the back calculation based anti-windup
The aim of the paper is to attract attention to this topic and by means of examples suitable for educational use to demonstrate the importance for engineering applications.
<=
AND
max
>=
0
OR <=
2. ANTIWIND-UP ALGORITHMS
AND
Several anti-wind-up mechanisms have been published in literature. Overview of anti-wind-up mechanisms is done in Åström et al. (1989) and Peng et al. (1996). Modified variant of tracking anti-wind-up is presented in Lygouras (1999), another modified variant of tracking anti-wind-up including description of tuning additional parameters is presented in Scottedward Hodel et al. (2001). The method combining approaches of back calculation and conditional integration is presented in Visioli (2003).
y'
0
>=
min y
1 s
1/τ tau
Fig. 4 Block scheme of the conditional integration anti-windup The comparison of both types of anti-wind-up mechanism is shown in Figure 2. The course of input into the integrator y’ (the derivation of y) is drawn by a blue line. The red line y1 shows the course of y when conditional integration anti-windup mechanism is used. It is clear that integration stops immediately when the output of the integrator reaches its limit. As the integration is stopped immediately after reaching the limit, when the derivation y’ changes its sign, the output value y1 starts to decrease immediately. The light blue line y2 and the violet line y3 show the courses of y when the back calculation
Usually, only the magnitude saturation is taken into account, only a few papers take into account also the rate saturation, e.g. Galeani (2008). When it is talked about anti-wind-up, it is typically connected to PI(D) controllers, however antiwind-up approach for IMC exists too (Zheng, 1994). The theoretical description of wind-up and anti-wind-up mechanisms is derived in Kothare et al. (1994), Kothare et al. (1995). Saturation used in anti-wind-up mechanisms is nonlinear property, however there exists a way how to linearize it (Doyle III, 1999).
3
There is a broader list of publications focused on the wind-up and its prevention. However, they are focused on only to wind-up occurring at the side of the controller. The publications considering wind-up effect in controlled plant modelling are rare, if any exist. For this reason, we focus on the wind-up and its prevention in modelling and simulating plants from the educational viewpoint.
Δt3
upper limit
2
Δt2 y’, y [-]
1
y2
0
y‘
-1
The anti-wind-up mechanism can be built in many ways. However not all of them are suitable for usage in the controlled plant model. Here, we focus on comparison two of them: back calculation (see the scheme in Fig. 3) and conditional integration (see the scheme in Fig. 4) that are easy to explain to students. Both of them give similar results, but there are some differences between them.
-2
-3 0
5
10
y3
y1
lower limit
15 t [-]
20
25
30
Fig. 2 Comparison of output value y course for two types of used anti-wind-up mechanism (y’ is the course of derivative, y1 is the output of integrator when conditional integration is used, y2 and y3 are the outputs of integrator when conditional y2 and y3integration is used for two different constants τd, the delays Δt2 and Δt3 occurs in these cases)
The back calculation alternative is easier to build, however it adds some kind of new dynamics into the modelled system, it requires setting a new additional time constant. The scheme
103
10th IFAC ACE August 28-30, 2013. Sheffield, UK
anti-wind-up mechanism is used. In this case, the limiter limits the output y at requested limits, but the integrator continues in integration over the limit (shown by the dashed lines). When derivation changes its sign, the integrator starts to decrease its output immediately; however it takes some time till it reaches the limit (dashed lines). As late as the limit value is crossed, then an effective decrease of the output y starts. The delay Δt2, resp. Δt3, between the time instant of the derivation sign change and time instance when the limited output y starts to change effectively, is a measure how effectively the wind-up is suppressed. It is seen in Fig. 2 that the conditional anti-wind-up reacts immediately to the derivation sign change while the back calculation always reacts with a delay, length of which depends on the constant τd. This fact is usually not explained to students, as the anti-wind-up is usually explained in the context of controller. When used in the controller, the possible time delay is not so much important as when it is used I modelling a real plant. When modelling the real plant no such a delay occurs in reality.
equipped with two independent anti-wind-up mechanisms because both integrations are mutually independent (see Fig. 5). For illustrative purposes and to maintain the scheme simple and then suitable as an example for students, the scheme in Fig. 5 (and also following schemes) models pure double integration. Also the possible limitation of speed is not considered. These properties can be simply added, to extend the explanation to the students. y'2 1 xo s
y'' aw
y2 = y'1 1 xo s
x20
y1
y
antiwind-up 2
y'
x10 aw
y
antiwind-up 1
Fig. 5 Block scheme modelling a second order system represented by the serial connection of two systems of the first order using two conditional integrations.
The conditional integration mechanism is build into the block of Integrator of Simulink environment of Matlab, it can be optionally turned on. However, its usage is limited to first order models. To obtain accurate simulation regarding models of higher order, the anti-wind-up mechanism becomes more complicated and the internal anti-wind-up mechanism of Simulink block Integrator is not usable.
When a model of the second order with limitations, which is indecomposable into two systems of the first order (e.g. the hydromotor), is used in simulation, the use previously presented anti-wind-up mechanisms does not represent an enough good wind-up prevention. Reaching the output limit at the second integrator, integration must be stopped in both integrators, and this anti-wind-up mechanism has to ensure that. The modification of the scheme in Fig. 5 into the scheme in Fig. 6 is not powerful enough. An example what happens in such a transformation is shown in Fig. 8.
3. ANTIWIND-UP IN MODELS OF SECOND ORDER From the anti-wind-up angle of view, the model of the second order created as a serial connection of two models of the first order differs from the models of the second order indecomposable into two systems of the first order (of type of calculating position from acceleration). The example of model created as a serial connection of two models of the first order is a serial connection of two tanks. In this case, the saturation in the second tank does not influence the first tank. E.g. if the second tank reaches its maximal water level, the water level in the first tank still can increase. For the anti-wind-up purposes, the model is then decomposable to two individual parts, where the anti-wind-up can be solved independently. The second example is the hydromotor modelled in a way that its position is calculated from the oil pressure. The pressure then corresponds to acceleration, velocity of piston is calculated from acceleration, and piston position is calculated from velocity. However in this case, when the piston position reaches its limit, it causes velocity to equal zero. Then, when the pressure changes its sign (the oil flow rate changes its direction), the piston starts to move immediately in the other direction. This behaviour causes, that the antiwind-up mechanism cannot be solved independently for the velocity and for the position; it is then indecomposable from the anti-wind-up point of view. The difference in the behaviour (reaching limit in second tank has no immediate influence to water level in first tank, reaching limit in piston position forces the velocity of piston to be zero) needs to be respected in anti-wind-up and then both cases needs different approach.
y'' 1 s
y''
y' 1 xo s
aw
y
y
antiwind-up 2
y'
x0 aw
y
antiwind-up 1
Fig. 6 Scheme of an indecomposable model of the second order with two conditional integrations. y'' 1 s
y' 1 xo s
y'' aw
y
y
antiwind-up 2
y'
x0 aw
y
antiwind-up 1
Fig. 7 Scheme of an indecomposable model of second order with one conditional integration and integrator resetting. In Fig. 8, we suppose a variable y range is limited from 0.1 to 1.5. If two conditional integrations are used, then the variable y is limited correctly, however wind-up of length Δt occurs in calculating first derivation y’ from second derivation y’’.
The model based on the serial connection of two models of the first order (e.g. the serial connection of two tanks) can be 104
10th IFAC ACE August 28-30, 2013. Sheffield, UK
To prevent this kind of wind-up occurrence when simulating a second order model, the first integrator needs to be reset when variable y reaches its limits (see Fig. 7). Once the first integrator is reset, the conditioning of the second integration is not necessary. The result of adding resetting function is shown in Fig. 9.
The set point hw can be set by a manual control wheel. The proportional gain can be set by setting the proportion of the lengths a and b at the top lever. w (Dhw)
2 1.5
y
y, y’, y’’ [-]
1
-0.5
uI(t)
y‘ Δt
-1 -1.50
5
t [-]
10
y
y, y’, y’’ [-]
0.5
y‘‘
y‘
-
-1 -1.5 0
5
A
d( t) (Dl2)
r
To create a reliable simulation model of this example of water level control, following limits should be taken into account:
1
-0.5
uP( t) u( t) (D l1)
The pressures defined in Fig. 10 are: P1 – pressure of inlet water, P2 – pressure of environment, PN – source pressure for control of hydromotor, Ppopen – below hydromotor piston, and Ppclose – pressure above hydromotor piston.
2
0
PN
Kv2 P2=0 Kv1 P1 Fig. 10 Functional control scheme of water level in a tank.
15
Fig. 8 Courses of the variables in a model of the indecomposable second order model when two conditional integrations are used as the anti-wind-up mechanism – A non-real time delay Δt is caused. 1.5
De(t) (Dh)
Pp ope n Ap
y‘‘
a
Pp close
0.5 0
b
t [-]
10
-
15
Fig. 9 Courses of variables in a model of the indecomposable second order model where one conditional integration and integration resetting are used as anti-wind-up mechanism.
-
the height of the tank is limited, the range of inlet and outlet tank valve opening is limited to a range from zero to maximal opening, the movement of piston in the hydromotor for integral action is limited, the movement of hydromotor control valve is limited.
4.1. Linear versus nonlinear model of the water tank
4. ILLUSTRATIVE EXAMPLE The problem of wind-up and its removing can be demonstrated on an example of mechanically performed level control in a tank. A functional scheme of this control is depicted in Fig. 10. The control function is simplified and idealized in order to keep simplicity of the example and in no case it represents real construction. For investigation wind-up impact, it is necessary to propose a model of the control circuit where the existing limits should be respected in simulations.
The nonlinear model of the water tank is very easy to build as it is represented just by the following equation;
(
dh 1 K v1l1 P1 hrg K v 2 l 2 hrg . dt A
(1)
However, there can be a need to use a linear model, e.g. for educational purposes, or to make the model as simple as possible. The linear model can be described by the following equation;
The example control circuit consists of a water tank of crosssection A equipped with two valves defined by their flow rate constants Kv1 and Kv2; the opening of the inlet valve l1 is controlled (manipulated variable u(t)) to ensure the desired water level hw in the tank while the opening of the outlet valve l2 is controlled manually and from the control angle of view acts as a disturbance d(t). The water level h (acting as controlled variable y) is measured by a buoy whose movements are transferred via lever mechanism to the tank inlet valve (proportional action up(t)) and to the hydromotor control valve. The hydromotor acts as integral action uI(t) and the movement of its piston of cross-section Ap is transferred via the lever mechanism. The lengths of levers are marked by letters a, b, d, m, and n. The water has the density ρ. e(t) is the difference between measured and desired water level (control error).
d (h h0 1 (k P (P P0 k1 (l1 l10 k2 (l2 l20 (h h0 ,(2) dt Where the variables with zero in the index are values of steady state where the linearization have been done. When comparing the step responses with small size, the step responses are similar for both nonlinear and linear model. However, from the Figure 11, it is clear, that the linear model has one undoubtedly unrealistic property – the water level can be negative. In real world, the water level in the tank cannot be negative and this should be respected in simulations too; the nonlinear model respects this automatically, but the linear model does not. For this reason, it is necessary to equip the linear model with anti-wind-up mechanism to limit 105
10th IFAC ACE August 28-30, 2013. Sheffield, UK
the water level. In both cases, linear and nonlinear, the tank height should be respected. When the water level reaches the height of the tank, the accumulation is stopped. 2
linear model nonlinear model
1.5 1 0.5 0
1
l [m]
-0.5 0.2 0.1 0 0
0.5
1 t [s]
1.5
2 4
x 10
For the same reasons, the range of buoy movement is also limited. When respecting this limit, it is possible that the real water level is temporarily different to the value measured by buoy.
Fig. 11 Demonstration of linear and nonlinear model properties when the tank inlet valve is fully opened and fully closed – the linear model can calculate negative water level.
4.4. Comparison of simulation results respecting and not respecting the limits
4.2. Hydromotor The hydromotor can be simulated in a two ways, one way is based on flow rate of oil and the second one is based on pressure of oil. If the viscosity and friction is neglected, the first way leads to the following equation;
u I (t )
1 K v Ae (t ) P1 dt , Ap
(3)
h(t) [m], hw(t) [m]
h [m]
mechanism, the hydromotor control valve and tank inlet valve causes that the set point directly influences the opening of tank inlet valve and opening of the hydromotor control valve. Because of limits on both valves, the possible change of set point is then limited too. The maximal set point change should not cause exceeding the limits of both tank inlet valve and the hydromotor control valve. In this case, the use of Simulink block Saturation with variable limits is enough, but both upper and lower limits needs to be calculated properly. The limits vary because the tank inlet valve opening depends not only on the position of lever mechanism but also on the position of the hydromotor piston, which is independent on the position of lever mechanism.
(4)
Where;
l1(t) [mm]
(
hw – set point h –without respecting limitations h –using block of saturation h –using antiwind-up
1 0.9
(6)
In both cases, the piston of the hydromotor must stop at the ends of the cylinder, because the cylinder is not infinitive. However there is another limitation of the piston movement, the limited range of tank inlet valve (l1). Then the piston should stop not only at the end of the cylinder, but also when the inlet valve opening reaches its limit. This is a slightly complicated task, because the inlet valve opening depends not only on the position of the hydromotor piston, but also on the position of the lever driving also the hydromotor control valve. The limits of piston movement then vary in dependence on position of this lever. The anti-wind-up mechanism should respect both limits the cylinder size and limits of inlet valve opening.
25 20 15
Upper limit of hydromotor piston movement
uI(t) [mm]
(5)
Upper limit of input valve opening
30
10 40
2
u I (t ) Ap , Ppclose(t ) K A ( t ) v e Ppopen(t ) P1 Ppclose(t ) .
1.1
35
The second way leads to the equation;
A uI (t ) p Ppopen(t ) Ppclose(t ) dt2 , m
1.2
30 20 10 0
uP(t) [mm]
40
Upper limit of hydromotor control valve opening
30 20 10 0
l2(t) [mm]
-10 -20 15 10 1.6
Limits of buoy movement calculated from tank inlet valve position – blue lines
h(t) [m]
1.4
4.3. Limits of the set point change and limits of buoy movement
1.2 1
The responses to input step change are typically used in simulations. However, when the limits are respected, the set point w step change cannot be of any size, but it’s size is limited. The mechanical connection among set point setting
0.8
Limits of buoy movement calculated from control valve position – black lines 0
50
100
150
Fig. 12 Comparison of three tank water level control simulations with different levels of the respecting real limits. 106
10th IFAC ACE August 28-30, 2013. Sheffield, UK
Results of the three simulation experiments with different level of respecting the real limits are shown in Fig. 12. The first experiment (courses corresponding to this experiment are drawn by the violet lines) is done without the respecting the limits at all. The second experiment (courses corresponding to this experiment are drawn by the red lines) is done with respecting the limits by using the Simulink block of saturation; the buoy movement range is not respected. The third experiment (courses corresponding to this experiment are drawn by the blue lines) is done with respecting the limits by using the anti-wind-up mechanism; the buoy movement range is respected. The figure shows the simulation without respecting the limits causes unrealistic fast response to a se point change, because the maximal inlet valve opening is not respected. When the saturation blocks are used to limit the variables, the non-existing delay occurs in simulation, because the simulated hydromotor integrates over the value of position of the hydromotor piston. When the limits are simulated correctly,
should be left. The examples used in this paper can be used as simple demonstration tools when the wind-up problem in modelling the devices is explained to students. ACKNOWLEDGEMENT This work has been supported by the Grant Agency of the Czech Technical University in Prague, grant No. SGS13/179/OHK2/3T/12. REFERENCES Åström, K. J. and Rundqwist, L. (1989, June). Integrator windup and how to avoid it. In American Control Conference, pp. 1693-1698. IEEE, New York. Doyle III, F. J. (1999). An anti-windup input–output linearization scheme for SISO systems. Journal of Process Control, volume 9 (issue 3), pp. 213-220. Galeani, S., Onori, S., Teel, A. R., and Zaccarian, L. (2008). A magnitude and rate saturation model and its use in the solution of a static anti-windup problem. Systems & Control Letters. volume 57 (issue 1), pp 1-9 Kothare, M. V., Campo, P. J., Morari, M., and Nett, C. N. (1994). A unified framework for the study of antiwindup designs. Automatica, volume 30 (issue 12), 1869-1883. Kothare, M. V. and Morari, M. (1995, December). Multiplier theory for stability analysis of anti-windup control systems. In Proceedings of the 34th IEEE Conference on Decision and Control, 1995. Volume. 4, pp. 3767-3772. IEEE, New York. Lygouras, J. N. (1999). DC Thruster Controller Implementation with Integral Anti-wind up Compensator for Underwater ROV. Journal of Intelligent and Robotic Systems. Volume 25 (Issue 1), pp 79-94 Peng, Y., Vrančić, D., and Hanus, R. (1996). Anti-windup, bumpless, and conditioned transfer techniques for PID controllers. IEEE Control Systems Magazine, volume 16 (issue 4), pp. 48-57. Scottedward Hodel, A. and Hall, C. E. (2001). Variablestructure PID control to prevent integrator windup. IEEE Transactions on Industrial Electronics, volume 48 (issue 2), pp. 442-451. Šulc, B. and Vrána, S. (2012). Commonly Untaught Information Concerning Practical Use of Tuning Procedures in Control. In Advances in Control Education, pp. 454459. IFAC, Nižnyj Novgorod. Visioli, A. (2003, January). Modified anti-windup scheme for PID controllers. IEE Proceedings - Control Theory and Applications, Vol. 150, (No. 1), pp. 49-54. Zheng, A., Mayuresh, V. K., and Morari, M. (1994). Antiwindup design for internal model control. International Journal of Control, volume 60 (issue 5), pp. 1015-1024.
The bottom part of Fig. 12 shows the courses of limits of maximal possible movement of buoy. The black lines show the limits calculated from the actual position of the hydromotor control valve, the blue lines show the limits calculated from the actual tank inlet valve opening. The upper limit is the lower from both upper limit values; the lower limit is the upper from lower limit values. After the outlet valve opening l2 is changed the real water level temporarily undergo the lowest level measurable by buoy at the moment. The water level indicated by buoy is then different from real water level. This causes slower reaction to the change of the outlet valve opening l2. 5. CONCLUSIONS When the limits are not respected, but are reached and exceeded during simulations, the simulation results loose a part of their value, because it shows the behaviour, which is unrealistic and which cannot arise. The simple solution of using a limiter, which is often used in the education, is not helpful in this case, because it just hides the problem, but not solves it. The limiter can be used only in situations where it is unified with reality, e.g. limited range of sensors, when the measured value can exceed the sensor range. Otherwise, the correct limiting of integration with antiwind-up mechanism should be used. The wind-up problem is well-known in the field of a controller and many publications solving controller wind-up were presented thus the problem is well-known and is taught, however, its knowledge in a field of simulation models of real devices is insufficient and usually not mentioned during future control engineer education. Several anti-wind-up mechanisms have been designed to prevent wind-up effect in controllers, however they are not always usable when modelling a model of higher than first order; for these models, the anti-wind-up mechanism have to be enhanced in order to ensure its correct function. Conditional integration seems to be more suitable for use in modelling, because it causes no delay in situation when the reached limit 107