# Real-Time Control and Identification of a Thermal Process Based on Multiple-Modeling Approach.

код для вставкиСкачатьDev. Chem. Eng. Mineral Process. 13(3/4), pp. 221-232, 2005. Real-Time Control and Identification of a Thermal Process Based on MultipleModeling Approach A. Aminzadeh*, A.A. Safavi and A. Khayatian School of Engineering, Shiraz University,Zand Avenue, Namazi Square, Shiraz, I.R. of Iran This article presents implementation of Real-Time Control and Identification algorithms based on a Multiple-Modeling approach for an experimental thermal process. The thermal process is a nonlinear plant; therefore, based on variations of the input and disturbance, four local operating regimes are defned. The linear local ARMAX models are identified for diflerent regimes and integrated into a NARMAX model by combining them via proper validity and interpolation functions. Results of modeling the plant with a single model and multiple models show superior peqormance of the Multiple-Modeling technique which is also more flexible. Moreover, the Real-Time Control of the plant with four locally designed controllers is addressed. The platform used for the Real-Time implementation is Matlab/Simulinld Real-Time-Workshop with Visual C++ and Watcom compilers using a DAQ interface. The Real-Time application of the global controller based on the MultipleModel approach demonstrates excellent pe$ormance for this design when compared to a single PID controller. Introduction Usually it is extremely difficult to identify a model that accurately matches a nonlinear plant in all operating regimes [I-91. Even if such a model can be identified, controller design may be also difficult. Therefore, it is quite attractive to use an approach wherein local multiple models are identified at the different regions of operation and controller design is carried out based on these models. This allows us to invoke simple linear models to represent a nonlinear system, and then systematically design the controllers [4]. There are many advantages of using multiple models; such as flexibility in selecting the modeling methods (e.g. transfer fimction or state space), capability for different presentations (e.g. continuous time or discrete time) [4-5 3, and * Author for correspondence (arash-aminzadeh@yahoo. com). 22 I A . Aminzadeh, A.A. Safavi and A . Khayatian other cases such as noise and disturbance reduction. Moreover, this method can be applied easily for online control of real systems with high speed and accuracy [3,7-81. Multiple modeling control has been a research tool in various applications. One conventional method that guarantees the stability of a global system, and includes some local sub-systems or controllers, is addressed in [2] and is called simultaneous stabilization. Necessary and sufficient conditions for control stability are presented and the method is used for three SISO plants to m SISO plants. Johansen and Foss [5] showed an empirical modeling of a heat transfer process using local models and interpolation. Narendra et al. (71 introduced a general methodology for performance improvement of dynamical system operating in rapidly varying environments. Both linear and nonlinear plants are considered, and an indirect approach based on multiple models is used for control. The article also presents a general architecture for indirect adaptive control using neural networks (NN). Gregorcic and Lightbody [3] compared pole-placement self-tuning control with the multiple model approach for the control of a highly nonlinear process. A nonlinear continuous stirred tank reactor (CSTR) process is used to highlight some of the difficulties associated with self-tuning control. Another attractive application of the multiple model approach is Supervisory Multiple Model Control (SMMC); this technique selects the proper mechanism by Multiple Model Observer (MMO) based on suitable frequency ranges [9]. Many interesting problems with multiple modeling approaches have been reviewed [ 101. In this paper, we have developed the multiple model-based method in a simple way, but also consideration of its real-time implementation. Although an advanced local controller can be designed, simple PID controllers are considered to emphasize the benefit of the multiple model approach for real-time implementation. Extension to a more advanced controller, such as pole placement, MPC or LQR, is straightforward. The system used in this paper is an experimental heating plant with an air tube which contains a heating element as input; temperature sensor as output;and an air damper as a disturbance [4-5, 81. It is desirable to control the output temperature of this system. The main reason for using the multiple model approach is the special nonlinear behavior of this system [ 1 1-12]. Developing the Data Acquisition (DAQ) software for real-time control can be a difficult task, often resulting in software that is inflexible, hard to maintain and difficult to modify, especially if the specifications of the hardware involved change [13]. Therefore, another goal here is to apply the Real-Time-Control signals to the actual process. This requires advanced methods of sending and receiving data that are compatible with the special software and hardware equipment such as (DAQ) [13-141. The thermal-process is connected to a computer with the Matlab/Simulink environment using the required interfaces [ 15-17]. The Thermal Process Description Consider the experimental heating plant schematically depicted in Figure 1. The experimental process consists of a tube, an air damper, a heating element and a temperature-measuring device. Air enters the tube and is warmed up by the heating element. The temperature of the air is measured by the temperature sensor and is fed back to the controllers to make a proper signal. The variables are: 222 Real- Time Control and Identification Based on Multiple-Modeling Approach II, Sensor -+j- Measured Output YW AIR Figure 1. Schematic of the real thermal process Input voltage u(t) applied to the heater, and is changed by the fire angle of a BT137 Triac. Fan dnver voltage v(t) is considered as a disturbance, and is changed by the potentiometer which controls the fan driver containing two BD-140and 2N-3055 transistors. 0 Output temperature y(t) is measured by an LM-35 transistor, and amplified by an OP-07Op-Amp. The measured output sensitivity is 1V/20°C. The goal is to implement multiple model control in order to set the output temperature of the plant at a desired temperature, regardless of fan dnver disturbances. Real-Time Control and Data Acquisition Platform For implementing identification and control algorithms, the thermal process is connected to a computer via a PCL-818HG DAQ-card of Advantech Company which is a high-gain, high-performance multifunction data acquisition card for IBM PC/XT/AT or compatible computers. It offers the five most desired measurement and control functions, namely: 12-bit A/D conversion, D/A conversion, digital input, digital output and timerkounter [ 151. This card contains a main board whch connects to the Industry Standard Architecture (ISA) slot on the PC-Mother-Board, a terminal board whch connects to the real process in order to send and receive data, and a connector cable 37-pin to link these two boards. There are two modes whch can be used for several applications by changing the jumpers of the DAQ card: differential mode with 16 channels; and single ended mode with 8 channels. Depending upon the terminal board properties [15], single ended mode by grounding other channels is used. This allows measurement of low frequency and DC signals for slow system dynamics. This DAQ-Card acts as an interface between the software environment (Matlab/Simulink/Real-Time-Workshop) and the heating plant to be controlled. The control system framework is shown in Figure 2. To develop the necessary software for data acquisition, the model file in the Simulink environment should be generated. Then, the required files for sending and receiving data should be created. This can be done by defaulting Visual C++,Watcom and Java compilers in the Matlab environment to make a link with an ISA slot [16-171. This algorithm is called build a model whch generates the following codes: 223 A . Aminzadeh, A.A. Safavi and A . Khayatian The Experimcnfal Heating Planc (Thermal Pmecns) Data Acquisition Interface on ISA (Advantcch PCLBIBHG Card) MatlablSirnuIinLlReal-TimeWorkshop Environment (Including VC++. Watcom d Java Compilm) Figure 2. Control systemfiamework. 0 0 0 0 0 Invoking Target Language Compiler Real Time Source File Model Header File Parameter Header file Registration Header File Data Type Transition C File 0 0 0 0 Project Maker File Real Time Windows Target Module Dynamic Link Library File Intermediate Object File Batch File After creating the above functions the external simulation in Simulink can be started using the real data on the DAQ buses. Modeling, controlling, sending and receiving signals of a heating process are discussed in the following sections. Multiple Modeling Approach Based on the Process Operating Regimes Any model has a limited range of validity. The model restrictions may be due to the assumptions made for a mechanistic model, or by the experimental conditions under which the data was logged for an empirical model. To emphasize this, a model that has a range of validity less than the desired one is called a local model, as opposed to a global model being valid over the full range of operation. We are concerned with a modeling framework that is based on combining a number of local models, where it is of particular importance to describe the region in which each local model is valid. We call such a region an operating regime [18]. When different local models are found, each local model will have a relative validity in its operating regime [4]. The framework for a multiple model approach can be conceptually illustrated as shown in Figure 3. The full range of system operation is completely covered by a number of possibly overlapping operating regimes. In each operating regime the system is modeled by a local model, and the local models can be combined into a global model using an interpolation technique. One motivation behmd this framework is that global modeling is complicated because of the need to describe the interactions between a large number of phenomena that appear globally. Alternatively, local modeling may be considerably simpler because locally there may be a smaller number of phenomena that are relevant, and their interactions are simpler [4j. 224 Real- Time Control and Mentifieation Based on Multiple-Modeling Approach Regime 1 Regime 4 Regime 2 Figure 3, The set of two-dimensional operating points is decomposed into four regimes; the vector z(t) = (zl(t); z2(t)) is the operating point [4]. For some applications, a model may be required that only describes the input'output behavior of the system (i.e. the system is considered as a black box). The ARMAX model representation is a well known linear inputloutput model representation, while the NARMAX (Nonlinear ARMAX) model representation is an extension that represents the model as a nonlinear mapping ofpast inputs, outputs and noise terms to future outputs [19]. Consider the NARMAX model representation: This can be used to represent the observable and controllable modes of a large class of discrete-time non-linear systems. Here y ( t ) E Y c R" is the output vector, u(t) E U c R' is the input vector, and e(t) E E c R" is the noise vector. Assume n,n, and n, are known constants representing delays in output, input, and noise vectors, respectively. When describing a system, the crucial problem is constructing the nonlinear h c t i o n f : Y + R" . Therefore, introduce the (m(n, + n e ) + 'nu) dimensional information vector: v(t-1)=b<t-1) ... y ( r - n , ) u(t-1) ... u(t-n,) e(t-1) ... e ( t - n , ) p -..@I belonging to the set Y = Y"' X U " "x E"=. This allows Equation (1) to be rewritten in a compact form: Y O ) = f (w(t - 1)) + e(t) ...(3) Provided that necessary smoothness conditions on f are satisfied, a general way of approximating f is by series expansions. A first-order Taylor-series expansion about an equilibrium point yields an ARMAX model. Higher-order Taylor-expansions are also possible, but are not very useful in practice because the number of parameters in the model increases rapidly with the expansion order, and because of the poor extrapolation and interpolation capabilities of higher-order polynomials. Splines offer one possible solution to this problem. A representation closely related to splines in spirit, but still very different for multi-dimensional modeling problems, is based on 225 A, Aminzadeh, A.A. Safavi and A . Khayatian patching together local models [4]. For the optimal combination of local models, suppose N local models (indexed by i E {1,2,. .., N } ) : are available, and the different local models are accurate under certain operating conditions. Hence, under some operating conditions there may be several accurate local models, while no local model may be accurate under other conditions. Suppose the relative validity (or relevance) of each local model is indicated by the weighting functions p, ,&,...,pN :y + [0,1]. If at a given ry E y the local model indexed with i is accurate, then p, ( w ) will be close to one, while pi ( w ) is close to zero for all ry E y where local model i is inaccurate. We essentially seek a global model: YO)= ... ( 5 ) Z W - 1)) + e(t> based on a combination of the local models (Equation 4). From the definition of is natural to require that, icy) should be close to is large. This suggests that i(~) at those v/ EY pi,it where & ( w ) should be selected such that a criterion given by: ...(6) is minimized where 1 -1 is the Euclidean norm. It can be shown by a theorem [4] that if the function h,j2,.,.,jN belong to ~ " ( ~ the 1 , set of all continuous m-dimensional functions defined on Y and also p, (vl), 0,for all (v E Y , then the function defrned by: c;, i ...(7) . ..(8) minimizes A4 on c " ( ~ [4, ) 61. Equation (7) implies that regardless of A(,,,) and P , ( ~ values, ) in order to minimize ~ ( jin )Equation (6), j ( v ) should be chosen as a weighted linear combination of local models J(v) and weighted functions F , ( ~ ) . Proof of this result is available [4]. There are degrees of freedom in selecting the from local system behavior such that a and ij,(w) values. First select minimum root mean square error is achieved, then F , ( ~ )is selected such that it is close to one where local model i is accurate and close to zero elsewhere. The popular choices for p, (v) are Gaussian and fuzzy membership functions. In this paper are selected as local ARMAX models and ~ ( are~ common 1 Gaussian functions, as described in the following sections. 226 Real-Time Control and Identification Based on Multiple-Modeling Approach Modeling and Identification of the Thermal Plant In order to identifying the thermal process, two approaches are considered in tfus section. In the first approach, a single ARMAX model is developed to predict the system input-output and disturbance-output behaviors. In the second approach, several local linear ARMAX models are identified for different operating regimes and a global model will be generated by patching them together. Although a semimechanistic model exists which can predict the thermal process behavior [20-2 11, we choose to compare only the single ARMAX model and the multiple model approach. Comparison with the semi-mechanistic approach is provided elsewhere [22]. Single ARMAX Model Identification To identify the system, the data sequences fiom the thermal process as shown in Figure 4 are used. The sampling interval, due to the long time constant of the system and its slow dynamics, is chosen as At = 0.1 s and the sequence contains about 10,000 samples. The input ~ ( tE)[0,2] volts is selected to be an exciting signal with normal random distribution covering the full range of input operation. The fan speed that vanes with its dnver voltage ~ ( tE)[3,5]volts and acts as the disturbance is selected to have deviation over the full range of its operation in a pseudo-random manner. Using standard identification techniques [23] with the data sequences collected at room temperature, the following ARMAX model for the overall range of variations of input and disturbance is obtained: H(2)= Y ( 2 ) - -0.000616~+0.001445 , U ( 2 ) z 2 - 1.77222 + 0.77269 G(z) = Y ( 2 ) - 0.0048629~+ 0.004855 = V(2) 2’ - 1.77222 0.77269 f where the output is given by: Y(z)=H(z) U(z)f G(z) V(z) 49) This model is simulated in order to estimate the temperature of the heating plant, and the results are compared with the actual output temperature as shown in Figure 5 . Multiple Model Based Identification The single ARMAX model developed in the previous section is not sufficiently accurate for the entire operating region of the non-linear thermal process. Hence the need to search for accurate local models at some smaller operating regions, and the different operating regimes of the process should first be identified. Then, a wide range of step changes to both input and disturbance in each operating regime is applied to the process, and the resulting output samples are collected. Th~sprocedure provides rich mformation for identifjmg the system operating regimes. It is obvious that the steady state response of the plant depends on both u(t) and v(t). There are several methods of searchmg algorithms for optimal decomposition of the overall plant into different operating regimes [19, 241. Most of these algorithms are heuristic and depend on exhaustive search methods to find the best operating regimes. Depending upon the steady-state response gain characteristic [22], we chose 22 7 A. Aminzadeh, A.A. Safavi and A. Khayatian Tlme (smc) T i m (sac) Figure 4. Applied data sequences used for identification Tlma (sac) Figure 5. Simulation of an ARMAX modeling. to combine four local ARMAX model structures into an NARMAX model structure. The input and disturbance deviations are thus decomposed into the following separate regimes: Regime #I: ~ ( tE) [OJ] v(t) E [3,4], Regime #2: ~ ( tE) [0,1] v(t) E [4,5] Regime #3: u(t)E [1,2] v(t)E [3,4] , Regime #4: u(t) E [1,2] v(t) E [4,5] Four separate data sequences, with the necessary deviations in each operating regime, are generated in order to identify the local ARMAX models as shown: H,,( 2 ) = - 0.00045&' + 0.00052@ H,&)= Z' - 1.285,lod t 2 G1l(z)= Z' - 1.9838z+0.9839 -1.983&+0.9839 - 0.00072~'+ 0.000804~ Z' 1.97652 + 0.9766 - -0.001 13z3 +O.O01184Z' HZI(2)= 2' - I ,09732' -0.97062 t0.8879 H2'0 )= - 0.003962' + 0.007835~ Z' - 0.72732 - 0.2697 G,,(z) = G'l(z'= 2' 2'- G2:( 2 ) = - 2.553.10-"z ' - 1.9765~+ 0.9766 - I .3 I2 . lo-' z' 1.0473~'-0.47062+0.6879 - 4.789 .\o-J2' z 2 - 0,72732 - 0.2697 where the output of each local model is obtained from a relationship similar to Equation (9). The errors between model and actual plant are calculated based on the normalized root mean square error (NRMSE) [25], as shown in Table 1 for each operating regime. Table 1. Errors of the identifed locaI models. Model Local Model #I Local Model #2 228 NRMSE 0.0801 0.0973 Model Local Model #3 Local Model #4 NRMSE 0.1006 0.0253 Real- Time Control and Identification Based on Multiple-Modeling Approach Validity and Interpolation Functions To combine the four local ARMAX models into an NARMAX model in a smooth manner, define a validity hnction which shows the relative validation of each local model. The validity functions are considered as two-dimensional Gaussian functions: where ui and vi are mean input and disturbance, and o, and ov are their conesponding standard deviations. According to Equation (8), the interpolation functions can be defined as: An important task is to choose the best standard deviations for the validity functions such that minimum NRMSE can be achieved. The variations of NRMSE versus changes in standard deviations of input and disturbance is shown in Figure 6. The best values of a, and a,can be selected from this diagram, namely a, = 0.43, and ov= 0.40. The selected interpolation and validity functions are shown in Figure 7. Figure 6. NRMSE vs. variance deviations. Figure 7. Validity and interpolation functions. The model output can be found by combining the outputs of local models with interpolating functions that change with the values of input and disturbance. The performance of the multiple model approach for the same test data sequences used for single ARMAX model approach (see Figure 4) is illustrated in Figure 8. An analysis of the errors of identified models shows that the NRMSE values of the single ARMAX model approach and the NARMAX multiple model approach are 0.1453 and 0.0517, respectively. It is evident that the multiple model performs much better than a single ARMAX model acting globally. 229 A , Aminzadeh, A.A. Safavi and A . Khayatian Real-Time Control and the Implementation Results In this section the procedure for designing the Real-Time control system is presented. The global controller for the thermal process consists of four local digital PID filters [26], with the following structure: D ( z ) = a, + qz-' + a2z-* , a o = K p + KIT - t - KD 1 + 4.-' + b2z-2 2 T a,=-K,,+K,T/2-2KD/T, a 2 = K o / T , 4 = - 1 , b 2 = 0 ,.(12) where K p , KIand KD are the proportion, integration and differentiation coefficients. There are several methods to tune the PID controllers by auto-calibration [27]. One practical method is a dynamic system simulation for Matlab which is called nonlinear control design (NCD) [28]. The NCD blockset uses time domain constraint bounds to represent lower and upper bounds on response signals. Constraint bounds can be changed to meet the best performance. Based on the best constraint bounds which are reached, hence the input is in the allowable range of DAQ interface, (0-5 volts), the following digital controllers for each of the local models are designed as: D,,(z) = (195.5-385.52-' +190~-*)/(1-~-'), D,,(z) = (205-405~-' + 2 0 0 ~ - ~ ) / ( 1 - ~ - ' ) , D,,( 2 ) = (186 - 3 6 6 ~ -+' 180~-')/(1- Z-I), D 2 2 (= ~ (2 ) 15 - 425z-I + 2 102-') /(I - Z-') These controllers are combined via the validity and interpolation h c t i o n s (found in the previous section) to obtain the global controller for the thermal plant. The implementation is shown in Figure 9. The saturation function at the output port limits the level of the control signal applied to the DAQ card, hence avoiding the unbounded signals. In order to illustrate the performance of the multiple model controller, three random setpoint changes at 15, 120 and 160 seconds together with disturbance changes at 35, 140 and 270 seconds (with 20 seconds duration) were applied as shown in Figure 10. The results with a single PID controller (designed by NCD blockset with the best constraint bounds) and comparison with the multiple-model based control are shown in Figure 11, it is clear that the multiple model shows better performance (e.g. lower overshoot). 230 Real-Time Control and Jdentlfication Based on Multiple-Modeling Approach Figure 9. Block diagram of real-time control system. Figure 10. Applied setpoints and disturbances. Figure 11. Closed-loop responses. Conclusions We have presented an evaluation of multiple-model based control and identification of a nonlinear thermal process. After defining several operating regimes for the operation of the nonlinear process, local modeis and local controllers were developed. These models and controllers were then combined in order to find a global model and a global controller. T h s method simplifies the modeling and control of complex systems. In addition, a useful environment was set up for real-time implementation on the experimental nonlinear thermal process. References 1. Bar-Shalom, Y ., and Blair, W.D. 2000. Multitarget-Multisensor Tracking, Application and Advances, Volume 111, Artech House Inc. 2. Femandez-Anaya, G., and Escandon-Alcazar, L.G. 1997. Simultaneous Stabilization of rn SISO plants, Necessary and Sufficient Conditions, Inr. Con/: Conrro1'97, Cancun. Mexico, 140-142. 231 A. Aminzadeh, A.A. Safavi and A. Khayatian 3. Gregorcic, G., and Lightbody, G. 2000. A Comparison of Multiple Model and Pole-Placement SelfTuning for the Control of Highly Nonlinear Processes, In Proc. Irish Sig S’st. Con$, June 2000, 303311. 4. Johansen, T.A. 1994. Operating Regime based Process Modeling and Identification, PhD Thesis, Dept. of Eng.Cybernetics, University of Trondheim,Norway. 5. Johansen, T.A., and Foss, B.A. 1995. Empirical Modeling of a Heat Transfer Process using Local Models and Interpolation, Amer. Contr. Con$, Seattle. USA, 3654-3658. 6. Johansen, T.A., and Foss, B.A. 1997. Operating Regime based Process Modeling and Identification, Comput. Chem. Eng., 21, 159-176. 7. Narendra, K.S.;Balakrishnan, J., and Ciliz, M.K. 1995. Adaptation and Learning Using Multiple Models, Switching and Tuning, JEEE Contr.Syst., June 1995.37-51. 8. Palizban, H.A.; Safavi, A.A., and Romagnoli, J.A. 1997. A Practical Multi-Model Approach for Controlling Nonlinear Process, Control 97, Iasted-Acta Press, 169-174. 9. Rodriguez, J.A.; Romagnoli, J.A., and Goodwin, G.C. 2003. Supervisory Multiple Regime Control, J. Process Control, 13,177-191. 10. Johansen, T.A., and Foss, B.A. (Eds). 1999. Special Issue on Multiple Model Approaches to Modeling and Control, Inf. J. Confrol,72(7/8). I I. Holman, J.P. 1981 Heat Transfer, 5th ed., McGraw-Hill, New York. 12. Incropera, F.P., and De Witt, D.P. 1991. Fundamentals of Heat and Mass Transfer, 3rd ed., John Wiley, New York. 13. Moallem, M. 2001. Distn’buted Real-Time Control and Data Acquisition of Free-Elecbon Laser Beams, IEE Comput. Control Eng. J., 179-187. 14. The Mathworks Inc. 1999-2001.Data Acquisition Toolbox User’s Guide, Version 2.0. IS. Advantech High-performance DAS card, 1994. PCL-818HG User’s Manual, 2nd ed. 16. The Mathworks Inc. 1999. Real-Time Windows Target User’s Guide, Version 1.0. 17. Microsoft Visual Studio, 1994-1998. Visual C* User’s Guide, Version 6.0. 18. Johansen, T.A., and Foss, B.A. 1995 Semi-Empirical Modeling of Non-Linear Dynamic Systems through Identificationof Operating Regimes and Local Models, Springer Verlag. 19. Johansen, T.A., and Foss, B.A. 1993. Constructing NARMAX models using ARMAX models, Int. J. Control, 58, 1125-1 153. 20. Franklin, G.F.; Powell, J.D., and Workman, M.L. 1994. Digital Control of Dynamic Systems, 2nd ed., Addision-Wesley Publishing Co., USA. 21. Lindskog, P., and Ljung, L. 1994. Tools for semi-physical modeling, in Preprints IFAC Symp. Syst. Jdentijcution, Copenhagen, 3,231-242. 22. Aminzadeh, A. 2003. A Real-Time Application of an Advanced Multiple-Model Based Control to a Thermal Process, M.Sc. Thesis, School of Engineering, S h i m University, Iran. 23. Ljung, L. 1999. System Identification Theory for the User, Prentice-Hall, USA. 24. Johansen, T.A., and Foss, B.A. 1995. Identification of Non-linear System Structure and Parameters using Regime Decomposition, Automotica, 31,321-326. 25. Atiya, A.F.; El-Shoura, S.M.; Shaheen, S.I., and El-Sherif, M.S. 1999. A Comparison Between NeuralNetwork Forecasting Techniques Case Study: River Flow Forecasting, IEEE Trans. Neural Networks, 10(2), 402-409. 26. Phillips, C.L., and Nagle, H.T. 1984. Digital Control System Analysis and Design, Prentice-Hall, USA. 27. Voda, A.A., and Landau, I.D. 1995. A Method for the Auto-calibration of PID Controllers, Auromarica, 3l(l), 41-53. 28. The Mathworks Inc. 1997. Nonlinear Control Design User’s Guide, Version 5.0. - Received: 11 September 2003; Accepted after revision: 20 May 2004. 232

1/--страниц