Citation
Design and Analysis of Offset Free Model Based Predictive Control

Material Information

Title:
Design and Analysis of Offset Free Model Based Predictive Control
Creator:
GOMEZ-GONZALZ, RICARDO ( Author, Primary )
Copyright Date:
2008

Subjects

Subjects / Keywords:
Cost functions ( jstor )
Design analysis ( jstor )
Mathematical variables ( jstor )
Matrices ( jstor )
Modeling ( jstor )
Penicillin ( jstor )
Predictive modeling ( jstor )
Simulations ( jstor )
Trajectories ( jstor )
Velocity ( jstor )

Record Information

Source Institution:
University of Florida
Holding Location:
University of Florida
Rights Management:
Copyright Ricardo Gomez-Gonzalz. Permission granted to the University of Florida to digitize, archive and distribute this item for non-profit research and educational purposes. Any reuse of this item in excess of fair use or other copyright exemptions requires permission of the copyright holder.
Embargo Date:
3/30/2009
Resource Identifier:
774148531 ( OCLC )

Downloads

This item is only available as the following downloads:


Full Text

PAGE 1

1 DESIGN AND ANALYSIS OF OFFSET FREE MODEL BASED PREDICTIVE CONTROL By RICARDO GOMEZ-GONZALEZ A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLOR IDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY UNIVERSITY OF FLORIDA 2006

PAGE 2

2 Copyright 2006 by Ricardo Gomez-Gonzalez

PAGE 3

3 To my Lord and Savior Jesus Chris t; for keeping me safe thus far.

PAGE 4

4 ACKNOWLEDGMENTS I would like to thank Dr. O. Crisalle for be ing my advisor and for guiding me trough this journey called graduate school. I w ill also like to extend my gratit ude to Dr. H. Latchman, Dr. S. Svoronos, and Dr. G. Hoflund for serving in my supervisory committee. I would like to recognize the cu rrent and past members of the Process Control Lab for all the discussions and help they pr ovided me with. I extend my gr atitude to all my friends and church family who have put up with me for the last five and a half years, and for all the moments we have share. I thank my parents for the continuous support an d encouragement that they have showered me with. I express my thankfulness to my brot her and sister, and their respective families, for their support. Finally, I would like to thank CONACYT for th e financial support that made this work possible, as well as IIE and th e Fulbright Commission for their help. I have certainly being exposed to things I never thought of due to the vote of trust that you they laid on me.

PAGE 5

5 TABLE OF CONTENTS page ACKNOWLEDGMENTS...............................................................................................................4 LIST OF FIGURES................................................................................................................ .........8 ABSTRACT....................................................................................................................... ............11 CHAPTER 1 INTRODUCTION..................................................................................................................13 2 DESIGN AND ANALYSIS OF PREDICTIVE CONTROLLERS.......................................15 Theoretical Background......................................................................................................... .15 Offset Elimination............................................................................................................. .....18 Development of Predictors and Associated Control Functions..............................................19 Predictor Form 1: Position Weights................................................................................19 Derivation of a Positi on Weight Predictor......................................................................20 Predictor Form 2: Velocity Weights................................................................................21 Derivation of a Velocity Weight Predictor......................................................................22 Controller Design and Stability Analysis........................................................................25 Control design and analysis for a predictor based on position weights...................25 Control design and analysis for a pr edictor based on velocity weights...................27 Simulation Studies............................................................................................................. .....29 First Simulation Study.....................................................................................................30 Second Simulation Study................................................................................................31 Conclusions.................................................................................................................... .........33 3 CONTROL OF NON-HO LONOMIC VEHICLES................................................................40 Literature Review.............................................................................................................. .....40 Control of Autonomous Non-Holonomic Vehicles.........................................................40 Dynamics of the Khepera Robot.....................................................................................43 Predictive Control Design...............................................................................................46 Tracking Problem in No n-Holonomic Vehicles.....................................................................48 Experimental Results........................................................................................................... ...49 Khepera Robot Tracking Problem...................................................................................49 Controller performance for an L-shaped trajectory..................................................51 Controller performance for a Kidney-shaped trajectory..........................................54 Penicillin Production.......................................................................................................56 Conclusions.................................................................................................................... .........59 4 REMOTE AND VIRTUAL EXPERIMENT ATION OVER THE INTERNET....................84 Remote and Virtual Experimenta tion-Historical Approaches................................................84

PAGE 6

6 Case Studies................................................................................................................... .........86 Interconnected Tanks System..........................................................................................86 Nonisothermal CSTR System..........................................................................................89 Remote and Virtual Laboratories Developed.........................................................................91 Interconnected Tanks Remote and Virtual Experiments.................................................91 Nonisothermal CSTR VCL.............................................................................................93 Conclusions and Future Work................................................................................................94 5 CONCLUSIONS AND FUTURE WORK...........................................................................100 Conclusions.................................................................................................................... .......100 Future Work.................................................................................................................... ......101 APPENDIX A OFFSET ELIMINATI ON-SUPPORT FILES......................................................................102 Position Weights Predictor...................................................................................................102 PC_Int_driver1.M..........................................................................................................103 PC_Int_ssinput.M..........................................................................................................104 PC_Int_V1.M................................................................................................................106 PC_Int_KV1.M.............................................................................................................107 PC_Int_Loop1.M...........................................................................................................108 PC_RS.M.......................................................................................................................109 PC_Int_Plot_Res.M.......................................................................................................110 Velocity Weights Predictor...................................................................................................113 PC_Int_V2.M................................................................................................................114 PC_Int_KV2.M.............................................................................................................116 B TIME-VARYING PREDICTOR DERIVATION................................................................117 Predictor Derivation........................................................................................................... ...117 Predictor based on Position Weights.............................................................................117 Detailed Derivation of Positi on Weights Based Predictor............................................118 Predictor based on Velocity Weights............................................................................119 Detailed Derivation of Veloc ity Weights Based Predictor............................................120 Matlab Files................................................................................................................... .......123 PC_AkBkEFdghat.M.....................................................................................................124 PC_CreateAkAkm1.M..................................................................................................127 PC_CreateBDB.M.........................................................................................................128 PC_CreateRThat.M.......................................................................................................128 C VIRTUAL CONTROL LABORATORY -DETAILED DESCRIPTION............................130 Interconnected Tanks System...............................................................................................130 Configurations...............................................................................................................130 Help, Analysis, and Simulation.....................................................................................131 Non-Isothermal CSTR System.............................................................................................132

PAGE 7

7 System Animation.........................................................................................................132 Configuration Area........................................................................................................132 Analysis and Simulation................................................................................................133 LIST OF REFERENCES.............................................................................................................152 BIOGRAPHICAL SKETCH.......................................................................................................156

PAGE 8

8 LIST OF FIGURES Figure page 2-1 Example of elements in predictive control: r , reference trajectory. x , predicted output; xm, measured output; u , control action...................................................................34 2-2 Position weights based controll er. Two interconnected tanks..........................................35 2-3 Velocity weights based controlle r. Two interconnected tanks.........................................36 2-4 Position weights based controll er. Distillation column system.........................................37 2-5 Velocity weights based controlle r. Distillation column system.........................................38 2-6 Velocity weights based controller applied only to the first state. Distillation column system......................................................................................................................... .......39 3-1 Vehicle position and orientation to respect to the target frame.........................................60 3-2 Khepera robot.............................................................................................................. .......60 3-3 Track reading interface for Khepera robot.........................................................................61 3-4 Control interface in LabVIEW...........................................................................................62 3-5 New paradigm for predictive control: the element rd is a corrected trajectory based on the current state of the system............................................................................................63 3-6 Aiming-distance paradigm. Ad is the corrected angle that is calculated at each iteration. “a” is the length ah ead that the aiming-distance al gorithm uses to create the new angle...................................................................................................................... .....64 3-7 Controller based on position weights. Nonlinear system. L-shaped trajectory.................65 3-8 Controller based on velocity weights. Nonlinear system. L-shaped trajectory.................66 3-9 Controller based on position weights with aiming distance correction. Nonlinear system. L-shaped trajectory...............................................................................................67 3-10 Controller based on velocity weights with aiming distance correction. Nonlinear system. L-shaped trajectory...............................................................................................68 3-11 Controller based on position weights. Decoupled system. L-shaped trajectory................69 3-12 Controller based on velocity weights. Decoupled system. L-shaped trajectory................70 3-13 Controller based on position weights with aiming distance correction. Decoupled system. L-shaped trajectory...............................................................................................71

PAGE 9

9 3-14 Controller based on position weights. N onlinear system. Kidney-shaped trajectory........72 3-15 Controller based on velocity weights. N onlinear system. Kidney-shaped trajectory........73 3-16 Controller based on position weights with aiming distance correction. Nonlinear system. Kidney-shaped trajectory......................................................................................74 3-17 Controller based on velocity weights with aiming distance correction. Nonlinear system. Kidney-shaped trajectory......................................................................................75 3-18 Controller based on position weights. D ecoupled system. Kidney-shaped trajectory.......76 3-19 Controller based on velocity weights. D ecoupled system. Kidney-shaped trajectory.......77 3-20 Controller based on position weights with aiming distance correction. Decoupled system. Kidney-shaped trajectory......................................................................................78 3-21 LabVIEW test. Nonlinear syst em with velocity weights...................................................79 3-22 Controller based on position weights. Penicillin production.............................................80 3-23 Controller based on position weights w ith aiming distance correction. Penicillin production..................................................................................................................... .....81 3-24 Controller based on velocity weights. Penicillin production.............................................82 3-25 Controller based on velocity weights with aiming distance correction. Penicillin production..................................................................................................................... .....83 4-1 The three basic configura tions for the two-tank module...................................................95 4-2 Two-tank module............................................................................................................ ...95 4-3 PID control interface for tank 1.........................................................................................96 4-4 PC control interface for tank 1...........................................................................................97 4-5 The two-tank module VCL interface.................................................................................98 4-6 Nonisothermal CSTR interface..........................................................................................99 C-1 The feed goes to tank 1. The c ontrolled variable is level 1............................................133 C-2 The feed is being split between tanks 1 and 2. Level 1 is the controlled variable..........134 C-3 Tank 1 feeds tank 2. Level 2 is the variable to be controlled.........................................135 C-4 The feed is being distribu ted between tanks 1 and 2. The variable to control is the level of the bottom tank, or level 2..................................................................................136

PAGE 10

10 C-5 Manual control. The user decides where the feed goes and adjusts the pump voltage manually....................................................................................................................... ....137 C-6 Parameter configuration area. The t op part is concerned with the physical configuration. The bottom part configures the controller...............................................138 C-7 Help tab................................................................................................................... .........139 C-8 Plant information tab...................................................................................................... ..140 C-9 Controller information tab...............................................................................................141 C-10 Plant – controller analysis tab..........................................................................................142 C-11 Simulation area........................................................................................................... .....143 C-12 Level control............................................................................................................. .......144 C-13 Concentration control..................................................................................................... ..145 C-14 Temperature control....................................................................................................... ..146 C-15 Manual configuration...................................................................................................... .147 C-16 Controller configuration tab.............................................................................................148 C-17 Parameters setup tab...................................................................................................... ..148 C-18 Plant configuration tab................................................................................................... ..149 C-19 Analysis area............................................................................................................. .......150 C-20 Simulation screen......................................................................................................... ....151

PAGE 11

11 Abstract of Dissertation Pres ented to the Graduate School of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy DESIGN AND ANALYSIS OF OFFSET FREE MODEL BASED PREDICTIVE CONTROL By Ricardo Gomez-Gonzalez December 2006 Chair: Oscar D. Crisalle Major Department: Chemical Engineering. One predictive control design is derived to elim inate the steady state error or offset from a system response. This strategy makes use of a velocity weights based predictor, which inherently works as an integrat or. Sufficient conditions to elim inate offset are presented and proved in terms of a matrix rank Conditions for obtaining offset fr ee behavior are more challengi ng to obtain for the case of underactuated and nonlinear systems. An ad hoc modification is proposed through the introduction of an aiming distance concept that corrects the reference trajectory in a portion of the prediction horizon. The modification can help to avoid cases where controllability of a state is lost due to the dynamics of the system. Exte nsive simulation studies ar e carried out to show the feasibility of the aiming dist ance correction. A Khepera robot is chosen as a test system since it introduces significant challenges to the controller given that it is underactuated, and controllability can be lost in some of its states . The tests have proved to be successful, showing how the aiming distance correction factor can make the controller account for unseen errors that will otherwise lead to persistent offset in the response of the system. Extensions of the aiming distance into chemical engineering are studied via simulation of a semi-batch reactor for the production of penicillin.

PAGE 12

12 The advent of new technologies such as the Internet has posed a challenge in the way engineering is taught at the unive rsities. The Virtual Control Laboratory presents a fast and simple tool for both the designer and the user. It features significant le vels of modularity, such that most of the code can be reused and only mi nor changes are needed to create a new system. Due to its intuitive graphical inte rface the user can interact with the system in an analogous way to the physical setup. Two laboratories are presented to demonstrate the VCL.

PAGE 13

13 CHAPTER 1 INTRODUCTION Model based predictive contro l has proved to be a powerfu l tool in the design of controllers for industrial applica tions. An offset free response, with no steady state error, is always desirable, to this extent several ad hoc solutions are widely used to improve the performance of the predictive controllers. For example, Muske and Badgwell (2002) and Pannocchia and Rawlings (2003) make use of Kalm an filter estimators to improve the controller response. These approaches are rather lengthy to de sign. Looking for alternatives to achieve offset free response in a more dire ct way is one of the goals of this dissertation. Ideas obtained from other fields of control design are expl ored and adapted for predictive control. Nonlinear processes or the tracking of set point changes different than step changes, for example a ramp or a time dependent set point, or when the system has non modeled disturbances or perturbations that can cause instability are hard to control. The idea of using a corrected reference trajectory instead of th e reference trajectory, as Maciej owski (2002) proposes, is in the backbone of the aiming distance correction. The aiming distance recalcula tes a small portion of the reference trajectory to account for disturbanc es in the system and uses it to evaluate the control action to be utilized. There are several reasons why a student may not be able to have access to a physical facility to perform experiments. Either the stude nt is physically in a different location, has time constraints or there is a limited or null availability of equipment. To cope with th ese restrictions and make use of modern technologies widely available, i.e., the Internet, remote and virtual experimentation offer an appealing way to bring the experience of a laboratory setting to the students in a flexible environment that can acco mmodate their needs. In order to maximize the pedagogical experience of the student s several key issues must be addressed. Faithfulness to the

PAGE 14

14 physical system, intuitive interface, reaction time, etc. are some of the key factors to consider when designing an online experime nt. Since the advent of the In ternet several solutions have been proposed and improved through time. Co mmercially available solutions are easily accessible nowadays, and two are to be evaluated in this document: Quanser and LabVIEW online capabilities will be put to test.

PAGE 15

15 CHAPTER 2 DESIGN AND ANALYSIS OF PREDICTIVE CONTROLLERS The predictive control strate gy relies on a model of the sy stem; hence its performance depends in the accuracy of the model, in the struct ure of the predictor and in the cost function to be minimized. Normally, the model of the system is linearized in order to simplify the model used in the predictor. Several forms of predic tors and cost functions are evaluated, using the linearized model of the system for control design. Conditions to ensure offset free behavior are being developed for the various forms of controllers designed. Theoretical Background The predictive control (PC) techniques are wi dely used in industry to handle those systems where the proportional-integral-derivative (PID) c ontrollers fall short. Despite the popularity and simplicity of the PID controllers, PC use has grown in the past since it actually uses a model of the system to achieve the control task, taki ng into consideration the dynamic response of the process. The general framework of PC contains f our basic elements (Ogunnaike and Ray, 1994) that are observed in Figure 2-1: A desired target trajector y for the process output ( r ). Usually it is not desirable to have abrupt changes in the process output, and by defining a desired trajectory an abrupt change can be smoother. A model of the system, which is used to predict the process output ( x ) over a defined time horizon. A control action sequence ( u ) based in the model. Usually the control signal is obtained via minimization of a cost function J = J ( x,r,u ). A prediction error can be cal culated and used to improve the predictor eq uation, because normally there exists a difference between the model prediction and the plant measurement for the process output. Most of the developments in predictive cont rol are based on linear systems, and it is not until recently that the field of nonlinear predictive control systems has been explored. The linear

PAGE 16

16 systems are classified by the technique used to model the process; the most common are the impulse response, the step response, state sp ace, and transfer function models (Camacho and Bordons, 1995). The impulse response model is obtained by disturbing the process with a unit impulse signal and taking measurements of the syst em at a constant sampling period (Kwon et al. , 2002). The model for a single input single output (SISO) system is given by 1()()pN i i y khuki (2-1) where h is the sampled output when the proc ess has been disturbed by a unit impulse; hi is also known as the impulse-response sequence. The adva ntage of this method is that the process identification is really simple, since there is no need of prior information. The disadvantage is that a normal process needs approximately N = 50 impulse-response samples to be faithfully modeled. The step response model is obtained by pertur bing the system with a unit step change instead of a unit impulse (Howell, 1997; Wang and Cluett, 1997; Wang et al. , 1999). The model for a SISO system is of the following form 1()()pN i iykguki (2-2) where g is the sampled output values for the st ep input, also called step-response sequence gi, and the rate of change in the input ()()(1) ukukuk . Similar to the impulse response method, the step response method also requires the calculation of a considerable number of stepresponse functions.

PAGE 17

17 Transfer functions are also employed to descri be a system (Leon de la Barra and Prieto, 1999; Wang et al. , 1999; Verboven et al. , 2005). This technique is widely used, especially in generalized predictive contro l (GPC). The model for a SISO system is given by 1 1() ()() () Bz y kuk Az (2-3) where 112 12()1na naAzazazaz and 112 12()nb nb B zbzbzbz . The coefficients ai and bi can by obtained by r ecursively solving a Diophan tine equation. Although a priori knowledge of the system is required to find the coefficients, and to determine the degree of the polynomials. Another technique based on a priori knowledge of the system is the state space model (Raynaud and Zergainoh, 2000; Banning et al. , 2001; Sjovall et al. , 2006). The general model is given by ()(1)(1) kkk xAxBu ()()() kkk y CxDu (2-4) where n x, m u, p y, nn A, nm B, pn C, and pm D. In the case of a SISO system u = p = 1. This model has the advant age that can handle multiple input multiple output (MIMO) systems in a rather strai ghtforward fashion. Although in some cases the meaning of the states is lost bearing no physi cal interpretation. This approach is the one considered in this document, and will be continuously used throughout the chapters. There are several algorit hms available in literature to ap ply the predictive control concepts; among these methods, there are some that due to historical reason are worth mentioning, such as DMC (Dynamic Matrix Control) which is base d on a step-response model, the MAC (Model Algorithmic Control) which uses a impulse-respons e model identification as its foundation, and

PAGE 18

18 finally GPC (Generalized Predictive Control) which was the first one that minimized a multistage cost function over a prediction horizon to obtain the control signals (Camacho and Bordons, 1995). Because most chemical processes are nonlinear, i.e. , batch and semi-batch processes, nonlinear predictive control has received more attention in the last few years. The nonlinear system presents several challenge s, specifically those related to the creation of the model for the process and the model inversion required for the normal predictive controller. Some of the techniques utilized to ov ercome there challenges are the scheduled linearization, in which the model is linearized around several operating points, and then these linearized models are used with a linear PC method; extended linear PC, which basically accounts for the nonlinearities of the system by creating an augmented model what takes into account the nonlinearities; finally nonlinear PC addresses the nonlinearities without any loss of information, and tries particularly to establish a framework where the model inversion is feasible; once this task is accomplished, the rest of the st andard PC methodology follows in a quite straightforward fashion (Ogunnaike and Ray, 1994). Offset Elimination Offset-free behavior is generally hard to achieve in industrial applications, due to modeling errors, and to perturbation and disturbances that enter the systems in different parts of the system, namely input, state and output variable s. In addition the use of a purely proportional controller can not guarantee the elim ination of offset in the system response. In order to tackle this deficiency several ad hoc solutions have been successfully used, the most common of which is the addition of an integral perturbation model to the plant model, and the utilization of a Kalman filter to estimate the st ates and the perturbation (Muske and Badgwell, 2002; Pannocchia and Rawlings, 2003). This approach presents several disadvantages in the design process as

PAGE 19

19 there are not precise guidelines to design the pert urbation model, greatly relaying on the designer experience. The use of velocity weights is being considered to tackle the issue of offset in the steady state behavior of the plant. The use of velocity weights has an inherent integral behavior, since the rate of change of the control input is the one being pe nalized, rather than th e total input value. Because of the integral behavior offset elimina tion is obtained.. This approach guarantees that offset free behavior would be obt ained in the presence of step changes and in the presence of a constant disturbance. One of the main disadvantage s if the disturbance is not constant is the fact that the error can grow to infi nity, thus requiring the use of an anti-windup algorithm. Development of Predictors and Associated Control Functions Several predictor schemes are derived for MP C using the state space method representation of the dynamics of the system. This method renders a plant model de scribed by a system of differential equations of degree n into a set of n differential equations plus one set of algebraic equations, as in the following state space (1)()() kkk xAxBu and ()()() kkk y CxDu, where n x, m u, p y, nn A, mn B, pn C, and pm D. The special case where the matrix C is the identity matrix, where p = n , and D is the zero matrix is considered in this work. Predictor Form 1: Position Weights. A predictor based on position weights uses an explicit model of the system, projecting it into a horizon defined by the control designer. This predictor is called position weights, since the penalty matrices in the cost functional dire ctly impact the manipulated variables or control inputs. Thus, directly penalizing the position of the controller. Consider a dynamic system expressed by

PAGE 20

20 (1)()() kkk xAxBu (2-5) where n x, m u, nn A, and nm B Let Np be the prediction horizon and defi ne the augmented state vector (1) (2) ()pk k kN x x x x (2-6) where p Nn x Then the predictor in matrix form is given by 2 12(1) () (2) (1) () () (1)pp pNN N p ck k k k k kN kN u x B AA B00 x u ABB0 x A u x x u ABABB A (2-7) where pNnn A, p cNnNm B, and cNm u. Derivation of a Position Weight Predictor To derive a position weight predic tor, the model of the system is projected into the future for a given prediction horizon. C onsider the dynamic system in Eq. (2-5), the state vector at instant k+ 2 is obtained by shifting the index of Eq. (2-5) by one unit, to yield (2)(1)(1) (()())(1) kkk kkk xAxBu AAxBuBu (2-8) Hence, after a straightforward operation on the right hand side, the predicted value becomes 2(2)()()(1) kkkk xAxABuBu (2-9)

PAGE 21

21 At instant k+ 3, the state vector is obtained by shifting the index in Eq. (2-5) by two units and then substituting x ( k +2) for its expression Eq. (2-9), as follows. 2(3)(2)(2) (()()(1))(2) kkk kkkk xAxBu AAxABuBuBu (2-10) Hence, proceeding as before yields the predicted state 32(3)()()(1)(2) kkkkk xAxABuABuBu (2-11) Analogously, at instant k + Np element the state vector becomes 12()()()(1)(1)pppNNN pckNkkkkN xAxABuABuBu (2-12) Equation (2-5), and Eq. (2-9)Eq. (2-12) are then combined in matrix form to give Eq. (2-7). Predictor Form 2: Velocity Weights. A predictor based on velocity weights makes use of a differential or ve locity model of the system. This model is obtained by subtracting th e model equation for two consecutive instants. This introduces a rate of change or increment, u, of the control signal. The penalty matrices in the cost functional weight the velocity or rate of change of the control input. Thus yielding an integral controller that depends in the previous value of the co ntrol input to generate the new control manipulation. Now, consider the dynamic model (1)()() kkk xAxBu (2-13) where n x, m u, nn A, and nm B. Let Np be the prediction horizon and define (1) (2) ()pk k kN x x x x

PAGE 22

22 where p Nn x Then, the predictor takes the form 11 00 22 00 00 1 0 1 0(1) (2) ()(1) ()pp pii ii ii ii p NN ii ii i i N i ik k kxk kN x ADAIA x AIA x x x AIA B00 ABB0 AB 2 00ppcNNN ii ii Bu ABAB (2-14) where cNm u, pNnn A, pNnn D, and p cNnNm B. Derivation of a Velocity Weight Predictor First, define the increment input vector ()()(1) kkk uuu (2-15) Then subtract from the original system (1)()() kkk xAxBu (2-16) the system ()(1)(1) kkk xAxBu (2-17)

PAGE 23

23 which is obtained by shifting back by one uni t the index of the or iginal system Eq. (2-16). After a rearrangement of terms, the result is (1)()()(1)() kkkk xAIxAxBu (2-18) which is equivalent to the original system Eq. (2-16), and that features the input increment vector u. At time instant k+2, subtracting the system at instant k+1 from the system at k+2, yields a velocity equation of the form (2)()(1)()(1) kkkk xAIxAxBu (2-19) Repeating the procedure at the sampling time k +3, yields (3)()(2)(1)(2) kkkk xAIxAxBu (2-20) Finally, at the time k+Np ()()(1)(2)(1)pppckNkNkNkN xAIxAxBu (2-21) Combining Eq. (2-18) through Eq. (2-21) in matrix form gives (1)(1) (2)(2) (3)(3) ()()ppkk kk kk kNkN DE xxx 000000AI xx AI00000A xx AAI00000 xx 000AAI00 () () (1) (2) (1) ()c x k k k k k kN F G uu AB000 u 00B00 u xu 000B0 u 0000B (2-22) where cNm u, p pNnNn D, pNnn E, pNnn F, and p cNnNm G.

PAGE 24

24 Rearranging terms in Eq. (2-22) gives (1) (2) (3) () () (1)pk k k x k kN k E x Fx I00000AI x AII0000A x AAII0000 x 000AAII0 A 0 x 0 0 () (1) (2) ()ck k k kN G uu B000 u 0B00 u 00B0 u 000B (2-23) where the inverse of the matrix p pNnNn is given by the analytic expression 1 0 1 12 00ppi i NN ii ii I00 AI0 AAI (2-24) Obviously, matrix is invertible because it is of a lower-diagonal form, with identity matrices in the diagonal. Carrying on the multiplication of Eq. (2-23) by Eq. (2-24) results in 111()() kk xExFxGu (2-25) define 1 AE , 1 DF , and 1 BG (2-26) Finally, substituting the matrices defined in Eq. (2-26) into Eq. (2-25) yields the predictor Eq. (2-14).

PAGE 25

25 Controller Design and Stability Analysis Consider a plant model of the form (1)()() kkk xAxBu wheren x , m u , nn A , and nm B . For the purpose of the following analysis, if n>m no controller can be designed that guarantee to achieve offset-free behavior for arbi trary set points with constant final value. Assume that mn , and that all the states are availabl e for measurement. If the following condition holds ranknm IAB I0 (2-27) then, the system is fully contro llable and observable (Trentelman et al. , 2001). Control design and analysis for a p redictor based on position weights The control design is based on the minimi zation of the quadratic cost functional ()()TTJ rxQrxuu (2-28) Note that matrix weights the vector u, since it is called a position weight matrix. Taking the partial derivative of the cost f unctional with respect to the input s and equating the result to zero, yields 0(())TTk rAxBuQBu (2-29) Solving for the input vector gives the followi ng expression for the minimizing of the cost functional Eq. (2-28): 1()(())TTk uBQBBQrAx (2-30) Defining the controller gain matrix

PAGE 26

26 1 1()T TT k KBQBBQ K (2-31) where cpNmNn K, p mNn T k, and (1) 1cpNmNn K. The final form of the controller that is implemented at instant k is given by ()(())Tkk ukrAx (2-32) The analysis of offset rejection can now be made under the assumption that the system is completely controllable and observabl e. Consider th e error function ()()() kkk erx (2-33) and its steady state form s sssss erx (2-34) Note that at steady state (1)() s skk xxx . Hence, model Eq. (2-5) becomes () s sss IAxBu (2-35) In the case that the plant posses a pole at 1, the matrix inverse 1() IA is not defined, to overcome this issue we multiply the error function Eq. (2-34) by the matrix () IA which results in ()()() s sssss IAeIArIAx . Substituting the plant model at steady state into this resulting function, yields ()() s sssss IAeIArBu (2-36) Hence, at steady state the controller Eq. (2-32) is given by ()T s sssss ukIrAx (2-37) where T IIII

PAGE 27

27 Substituting the controller Eq. (2-37) into the er ror expression Eq. (2-36) yields ()()() ()T s sssssss TT s sss IAeIArBkIrAx IABkIrBkAx (2-38) Offset free behavior requires that 0ss e . The only way in which offset-free behavior can be ensured from Eq. (2-38) is for the special case where the inverse 1() IA exits, and 11(())()TT IIABkIIABkA . In all other instances offset is present. Control design and analysis for a predictor based on velocity weights Theorem 2.1. For a LTI system that is controllable and observable under rank condition Eq. (2-27), and ()enull K0 . Then lim(()())kk k rx0 . The auxiliary matrix Ke is given by the sum of the block elements of kT T 12 p eN KkIkkk (2-39) where ,1,2,,mn eipiN Kk. Due to the assumption that m n, the column rank condition, ()erankn K , has to be satisfied for the null space to be empty. To design the controller adopt the quadratic cost functional ()()TTJ rxQrxuu (2-40) taking the partial derivative of th e cost function with re spect to the rate of change of the inputs and equating the result to zero, yields 0(()(1))TTkk rAxDxBuQBu (2-41) Now, solving for the input vector that minimizes Eq. (2-41) yields

PAGE 28

28 1()(()(1))TTkk uBQBBQrAxDx (2-42) Defining the controller gain matrix as 1 1()T TT k KBQBBQ K (2-43) where cpNmNn K, p mNn T k, and (1) 1cpNmNn K. The final form of the controller that is implemented at instant k is given by ()(()(1))TkkDk ukrAxx or ()(1)(()(1))Tkkkk uukrAxDx (2-44) The analysis of offset rejection is carried out under the assumption that the system is completely controllable and observable. Consider th e integral form of the controller Eq. (2-44), and its steady state form ()T s sssssssss uukIrAxDx (2-45) Now, since s sssss AxDxIx , substituting into Eq. (2-45) and factoring I , yields ()T s sssssss uukIrx (2-46) and eliminating s su from Eq. (2-46) and using the definition Eq. (2-39) for Ke , equation Eq. (2-46) reduces to ()essss 0Krx (2-47) where if Theorem 2.1 holds, the only way to satisfy the equality is if s sss 0rx , which ensures offset free behavior. For the special case of a square system where ,,n xur and the inverse of the matrix 1() IAB exits, the control input Eq. (2-44) at steady state is of the form

PAGE 29

29 11(()) s sss uIABr (2-48) analogously to the form proposed by Kwakernaak and Sivan (1972) for offset rejection. Consider a plant model of the form Eq. (2-5), where its steady state form is given by Eq. (2-35). Based on the assump tion that the inverse of () IA exits, then the steady state form of the states is given by 1() s sss xIABu (2-49) For the error function Eq. (2-33), consider its steady state form s sssss erx (2-50) Substituting the definition for s sx , as given by Eq. (2-49) into Eq. (2-50), the error fuction becomes 1() s sssss erIABu (2-51) and then the value for s su defined by Eq. (2-48), the equation becomes 111(())(()) s sssss ssss erIABIABr rr (2-52) after canceling terms, Eq. (2-52) reduces to ss err0 (2-53) Hence, offset-free behavior is obtained. Simulation Studies The different controllers derive d are tested via simulation, us ing two different problems. The first problem is a LTI system with a constant disturbance that repres ents two interconnected tanks as presented in Coughanowr (1991). Th e second example is taken from Pannocchia and Rawlings (2003). For details a bout how the predictors and c ontrollers are implemented in Matlab refer to Appendix A.

PAGE 30

30 First Simulation Study The model that describes the two interconne cted tanks of the first case of study is 3212 (1)()() 4500kkk xxu (2-54) where the true plant model is given by 32101 (1)()()(0.7) 45021kkk xxu (2-55) The controller with integrating feedback errors of the form described in Eq. (2-30) is designed using a prediction horizon Np = 5 and a control horizon of Nc = 3. The weighting matrices are as follows 10 01 Q and 10 01 (2-56) The two interconnected tanks syst em satisfy the condition that mn , since m = n = 2, and the rank condition Eq. (2-27) expressed as 4210 4602 42 1000 0100rankm (2-57) is satisfied as well. Figure 2-2 shows the behavior of the plant under a contro ller based on position weights designed using the penalty matrices in Eq. . Noti ce that steady state offset is present in both states. Finally, Figure 2-3 s hows the state trajectory provided by a controller based on velocity weights, designed using the penalty matrices Eq. (2-56). Offset free behavior is obtained.

PAGE 31

31 Second Simulation Study This example taken from Pannocchia and Ra wlings ( 2003) involves the model of an ill-conditioned distillation column first propos ed by Morari and Zafiriou (1989). One main challenge here is that the determinant of the gain matrix in the transfer function is close to zero. Furthermore, the model used for control has a mismatch with respect with the real plant dynamic, since the determinant of the gain matrix for the model has a different sign than that of the real plant. Hence, any feedback controller with integral action design on the model of the plant will lead to instability of the plant (P annocchia and Rawlings, 2003). The distillation column is described by the transfer function 0.8780.880 1 () 1.1001.096 751ps s G (2-58) The pole is located at 1/75 s, and the gain matrix 0.8780.880 1.1001.096p K has a det0.0057p K. Using a sampling period of 5 min, system in Eq. (2-58) renders the discretetime state space equation 00.8780.88010 (1)()(1);()() 01.1001.09601kkkk xxu y x (2-59) where exp(5/75) . The plant model used for control design of the plant is given by the transfer function 0.8780.864 1 () 1.0821.096 751s s G (2-60)

PAGE 32

32 Note that the pole of the plant model is located at 1/75 s , and the gain matrix 0.8780.864 1.0821.096p K has det0.0274p K. Using a sampling period of 5 min, system in Eq. (2-60) gives the discrete-time state space equation 00.8780.86410 (1)()(1);()() 01.0821.09601kkkk xxu y x (2-61) where is defined as above. Both, the plant and the plant model used for control, satisfy the rank condition Eq. (2-27), for the plant it is expressed as 0.064500.05660.0568 00.06450.07090.0707 4 1000 0100rankmn (2-62) for the plant model used for control is 0.064500.05660.0557 00.06450.06980.0707 4 1000 0100rankmn Hence, both the plant and the model used for control design are controllable and observable. First, a controller of the form given by Eq. (2-30) is designed w ith a prediction horizon Np = 5 and a control horizon Nc = 3. The penalty matrices used on the error and the inputs are 10 01 Q and 10 01 (2-63) Figure 2-4 shows the dynamic response of the pl ant when the loop has been closed using a position based controller . The offset at steady state is present, as theoretically expected since a

PAGE 33

33 purely proportional controller is not able to elimin ate offset. It is worth mentioning that the plant and the model are functionally controllable as defi ned by Rosenbrock (1970). This means that if it were not for the mismatch between the plant a nd the model perfect tracking would be possible. Finally, a controller of the form Eq. (2-44) is designed using the same prediction and control horizons used for the previous controller. The same penalty matrix is applied, and two different Q matrices are used 10 01 Q (2-64) and 10 00 Q (2-65) Figure 2-5 shows that for the case when both st ates are required to reach their desired setpoint the closed loop is unstable, with conti nuously increasing error. Figure 2-6 shows that perfect tracking is ensured for the first state, as for the second stat e constant steady state offset is present. Conclusions Design of several controllers ba sed on different predictors and cost functions has been derived. Theorem 2.1 provides sufficient conditions to achieve offset free behavior for a linear system even in the presence of disturbances. In some cases the presence of perturbations, plant mismatch or lack of observability prevents ensuing offset free behavior in all the states. In such case the controllability of some states can be sa crificed to achieve offset free behavior in the remaining states. The selection of states to be co ntrolled still remains a decision of the designer. Further work is required to develop conditions to ensure the necessity of the theorems; especially in the case where the system is not square or ill-conditioned.

PAGE 34

34 Figure 2-1. Example of elem ents in predictive control: r, reference trajectory. x, predicted output; xm, measured output; u, control action.

PAGE 35

35 Figure 2-2. Position weights based c ontroller. Two interconnected tanks.

PAGE 36

36 Figure 2-3. Velocity weights based c ontroller. Two interconnected tanks.

PAGE 37

37 Figure 2-4. Position weights based c ontroller. Distillation column system.

PAGE 38

38 Figure 2-5. Velocity weights based c ontroller. Distillation column system.

PAGE 39

39 Figure 2-6. Velocity weights base d controller applied only to the first state. Distillation column system.

PAGE 40

40 CHAPTER 3 CONTROL OF NON-HOLONOMIC VEHICLES In this chapter, a Khepera robot is used as a platform to test se veral predictive control designs for nonlinear time-varying systems. A penici llin reactor is taken from literature to test the performance of several predictors in ach ieving offset free beha vior for underactuated nonlinear time-varying systems. Performance an alysis of the diverse control schemes is conducted via simulations using a Khep era robot and a penicillin reactor. Literature Review Control of Autonomous Non-Holonomic Vehicles The area of autonomous-vehicle control has been extensively studied due to its inherent importance and its wide range of applications, such as the operation of automated lift-forks in storage areas (Hu et al., 1993), automatic sailing of vessels (Sandler et al., 1996; Wahl and Gilles, 1998). The research area is also importa nt because of the potential it holds for possible reduction of traffic and car accidents (H uang and Ren, 1996; Huang and Ren, 1998), etc. These car-like vehicles present a physical cons traint, namely, they have a minimum turning radius at any given translational velocity different than zero, inhi biting them to change direction instantaneously (Hu et al., 1993). Thus limiting the path geometry that such a vehicle can follow. A non-holonomic vehicle is a car-like vehicle, with its coupled linear and angular velocities. Thus it has a minimu m turning radius restriction, opposed to a holonomic vehicle. As oppose to a holonomic vehicle, which has its li near and angular velocities independent from each other, i.e., a helicopter. During the last decade a number of strategies have been pursued to achieve the path planning and trajectory tracking tasks. Most of the results obtained can be classified according to the coordinate system adopted for devel opment, because in the case of the Cartesian

PAGE 41

41 coordinate system, the following well-know n Brockett theorem applies (Brockett et al., 1983): “If we have 1()m ii id dtx g xu (3-1) with the vectors gi( x ) being linearly independent at x0, then there exists a solution to the stabilization problem if and only if there are as many control parameters as dimensions of x . Of course the matter is completely different if the set { gi( x0)} drops dimension precisely at x0 (Brockett et al., 1983)”. For the fairly general case of non-holonomic autonomous vehicles there are three states and only two inputs. The states are the position coordinates (x,y) and the angle , which gives the direction of the vehicle. The inputs are the linear velocity in the direction and the angular velocity. Theref ore, since the dimension of x is 3, which is different from the number of input variables, u namely 2, Brockett’s theorem implies that there is no stabilizing solution. Hence it is necessary to fix one state, reducing x to two to make the stabilization problem feasible. The set of state equations that describe a generic non-holonomic autonomous-vehicle system is (Indiveri, 1999) cos dx v dt sin dy v dt (3-2) d dt where x is the horizontal plane in a Cartesian coordinate system, y is the vertical component of the Cartesian coordinate system, and is the heading angle of the vehicle,

PAGE 42

42 namely the direction to which the ve hicle is pointing. The inputs are v , for the linear velocity, and the non-negative variable stands for the angular velocity. To overcome the restriction imposed by Brockett ’s theorem, a change of coordinates has been used (Aicardi et al. , 1995; Indiveri, 1999), which maps the Cartesian to a polar coordinate system, to cast the system described by Eq. (3-2) in the equivalent form cos() de v dt sin d v dte (3-3) d dt where e is the non-negative error between the cent er of mass of the vehicle and a desired point ahead, is the heading angle with respect to the desired point the vehicle should reach, and is the current heading angle of the system. The inputs v and are defined as before. Letting be defined as , the above set of equations becomes cos de v dt sin d v dte (3-4) sin d v dte Since e > 0 the system becomes discontinuous, thus Brockett’s theorem no longer holds. For a more detailed description refer to Figure 3-1, where it can be seen that e is defined as the difference between the center of gravity of the ve hicle and any desired give n point such that at any instant e > 0 holds.

PAGE 43

43 Several control strategies have b een proposed for the system in Eq. (3-2) defined in Cartesian coordinates, such as a gene ralized predictive controller (Watanabe et al. , 1991; Hu et al. , 1993), model predictive control (Kim et al. , 2001),two feedback control-loop structures using input-output pseduolinearizati on and gain scheduling (Jeng et al. , 1997), adaptative self-tuning control (Tarin et al. , 1999), global exponential tracking under a mild persistency of excitation condition (Dixon et al. , 1999), nonlinear model predictive control (Wahl and Gilles, 1998), robust predictive control (Berlin and Frank, 1991), fuzzy control (Huang and Hu, 1995; Wong et al. , 2001), model based predictive control wi th genetic online optimization (Ramirez et al. , 1999), and MPC with satisficing decision theory (Curtis and Beard, 2001). Lyapunov-based controllers have been used for the case of a system modeled under polar coordinates (Aicardi et al. , 1995; Indiveri, 1999). Finally, the successful design of a sliding mode controller is also reported in the literature (Yang and Kim, 1999). Dynamics of the Khepera Robot A special case considered in our study is th e Khepera robot, developed by the K-Team at the Swiss Federal Institu te of Technology, a non-holonomic ve hicle that can be modeled as a unicycle (Aicardi et al. , 1995; Bicchi et al. , 1996). The robot has two wheels that are independently powered by two DC motors. Tha nks to the simplicity and ease of use of the Khepera robot, it offers a user-friendly environm ent to carry out developmental work. Various discrete-time models are available in the literature for Khepera robot. Of particular interest to us is the discrete-time kinematic model based on stra ight segments adopted by Niederberger (2002), which is of the form

PAGE 44

44 (1)()(()())cos() 2 (1)()(()())sin() 2 (1)()(()())rl rl rlh x kxkVkVkk h y kykVkVkk h kkVkVk L (3-5) where L is the distance between the two wheels, Vr is the velocity of the right wheel, Vl is the velocity of the left wheel, and where time is defined as t = kh . Equation (3-5) can be expressed in matrix form as () (1)() (())cos()cos() 22 (1)() () (1)()sin()sin() () 22 (1)()xyxyr l k kk khh kk xkxk Vk hh ykykkk Vk kk hh LL v xx B (3-6) To decoupled Eq. (3-6) suffices to defined to new inputs 1()(()()) 2rlh ukVkVk and 2()(()())rlh ukVkVk L . After substituting these new inputs into Eq. (3-6), a decoupled model is obtained, yiel ding the new model 1 (1)()(()) 2(1)()cos() () (1)()sin() (1)()xyxykkkxkxkk uk ykykk kku xxB (3-7)

PAGE 45

45 An alternative model documented by Niederbe rger (2002) is the discrete-time kinematic model based on circular arcs ()() (1)()(sin(1)sin()) 2()() ()() (1)()(cos(1)cos()) 2()() (1)()(()())rl rl rl rl rlVkVk L x kxkkk VkVk VkVk L y kykkk VkVk h kkVkVk L (3-8) Both models, Eq. (3-6) and Eq. (3-8), are nonlinear, but Eq. (3-8) is somewhat more complicated because it presents a singularity when Vr = Vl, plus the fact that ( k+1 ) is used in the calculation of the coordinates x ( k+1 ) and y ( k+1 ). Due to the intrinsic limitations of Eq. (3-8) Niederberger (2002) used Eq. (3-6) and Eq. (3-7) for control design. Since the Khepera robot is so small and light, it can be considered to be able to move instantaneously. To translate the results to heav ier systems inertial forces must be taken into account. The inertial forces can be expressed as a delay in the r eaction of the robot. A sample approach consists of adding a first-order dyna mic system to the kinematic model in Eq. (3-5) to emulate the inertial mass. More specifically, the virtua l inertia is modeled through the first order dynamics vu()() s s s 1 1 (3-9) where u(s) is the output from the controller, and v(s) is the input to th e Khepera robot, namely the speed for the right and left wheel, and is the time constant of the first order system. The virtual inertia can be discretized by a sa mple-and-hold process, yielding the equation vvu()()()() kekekhh11 (3-10)

PAGE 46

46 which can be added to (3-6) giving the augmented dynamic system 3 32 232 2 (1)() ()(()) (1)() () (1)() (1)xyxy h h kk kk kk k kk e e xx B AIB 0 xx u vv 0I I (3-11) To tackle the issue of determ ining the position of the robo t Herrera (1999) used a video camera, and Niederberger (2002) read the in cremental wheel sensors and used the Eq. (3-8). Predictive Control Design Both Herrera (1999) and Niederberger (2002) used a predictive cont roller to target the tracking requirements of the Khepera robot. In particular, Herrera (1999) proposed a controller based on the decoupled system described in Eq. (3-7), using a controller design on a predictor based on position weights. The work of Herrera (1999) documents an implemen tation of this strategy in cascade mode using two predictive controllers to ma nage the non-linearity of the syst em, where the master controller predicts the angle, which is then fed to the second controller to cal culate the position. Analogously Niederberger (2002) calculated two different predic tive controllers, both based on the system Eq. (3-11) but written in the form xAxBu ()(,)()() kkkk r 1 (3-12) where 3 232(()) (,)r h rk k e IB A 0I and where r is the reference angle. Equation (3-12) has the companion predictor ()()()(1)()rrrkk xAxDxBu (3-13)

PAGE 47

47 where p Nn x, cNmu, p pNnNn A, p pNnNn D, and p cNnNm B. The augmented vectors and matri ces are defined as follows (1) (2) ()pk k kN xx x x, () (1) (1)ck k kN u u u u , 1(,()) (,(1))(,()) () (,(1))(,())r r Np rkk kkkk kkkk A AA A AA, 1(,()) (,(1))(,()) () (,(1))(,())r r Np rkk kkkk kkkk DIA IAA IAA, and 1 0 12 000(,) () (,)(,)(,)pppci r i r NNNN iii rrr iiik kkk B00 ABB0 B ABABAB (3-14) Using a cost function of the form ()()TTJ rxQrxuu (3-15) After carrying out the minimiza tion of the cost function Eq. (3-15) the resulting controller is given by 0()()r uKrx (3-16) where 1()(()())()TT rrrr KBQBBQ (3-17) 0()()()()(1)rrrkk xAxDx

PAGE 48

48 To eliminate the offset present in the controller, Niederberger proposed the ut ilization of a parameter, defined as the aiming distance, whic h serves as a correction to the existing error between the reference angle and th e actual angle of the Khepera r obot. This correction leads to a controller similar to Eq. (3-16), but instead of using r, a new angle c is used. Basically, c seeks to correct the offset by calculating a headin g angle, which is obtained based on the current position and angle, and the refere nce position. The speed at which the offset is eliminated depends on the aiming distance parameter that is se t by the user, and utilized by the controller to calculate the number of steps requir ed to get the robot back on track. Tracking Problem in Non-Holonomic Vehicles The control action u used in predictive control is usually obtained through the minimization of a cost function J = J( x , r , u ), where x is the process output, and r is the desired process output, namely the process reference. Th e choice of the cost function plays a key role in the predictive control strategy to be followed. Also, the form of the process model is important because input increment functions and well as output errors can be added to the system equation. In this study, several predicto rs are derived for linear syst ems, where the matrices that multiply the process output and input are considered to be time invariant. Similar derivations must be made and validated for the case where thes e matrices are time variant, as in the case of non-linear systems (details provided in Appendix B). The matrices of nonlinear systems can lose rank, which causes some or all of the states to become uncontrollable, although not necessarily unstable. The solution for the Khepera robot system as proposed by Niederberger (2002), utilize an aiming distance parameter, which forces the predicto r to react in a certain time frame. The use of this parameter is based in a series of assump tions that may not hold in a real system, such as assuming that a perfect tracking is accomplished, and that the reference track is perfectly

PAGE 49

49 followed. To overcome such restrictions, differe nt predictors and cost functions are to be evaluated for the non-linear and decoupled models. Experimental Results Khepera Robot Tracking Problem The Khepera robot utilized fo r the experiments was obtained from the Swiss Institute of Technology. Due to the fact th at it is a modified version of a commercial Khepera robot (K-Team, 1999), and since the in terface was designed for an Apple computer, some hardware conversions needed to be done. The Khepera robo t can be controlled with a code written in LabVIEW (Khepera LabVIEW 5, 2 002), which communicates with th e robot via a serial port. This posed some problems, due to the fact that Apple systems utilize a differential data transfer scheme and only has 8 pins, whereas Intel-based MS Windows computers have a serial port with 9 pins and uses a direct data transfer method. Figure 3-2 shows a model of the Khepera robot that can be acquired from the K-Team Corporation. The modified version utilized fo r these studies has two infrared sensors in the front, pointing down, located besides two sensors pointing to the front. Basic Matlab and LabVIEW code was availabl e from Niederberger (2002). All this software was written for the Apple version of La bVIEW, which lacks some of the functionality that LabVIEW for MS Windows-based computers has, such as the possibility of importing Matlab code directly into LabVIEW (2002). The code developed by Niederberger was test ed and optimized to take into account the enhanced LabVIEW functionality and improve the performance of the controller, especially in the time that LabVIEW takes to perform each iteration. Since LabV IEW runs under a Windowsbased environment, it does not r un in a deterministically periodic fashion. This means that the length of time for each cycle that LabVIEW execu tes is not necessarily constant. The sampling

PAGE 50

50 time is not only a function of LabVIEW itself, but also a function of the interaction of the user with the computer and the operating system, and othe r programs that may be running in parallel. Thus, an approach to optimize the LabVIEW code performance is to use Matlab code embedded in the LabVIEW scheme, especially to perform linear algebra calculations. The code in LabVIEW can be divided in two ma in areas. The first area is track reading, where the Khepera robot is controlled by a PI cont roller, and is ran at a low speed. Based on the displacement of each wheel, th e software calculates the (x,y) position and the heading angle . Figure 3-3 shows the user interface of the tracking software in LabVIEW. Once the track coordinates are obtained (usually the data over several laps is taken) a Matlab program generates a reference path by sm oothing the data acquired using cubic splines. With this reference path, the second LabVIEW c ode is invoked to uti lize a predictive control strategy to control the Khepera robot , and it runs at higher speeds. At the end of the trial run, the reference path can be compared with the actual track that the robot followed, giving a graphical measurement of the controller pe rformance. Figure 3-4 shows the user interface to test the controller performance. The LabVIEW and Matlab code had been revers e-engineered and modified to optimize the processor time, to make each iteration as shor t as possible. Matlab code was embedded in LabVIEW, rendering a more compact and effi cient program. The code has also been modularized to enable future modifications on the control scheme in a tran sparent fashion, since only few subroutines need to be edited. As for th e code in Matlab, more predictors where tested and a user friendly program structure was developed. The nonlinear model and the decoupled model were implemented in Matlab. Two different controller forms were tested with each model. Namely, a controller based on position

PAGE 51

51 weights, and a controller based on velocity we ights. For comparison purposes, the aimingdistance correction based on an id ea proposed by Niederberger (2002) was also evaluated; using both position and velocity weights based contro llers. The aiming-distance correction aims to recalculate part of the reference trajectory based on the current location of the robot. Two types of trajectories are used, an L-shaped trajector y and a kidney-shaped trajectory. The L-shaped trajectory poses some interesting problems, since due to the model of the system, the y state of the model becomes uncontrollable when the robot moves along the x-axis. The same happens to the x state when the robot moves along the y-axis. The results of this problem can be observed in the persistence of offset for the control st rategies tested. The aiming-distance controller succeeds in eliminating the offset by introducing an error in , which in turn affects the x and y states, allowing the controller to regain controllability of the previously uncontrollable states. The aiming-distance correction factor is based on a modified predictive control paradigm presented by Maciejowski (2002), where a corrected reference trajectory is included, as can be seen in Figure 3-5, where rd is a corrected refere nce trajectory, which is valid only for the prediction horizon and based on th e current measured states. Figure 3-6 shows how the aiming-distance correcti on is applied. The user has to fix the aiming-distance factor, that multiplied by the diam eter of the robot yields a physical distance a. The distance a is translated into a point in the referen ce that would be reached in a finite number of iteration steps. A new angle is calculated using the current position and the future positions and is then utilized as the reference for the current iteration. This process is applied recursively. Controller performance for an L-shaped trajectory For the case of an L-shaped tr ajectory two interesting dynamics are observed. First, when the angle = 0 rad, the model Eq. (3-6) of the robot becomes

PAGE 52

52 (1)() 22 () (1)()00 () (1)()r lhh xkxk Vk ykyk Vk kkhh LL (3-18) It is readily seen that the state y is not affected by the inputs. In the case when = /2 rad, the model of the robot becomes 00 (1)() () (1)() () 22 (1)()r lxkxk Vk hh ykyk Vk kk hh LL (3-19) It can be observed that in this case the state x becomes uncontrollable. Due to this behavior it is particularly difficu lt to achieve good control, since the controller has no means of minimizing an offset error in the uncontrollable state. The use of an L-shaped trajectory is particular ly relevant, since it offers an step change in the angle, along with a ramp in one of the two ot her states. First, consider the nonlinear system in Eq. (3-6), with the initial state (,,)(.,.,.)xymmmmrad 0505025, a prediction horizon Np = 7, and a control horizon Nc = 5. The simulation results are as follows. Figure 3-7 shows the performance of a contro ller based on position weights as the one obtained in Chapter 2. For details on how the nonlinear predictor is obtained refer to Appendix B. The state and input penalty matrices used are 1000 100 0100; 010 005500 Q (3-20) The controller is not able to elim inate the initial offset , although it is able to stabilize the robot.

PAGE 53

53 Figure 3-8 shows the performance of a contro ller based on velocity weights as the one described in Chapter 2. Details of the deriva tion of the nonlinear predictor for the velocity weight scheme are provided in Appendix B. Th e penalty matrices used for this scheme are 1000 100 0100; 010 002000 Q (3-21) Better performance is obtained, compared to the controller based on pos ition weights, although offset is still present and overs hoot is present in the corner. Figure 3-9 shows the performance of a contro ller based on position we ights and with the aiming-distance correction scheme. Offset elimina tion is achieved, altho ugh error is present in the corner, and a small overshoot is visible. The penalty matrices used for this controller those given in Eq. (3-20), with an aiming-distance a = 0.15L. Figure 3-10 shows the performance of a cont roller based on velocity weights with the aiming-distance correction scheme. Offset free behavior is achiev ed. The corner is smooth and no overshoot is present. Now consider the decoupled system, where the angle is calculated first, and the predicted values are in turn used to calculate the input matrix for the position states. The same initial conditions apply. The prediction and control ho rizon for the position are kept the same. The horizons for the angle are as follows, Np = 13, and Nc = 7. A controller based on position weights is used for the corner, since no consider able advantage is obtained by using a controller based on velocity weights. For the case of the controller using the aiming-distance correction, a factor of 0.075 is used, and hence a = 0.075L. The penalty matrices used for the angle controller are Q 100010 ; (3-22)

PAGE 54

54 while the penalty matrices used for position states controller are Q L N M O Q P 1000 0100 10 ; (3-23) Figure 3-11 shows the performance of a contro ller based on position weights. Offset is present in the horizontal section, but eliminated in the vertical leg. Note that the turn in the corner is performed in a rather sharp fashion. Figure 3-12 shows the perf ormance of a controller based on velocity weights. No visible improve ment is gained by using this controller form versus the one based on position weights. The initial offset is not totally eliminated in the horizontal section of the traject ory. Figure 3-13 shows the perf ormance of a controller based on position weights with aiming-distance correction. The initial offset is eliminated, and a smother turn is visible. The performance of the controllers is improved by using the decoupled system versus the nonlinear system. This is due to the fact that the decoupled scheme uses the predicted values of the angle to evaluate the input matrix for the prediction horizon required by the controller, instead of using the reference angles as is done for the nonlinear scheme. Also here it can be observed an improvement in the behavior of th e control when the aiming-distance correction is utilized. Controller performance for a Kidney-shaped trajectory A kidney-shaped trajectory is used to study a mo re general case of traj ectory tracking. The nonlinear and decoupled systems are considered for the simulations. The initial conditions, horizons, and the penalty matrices are kept the same as in the previous section. Figure 3-14 shows the performance of a contro ller designed using a predictor based on position weights using the pena lty matrices defined by Eq. (3-20). The overall performance of the controller is acceptable, although it shows a sl ight error in the curves . Figure 3-15 shows the

PAGE 55

55 performance of a predictor based on velocity weights penalized by the matrices given in Eq. (3-21). A tracking error is pres ent, especially in the curves. The addition of an aiming-distance correction is evaluated, by corre cting the reference for both controller, namely position and velocity weight. An aiming-distance parameter a = 0.15L is used here. Figure 3-16 shows the performance of a controller designed usi ng the position weight predictor form with an aiming-distance correct ion, using the penalty matrices given by Eq. (3-20). The tracking is of good quality, espe cially in the curves where the previous controllers tend to show more difficulty follo wing the trajectory. Figure 3-17 shows the performance of a controller based on velocity weights with the aiming-distance correction, the weighting matrices Eq. (3-21) are applied to the controlle r design. The tracking is almost perfect, as the offset is almost nonexist ent in the majority of the trajectory. Simulations were also carried out using the decoupled model of the system, using the penalty matrices Eq. (3-22) for the angle loop, and Eq. (3-23) to penalize th e position states. Figure 3-18 shows the performance of a controller designed using the pos ition weights predictor, for both the position states and th e angle. Good tracking is achi eved, although the trajectory is slightly off in the curves. No offset is appreciable in the straight segments. The effects of using a controller based on veloci ty weights for the position states yields the results shown in Figure 3-19. The controller used for the angle is the same as in the previous simulation. There is error present in the curves. Figure 3-20 shows the performance of a controller designed using position weights for th e position states and a controller based on position weights with an aiming-dist ance correction for the angle of a = 0.075L. The dynamics of the system are decoupled. The tracking perf ormance is similar to the one achieved without the use of the aiming-distance correction.

PAGE 56

56 No improvements were obtained from the use of decoupled dynamics for the case of a kidney shaped trajectory. Also, the use of the aiming distance was only helpful in for the system with the nonlinear dynamics, since all the states are coupled. After simulations were carried on in Matlab , the nonlinear system was evaluated using LabVIEW. The predictor based on position weights and a predicto r based on velocity weights, both with and without the use of the aiming-distance correction. Figure 3-21 displays the results of a test using the LabVIEW interface. The model used is the nonlinear dynamical plant. And the controller selected is designed based on the predictor with velocity weights. The test results are close to those predicted via simulation. Penicillin Production The use of semi-batch reactor is common in the pharmaceutical industry. These type of processes present an interesting case for study, since they have to follow a certain recipe in a fashion analogous to to the Khepera robot following a trajectory. To test the validity of the aiming-distance paradigm, a semi-batch reactor used in the production of penicillin is controlled using various predictive contro l schemes, with and without the use of an aiming distance correction factor in the setpoint. Th e plant model proposed by Srinivasan et al. (2002) is of the form () () ()xpdXu SXX dtV dSSXvXu SinS dtYYV dPu vXP dtV dV u dt (3-24) where

PAGE 57

57 2() ((/))m miS S KSSK (3-25) and where X represents the concentration of biom ass, S the concentration of substrate, P the concentration of penicillin, and V the volume. The imput is given by u, which represents the feed flow into the reactor w ith a substrate concentration Sin. The yield coefficients are given by Yx and Yp. The kinematic constants are (S), v, Ki, Km. There are two sources of uncertainty in the system, namely the concentration of the substrate in the inlet flow, Sin, which is known to vary between 200-250 g/l, and the coefficient Yx, which oscillates between 0.3-0.5. A discrete-time nonlinear model is obtained by forward discretization using a time step h, and an index k instead of the time t, namely t=kh, resulting in a model of the form () (())1000 () (1)() (()) (()()) 100 (1)() () (1)() () 010 (1)() () 0001xpXk h hSk Vk XkXk Skv SinkSk h SkSk h uk YY V PkPk Pk hv h VkVk Vk h (3-26) where 2() (()) (()(()/))m miSk Sk KSkSkK (3-27) The cost function that minimizes the final valu e of the product subject to constraints in the amount of biomass and the range in which th e control input can ope rate is implemented (Srinivasan et al, 2002). In our study a solution based on minimizing a desired product profile is carried out, such that a predictiv e control approach can be utili zed. The controller is designed using the discrete-time nonlinear model and consid ering the uncertainties to be at their mean values, although for the real syst em the uncertainties are free to os cillate within their operational

PAGE 58

58 ranges. The trajectories for all the states are based on the nominal optim al solution, except for the volume, V, as it is let free to change. The simulations are carried out using a c ontroller based on positi on weights with and without the use of the aiming dist ance correction paradigm in the re ference trajectories, and also using a controller based on velocity weights, again with and without the use of an aiming distance correction. For details about the deriva tion of the predictors and the code used for implementation refer to Appendix B. The wei ghting matrices used for the simulations are Q L N M M M M O Q P P P P100000 010000 0010000 0000 ; and [] 100. (3-28) The prediction horizon Np = 10, the control horizon Nc = 7, the sampling time is h = 1hour, and the aiming distance horizon is a = 3. This means that only the first three elements of the reference vector are being modifi ed during each iteration. In Fi gure 2-22 shows the behavior of the plant when a controller base d on position weights is applied. The plots in the left column show the dynamics of each state, in the form of a solid line, versus the desired trajectory, represented by the dash line. All the plots are for 150 hours, which is represented in the horizontal axis. The right column shows the deviat ion or error that exists between a given state and its reference at any given inst ant in time. The last plot of the right column shows the control action that is being applied to th e system. The most important se t of plots is the third row of each column, which stands for the production of peni cillin. Figure 2-23 the behavior of the plant under a controller based on position weights is appreciable. Figure 2-23 makes use of a controller that includes the ai ming distance correction. The use of it renders a smoother response, since the controller displays a less aggressive behavior. The error in the product

PAGE 59

59 concentration goal is reduced from 0.15 g/l in Figure 2-22 to 0.11 g/l, in Figure 2-23. The controller in Figure 2-23 also shows how the addition of th e aiming distance correction helps the controller reject disturbances th at in other case would have ca used severe deviations from the nominal trajectories in the biomass and the subs trate as can be observed in Figure 2-22. In Figure 2-24 and Figure 2-25, the behavior of th e plant when a controller based on velocity weights is used can be seen. Figure 2-25 make s use of the aiming distance correction in its control strategy, resulting in an improved respon se from the system. An improvement in the reduction of the product error of almost 90% is observed, since the erro r goes from 0.24 g/l in Figure 2-24 down to 0.03 g/l in Figure 2-25. The response of the controller aided with the addition of the aiming distance correction also pr oved to have a smoother behavior, rejecting the peeks caused by the disturbances in the bioma ss and substrate, as observed in Figure 2-24. Conclusions Non-holonomic vehicles provide an excellent test bed to evaluate the performance of different controllers. Due to its dynamics, which are underactuated, it presents special challenges for the control designer. A new paradi gm was utilized, namely the use of the aiming distance correction. This creates a corrected refere nce vector that allows the system to react to unseen errors. The use of the aiming distance correction gives the designer another control parameter to determine. It is important to notice that the quality of the performance of the controller will vary greatly with the selection of this parameter. Successful use of the aiming distance strategy has been shown, first to control a Khepera robot and also to control the production of peni cillin. Both systems are underactuated, and in both cases the use of a corrected the referen ce vector greatly improved the response of the system, reducing the error and in some cases to tally eliminating it. The potential of aiming

PAGE 60

60 distance paradigm is yet to be explored in furthe r details. Further effort s in a rigorous proof of the effects of it in the controller performance are advised. Figure 3-1. Vehicle position and orientation to respect to the target frame. Figure 3-2. Khepera robot.

PAGE 61

61 Figure 3-3. Track reading interface for Khepera robot.

PAGE 62

62 Figure 3-4. Control interface in LabVIEW.

PAGE 63

63 Figure 3-5. New paradigm for pr edictive control: the element rd is a corrected trajectory based on the current state of the system.

PAGE 64

64 Figure 3-6. Aiming-distance paradigm. Ad is the corrected angle th at is calculated at each iteration. “a” is the length ah ead that the aiming-distance al gorithm uses to create the new angle.

PAGE 65

65 Figure 3-7. Controller based on position weights. Nonlinear system. L-shaped trajectory.

PAGE 66

66 Figure 3-8. Controller based on velocity weig hts. Nonlinear system. L-shaped trajectory.

PAGE 67

67 Figure 3-9. Controller based on position weig hts with aiming distance correction. Nonlinear system. L-shaped trajectory.

PAGE 68

68 Figure 3-10. Controller based on velocity we ights with aiming distan ce correction. Nonlinear system. L-shaped trajectory.

PAGE 69

69 Figure 3-11. Controller based on position weights. Decoupled system. L-shaped trajectory.

PAGE 70

70 Figure 3-12. Controller based on velocity weig hts. Decoupled system. L-shaped trajectory.

PAGE 71

71 Figure 3-13. Controller base d on position weights with aimi ng distance correction. Decoupled system. L-shaped trajectory.

PAGE 72

72 Figure 3-14. Controller based on position weights. Nonlinear sy stem. Kidney-shaped trajectory.

PAGE 73

73 Figure 3-15. Controller based on velocity weights. Nonlinear system. Kidney-shaped trajectory.

PAGE 74

74 Figure 3-16. Controller base d on position weights with aimi ng distance correction. Nonlinear system. Kidney-shaped trajectory.

PAGE 75

75 Figure 3-17. Controller based on velocity we ights with aiming distan ce correction. Nonlinear system. Kidney-shaped trajectory.

PAGE 76

76 Figure 3-18. Controller based on position weights. Decoupled sy stem. Kidney-shaped trajectory.

PAGE 77

77 Figure 3-19. Controller based on velocity weig hts. Decoupled system. Kidney-shaped trajectory.

PAGE 78

78 Figure 3-20. Controller base d on position weights with aimi ng distance correction. Decoupled system. Kidney-shaped trajectory.

PAGE 79

79 Figure 3-21. LabVIEW test. Nonlinea r system with velocity weights.

PAGE 80

80 Figure 3-22. Controller based on pos ition weights. Penicillin production.

PAGE 81

81 Figure 3-23. Controller based on position weights with aiming distance correction. Penicillin production.

PAGE 82

82 Figure 3-24. Controller based on velo city weights. Penicillin production.

PAGE 83

83 Figure 3-25. Controller based on velocity we ights with aiming distance correction. Penicillin production.

PAGE 84

84 CHAPTER 4 REMOTE AND VIRTUAL EXPERIME NTATION OVER THE INTERNET The advent of the Internet has opened new ve nues for research and education. Due to time and location constraints, as well as equipment av ailability the use of we b-based tools has been popularized in the last years (Latchman et al., 1999; Gillet et al., 2001). Two main frameworks are explored in this research, first th e remote experimentation paradigm (Ko et al., 2001), and second the virtual experimentation paradigm (Ko et al., 2001; Gillet et al., 2003). In the first approach a person can interact with a physical se tting that cannot be easily accessed due to either time or location constrains. The person inter acts with the system th rough an interface that reproduces, as faithfully as possible, what is available in the lab. The virtual control lab offers the same interface to the user with the differen ce that now the representation of the system is created by a simulation engine ra ther than showing the status of a physical setting. Both approaches have advantages and disa dvantages inherent to their design. Remote and Virtual Experiment ation-Historical Approaches. The growth and adaptability of the Internet has opened new communication channels that allow the development of novel technologies, such as distant education, the use of remote machinery, etc. The first approach utilized for remo te interaction was in an asynchronous fashion, mainly due to bandwidth and transmission issues, but now thanks to the development of better software that allow the tr ansmission of video and audio al ong with other data, and faster and more reliable connections, there is the opportunity to interact in a synchronous way. Several efforts have been made towards real -time interaction and experimentation. In particular (Gillet et al., 2001, Gillet et al., 2003) propose the use of an interface developed in LabVIEW, which contains first a scope area where all the relevant variables are displayed in a plot that allows the user to ha ve a historic record of the system in a graphical way. Secondly, a

PAGE 85

85 visualization area where a mix of real-time video and a virtua l image created by the client software is displayed, showing the current perf ormance of the system. Finally, there is the control or manipulation area, wher e the control parameters and ke y variables can be manipulated in order for the user to interact with the system. An alternativ e approach is proposed by Quanser (2002), where a virtual machine is used instead of using a real-time video stream. This is a precise graphical representation of the system which is updated based on the state of the monitored variables. The gr aphical representation can be done in a three-dimensional environment, giving the user the opportunity of looking to the system from different perspectives. For either choice of visualiza tion, online video or virtual sy stem, several issues must be addressed to take full advantage of such capabilities (Latchman et al., 1999; Gillet et al., 2001; Gillet et al., 2003). If the control variab le or the behavior of the system is not visually observable, as in the case of temperature co ntrol where the effect of the controller (i.e., an increment in the temperature of the system) is not easily observed in a heat exchanger. In cases like this, visualization is not us eful and only consumes bandwidth. The dynamics of the system is another important aspect that must be taken into consideration. If the re sponse of the system is too fast, the changes are not observa ble, and if is to slow the visu alization is not a priority, since the user can react to changes in the system ba sed on information obtained from directly reading the variables, given that the time is not a major factor. For the case where a physical set up is not availa ble, the use of a Virtual Control Lab is a feasible solution. In a recent paper, Peek et al. (2005) propose the use of a simulation engine to emulate the behavior of the system. The syst em is represented by a dynamic animation, such that the user can get a grasp of the behavior of the system. The interface provides information

PAGE 86

86 about the system, the controller and the simulation via different tabs accessible to the user. This approach allows different users to interact with the system in a concurrent fashion, since a copy of the program is run in the server for each individual user. Thus, maximizing the use of resources available. Case Studies Interconnected Tanks System The two-tank module by Quanser is used for th e purpose of testing a real-time process over the Internet. The module consists of two cylindr ical tanks, as shown in Figure 4-1, where tank 1 feeds tank 2, and, depending in the configuration, the pump can f eed only tank 1 or both tanks. At the bottom of each tank there is a variable-dia meter orifice; furthermore the orifice in tank 1 feeds tank 2, and the one in tank 2 di scharges into the water reservoir. Figure 4-1 shows the three basic configurations of the system (Quanser, 1999). The first one is where the pump feeds only tank 1, and the leve l in tank 1 (denoted L1 in the figure) needs to be regulated. The second configuration is wh ere the pump feeds tank 1 but the level in tank 2 (L2) needs to be controlled. Fi nally, the third configuration is where the pump feeds both tanks, while tank 2 is being fed by tank 1, and the level of tank 2 (L2) is to be controlled. Each tank has a pressure sensor in the bottom that the system uses to calculate the water level. The equations that describe the system ar e given in the Quanser Experiment Manual (Quanser, 1999) for this system and reproduced here for completene ss. The inflow for tank 1, in the first and second configur ation, is described by 3(cm/sec)inmpFKV (4-1) where Km is the pump constant and Vp is the voltage applied to th e pump, and the outflow rate is 3 12(cm/sec)outFagh (4-2)

PAGE 87

87 where a1 is the outflow orifi ce cross-sectional area, g is the gravitati onal constant, and h1 is the height of the water in the tank. At a given time instant, the volume of water in the tank is given by the mass balance inoutdV FF dt (4-3) For a fixed cross-sectional tank area A1 the change in level is given by 1 1 1 11() 2(cm/sec)m pa K dht ghV dtAA (4-4) In an analogous fashion, the level of tank 2 for the second configuration is given by 212 12 12() 22(cm/sec)dhtaa ghgh dtAA (4-5) For the case of the third confi guration, the outflow of the pum p is divided according to the diameter of the connections. Let define the fraction of the pump outflow that is fed to tank 2 so that (1) is the fraction that goes to tank 1. Thus , the system is desc ribed by the set of differential equations 1 1 1 11() 2(1)(cm/sec)m pdht K a ghV dtAA (4-6) 2 12 12 122() 22(cm/sec)m pdht K aa ghghV dtAAA (4-7) For implementation the linearized versions of Eq. (4-4), Eq. (4-5), Eq. (4-6), and Eq.(4-7) are used. Taylor series expansion (Kreyszig, 1999) around a nominal point is applied and any term of second degree or higher is dismissed. After performing the lin earization, the resulting equation for the first configuration is

PAGE 88

88 1 1 1 1 112m pa K dh g hV dtAA h (4-8) where 111hhh and pp pVVV are deviation variables, and 1h and pV are the nominal values. For the second configuration, after performing the linearizat ion the model becomes 212 12 12 1222dhaa gg hh dtAA hh (4-9) where 222hhh is the deviation va riable for the level of the s econd tank, for a given nominal value 2h. Finally, for the third configuration the model becomes 1 1 1 1 11(1) 2m pa K dh g hV dtAA h (4-10) 212 12 122 1222m pK dhaa gg hhV dtAAA hh (4-11) with the deviation variables defined as before. An interface is developed fo r this system, considering the restrictions imposed by the bandwidth of different Internet connections. The bandwidth restriction limits the amount of variables that can be monitored a nd controlled in the proc ess. Also it restricts the interaction that the user can have with the system, either via on -line video broadcasting or via a virtual machine that reproduces the behavi or of the real system. A different perspective for addressing this pr oblem is though the use of a virtual control lab (VCL) suite, in which the user interacts with an in terface that simulates the behavior of the real system. The system is represented with the help of an animation that responds to the values generated by the simulation machine.

PAGE 89

89 Nonisothermal CSTR System The nonisothermal CSTR model considered is given in Luyben (1990) . Some assumptions are made to render a simplified model, wit hout loss of pedagogical value. First, (i) the reactor is assumed to be perfectly stirred, such that the concentration of the reactants and the temperature can be considered to be the same anywhere in the reactor, (ii) the temperature of the cooling fluid being pumped in the jacket is c onsidered to be constant, and (iii) the flow of coolant is assumed to be high such that the temperature of the coo ling fluid would not change. This last assumption effectively reduces the size of the model by one st ate. A nonlinear model is used to model the system. A model linearized about a nominal valu e specified by the user is used for the purpose of designing the controller. The reactor is used to convert a reactant A into a product B, where the conversion is given by the elementary reaction AB k The set of nonlinear equations that describe the material and energy balances that take place in the reactor is the following () ()()o oo H ooj pp jj H jojj jjjjdV FF dt dVC FCFCVkC dt VkCUA dVT FTFTTT dtCC dTF UA TTTT dtVVC A AAA A (4-12) where V is the volume of the reactor. The rate of change in the volume of the reactor is given by the difference between the inlet flow Fo, and the outlet flow F. Furthermore, CA is the concentration of the reactant, T is the temperature inside the reactor, and Tj is the temperature of

PAGE 90

90 the cooling fluid in the jacket. The density, , the internal energy U, the heat transfer area AH, and heat capacities C are considered to remain constant throughout the reaction. Due to assumption (iii), it follows that Tj = Tjo, causing the last equati on to be eliminated, and rendering a reduced system of the form () ()()o o o o H oj ppdV FF dt F dC CCkC dtV F UA dTk TTCTT dtVCVC A AAA A (4-13) The values of CAo, To, Fo and Tj can change while the simulation is running and thus they can be considered as perturbations. A linearized model, via Taylor series expansi on (Kreyszig, 1999) is used for the design of the controller. This greatly simplifies the analys is of the plant, although it introduces some error into the system, as the controller performs well near the nominal value for which it was designed, but the behavior cannot be predic ted for operational values far from the nominal value, since the nonlinear model is used to simulate the real behavior of the plant. The linearized model is of the form 2 22()() ()() ()oo o o H j o p o H p pdV F dt FF dC CCVkC dt V V F UA dT TTVTTV dt VVC F UA k CT C VVC A AA A A (4-14)

PAGE 91

91 where V, CA, T, jT, and F are the nominal or steady state values. The deviation variables are denoted by VVV , CCCAA A, TTT , and FFF . It is worth pointing out that due to the fact that a PID controller is used, only one variable can be effectively controlled. Thus the user has the opportunity to select the output to be coupled with the input. Remote and Virtual Laboratories Developed Interconnected Tanks Remote and Virtual Experiments Figure 4-2 shows the two-tank module. Two alte rnatives have been explored to interact with this system. First, using the proprietar y software, Weblab, provi ded by Quanser (2002). , where all the calculations, cont rol, and communications are d one via Simulink (2003) Weblab provides a visual environment to create a human machine interface. Simulink makes use of the Real-Time Windows Target, integrated in Matla b (2003), to establish communication with the physical system. The data is processed in Simuli nk and the control is fe d back to the physical system. At the same time, Simulink broadcasts the data to the interface in Weblab, where a virtual representation and real tim e trending capabilities are availa ble for the user to learn from the system. The second approach developed ma kes use of the simulation toolkit in LabVIEW (2004), along with the Internet publ ishing toolkit. For this altern ative a model of the system is used to simulate its behavior. A virtual repres entation is available to provide the interactivity needed for the user. Figure 4-3 shows the interface for the two-tank module developed in Weblab (Quanser,2002). The interface displays an animati on which is updated in real time to display the current state of the physical system. It also allo ws the user to plot th e history of the system during the experiment. For this specific setup, a PID controller is used to regulate the level in tank 1. The user can change the set-po int as well as the control parameters.

PAGE 92

92 A predictive controller is also implemented in Weblab, for this purpose a discrete-time model of the system is required. The continuous time model in Eq. (4-8) is discretized using a forward step t = kh, where k is the sampling instant and h is the sample step. The discretization yields a system of the form 1 11 1 11(1)1()() 2m pa K g hkhhkhVk AA h (4-15) Figure 4-4 shows the interface for the implementation of a predictive controller based on the predictor form 2, velocity weights, from Chapter 2. For details on the derivation of the predictor and the controller refer to Chapter 2, fo r details on the implementation in Matlab refer to the code included in Appendix A. Th e user can vary the penalty matrices Q and on the states and the input in order to observe the change in behavior in the system. For example a small weight on the inputs will allow the controlle r to make drastic changes, which can lead to saturation on the actuator. The control action smoothes as the input we ight is increased. A larger weight for the states makes the controller r eact more aggressively in the presence of error, while a smaller weight slows down the behavior of th e controller. It is the task of the user to obtain the proper combination of weight s to accomplish a desired behavior. Figure 4-5 shows the Virtual Control Laborator y developed in LabVIE W. The system has five different configurations, here it is shown the case where the feed goes to tank 1 and the level in tank 1 is controlled. Depending in the conf iguration selected by the user the graphical representation changes givi ng the user the opportunity to select th e setpoint directly in the virtual representation, making the in terpretation of the variab les clearer and more intuitive to the user. The virtual representation of the system is updated after every iteration. The user is given information about the system and the control st rategies, as well as an analysis area and

PAGE 93

93 simulation results via different tabs . The advantage of this appro ach is that no physical set up is needed without loss of a “handson” feeling, since the system can contain alarms and errors that mimic the real world, as in this case where an alarm goes off if the tanks start to overflow. Another advantage is that several users can interact with the syst em at the same time, since the server makes a copy of the system for each user. Thus each user running the system concurrently can input different set-points and pa rameters without affecting other users. Another key advantage is the need of minimal software, since only an standard web-browser with support for Active-X (present in most Windows based com puters) is needed. Refer to Appendix C for a detailed explanation of different ta bs and functionality of the VCL. Nonisothermal CSTR VCL The nonisotermal CSTR is implemented usi ng the VCL paradigm. The simplified model is used which reduces the system to three states and one input. Hence, the user has the option of selecting which output variable to couple with the i nput. Namely the close loop containing a PID controller is formed within the selected outpu t ant the input. In Figure 4-6 a screenshot of the interface is presented. As pointed out before, four different configurations are possible, three configurations come from closing the control loop with one of th e outputs, and the fourth one is when the system is operated in a manual config uration. The manual configuration allows the user to vary the outlet flow F to appreciate how the different st ates react to such change. The virtual representation of the system changes to show the connections a nd variables in a more intuitive way. For example, when the concentration of the reactant CA is being controlled, a black needle is visible in the dial, the user then can either modify the set point by moving the black needle, by entering the set point directly into th e box under the dial or by using the generic setpoint interface in the simulation tab. Refer to Appendix C for a thorough explanation of the VCL functionality.

PAGE 94

94 Conclusions and Future Work Two different approaches had been evaluated. Quanser allows for remote experimentation, as the user interface connects to the physical set up, giving the user an accurate representation of the state of the system. The nature of remote experimentation enhances the learning experience as the real system possesses disturbances, perturba tions and noise in the r eadings, which can only be simulated to a certain extent in a virtual experimentation set up. The main problems that this scheme presents are the need of various proprie tary software programs to develop the different module of the remote laboratory. The restriction that on ly one user at the time can interact with the physical setting, while other users can only be spectators. The fashion in which the laboratory is developed does not permit modularity. Hence, every experiment requires to be coded independently. In the othe r hand the use of the virtual cont rol laboratory scheme gives the designer more freedom as to what to include a nd leave out. Offers improve modularity, which greatly reduces the development time. It only requires an standard we b browser to be accessed, and several users can connect simultaneously wit hout interfering with each other. The main disadvantage of the VCL paradigm is that it st rongly depends in the model of the system being used to mimic the real behavior of the system. In cases where a simplified model of a plant is used, valuable dynamical behavior can be left ou t, reducing the learning experience of the user. On the other hand, the ease of development and deployment offers a powerful pedagogical tool. Further work needs to be done in making the VCL code more efficient to improve the response of the visualization and the simulati on. Hands-on testing needs to be addressed by giving students the opportunity to interact with the experiments and su rvey how much their pedagogical experience improve or diminish.

PAGE 95

95 Figure 4-1. The three basic confi gurations for the two-tank module. Figure 4-2. Two-tank module.

PAGE 96

96 Figure 4-3. PID control interface for tank 1.

PAGE 97

97 Figure 4-4. PC control interface for tank 1.

PAGE 98

98 Figure 4-5. The two-tank module VCL interface.

PAGE 99

99 Figure 4-6. Nonisothermal CSTR interface.

PAGE 100

100 CHAPTER 5 CONCLUSIONS AND FUTURE WORK Conclusions This dissertation presents a de tailed analysis of various pred ictive controls schemes, as well as applications. It also explores the feasib ility of using virtual laboratories to improve the pedagogical experience of students in the area of process control. Chapter 2 gives an overview of the history of Predictive Control, to then propose several controller forms. These controllers are analyzed to ensure offset elimination. Offset is a common problem in control applications, where th e process variables do not reach their desired value. For this, one theorem was proposed that pr ovide sufficient conditions to eliminate offset. The validity of these schemes was tested via simulations of known problems in literature and comparing the performance of the different approaches. Chapter 3 makes an extension of the designe d controllers for the case of underactuated systems, namely the Khepera robot and a peni cillin reactor. The aiming distance correction factor is used and shown to be a powerful tool . The performance improvement that the use of the corrected reference vector offered is readil y seen. The aiming distance correction technique can be compared to adding a time varying di sturbance model into the plant dynamics to eliminate offset. Chapter 4 evaluates the possibilities of commercially available tools to maximize the laboratory experience in the cases where no acce ss to the physical set up is possible. Two different approaches were cove red. First a remote experiment ation setup by Quanser. Second, the web publishing capabilities of LabVIEW are expl oited in seeking for a robust infrastructure to enhance the learning experience in the area of process control.

PAGE 101

101 Future Work Several areas of future work are clear. In Chapter 2, str onger conditions that ensure the necessity of the theorem is an obvious area. Development of conditions under which underactuated systems benefit from the use of this control schemes is also desirable. Regarding Chapter 3, the author would suggest the inclusion of other controller sche mes, such as adaptive predictive control or the use of a neural network to correct the refe rence vector instead of the use of an aiming distance correction factor. Finally, further testing needs to be done on the VCLs to ensure a good pedagogical experience. The modular ity of the system needs to be refined as to minimize the changes needed to develop a new VCL. So far only single input single output systems have been explored. It will be interes ting to address the case of a multiple input multiple output plant.

PAGE 102

102 APPENDIX A OFFSET ELIMINATI ON-SUPPORT FILES The simulations are carried out in Matlab. The creation of the matrices for the predictor is automated, such that based on the state space mo del of the plant and th e different horizons the appropriate function is called and the matrices calculated. Position Weights Predictor For the simulations based on the position wei ghts based predictors with and without integrating feedback error the following files are used. The master file PC_Int_driver1.m contains cal ls for all the other files required to run a simulation for a position weights based controller, with or without the addition of integrating states, the parameter “pred” is required in the pl otting subroutine to properly label the plots. A value of 1 in “pred” defines that a controller based on the predictor form 1 or form 2 from Chapter 2 is used. The input file PC_Int_ssinput.m is used to set control, plant, and display parameters for the simulation. The linear time invariant models for the plant and for controller design are established here, as well as the control and prediction horizons, Nc and Np, and the penalty matrices Q and . Initial conditions, consta nt disturbances, and desire d set point value changes and when are they applied are also defined here . Several internal parameters are defined, as “ramp”, where a value of zero defines a step change in the set point and a value of ones sets the desired set point to be a ramp,the parameter “sal var” when defined as 1 saves the plots to hard drive as image files. The augmented matrices needed to create the predictor are built in PC_Int_V1.m. This subroutine uses the model defined for control design to create the matrices of the predictor.. This subroutine is ran only once during the simulation cycle.

PAGE 103

103 Once the augmented matrices for the predictor have been built, the file PC_Int_KV1.m is utilized to create the gain matrix Tk for the controller. This program runs only one time at the beginning of the simulation, since the system is lin ear time invariant, the gain matrix is static, namely it remains constant for any instant in time. The file PC_Int_Loop1.m is in charge of pe rforming the calculations iteratively for the defined simulation time. It cont ains a history built-up section, wh ere the initial values are kept constant for a small period of time, for plotting pu rposes, before the system is let free to evolve dynamically. The duration for the history build-up is defined by the parameter “khyst” contained in the input file. For each iterati on the states of the plant are ca lculated using th e plant model, which can contain a explicit c onstant disturbance depending of the value assigned to the parameter “pkm1 “ in the input file. Once the current states of the plant are obtained the predicted future error is calculat ed and the control input is evalua ted. Finally, a historical record of the states, control input and reference is created, which in turn is used in the plotting subroutine. The support file PC_RS.M creates a future reference vector that is used in the simulation loop to obtain the predicted future error. Based on the configuration define d in the input file, the reference vector is created. This avoids the need of having a reference in put file that contains a priori the whole trajectory. Alt hough it only allows for one se t point change per state. Finally, the file PC_Int_Plot_Res.m creates th e plots by coupling the appropriate reference with its state. Also plots the control inputs and generates an er ror plot for each state in the system. PC_Int_driver1.M clear all close all

PAGE 104

104 pred = 1 ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = % Read the initial and input conditions % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = PC_int_ssinput ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = % Create the matrices A1,A2,A3,A4. % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = PC_int_V1 ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = % Create matrix K. % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = PC_int_KV1 ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = % Execute simulation loop % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = PC_int_LOOP1 ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = % Create the plots % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = PC_int_PLOT_RES ; PC_Int_ssinput.M This is a reusable file, as it is also used as an input file to the simulation for the velocity weights based controller. %SSINPUT.M version 1.0 %Ricardo Gomez-Gonzalez %In this input file the matrices Am, Bm, and Cm of the model %x(k+1) =Amx(k)+Bmu(k); %y(k) =Cmx(k) %are stated. %also the matrices that describe the plant, in case there is a difference %between the plant and the model are stated, where the plant has the form %x(k+1) =Apx(k) + Bpu(k); %y(k) =Cpx(k). %system: two interconected tanks, from Coughanow r, D. Process Systems Analysis and Control. %pg 459 Am = [-3 2;4 -5]; Bm = [1 0;0 2]; Cm = [1 0;0 1]; %Disturbance plant model

PAGE 105

105 Ap = Am; Bp = Bm; Cp = Cm; Bd = ones(length(Ap),1); %Now define the prediction Ny and the control Nu horizon. Ny = 5; Nu = 3;% %Controller wighting functions. qx = [1 1];%the number of elements is equal to the number of rows of Cm, and are %the diagonal elements of the penalty matrix Q lambda = [1 1];%number of elemen ts equal to the number of columns of Bm %Define the total time of the simulation. ttotal = 300; % this time must cons ider the time specified by the user for history %purposes. %Define the moment when the control algorithm will be applied. khyst = 0; %Define a sequence of setpoints or a singl e setpoint in the case of a fixed one. r0 = [0 0];%Initial setpoint, one per variable. rstp = [1 1.5];%Step ch ange in setpoint, one per variable. %if no change is to be applied to one variable fix the value to th e same of the initial setpoint. tstp = [50 60];%The period at which the step change will be applied to the setpoint ramp = 0;% 1 the input is a ramp, 0 the input is a step %Define initial conditions fo r the states variables. x0 = zeros(1,length(Ap));; %the number of columns must be equal to the number of %columns of A. %Define the initial value of the measured variables. y0 = [0 0];%the number of colums mu st be equal to the number of colums of C %Define the initial conditions for the input variables. u0 = [0 0];%the number of columns must be equal to the number of columns of B. %Define the initial error z0 = [0 0]; %Define the initial value of the perturbation. p0 = [0.7];%the number of colums must be equal to the number of colums of Bp. %Define when a perturbation enters the system rps = [0];%change in the initial value of the perturbation

PAGE 106

106 tps = [0];%time when the perturbation will become active. salvar = 1;%1 to save the pl ots to file, 0 not to save them PC_Int_V1.M This file creates the augmented matrices for the pr edictor, that will be used in the next file to create the controller gain matrix. %PC_V1.M v1.0 %Ricardo Gomez-Gonzalez 02/17/2003 % %X =A_hat x(k)+B_hat U %Y =C_hat X % %A_hat R Nyn x n %B_hat R Nyn x Nup %C_hat Nym x Nyn %the integral feedback error model used is %Inputs required %A, B,C, Ny, Nu %Outputs generated %A_hat,B_hat, C_hat, D_hat,G_hat %Internal variables %I, TA, TB, rA, cA, rB, cB, j,k [rA,cA] = size(Am) ; [rB,cB] = size(Bm) ; [rC,cC] = size(Cm) ; TA = [] ; TB = [] ; TC = [] ; A_hat = [] ; B_hat = [] ; C_hat = [] ; A2p = [] ; Ic = eye(rC) ; Zc = zeros(rC,cC) ; for j = 1:Ny ; TA = (Am^j) ; TB = (Am^(j-1))*Bm ; A_hat = [A_hat;TA] ; A2p = [A2p;TB] ; TC = [] ;

PAGE 107

107 for k = 1:Ny ; if j = =k ; TC = [TC;Cm] ; else TC = [TC;Zc] ; end ; end ; C_hat = [C_hat TC] ; end ; %Up to this point matrices A_hat, C_hat are ready, as well as the first %column of matrix B_hat TB = zeros(rB,cB) ; [rA,cA] = size(A2p) ; for j = 1:Nu ; B_hat = [B_hat A2p] ; for k = rA:-1:(rA rB + 1) ; A2p(k,:) = [] ; end ; A2p = [TB;A2p] ; end ; clear TA TB A2p TC Ic rA rB rC cA cB cC Zc j k ; PC_Int_KV1.M %PC_KV1.M v1.0 %Ricardo Gomez-Gonzalez 02/17/03 %This file calculates the matrix K of the controller % U = Kx(r-Xo) %For the predictor form 1 and 1b the matrix K is given by %K = inv(B_hat'*C_hat'(Qx) *C_hat * B_hat + L) %Kx = K * B_hat' * C_hat' * Qx %K R (Nc m) x (Np n) [rC,cC] = size(C_hat) ; [rB,cB] = size(B_hat) ; Qx = []; L = []; for m =1:Ny Qx = [Qx qx]; end; for m =1:Nu L = [L lambda]; end Qx = diag(Qx); L = diag(L);

PAGE 108

108 K1 = G_hat'*Qz*G_hat + Qx ; K1 = B_hat'*C_hat'*K1*C_hat*B_hat; K = inv(K1 + L) ; Kx = K*B_hat'*C_hat'*Qx ; [rB,cB] = size(Bm) ; %since only the first element is appl ed only the first p rows are used. KTx = Kx(1:cB,:) ; clear rB rC cB cC K1 K m ; PC_Int_Loop1.M %PC_LOOP1.M v1.0 %Ricardo Gomez-Gonzalez 02/19/03 % %This file calculates the histor y of the system, and after that %calculates the states an d the control input that needs to be applied. %This file applies to the predictor form 1 and 1b %initialize the history vector with the initial conditions uhist = [u0] ; xhist = [x0] ; yhist = [y0] ; rhist = [r0] ; phist = [p0] ; xkm1 = x0' ; ukm1 = u0' ; rkm1 = r0' ; pkm1 = p0' ; %Run the loop to create some history before applying the control scheme. for j = 0:khyst %calculate r pc_rs ; uhist = [uhist;u0] ; xhist = [xhist;x0] ; yhist = [yhist;y0] ; rhist = [rhist;rt(1,:)] ; rkm1 = rt(1,:)' ; phist = [phist;p0] ; end ; for j = khyst+1:ttotal pc_rs ;

PAGE 109

109 %get a sample, use the plant model Xp = Ap*xkm1 + Bp*ukm1 + Bd*pkm1 ; %calculate the value of the model Xmod = Am*xkm1 + Bm*ukm1 ; %Calculate Xhat0 and Z_hat0 Xhat0 = C_hat*A_hat*Xp ; Yk = Cp*Xp ; %calculate U U = KTx*(rs-Xhat0); %update history uhist = [uhist;U'] ; xhist = [xhist;Xp'] ; yhist = [yhist;Yk'] ; rhist = [rhist;rt(1,:)] ; xkm1 = Xp ; ukm1 = U ; rkm1 = rt(1,:)' ; end ; clear xkm1 ukm1 rkm1 pkm1 rt rs U Xp Xmod Xhat0 Yk PC_RS.M %This file calculates the matrix Rt. [rr,cr] = size(r0) ; rt = zeros(Ny,cr) ;%This is Np x n, this has to be changged to Npnx1 for m = 1:Ny ; if j < khyst ; rt(m,:) = r0 ; else ; for n = 1:cr ; temp = tstp(n) ; if j < temp ; rt(m,n) = r0(n) ; else if ramp==1 rt(m,n)= r0(n)+j-khyst+m ; else rt(m,n) = rstp(n) ; end end ; end ; end; ;

PAGE 110

110 end ; for m = 1:Ny ; if m == 1 ; rs = rt(m,:)' ; else rs = [rs;rt(m,:)'] ; end ; end ; clear rr cr m n temp PC_Int_Plot_Res.M %PC_PLOT_RES.M v1.0 %Ricardo Gomez-Gonzalez 02/20/03 % %This M-file plot the outputs vs time, %the step input function vs time, %and the inputs vs time % % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = %clear all previous plots % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = hold off ; close all ; lw =1; [rpl,cpl] = size(rhist) ; nopl = 100 * (cpl+1) ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = %separates the matrices %into 2 vectors % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = [ra,ca] = size(yhist) ; for j = 1:ra ; if j = = 1 ; kvx = [0] ; else kvx = [kvx;j-1] ; end ; end ; numero = nopl + 10 ; xmin = min(min(yhist)) ;

PAGE 111

111 xmax = max(max(yhist)) ; rmin = min(min(rhist)) ; rmax = max(max(rhist)) ; plmin = min(xmin,rmin) ; plmax = max(xmax,rmax) ; if pred = = 1 ; txt3 = 'Error in Position weight based predictor outputs' ; txt1 = 'Position weight '; end ; else txt3 = 'Error in Velocity weight based predictor outputs' ; txt1 = 'Velocity weight'; end ; title(txt1); % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = %Plot the pairs R-X. % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = for j = 1:cpl numero = numero + 1 ; H = subplot(numero) ; Xpl = yhist(:,j) ; Rpl = rhist(:,j) ; hold on stairs(kvx,Xpl,'-k') ; stairs(kvx,Rpl,'--k') ; grid; hold off axis([0 ra-1 plmin plmax*1.1]) ; txt2 = [] ; xtr = num2str(j) ; car = ['x_',xtr] ; txt2 = [car] ; car = ['r_',xtr] ; txt2 = [txt2;car] ; car = ['x_',xtr] ; ylabel(car) ; legend(txt2,2) ; if j = = 1 title(txt1) ; end ; end ; % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

PAGE 112

112 %Plot the input U % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = umin = min(min(uhist)) ; umax = max(max(uhist)) ; numero = numero + 1 ; subplot(numero) ; [rb,cb] = size(uhist) ; hold on stairs(kvx,uhist(:,1),'-k') ; stairs(kvx,uhist(:,2),'--k') ; grid; hold off axis([0 ra-1 umin umax*1.1]) ; xlabel('Time') ; txt2 = [] ; [rb,cb] = size(uhist) ; for j = 1:cb ; xtr = num2str(j) ; car = ['u_',xtr] ; if j = = 1 ; txt2 = [car] ; else txt2 = [txt2;car] ; end ; end ; ylabel('u') ; legend(txt2,2) ; if salvar = =1 if pred = =1 if d = =0 print -djpeg pred1-nvw-nif else print -djpeg pred1-nvw-if end else if d = =0 print -djpeg pred2-vw-nif else print -djpeg pred2-vw-if end end end %Plot the error on x1 and x2 h =figure;

PAGE 113

113 nop2 = 100 * (cpl) ; numero = nop2 + 10 ; for j = 1:cpl numero = numero + 1 ; H = subplot(numero) ; err = abs(yhist(: ,j)-rhist(:,j)) ; ermin = min(err)-1 ; ermax = max(err)+1 ; hold on stairs(kvx,err,'-k') ; grid; hold off axis([0 ra-1 ermin ermax]) ; txt2 = [] ; xtr = num2str(j) ; car = ['e_x_r_',xtr] ; txt2 = [car] ; ylabel(car) ; legend(txt2,2) ; if j = = 1 title(txt3) ; end ; end ; if salvar = =1 if pred = =1 print -djpeg pred1-err else print -djpeg pred2-err end end clear car txt2 txt1 cpl txt3 umin um ax xmax xmin rmin rmax rpl ; clear ermin ermax ra rb ca cb numero nop1 plmin plmax nop2 xtr Velocity Weights Predictor The driver file and the simulation loop file are analogous to the ones presented for the position weights predictor and will be omitted. Th e input file, the plot generating file, and the file to dynamically create the augmented refere nce vector are the same, and will be omitted as well.

PAGE 114

114 The files PC_Int_V2.m and PC_Int_KV2.m have similar functionality that the ones described in the previous sect ion, but are adapted for the cont roller design based on velocity weights. PC_Int_V2.M %Ricardo Gomez-Gonzalez 08-2005 % %X =A_hat x(k)+E_hat * x(k-1) + B_hat dU %Y =C_hat X % %A_hat R Nyn x n %B_hat R Nyn x Nup %C_hat Nym x Nyn %Inputs required %A, B,C, Ny, Nu %Outputs generated %A_hat,B_hat, C_hat, D_hat,G_hat, E_hat %Internal variables %I, TA, TB, rA, cA, rB, cB, j,k [rA,cA] = size(Am) ; [rB,cB] = size(Bm) ; [rC,cC] = size(Cm) ; TA = zeros(rA) ; TB = [] ; TC = [] ; A_hat = [] ; B_hat = [] ; C_hat = [] ; %creating temporary matr ices phi_inv, a_ob, a_ub, b_b Phi_inv = [] ; A_ob = [] ; A_ub = [] ; B_b = [] ; Pt = [] ; Za = zeros(rA) ; Zb = zeros(rB,cB) ; for j = 1:Ny ; TA = TA+(Am^(j-1)) ; Pt = [Pt;TA] ;

PAGE 115

115 switch j case 1 A_ob = [A_ob; (Am+eye(rA))] ; A_ub = [A_ub; -Am] ; case 2 A_ob = [A_ob; -Am] ; A_ub = [A_ub; Za] ; otherwise A_ob = [A_ob;Za] ; A_ub = [A_ub;Za] ; end ; B_bp = [] ; for k = 1:Nu if j = =k B_bp = [B_bp Bm] ; else B_bp = [B_bp Zb] ; end end B_b = [B_b;B_bp] ; %the procedure for creating C_hat remains unchanged TC = [] ; Zc = zeros(rC,cC) ; for k = 1:Ny ; if j = =k ; TC = [TC;Cm] ; else TC = [TC;Zc] ; end ; end ; C_hat = [C_hat TC] ; end ; %Up to this point the first n column s of the matrix phi_inv are formed %as well as A_ob, A_ub and B_b [rp,cp] = size(Pt) ; for j = 1:Ny Phi_inv = [Phi_inv Pt] ; for k = rp:-1:(rp rA +1) Pt(k,:) = [] ; end

PAGE 116

116 Pt = [Za;Pt] ; end A_hat = Phi_inv* A_ob ; E_hat = Phi_inv*A_ub ; B_hat = Phi_inv*B_b ; % clear TA TB rA rB cA cB Zc Za Zb Pt ; % clear Phi_inv A_ob A_ub B_b Pt clear A2p TC Ic rC cC ; PC_Int_KV2.M %This file calculates the matrix K of the controller % dU = Kx(r-C_hat(A_hat*x(k)+E_hat*x(k-1 %For the predictor form 1 and 1b the matrix K is given by %K = inv(B_hat'*C_hat'(Qx) *C_hat * B_hat + L) %Kx = K * B_hat' * C_hat' * Qx %K R Npp x Npn [rC,cC] = size(C_hat) ; [rB,cB] = size(B_hat) ; % Qx = qx*eye(rC) ;% R Nym x Nym % L = lambda*eye(cB) ;% R Nup x Nup Qx = []; L = []; for m =1:Ny Qx = [Qx qx]; end; for m =1:Nu L = [L lambda]; end Qx = diag(Qx); L = diag(L); K1 = G_hat'*Qz*G_hat + Qx ; K1 = B_hat'*C_hat'*K1*C_hat*B_hat; K = inv(K1 + L) ; Kx = K*B_hat'*C_hat'*Qx ; [rB,cB] = size(Bm) ; %since only the first element is appl ed only the first p rows are used. KTx = Kx(1:cB,:) ; clear rB rC cB cC K1 K m ;

PAGE 117

117 APPENDIX B TIME-VARYING PREDICTOR DERIVATION The predictors derived in Chapter 2 are for linear time invariant systems. For the more general cases of time varying and nonlinear systems the predictor matrices take a slightly different form as the sampling time has to be cons idered in their derivation given that the model evolves with time. It is assumed that the fo rm of the matrices is known at any time instant; otherwise the proposed appr oach is not applicable. Predictor Derivation Here the derivation for a predictor based on position weights and a predictor based on velocity weights is shown, for the plant model (1)()()()()kkkkk xAxBu (B-1) where ()nk x , ()mk u , ()nnk A , and ()nmk B . Predictor based on Position Weights Let Np be the prediction horizon and define (1) (2) ()pk k kN x x x x (B-2) where x ( k + j ) represents a state vector from Eq. (B-1) and p Nnx

PAGE 118

118 Then the predictor in matrix form is given by 0 12() (1) (1)() (2) () () () () ()()(1) ()()()(1)()(1)p c pppp iN N c iNiNiNk k kAk k k ki kN k kkk kikkikkikN x AA x A x x A x B00 ABB0 ABABAB () (1) (1)ck k kN u Bu u u (B-3) where cNmu, pNnn A, and p cNnNm B. Detailed Derivation of Position Weights Based Predictor The state vector at instant k +2 is (2)(1)(1)(1)(1) (1)(()()()())(1)(1) kkkkk kkkkkkk xAxBu AAxBuBu (B-4) Carrying out the matrix multiplication yields (2)(1)()()(1)()()(1)(1) kkkkkkkkk xAAxABuBu (B-5) For the instant k +3, the state vector is (3)(2)(2)(2)(2) (2)((1)()()(1)()() (1)(1))(2)(2)kkkkk kkkkkkk kkkk xAxBu AAAxABu BuBu (B-6)

PAGE 119

119 Proceeding as before yields (3)(2)(1)()()(2)(1)()() (2)(1)(1)(2)(2)kkkkkkkkk kkkkk xAAAxAABu ABuBu (B-7) Analogously, for the k + Np element the state vector becomes 01 2()()()()()() ()(1)(1)()(1)(1)pp c ppp iNiN N cc iNiNkNkikkikk kikkkikNkN xAxABu ABuABu (B-8) Equation (B-1), Eq. (B-5), Eq. (B-7), and Eq. (B-8) are combined in matrix form to give Eq. (B-3). Predictor based on Velocity Weights. Consider the system described by Eq. (B-1), let Np be the prediction horizon, and define (1) (2) ()pk k kN x x x x where p Nnx Then, the predictor takes the form 1111()(1)(1)kkk xAxExBuFu (B-9) where

PAGE 120

120 22 1 12 22 11 12 11(1) ()() ()()(1)pp pp pp ppNN ii ii jNjN NN ii p ii jNjNk kjkj kjkjkN I000 AII00 IAIAI0 IAIAAII (B-10) () () k k AI A A 0 0 , (1) k A 0 E 0 0 , () (1) (2) (1)p pk k kN kN B B F B B , () (1)(1) (2)(2)(2) (1)(1)(1)(1)ppp ppppk kk kNkNkN kNkNkNkN B000 BB00 B BBB0 BBBB for dimensional consistency with the predic tors derived in Chapter 2, the matrix B is truncated an only the first Nc columns are used, which account fo r the control horizon. Where the dimensions of the augmented matrices are cNm u,pNnn A, pNnn E, p cNnNm B, pNnm F, and 1 p pNnNn . Detailed Derivation of Velocity Weights Based Predictor Define the input increment ()k u as ()()(1)kkk uuu (B-11) Now, start with the systemin Eq. (B-1) at time k , namely

PAGE 121

121 (1)()()()() kkkkk xAxBu (B-12) Subtracting from it the model evaluated at time k -1 ()(1)(1)(1)(1) kkkkk xAxBu (B-13) and rearranging terms, yields (1)(())()(1)(1)()()()(1) kkkkkkkkk xAIxAxBuBu (B-14) At time instant k +2, the state is given by (2)((1))(1)()()(1)(1)(1)() ((1))(1)()()(1)(1) (1)()(1)(1) kkkkkkkkk kkkkkk kkkk xAIxAxBuBu AIxAxBu BuBu (B-15) To obtain the states at instant k +3, the following equations is used (3)((2))(2)(1)(1)(2)(2)(2)(1) ((2))(2)(1)(1)(2)(2) (2)(1)(2)()(2)(1) kkkkkkkkk kkkkkk kkkkkk xAIxAxBuBu AIxAxBu BuBuBu (B-16) Analogously, at the time instant k + Np the system results in ()((1))(1)(2)(2) (1)(1)(1)(2) (1)()(1)(1)ppppp pppc ppkNkNkNkNkN kNkNkNkN kNkkNk xAIxAx BuBu BuBu (B-17) Combining Eq. (B-14), Eq. (B-15), Eq. (B-16), and Eq. (B-17) in matrix form gives

PAGE 122

122 (1) (1) (2)(1)(2) (3)(1)(2)(3) ()(2)(1)(pppk k kkk kkkk kNkNkNk xDx000000x xAI00000x xAAI0000x x000AAI0x ) () ()(1) (1) () (2) ()(1)(1) (1) () (1)(1) (2) p pN k kk k k k xkkk kN k kk k AE FB AIA B A0 B xu 00 B 00 B000 BB00 BB () (1) (2)(2)(2) ()()()()(1)pppppk k kkk kNkNkNkNkN Buu u B0u BBBBu (B-18) where p Nm u, pNnn A, pNnn E, pNnm F, p pNnNm B, and p pNnNn D. Rearranging terms gives (1) (1)(2) (1)(2)(3) (2)(1)()pppk kk kkk kNkNkN xI00000x AII0000x AAII000x 000AAIIx ()(1)(1) kkk AxExBuFu (B-19) where the inverse of is given by Eq. (B-10). Carrying out the multiplication of Eq. (B-19) by Eq. (B-10) results in

PAGE 123

123 1111()(1)(1) kkk xAxExBuFu (B-20) Now, defining 1 AA , 1 EE , 1 BB , and 1 FF . (B-21) And substituting the matrices defined in Eq. (B-21) into Eq. (B-20) yields the predictor ()(1)(1) kkk xAxExBuFu (B-22) Matlab Files Several functions are coded in Matlab to generate the required augmented matrices for the controller. Also a function, PC _CreateRThat.m, that updates the reference trajecto ry, in case the Aiming-distance correction is applied, is coded to generate a reference vector used in the calculation of the control input. A single function, PC_AkBkEFdghat. m, is used to calculate the augmented matrices for both predictors; position wei ghts and velocity weights. It also calculates the augmented matrices for an integrating feedback error model independently of the predictor form. Two support functions ar e utilized by the previous fu nction, PC_CreateAkAkm1.m is responsible for calculating the valu es of the model dynamic matrix A for the given prediction horizon and for the previous instan t in time. Finally, the function PC_CreateBDB.m is used to generate the input matrix B for the different instants in time of the prediction horizon, as well as the change of the matrix B between consecutive instants, namely the B terms contained in the matrix F as defined in Eq. (B-18). Notice that the last tw o functions contain a explicit expression of the matrices A and B given by the model used for c ontrol design. These functions need to be adapted to the dynamics of the system under study. In the ca se presented here the equations for the penicillin reactor are used.

PAGE 124

124 PC_AkBkEFdghat.M function [Ahat,Bhat,Ehat,Fhat,Dhat,Ghat] = pc_AkBkEFdghat(A,Akm1,B,DB,Np,Nc,n,p,dif) %This function calculates the augmented matrices for the predictors for a %system of the form x(k+1) = A(k)x(k)+B(k)u(k) %the first predictor is of the form %X = Ahat(k+i)x(k)+Bhat(k+i)U %the second predicto r is of the form %X = Ahat(k+i)x(k)+Ehat(k+i)x(k-1)+Bhat(k+i)dU+Fhat(k+i)u(k-1) %the parameters are as follow %n is the number of states %p is the number of inputs %Np is the prediction horizon %Nc is the c ontrol horizon %A is Np*n x n, it contains the matrix A evaluated at every instant of the %prediction horizon %B is Np*n x p, it contains the matrix B evaluated at every sample of the %prediction horizon %DB is Np*n x p, it contains the diffe rence of the matrix B evaluated at %two consecutive samples, namely dB(k) = B(k)-B(k-1). Ahat = []; Bhat = []; Ehat = []; Fhat = []; Dhat = []; Ghat = []; [rA,cA] = size(A); [rB,cB] = size(B); %Define Ghat and Dhat %Z = Dhat z(k+1) +Ghat*rhat-Ghat*xhat %this part is the same for both forms Ic = eye(n); Tc = zeros(n); A2p = []; for i = 1:Np A2p = []; for k = 1:Np if k< = i A2p = [A2p;Tc]; else A2p = [A2p;Ic]; end end

PAGE 125

125 Ghat = [Ghat A2p]; Dhat = [Dhat;Ic]; end clear A2p Tc Ic %Define Ahat, Bhat and Ehat %the parameter dif decides if the mode l is going to have velocity weights %of not %dif = 0 : X = Ahat*x(k)+Bhat(k)*U %dif = 1 : X = Ahat*x(k)+Ehat*x(k-1)+Bha t(k)*dU+Fhat(k)*u(k-1) if dif = = 0 TA = eye(n); for i = 1:Np TA = TA*A((i*n)-(n-1):(i*n),:); Ahat = [Ahat;TA]; end Zb = zeros(n,p); Bb = []; for i = 1:Nc TB = []; Bb = B((i*n-(n-1)):i*n,:); for j = 1:Np if j> = i TB = [TB;Bb]; Bb = A((j*n) -(n-1):j*n,:)*Bb; else TB = [TB;Zb]; end end Bhat = [Bhat TB]; end Ehat = zeros(Np*n,n); Fhat = zeros(Np*n,Nc*p); else phi = []; A_ob = []; A_ub = []; Za = zeros(n); Ia = eye(n); Zb = zeros(n,p);

PAGE 126

126 B2 = []; B3 = []; B_b = []; Ak = A(1:n,:); for j = 1:Np %calculation of A_ob and A_ub switch j case 1 A_ob = [A_ob;Ak+Ia]; A_ub = [A_ub;-Akm1]; case 2 A_ob = [A_ob;-Ak]; A_ub = [A_ub;Za]; otherwise A_ob = [A_ob;Za]; A_ub = [A_ub;Za]; end %calculation of B_b B2 = DB((rA*j)-(rA-1):rA*j,:); B3 = B((rA*j)-(rA-1):rA*j,:); TB = []; for i = 1:Nc if j = = i TB = [TB B3]; elseif j>i TB = [TB B2]; else TB = [TB Zb]; end end B_b = [B_b;TB]; %calculation of matrix phi TA = Za; A2 = []; for k = 1:Np if k> = j TA = TA + Ia; A2 = [A2; TA]; TA = A((n*k)-(n-1):k*n,:)*TA; else A2 = [A2;Za]; end

PAGE 127

127 end phi = [phi A2]; end Ahat = phi*A_ob; Ehat = phi*A_ub; Bhat = phi*B_b; Fhat = phi*DB; end %end else PC_CreateAkAkm1.M function [A,Akm1]=pc_createAkAk m1(X_b,X_bkm1,Np,h,param,Yx) %this function creates matr ices A and Akm1 for several values of theta. %it uses the nonlinear model based on straight lines. %param contains all the plant parame ters, namely [miu_m,Km,Ki,Yp,niu] A = []; Akm1 = []; %each column of the matrix X_b cont ains all the values of the states, %either given measured from the plant, ei ther predicted or based on the reference. %the states are X, S, P, V for i=1:Np miuk = param(1)*X _b(2,i)/(param(2)+X_b(2,i)+(X_b(2,i)^2/param(3))); uno = miuk*h+1; dos = -h*((miuk/Yx)+(param(5)/param(4))); tres = h*param(5); A = [A;uno 0 0 0]; A = [A;dos 1 0 0]; A = [A;tres 0 1 0]; A = [A;0 0 0 1]; end miuk = param(1)*X _bkm1(2)/(param(2)+X_bkm1(2)+(X_bkm1(2)^2/param(3))); uno = miuk*h+1; dos = -h*((miuk/Yx)+(param(5)/param(4))); tres = h*param(5); Akm1 = [Akm1;uno 0 0 0]; Akm1 = [Akm1;dos 1 0 0]; Akm1 = [Akm1;tres 0 1 0]; Akm1 = [Akm1;0 0 0 1];

PAGE 128

128 PC_CreateBDB.M function [B,DB]=pc_createBDB(X_b,X_bkm1,Np,h,S_in, S_inkm1) %this function creates matri ces B and DB for several values of the states. %it uses the nonlinear model based on straight lines. B = []; DB = []; X_a = [X_bkm1 X_b]; %each column of the matrix X_a cont ains all the values of the states, %either given measured from the plant, ei ther predicted or based on the reference. %the states are X, S, P, V for i=2:Np+1 uno = X_a(1,i)/X_a(4,i); dos = (S_inX_a(2,i))/X_a(4,i); tres = -X_a(3,i)/X_a(4,i); cuatro = 1; B = [B;uno;dos;tres;cuatro]; duno = uno + (X_a(1,i-1)/X_a(4,i-1)); if i == 2 ddos= dos ((S_inkm1X_a(2,i-1))/X_a(4,i-1)); else ddos= dos ((S_inX_a(2,i-1))/X_a(4,i-1)); end; dtres = tres + (X_a(3,i-1)/X_a(4,i-1)); dcuatro = 0; DB = [DB;duno;ddos;dtres;dcuatro]; end B = h*B; DB = h*DB; PC_CreateRThat.M function [rhat,X_b]=pc_create_rthat(r ef,ind,Np,Vk,n,xk_real,refangles,nr); %in case refangles is corrected rhat=[]; if refangles ==1 X_b=[xk_real]; ref_ind = ref(:,ind+nr); d_x=( ref_ind(1)-xk_real(1))/nr; d_s=(ref_ind(2)-xk_real(2))/nr; d_p=(ref_ind(3)-xk_real(3))/nr;

PAGE 129

129 for i = 1:nr p_x=xk_real(1)+d_x*i; p_s=xk_real(2)+d_s*i; p_p=xk_real(3)+d_p*i; p_v=Vk; P_temp=[p_x p_s p_p p_v]'; rhat=[rhat;P_temp]; X_b=[X_b P_temp]; end X_b=[X_b ref(:,ind+nr+1:ind+Np-1)]; X_b(4,:)=Vk; for i=nr+1:Np rhat=[rhat; ref(:,ind+i)]; end; else X_b=[ref(:,ind+2:ind+Np)]; for i = 1: Np-1 X_b(4,i)=Vk; end X_b=[xk_real X_b]; for i=1:Np rhat=[rhat;ref(:,ind+i)]; end end

PAGE 130

130 APPENDIX C VIRTUAL CONTROL LABORATO RY-DETAILED DESCRIPTION The functionality of the virtual control laboratory, VCL, is covered in detail in this appendix. The two experiments presented in Chapter 4 are reviewed in depth. Interconnected Tanks System Configurations Four different automatic configurations can be used with the system, depending on how the inlet stream is fed into the tanks, and which level is to be controlled. Besides the control configuration, there is also the physical configuration, which estab lishes the size of the outlets in each tank. This has a strong effect in the mass ba lance, and as a consequence in how aggressive the controller must be to cope with the requirements. Figure C-1, Figure C-2, Figur e C-3, Figure C-4, and Figur e C-5 show the 5 possible configurations. The flow in the pipes is shown in blue, for example when the feed goes only into Tank 1, the pipe going into Tank 2 appears in grey. When the feed goes to both tanks, the percentage of flow that goes to each tank can be modified directly by typing the percentage in the box on top of the valve or in the Plant c onfiguration parameters area. The connection between the control variable a nd the process variable is show n graphically by the connecting solid lines; when the system is in manual contro l mode no connection is shown. The set point of the process variable that is be ing controlled can be adjusted directly by moving the black bar indicator in the appropriate tank, which is only shown in the tank under control. The set point can also be input into the system interface to the left of the plant animation, or in the simulation screen. Figure C-6 presents the user with a several para meters that can be mani pulated. In the top part, the parameters that control the physical setu p of the plant are available. Here the user can

PAGE 131

131 select the size of the outlet for each tank. The va riable to be controlled and how the feed will be distributed. The bottom part presen ts the controller configuration ar ea. Here the user can select to use P, PI, PD or PID contro l by selecting the appropr iate buttons, and typi ng the values of the controller parameters. If the Auto button is off, the system will go automatically into manual mode. Help, Analysis, and Simulation Figure C-7 shows the help screen. Here info rmation about the cont rol technique, and any detail about the use of the inte rface is explained to the user. In Figure C-8 the dynamics of the plant are explained, so that th e user can get a better understandi ng of the physical system. Also the model is presented here, and the different configurations that the user can select for the plant. Based on the selected configurati on a transfer function is calculat ed and the zeros and poles of it are plotted. The user can utilize this informa tion when deciding how aggressive or conservative the controller should be. Figure C9 presents a description of the control technique under use, it also displays a transfer function for the selected controller form and creates a Bode plot to help in the analysis of the controller behavior. The information presented independently in Figure C-8 and Figure C-9 comes together in Figure C-10, where the analysis tab is presented. Here, depending on the configuration of the system. The user can select to analyze the behavior of the closed loop or open loop dynamics of the de sired process variable and the controller. Figure C-11 presents the simulation interface, the variables of the system are presented in a box in the lower left side of the screen, each vari able has a unique color that matches the one in the plot that displays the state of the system. The slider bar in the lower right side, allow for manipulation of either the set point of the controlled variable or control of the voltage to the motor, in the case when the system is in manual. Several forms of set point can be chosen, for example a sine function, for which amplitude and frequency can be selected accordingly.

PAGE 132

132 Non-Isothermal CSTR System System Animation Similar to the two interconnected tanks system , the CSTR presents the user with several configurations to select from. The user can chose to control the level of the reactor, the temperature inside the reactor, or the concentrat ion of the reactant. Figure C-12, Figure C-13 and Figure C-14 show the connectio ns for these configurations. Note that depending on the case of the configuration to use, th e wires connecting the control box and the system change, also the displays change to accommodate setpoint selecti on for the controlled variable. For example in Figure C-13 a black needle in the concentration dial shows up. The user can move the needle to select a different setpoint for it. Figure C-15 shows the manual configuration, where the user decides how much to open the outlet valve of the reactor. Configuration Area Below the animation area is the configuration panels. There are three tabs to configure the system. Figure C-16 presents the user with the specifics of the controller to be used, there the user can decide if a P, PI, PD or PID controller is to be used and whic h values the controller parameters will be. In case the auto button is deselected the system goes automatically into manual mode. Figure C-17 shows tab where the parame ters values specific to the system can be changed. If these values ar e changed during the simulation, the system will update them, considering the change as a consta nt disturbance. The third tab, Figure C-18, allows the user to select the nominal or steady state values of the system. These values are used during the linearization process required by the plant and anal ysis screens. Also it presents the user with a menu to select the variable to be controlled, name ly the concentration, temperature or level in the reactor.

PAGE 133

133 Analysis and Simulation The help, plant and controller tabs are analogous to the ones presented for the two interconnected tanks system. Hence they are no t be included for the sake of brevity. The analysis tab is shown in Figure C19. For a given choice of controll er, the user can decide to pair it with the three different states to see the behavi or of them. This is done with the aide of the selector menus under the transfer function. Th e analysis plots are updated accordingly to the selection. The simulation panel is similar to th e one for the two intercon nected tanks, and it is shown in Figure C-20. The order of the elements is slightly different, but the functionality is the same, namely the user can vary the setpoint usi ng the slider rule, and ev en use a function, like a sine or a saw toot h, as setpoint. Figure C-1. The feed goes to tank 1. The controlled variable is level 1.

PAGE 134

134 Figure C-2. The feed is being split between tank s 1 and 2. Level 1 is the controlled variable.

PAGE 135

135 Figure C-3. Tank 1 feeds tank 2. Level 2 is the variable to be controlled.

PAGE 136

136 Figure C-4. The feed is being di stributed between tanks 1 and 2. The variable to control is the level of the bottom tank, or level 2.

PAGE 137

137 Figure C-5. Manual control. The user decides where the feed goes and adjusts the pump voltage manually.

PAGE 138

138 Figure C-6. Parameter configuration area. The top part is concer ned with the physical configuration. The bottom part configures the controller.

PAGE 139

139 Figure C-7. Help tab.

PAGE 140

140 Figure C-8. Plant information tab.

PAGE 141

141 Figure C-9. Controller information tab.

PAGE 142

142 Figure C-10. Plant – controller analysis tab.

PAGE 143

143 Figure C-11. Simulation area.

PAGE 144

144 Figure C-12. Level control.

PAGE 145

145 Figure C-13. Concentration control.

PAGE 146

146 Figure C-14. Temperature control.

PAGE 147

147 Figure C-15. Manual configuration.

PAGE 148

148 Figure C-16. Controller configuration tab. Figure C-17. Parameters setup tab.

PAGE 149

149 Figure C-18. Plant configuration tab.

PAGE 150

150 Figure C-19. Analysis area.

PAGE 151

151 Figure C-20. Simulation screen

PAGE 152

152 LIST OF REFERENCES Aicardi M, Casalino G, Bicchi A, Balestrino A. Closed Loop Steer ing of Unicycle-like Vehicles via Lyapunov Techniques. IEEE Robotics and Automation Magazine . 1995; 2(1): 27-35. Banning R, de Koning WL, Adriaens HJMTA, Koops RK. State-space Analysis and Identification for a Class of Hysteretic Systems. Automatica . 2001; 37:1883-1892. Berlin F, Frank PM. Robust Predictive Robot Control – Internal Report . Duisburg, Germany: University of Duisburg; 1991. Bicchi A, Casalino G, Santilli C. Planning Shor test Bounded-Curvature Paths for a Class of Nonholonomic Vehicles among Obstacles. Journal of Intelligen t and Robotic Systems . 1996;16: 387-405. Brockett RW. Asymptotic Stability and Feedback St abilization. In: Brockett, R, Millman, R.S.; Sussmann, H.J., eds. Differential Geometric Control Theory . Boston, Mass. Birkhuser; 1983; 181-191. Camacho EF, Bordons C. Model Predictive Control in the Process Industry . London, GB: Springer-Verlag;1995. Coughanowr DR. Process Systems Analysis and Control . 2nd ed. New York, NY: McGraw-Hill International; 1991. Curtis JW, Beard R W. A Model-Predictive Satisficing Approach to a Nonlinear Tracking Problem. In: Proc. of the 40th IEEE Conf erence on Decision and Control . Orlando, FL. 2001; 1: 491-495. Dixon WE, Dawson DM, Zhang F, Zergeroglu E. Global Exponential Tracking Control of a Mobile Robot System via a PE Condition. In: Proceedings. of the 38th Conference on Decision and Control . Phoenix, AZ. 1999; 5: 4822-4827. Gillet D, Geoffroy F, Zeramdini K, Nguyen AV, Rekik Y, Piguet Y. The Cockpit: An Effective Metaphor for Web-based Experimenta tion in Engineering Education. International Journal of Engineering Education . 2003, 19 (3): 389-397. Gillet D, Latchman HD, Salzmann C, Crisal le OD. Hands-On Laboratory Experiments in Flexible and Distance Learning. Journal of Engineering Education . 2001; 90 (2): 187-191. Herrera J, Trajectory Tacking through Predicti ve Control – Projet de Diplome [dissertation]. Lausanne, Switzerland: IA-EPFL;1999. Howell JR. Some Classes of Step-re sponse Models without Extrema. Automatica . 1997; 33: 1427-1428. Hu H, Brady M, Probert P. Trajectory Planni ng and Optimal Tracking for an Industrial Mobile Robot. SPIE Mobile Robots VIII . 1993; 2058: 152-163.

PAGE 153

153 Huang SJ, Hu CF. Predictive Fuzzy Contro ller for Robotic Motion Control. In: Conference Record IAS Annual Meeting (IEEE Industry Applications Society) . Orlando, FL. 1995; 2: 1668-1672. Huang S, Ren W. Longitudinal Control with Time Delay in Platooning. In: IEE Proceedings: Control Theory and Applications . London, United Kingdom. 1998; 145 (2): 211-217. Huang S, Ren W. Vehicle Longitudinal Control using Throttles and Brakes. Robotics and Autonomous Systems . 1996; 26 (4): 241-253. Indiveri G. Kinematic Time-Invariant Control of a Nonholonomic Vehicle. In: Proceedings of the 38th Conference on Decision and Control . Phoenix, AZ. 1999; 3: 2112-2117. Jeng JT, Shih CL, Lee TT. Mixing Input-Output Pseudolinearization and Gain Scheduling for Stabilization of Mobile Robots with two independently driven wheels. Robotica . 1997; 15 (5): 573-582. Khepera LabVIEW 5 [computer software]. Version 1.0. Yverdon-les-bains, Switzerland: The K-Team Corporation; September, 2001. Kim B, Necsulescu D, Sasiadek J. Model Pred ictive Control of an Autonomous Vehicle. In: International Conference on Advanced Intelligent Mechatronics Proceedings . Como, Italy. 2001; 2: 1279-1284. Ko CC, Chen BM, Chen J, Zhuand Y, Tan KC . Development of a We b-based Laboratory for Control Experiments on a Coupled Tank Apparatus. IEEE Transactions of Education. 2001; 44(1) : 76-86. Ko CC, Chen BM, Hu S, Ramakrishnan V, Che ng CD, Zhuang Y, Chen J. A Web-based Virtual Laboratory on a Frequency Modulation Experiment. IEEE Transactions on Systems, Man, and Cibernetics – Part C : Applications and Reviews . 2001; 31(3): 295-303. Kreyszig E. Advanced Engineering Mathematics . 8th ed. New York, NY. John Wiley & Sons; 1999. K-Team. Khepera User Manual Version 5.02 . Lausanne, Switzerland.The K-Team Corp.; 1999. Kwakernaak H, Sivan R. Linear Optimal Control Systems . New York, NY: John Wiley & Sons; 1972. Kwon WH, Kim PS, Han SH . A Receding Horizon Unbiased FIR Filter for Discrete-Time State Space Models. Automatica . 2002; 38: 545-551. LabVIEW [computer software]. Version 6.0. Austin, TX: National Instruments; 2002. LabVIEW [computer software]. Version 7.1. Austin, TX: National Instruments; 2004.

PAGE 154

154 Latchman HD, Salzmann C, Gillet D, Bouzekri H. Information Technology Enhanced Learning in Distance and Conventional Education. IEEE Transactions on Education . 1999; 42 (4): 247-254. Leon de la Barra BA, Prieto R.On the Frequenc y Response of Scalar Discrete-time Systems. Automatica . 1999; 35: 1843-1853. Luyben WL. Process Modeling, Simulation, and Control for Chemical Engineers . 2nd ed. New York, NY: McGraw-Hill; 1990. Maciejowski JM. Predictive Control with Constraints . Harlow, England: Prentice Hall; 2002. Matlab [computer software]. Version 6.5.0. Rel ease 13.0.1. Natick, MA: The Mathworks; 2003. Morari M, Zafiriou E. Robust Process Control . Englewood Cliffs, NJ: Prentice Hall, 1989. Muske KR, Badgwell TA. Disturbance Modeling for Offset-Free Linear Model Predictive Control. Journal of Process Control . 2002; 12: 617-632. Niederberger ASP. Predictive Control Design for a Khep era Robot – Projet de Diplome [dissertation]. Lausanne: Switzerland: IA-EPFL; 2002. Ogunnaike BA, Ray WH. Process Dynamics, Modeling, and Control . Oxford, NY: Oxford University Press; 1994. Pannocchia G, Rawlings JB. Disturbance Models for Offset-Free Model-Predictive Control. AIChE Journal . 2003; 49 (2): 426-437. Peek C, Depraz S, Crisalle OD, Gillet D. The Virtual Control Laboratory Paradigm: Architectural Design Requirements and R ealization through a DCmotor example. International Journal of Engineering Education . 2005; 21 (6):1134-1147. Quanser Consulting Inc. Coupled Water Tank Experiments . Markham, Ontario: Quanser Manuals; 1999. Quanser Consulting Inc. WebLab User’s Manual . Markham, Ontario: Quanser Manuals; 2002. Ramirez DR, Limon D, Gomez-Or tega J, Camacho EF. Nonlinear MBPC for Mobile Robot Navigation Using Genetic Algorithms. In: Proceedings of the 1999 IEEE International Conference on Robotics & Automation . Detroit, MI. 1999; 3: 2452-2457. Raynaud HF, Zergainoh A. State-space Repres entation for Fractional Order Controllers. Automatica . 2000; 36: 1017-1021. Rosenbrock HH. State-space and Multivariable Theory . New York, NY: John Wiley & Sons; 1970. Sandler M, Wahl A, Zimmermann R, Faul M, Kabatek U, Giller ED. Autonomous Guidance of Ships on Waterways. Robotics and Autonomous Systems . 1996; 18 (3): 327-335.

PAGE 155

155 Simulink [computer software]. Version 5.0.2. Release 13.0.1. Natick, MA: The Mathworks; 2003. Sjovall P, McKelvey T, Abrahamsson T. Constr ained State-space System Identification with Application to Structural Dynamics. Automatica . 2006; 42: 1539-1546. Srinivasan B, Bonvin D, Visser E, Palanki S. Dy namic Optimization of Batch Processes. II. Role of Measurements in handling uncertainty. Computers and Chemical Engineering Journal . 2002; 27: 27-44. Tarin C, Brugger H, Tibken B, Hofer EP. Adap tive Self-Tuning Path Control System for an Autonomous Mobile Robot. In: Proceedings of the 38th Conference on Decision and Control . Phoenix, AZ. 1999; 4: 3886-3887. Trentelman H, Stoorvogel A, Hautus M. Control Theory for Linear Systems . London, GB: Springer; 2001. Verboven P, Guillaume P, Cauberghe B. Multivariable Frequency-response Curve Fitting with Application to Model Parameter Estimation. Automatica . 2005; 41: 1773-1782. Wahl A, Gilles ED. Track-Keeping on Waterways using Model Predictive Control – Internal Report . Stuttgart, Germany: University of Stuttgart; 1998. Watanabe K, Ikeda K, Fukuda T, Tzafestas SG. Adaptive Generalized Predictive Control using a State Space. In: Proceedings of International Work shop on Intelligent Robots and Systems . Osaka, Japan.1991; 3: 1609-1614. Wang L, Cluett WR. Frequency-sampling Filt ers: An Improved Model Structure for Step-response Identification. Automatica . 1997; 30:939-944. Wang L, Desarmo ML, Cluett WR. Real-time Es timation of Process Frequency Response and Step Response from Relay Feedback Experiments. Automatica. 1999; 35:1427-1436. Wong CC, Lin, BC, Cheng CT. Fuzzy Tracking Me thod with a Switching Grey Prediction for Mobile Robot. IEEE International Fuzzy Systems Conference . 2001; 1: 103-106 . Yang JM, Kim JH. Control of Nonholonomic Mobile Robots. IEEE Control Systems Maggazine . 1999;19 (2): 15-23.

PAGE 156

156 BIOGRAPHICAL SKETCH Ricardo Gomez-Gonzalez was born on March 13 , 1977, in Monterrey, Mexico. The youngest of 3 children, he grew up mainly in Mo nterrey, with long summer and winter stays in the family farm in the town of Guemez, Tamaulipas. In 1994 he graduated from Eugenio Garza Sada’s Highschool, part of the Monterrey’s Institute of Technol ogy (ITESM) system. He earned his B.Sc. in chemical engin eering from ITESM in 1998. Upon graduation he joined SGS Mexico, where he developed expert systems ai med at automating and optimizing the decision and planning processes in industrial settings. In 2001 he was awarded a Fulbright Scholarship to perform graduate studies in the USA. In August 2001 he joined the University of Fl orida, where he later became a member of the Process Control Research Group under the guidance of Dr. Oscar D. Crisalle. As a member of the group, he investigated research topics on pred ictive control from both theoretical and applied perspectives. He also contribute d to the creation of t ools to facilitate and foster the teaching of control engineering via experimentation and through remote Internet connections.