Implementation of GPC for integrating··processes with low computational. Requirenients
Abstract
This paper presents a straightforward method for implementing generalized predictive self-tuning controllers with low computational requirements. The method makes use of the fact that a generalized predictive controller results in a control law that can be described with few parameters. The controller has been developed for processes having an integral effect. A set of simple functions relating the controller parameters to the process parameters has been obtained. With this set of functions either a fixed or a selftuning GPC can be implemented in a straightforward manner. An application to the control of a DC motor is given.
Full text
Proceedings of 3rd European Control Conference Rome, ltaly, September 199S IMPLEMENTATION OF GPC FOR INTEGRATING··PROCESSES WITH LOW COMPUTATIONAL. REQUIRENIENTS * Carlos Bordons and Eduardo F. Camacho Dpto. Ing. de Sistemas y Automática Escuela Superior de Ingenieros Univ. de Sevilla Av. Reina Mercedes s/n 41012 Sevilla Spain bordons©esi.us.es Keywords: Predictive control, adaptive control, pro cess control, implementation issues, real-time control. Abstract This pa.per presents a straightforward method for im plementing generalized predictive self-tuning controllers with low computational requirements. The method malees use of the fact tha.t a. generalized predictive con troller results in a. control la.w tha.t can be described with few parameters. The controller has been developed for processes having a.n integral effect. A set of simple functions relating the controller parameters to the process pa.rameters has been obtained. With this set of functions either a fixed or a selftuning GPC can be implemented in a straight forwa.rd ma.nner. An application to the control of a oc motor is given. 1 Introduction One of the reasons for the success of the traditional PID controllers in industry is tha.t they are very ea.sy to im plement and tune by using heuristic tuning rules such a.s the Ziegler-Nichols rules frequently used in practice. A Generalized Predictive Controller ( GPC) results in a linear control law which is very easy to implement once the controller parameters are known. The derivation of the G PC parameters requires, however, some mathemat ical complexities such a.s solving recursively a Diophan tine equation, forming the prediction equation matrices a.nd then solving a set of linear equations. Although this is not a problem for people in the research control community where mathema.tical packages are normally a.vailable, it may be discouraging for those practitioners *Work supported in part by CICYT Contract #TAP-95-0370 used to much simpler ways of implementing and tuning controllers. The previously mentioned computation has to be ca.rried out only once when dealing with processes with fixed parameters, but if the process parameters change, the GPC's parameters have to be derived again, perhaps in real time, at every sampling time if a selftuning con trol is used. This again may be a difficulty beca.use on one hand, sorne distributed control equipment has only limited mathematical computation capabilities for the controllers, a.nd on the other hand, the computation time required for the derivation of the GPC pa.ra.meters m�y be excessive for the sa.mpling time required by the process and the number of loops implemented. Fast implementation methods for processes that can be modelled by the rea.ction curve method (most pla.nts in the process industry) have been proposed in [61, [4J, where sorne Ziegler-Nichols type of rules were given for implementing a.daptive GPC requiring only a few mul tiplications. Sorne applica.tions can be found in [21, [31 and [5J. This paper extends those results and presents a method for the easy implementation and tuning of GPC for a wide range of processes in industry, such as pro cesses with integral effect. It will be shown that a GPC can be implemented with a limited set of instructions, available in most distributed control systems, and that the computation time required, even for tuning, is very short. The method to implement the GPC is ha.sed on the fact that a wide range of processes in industrv can be 1 " descrihed by a few para.meters and that a set of simple Ziegler-Nichols type of functions relating GPC para.me ters to process para.meters can be obtained. By using these functions the implementation and tuning of a GPC resu�ts almost as simple as the implementation and tun ing of a PID. The paper is organized as follows: first a short re view of GPC is given in section 2. Section 3 presents the 3573 Digitized by Google
plant model used to model the integral effect and the control law obtained in section 4. The controller param eters are calculated and some approximation formulas are obtained in section 5 whilst the implementation al gorithm is presented in section 6. The consideration of ramp setpoints is dealt with in section 7 and an illustra tive application to a DC motor is presented in section 8. The paper ends with some concluding remarks. 2 Generalized Predictive Control The GPC method was proposed by Clarke et al. [8] and has become one of the most popular Model-Based Pre dictive Control (MPC) methods both in industry and academia. It has been successfully implemented in many industrial applications [7], showing good performance and a certain degree of robustness with respect to over parametrization or poorly known delays. It can han dle many different control problems for a wide range of plants with a reasonable number of design variables, which have to be specified by the user depending upon. a prior knowledge of the plant and control objectives. The basic idea of GPC is to calculate a sequence of future control signals in such a way that it minimizes a multistage cost function defined over a prediction hori zon. The index to be optimized is the expectation of a quadratic function measuring the distance between the predicted system output and some predicted reference sequence over the horizon plus a quadratic function mea suring the control effort. Generalized Predictive Control provides an explicit solution (in the absence of constraints), it can deal with unstable and non-minimum phase plants and incorpo rates the concept of control horizon as well as the con sideration of weighting of control increments in the cost function. The general set of choices available for GPC leads to a greater variety of control objectives compared to other approaches, some of which can be considered as subsets or limiting cases of GPC The Generalized Predictive Control (GPC) algorithm consists of applying a control sequence that minimizes a multistage cost function of the form Java = E{ 2' 6(J')lz/(t +1" I t) - wtt +1)? + Z Amman +1 - 1r} j=l l where E is the expectation operator and 3}(t+j I t) is an optimum j-step ahead prediction of the system output on data up to time t, N1 and N2 are the minimum and maximum costing horizons, Nu is the control hori zon, 6(j) and /\(_j) are weighting sequences and w(t+j) is the future reference trajectory. The objective of predictive control is to compute the future control sequence u(t), u(t + 1),... in such a way that the future plant output g(t + j) is driven close to 'U1(t + This is accomplished by minimizing .](N1,iVQ,Nu). ' . The standard algorithm is given in This algo rithm involves the optimal prediction of g(t + for N1 3 j 3 N2, which is obtained-by the recursion of a Diophantine equation and the triangularization of an (Nz — d) x (N2 — d) matrix. The goal of this paper is to develop a fast algorithm to implement self-tuning GPCs for processes that can be modelled by a first order integrating system plus a pure dead time. 3 Integrating Processes In industrial practice it is easy to find some processes including an integral effect. The output of one of these processes grows infinitely when excited by a step input. This is the case of a tank where the level increases pro vided there is an input flow and a constant output. Also the angle of an electrical motor shaft which grows while being powered until the torque equals the load. These processes can be modelled by a first order plus delay transfer function, with the inclusion of an l/s term in order to model the integrating effect. Hence, the transfer function for this kind of processes will be: _ K “1'48 G(S) - me In the case of dead time being multiple of the sam pling time the equivalent discrete transfer function when a. zero-order hold is employed is given by: ~-1 --2 5(1) = “‘bo'i—Aibh—dfd (2) (1 — z )(1 —- az ) In this section the GPC control law for processes de scribed by (1) will be calculated. Notice that some for mulations of MP0 such as Dynamic Matrix Control (DMC [9]) or Model Algorithmic Control (MAC [11]) are unable to deal with these processes since they use the truncated impulse or step response, which is not valid for unstable processes. As GPC makes use of the transfer function, there is no problem about unstable processes. 4 Derivation of the Control Law The procedure for obtaining the control law is described below: Using a CARIMA model with the noise polynomial - equal to l, the system can be written as 80) A (1 — z'l)(1—az“l)y(t)=(bo +b12_1)z'du(t — 1) + which can be transformed into: g(t + 1) = (2 l. a)y(t) - (1 + 2a)y(t - 1) + ay(t _ 2) + +b0Au(t-d)+b1 Au(t—d— l)+e(t+l) 3574
If the values offl(t+d+i-1 | t), g](t+d+i-2 | t) and 3}(t+d+i—3 I t) are known, then the best predicted output at instant t+ d +2' will be: g](t+d+'i|t)=(2+a)3)(t+d+i-1|:t) —(1+2a)g}(t+d+i—2It)+agj(t+d+i—3|t) +boAu(t+i-1)+b1Au(t+i—2) (3) With these expressions of the predicted outputs, the cost function to be minimized will be a function of 3)(t+ dlt), fl(t+d— 1 | t) and g}(t+d—2 | t), aswellas the future control signals Au(t + Nu — 1), Au(t + Nu — 2) Au(t), and past inputs Au(t — l) and, of course, of the reference trajectory. If the horizons are: N1 = d + 1, 1’2 = N + d and Nu = N, the minimization of J(N1, N2, . ’11.) leads to the following matrix equation for calculating u: Mu=Py + Rw+ Q Au(t—1) where M and R are matrices of dimension N x N, P of dimension N x 3 and Q of N x 1. Vector 11 contains the future input increments and y the predicted outputs. The first element of vector u can be obtained by: Au(t)=qPy+qRw+qQAu(t—1) being q the first row of matrix M“. If the reference is considered to be constant over the prediction horizon and equal to the current setpoint: w =1]r(t) the control law results as: Au(t)=ly1g(t+dlt)+ly2!7(t+d_llt) (4) +1,,;, g(t+ d2 | t) +1,1 1-(t)+l,,1 Au(t - 1) {\r ;\9 Being q P =[ly1 lyg ly3], 1,1 = 2(qi 213,-) and [M = i=1 j=1 q Q Therefore the control law results in a linear expres sion depending on five coefficients which depend on the process parameters (except on the dead time) and on the control weighting factor /\. Furthermore, one of these co efficients is a linear combination of the others, since the following relation must hold so as to get a closed loop with unitary static gain: lyl +ly2 +1313 +lr1:0 5 Controller Parameters The control law is very easy to implement provided the controller parameters lyl, lyg, lyg, lrl and lul are known. The existence of available relationships of these parameters with process parameters is of crucial impor tance for a straightforward implementation of the con~ troller. In a similar way to for processes without in tegrators, simple expressions for these relationships will _be obtained. As the process can be modelled by (2) three pa rameters (a, b0 and b1) are needed to describe the plant. Expressions relating the controller coefficients with these parameters can be obtained, although the resulting func tions are not as simple, due to the number of plant pa rameters involved. In order to reduce the number of parameters involved, the process can be considered to have (b0 +b1)/(l -— a) = 1 so as to work with normalized plants. Then the computed parameters must be divided by this value that will not be equal to 1 in general. The controller coefficients will be obtained as a func tion of the system pole a and a parameter: b0 n, = 50 + b1 This parameter has a short range of variability for any process. As b0 and b1 are related to the continuous pa rameters by (see [1]): [)0 = K'(T+T(—l+6_;)) bl = [{(T—6—1':(T+T)) then __ a — 1 — log a n _ (a — 1) logo that for the usual values of the system pole (in the range from 0.5 to 0.99 when sampling at an appropriate rate [10]) is going to vary between n = 0.5 and n = 0.56. Therefore the controller parameters can be expressed as functions of the system pole. and n for a fixed value of A. Notice that the use of a predictor makes the parameters independent of the dead time. Figure 1: Controller coefficients lyl, lyg, lyg and [M The shape of the parameters is displayed in figure 1 for a fixed value of /\ = 1. It can be seen that the coefficients depend mainly on the pole a, being almost independent of n' except in the case of lul. Functions of the form f(a,n.,\) = k1(n,/\) +1.~__,(n,,\ “ )k3(n, —- a 3575
where (for N = 15) k,- can be approximated by: kw = _ exp(O.955 - 0.559,\ + 0.135%) km = - exp(0.5703 - 0.513A + 0.188%) km = 10343 km = exp(0.597 - 0.42m + 0.0953%) km = exp(1.016 - 0.42511 + 0.109%) km = 1.0289 (6) km = - exp(-—1.761 - 0.4221 + 0.071%) km = - exp(0.103 - 0.353,\ + 0.089%) 191,36 = 1.0258 km = 1.631n - 1.468 + 0.2151 - 0.056% km = —0.124n + 0.158 - 0.026/\ + 0.006% 19111.3 = 1.173 - 0.019). provide good approximations for lyl, lug, 1y; and lul in the usual range of the plant parameter variations. No tice that an approximate function for lrl is not supplied, since it is linearly dependent on the other coefficients. The functions fit the set of computed data with a maxi - mum error ofless than 1.5 percent of the nominal values. Notice that closer approximations can be obtained if de veloped for a concrete case where the range of variability of the process parameters is smaller. For other values of N and Nu similar expressions can be obtained. 6 Implementation Algorithm Once the /\ factor has been decided, the values kij can very easily be computed by expressions (6) and the ap proximate adaptation laws given by equation (5) can easily be employed. The algorithm in the adaptive case will consider the plant parameters (a, b0, b1, (1 and the factor G = (b0 + b1)/(l — a)) and the control law can be seen below. 1. Perform an identification step. Compute k,j(n, /\) . 3. Calculate lyl, lyz, lyg and lul Make lrl = —ly1 '— ly2 — lyg 4. Compute y(t + d | t), + d —1|t) and fit + d —- 2 | t) using (3) recursively. 5. Compute u(t) with: Au(t) = (lyl g](t + d l t)+ +ly2 12(t+d-1|t)+1y3 1)(t+d—'2|t)+ +l,.1 r(t))/G + [U1 A u(t — l) 6. G0 to step 1. (O Notice that in a fixed-parameter case the algorithm is simplified since the controller parameters need to be computed only once (unless the control weighting fac tor A is changed) and only steps 4 and 5 have to be carried out at every sampling time. 7. Consideration of Ramp Setpoints It is usual for a process reference signal to keep a certain constant value for a time and to move to other constant values by step changes during normal plant operation. This is What has been consideredlup to now, that is, w(t + d +1) = 'w(t + d + 2) . .. = r(t), r(t) being the setpoint at instant t which is going to maintain a fixed value.' But the reference evolution will not behave like this in all circumstances. On many occasions it can evolve as a ramp, which changes smoothly to another constant setpoint. In general it would be desirable for the process output to follow a mixed trajectory composed of steps and ramps. This situation frequently appears in different indus trial processes. In the food and pharmaceutical indus tries some thermal processes require the temperature to follow a profile given by ramps and steps. It is also of interest that in the control of motors and in Robotics applications the position or velocity follow evolutions of this type. GPC will be reformulated when the reference is a ramp, defined by a parameter 01 indicating the incre ment at each sampling time. The reference trajectory is therefore: 'w(t+d+l) = r(t+d)+a 'll.=(t+d+2) = 'r(t+d)+201 w(t+d+N) _ = ~r(t+d) +Ncz Employing the previously used procedure we get Mu=Py + Rw+ Q Au(t—1) If (1 is the first row of matrix M—1 then Au(t) can be expressed as Au(t)=qPy+qRw+qQ Au(t——1) By making hT = q R the term of the above expres sion including the reference(hTw) takes the form: .'V N hTw = Zh,1~(t+d+i)= Zhi(r(t+d) +811) i=1 i=1 N7 .-v i : Zhfi<t+d>+02hii i=1 i=1 therefore hTw = 1,.1 r(t + d) + a1,2 The control law can now be written as A1110 =ly117(t+dlt)+lyzzi(t+d—1lt)+ ly3g(t+ d - 2 | t) + lr1r(t+d) + alrg +lu1 3576
Where (I P = [ya], lul = (1 Q, lrl : N N N 2((1, 2 rij) and 1,.2 = a 2 hii. i=1 j=1 i=1 The control law is therefore linear. The new coeffi cient 1,2 is due to the ramp. It can be noticed that when the ramp becomes a constant reference, the control law coincides with the one developed for the constant refer ence case. The only modification that needs to be made because of the ramps is the term 1,-20. The predictor is the same and the resolution algorithm does not differ from the one used for the constant reference case. The new parameter l,.g is a function of the process parame ters (a, n.) and of the control weighting factor As in the previous cases an approximating function can easily be obtained. Notice that the other parameters are ex actly the same as in the constant reference case, meaning that the previously obtained expressions can be used. [ls/1 ly2 8 Applications 8.1 Step Setpoint The control law (4) will be implemented in an exten sively used system as a direct current motor. \Vhen the input of the process is the voltage applied to the mo tor (U) and the output the shaft angle ((9) it is obvious that the process has an integral effect, given that the position grows indefinitely whilst it is fed by a certain voltage. In order to obtain a model that describes the behaviour of the motor the inertia load (proportional to the angular acceleration) and the dynamic friction load (proportional to angular speed) are taken into account. Their sum is equal to the torque developed by the mo tor, that depends on the voltage applied to it. It is a first order system with regards to speed but a second order one if the angle is considered as the output of the process: (120 d0 — - = .y (1:2 +f dt I’" and the transfer function will be: 0(3) __ K U(s) _ s(1 + rs) where K and r are constructive parameters of the motor. The controller is going to be implemented on a real motor with a feed voltage of 24 V and nominal current of 1.3 A, subjected to a constant load. The reaction curve method is used to obtain experimentally the parameters of the motor, provoking a step in the feed voltage and measuring the evolution of the angular speed (which is a first order system). The parameters obtained are: J K = 2.5 r = 0.9 seconds and zero dead time. Taking a sampling time of T =4 0.06 seconds one gets the discrete transfer function: _ 0.0048912"l + 0.004783z'2 C(z) — (l _ 3-1)(1 _ 0.9355072“) If a high value of the control weighting factor is taken in order to avoid overshooting (/\ = 2) the control param eters in (4) can be calculated using expressions (6) with a = 0.935507 and n = 0.50558: lyl I l y2 1,,3 lul lrl : -11.537 19.242 —8.207 —0.118 0.502 The evolution of the shaft angle when some steps are introduced in the reference can be seen in figure 2. It can be observed that there is no overshooting due to the high value of A chosen. The system has a dead zone such that it is not sensitive to control signals less than 0.7 V; in order to avoid this a non-linearity is added. Output and Helemnce -3.0 O 1 00 200 300 400 500 600 Samples 3.0 Control Signal -2.0 ~ O 1 00 200 300 400 500 600 Samples Figure 2: l\/Iotor evolution for setpoint changes It is important to remember that the sampling time is very small (0.06 seconds) which could make the im plementation of the standard GPC algorithm impossible. However, due to the simple formulation used here, the implementation is reduced to the calculation of expres sion (4) and hardly takes any time in any computer. 3577
8.2 Ramp Setpoint As an application example, a GPC with ramp following capability is going to be designed for the motor described above. The reference trajectory is composed of a series of steps and ramps defined by the value of a (01 = 0 for the case of constant reference). The same controller parameters as in the previous example are used, with the addition of the new parame— ter 1,.; = 2.674. Considering that (b0+b1)/(1—a) = 0.15, the control law is given by: Au(t) = —76.921 y(t) + 128.29 y(t - 1) -54.72 y(t - 2) + 3.351r(t) + 17.82 a - 0.118 a u(t - 1) As the dead time is zero, the predicted outputs are known at instant t. The results obtained are shown in figure 3 where it can be seen that the motor is able to follow the ramp reference quite well. , 0 O C O 5 ‘5 i: 0 ¢ ID '5 Q. '5 0 4,0 l i a . O 100 200 300 400 500 600 Samples 3.0 2.0 - 1.0 ‘5 C .5! § 0.0 E O O 1.0 r -2.0 L _3_o . . - i L 0 100 200 300 400 500 600 Samples Figure 3: Combined steps and ramps setpoint 9 Concluding Remarks A method for approximating GPC parameters for pro cesses that can be modelled by a time lag plus one inte grator has been presented. Very simple formulas have been obtained to approx imate the GPC parameters. \lVlth the help of this formu las, the GPC can be implemented and tuned very easily allowing and adaptive policy even in fast systems with small sampling times. ' This straightforward formulation not only reduces calculations. but poses GPC implementation and tuning in an intuitive form similar to that usually employed by practitioners used to PID controllers and Ziegler-Nichols tuning rules. ' References [1] K.J. Astrom and B. 'Wittenmark. Computer Con trolled Systems. Theory and Design. Prentice-Hall. Englewood Cliffs, NJ, 1984. ['2] BF. Camacho, M. Berenguel, and C. Bordons. Adaptive Generalized Predictive Control of a Dis tributed Collector Field. IEEE Trans. on Systems Technology, 2(4):462—467, 1994. [3] BF. Camacho, M. Berenguel, and F.R. Rubio. Ap plication of a Gain Scheduling Generalized Predic tive Controller to a Solar Power Plant. Control En gineering Practice, 2(2):?27—238, 1994. [4] BF. Camacho and C. Bordons. Implementation of Self Tuning Generalized Predictive Controllers for the Process Industry. Int. Journal of Adaptive Control and Signal Processing, 7:63—73, 1993. [5] BF. Camacho and C. Bordons. Model Predictive Control in the Process Industry. Springer-Verlag, 1995. [6] E.F. Camacho and J.M. Quero. Precomputation of Generalized Predictive Self-tuning Controllers. IEEE Trans. on Automatic Control, 36(7):85'2—859, 1991. [7] D. \V. Clarke. Application of Generalized Predic tive Control to Industrial Processes. IEE'E Control Systems Magazine, 122:49—55, 1988. [8] DAV. Clarke, C. Mohtadi, and PS. Tuffs. Gener alized Predictive Control - Part I. The Basic Algo rithm. Automatica, 23(2):137—148, 1987. [9] CR. Cutler and BC. Ramaker. Dynamic Matrix ControlA Computer Control Algorithm. In Auto matic Control Conference, San Francisco, 1980. [10] R. Isermann. Digital Control Systems. Springer Verlag, 1981. [11] J. Richalet, A. Rault, J.L. Testud, and J. Papon. Model Predictive Heuristic Control: Application to Industrial Processes. Automatica, 14(2):413—428, 1978. 3578