application of mpc to cts2-correcetd

Upload: hbuddy

Post on 04-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    1/150

    APPLICATION OF MODEL PREDICTIVE CONTROLTO A COUPLED TANK SYSTEMSHUBHAM SRIVASTAVAA DISSERTATION SUBMITTED IN PARTIAL FULFILMENT OFTHE REQUIREMENTS FOR THE DEGREE OFMASTER OF SCIENCE IN COMPUTER CONTROL AND AUTOMATION

    http://www1.spms.ntu.edu.sg/~tcs/ntu_logo.jpg2010

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    2/150

    ACKNOWLEDGEMENT:I extend my deepest gratitude and sincere thanks to my project supervisor AssociateProfessor Ling Keck Voon for his invaluable support, guidance and motivation that led to thesuccessful completion of the project. His continuous encouragement and suggestions helped mefind a way out of the intricate technical complexities that I came across whileworking on thisproject. It was indeed a great opportunity and a great learning experience to work under him.I would like to thank all the staff and lab assistants in the Aerospace Electronics lab fortheir consistent support.

    Finally, I would like to thank all my colleagues and friends who helped me directly orindirectly for the successful completion of this project.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    3/150

    SUMMARY:Model Predictive Control (MPC) is an advanced control methodology that offers anefficient control strategy while dealing with multivariable systems with constraints. In thisdissertation, Coupled Tank System from Kentridge Instruments Pte Ltd has been used toimplement Model Predictive Control for controlling the level of water in the twotanks.The First Principles method relating to the Mass Balance Equation for volume ofwaterpresent inside the two tanks has been used to identify the system parameters andconsequentlydevelop an appropriate state space model for the Coupled Tank System. Model Validation iscarried out by comparing the simulated output obtained from the developed modelwith theactual step test plant output.MPC control law is defined for solving the constrained optimization criterion andsubsequently the controller is implemented by communicating with the system through NIDAQmx 6024E while the control algorithm runs in MATLAB. The experimental results

    obtained demonstrate an effective set point tracking abilities and disturbance handlingcapabilities of the controller.

    Finally, tuning of MPC parameters is carried out in order to choose the parameter valuesbest suited for this application. Constraint handling capability is one of the most striking featuresof MPC methodology that makes it unique in comparison to other conventional controltechniques. Experiments are carried out to specifically demonstrate the constrai

    nt handlingcapabilities of the controller.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    4/150

    TABLE OF CONTENTSACKNOWLEDGEMENT ............................................................................................................................................ ISUMMARY .................................................................................................................................................IILIST OF FIGURES ................................................................................................................................. ...VLIST OF TABLES .................................................................................................................................... VIICHAPTER 1 INTRODUCTION.......1

    1.1 MOTIVATION...11.2 OBJECTIVE OF THE THESIS .........21.3 THESIS ORGANIZATION .......3

    CHAPTER 2 PARAMETER DETERMINATION AND CALIBRATION OF THECOUPLED TANK SYSTEM .......42.1 OVERVIEW OF THE KENTRIDGE COUPLED TANK SYSTEM.....42.1.1 MODES OF OPERATION OF COUPLED TANK SYSYTEM..6

    2.2 PARAMETER DETERMINATION.......62.2.1 FIRST PRINCIPLE METHOD OF PARAMETER DETERMINATION...72.2.1.1 MASS BALANCE EQUATION .........82.2.1.2 LINEARIZATION .......92.2.1.3 DETERMINATION OF PARAMETERS a1, a2 AND a3 ..............................................122.3 STATE SPACE MODEL BASED ON DETERMINED PARAMETERS.....212.4 MODEL VALIADTION ....242.5 SENSOR AND ACTUATOR CALIBRATIONS .......262.5.1 SENSOR CALIBRATIONS ......262.5.2 MOTOR CALIBRATIONS .......33CHAPTER 3 MPC IMPLEMENTATION ON COUPLED TANK SYSTEM ..373.1 INTRODUCTION TO MODEL PREDICTIVE CONTROL......37

    3.1.1 RECEDING HORIZON CONCEPT .....393.1.2 SET POINT IMPROVEMENT .....393.2 THE STATE SPACE MODEL .........403.2.1 CHOICE OF APPROPRIATE AUGMENTED STATE SPACE MODEL ......433.2.2 MAKING UNBIASED PREDICTIONS ...443.3 SOLVING THE QP PROBLEM ... 46

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    5/150

    3.4 IMPLEMENTATION OF MPC ON THE COUPLED TANK SYSTEM.......473.4.1 OPERATING REGION FOR CONTROL ACTION......483.4.2 USE OF MANUAL CONTROL .....493.4.3 EXPERIMENTAL SETUP .....503.4.4 EXPERIMENTAL RESULTS ....523.5 DISTURBANCE HANDLING CAPABILITIES OF THE CONTROLLER .56CHAPTER 4 TUNING OF MPC PARAMETERS ANDMPC CONSTRAINT HANDLING CAPABILITIES ...574.1 TUNING OF MPC PARAMETERS .574.1.1 TUNING OF PREDICTION HORIZON ........574.1.2 TUNING OF CONTROL HORIZON .....584.1.3 TUNING OF CONTROL WEIGHTING FACTOR 604.2 CONSTRAINT HANDLING CAPABILITIES OF THE CONTROLLER .....614.2.1 SLEW RATE CONSTRAINTS .......614.2.2 INPUT CONSTRAINTS .....644.2.3 OUTPUT CONSTRAINTS .....67CHAPTER 5 CONCLUSION AND RECOMMENDATIONSFOR PERFORMANCE IMPROVEMENT ....695.1 CONCLUSION......695.2 RECOMMENDATIONS FOR FURTHER IMPROVEMENTS .....70BIBLIOGRAPHY ...72APPENDICES......74APPENDIX A (DATA VALUES OBTAINED FOR SIMULTANEOUS DETERMINATION

    OF DISCHARGE COEFFICIENTS) ...74APPENDIX B (DERIVATION OF MPC CONTROL LAW) ....76

    APPENDIX C (PROGRAM LISTING) ......84

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    6/150

    LIST OF FIGURESFIGURE 2.1 KENTRIDGE COUPLED TANK SYSTEMFIGURE 2.2 DYNAMICS OF COUPLED TANK SYSTEMFIGURE 2.3 MODEL VALIDATION RESULTSFIGURE 2.4 LEVEL SENSOR INPUT-OUTPUT ENTITIESFIGURE 2.5 SENSOR 1 CONVERSIONS REGION 1FIGURE 2.6 SENSOR 1 CONVERSIONS REGION 2FIGURE 2.7 SENSOR 1 CONVERSIONS REGION 3FIGURE 2.8 SENSOR 2 CONVERSIONS REGION 1FIGURE 2.9 SENSOR 2 CONVERSIONS REGION 2FIGURE 2.10 SENSOR 2 CONVERSIONS REGION 3FIGURE 2.11 SENSOR 1 CONVERSIONS FOR ALL 3 REGIONSFIGURE 2.12 SENSOR 2 CONVERSIONS FOR ALL 3 REGIONSFIGURE 2.13 MOTOR PUMP INPUT-OUTPUT ENTITIESFIGURE 2.14 MOTOR PUMP 1 CONVERSIONSFIGURE 2.15 MOTOR PUMP 2 CONVERSIONSFIGURE 3.1 STRUCTURE OF MODEL PREDICTIVE CONTROL (FLOWCHART)FIGURE 3.2 RECEDING HORIZON CONCEPTFIGURE 3.3 SET POINT IMPROVEMENTFIGURE 3.4 COMPARISON OF 3 AUGMENTED ATATE SPACE MODELSFIGURE 3.5 USE OF MANUAL CONTROLFIGURE 3.6 MPC IMPLEMENTATION: BLOCK DIAGRAMFIGURE 3.7 EXPERIMENTAL RESULTS FOR MPC IMPLEMENTATION

    FIGURE 3.8 EXPERIMENTAL RESULTS FOR MPC IMPLEMENTATIONFIGURE 3.9 MPC IMPLEMENTATION FOR H1=12cm, H2=13.5cmFIGURE 3.10 MPC IMPLEMENTATION FOR H1=17cm, H2=15cmFIGURE 3.11 MPC IMPLEMENTATION FOR H1=20cm, H2=17cmFIGURE 3.12 DISTURBANCE HANDLING CAPABILITIES OF THE CONTROLLERFIGURE 4.1 EFFECT OF VARIATION OF PREDICTION HORIZONFIGURE 4.2 EFFECT OF VARIATION OF CONTROL HORIZON

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    7/150

    FIGURE 4.3 EFFECT OF VARIATION OF CONTROL WEIGHTING FACTORFIGURE 4.4 CONSTRAINT HANDLING CAPABILITIES SLEW RATE CONSTRAINTSFIGURE 4.4-a SLEW RATE CONSTRAINTS - 1 cm3/sec = .r = 1 cm3/secFIGURE 4.4-b SLEW RATE CONSTRAINTS - 5 cm3/sec = .r = 5 cm3/secFIGURE 4.4-c SLEW RATE CONSTRAINTS - 15 cm3/sec = .r = 15 cm3/secFIGURE 4.4-d SLEW RATE CONSTRAINTS - 20 cm3/sec = .r = 20 cm3/secFIGURE 4.5 CONSTRAINT HANDLING CAPABILITIES INPUT CONSTRAINTSFIGURE 4.5-a INPUT CONSTRAINTS (0 cm3/sec = r1 = 35.13 cm3/sec; 0 cm3/sec = r2 =34.11 cm3/sec)FIGURE 4.5-b INPUT CONSTRAINTS (0 cm3/sec = r = 30.94 cm3/sec; 0 cm3/sec = r2 =30.94 cm3/sec)FIGURE 4.5-c INPUT CONSTRAINTS (0 cm3/sec = r1 = 28.55 cm3/sec; 0 cm3/sec = r2 =28.47 cm3/sec)FIGURE4.6 CONSTRAINT HANDLING CAPABILITIES OUTPUT CONSTRAINTSFIGURE 4.6-a OUTPUT CONSTRAINTS (0 cm = y1 = 18.23 cm; 0 cm = y2 = 20.85cm)FIGURE 4.6-b OUTPUT CONSTRAINTS (0 cm = y1 = 16.28 cm; 0 cm = y2 = 19.29cm)FIGURE 4.6-b OUTPUT CONSTRAINTS (0 cm = y1 = 15.00 cm; 0 cm = y2 = 18.25cm)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    8/150

    LIST OF TABLESTABLE 2.1 READINGS FOR DISCHARGE COEFFICIENT a1TABLE 2.2 READINGS FOR DISCHARGE COEFFICIENT a2TABLE 2.3 READINGS FOR DISCHARGE COEFFICIENT a3TABLE 2.4 READINGS FOR SIMULATNEOUS DETERMINATION OF a1, a2, a3TABLE 2.5 COMPARISON OF METHOD 1 AND 2 OF PARAMETER DETERMINATIONTABLE 2.6 DIVISION OF REGIONS ON LEVEL SENSORSTABLE 2.7 LEVEL SENSOR 1 CALIBRATIONSTABLE 2.8 LEVEL SENSOR 2 CALIBRATIONSTABLE 2.9 MOTOR 1 CALIBRATIONSTABLE 2.10 MOTOR 2 CALIBRATIONSTABLE 3.1 AUGMENTED STATE SPACE MODELS

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    9/150

    Chapter 1- IntroductionLooking Ahead:

    .Motivation.Objective.Organization of the thesis

    1.1 MotivationThe Kentridge Two Tank system is one of the most commonly available systemsrepresenting a coupled Multiple Input Multiple Output (MIMO) system. With 2 inputs and 2outputs, it is the most primitive form of a coupled multivariable system. Levelcontrol in acoupled multivariable tank system is challenging due to the following issues-

    1. Multivariable nature causes interaction between the two subsidiary tanks. Hence waterflows in either of the two directions, depending upon the present water level in

    the twotanks.2. System constraints-.The capabilities of the dc motors used to pump water, is limited (input

    constraints).

    .The water level in the two tanks have to be maintained at the desired set point

    withina specified tolerance limit (output constraints)

    Normally, control mechanism of such a system would involve a decentralized controlaction where the system sections are decoupled and separate controllers are designed for thedecoupled sections. But, the constraints have also to be accounted for. Model Pr

    edictive Controlsforms a suitable alternative because it can handle both the above mentioned issues effectivelyprovided a sufficiently high computational speed is available. MPC approaches these issues inthe form of an optimization problem, where an optimal value of control input tobe given to the

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    10/150

    system is worked out by solving a standard Quadratic Programming (QP) problem [1, 2, 3, 7]comprising of-

    (a) A cost function which comprises of a linear combination of square of the error betweenpresent output and the set point, and the change in control input.(b) The system constraints.

    Moreover, the cost function also enjoys the luxury of being formulated so as tosuit theparticular case, pertaining to the choice of prediction horizon and a weightingfactor depictingand deciding the relative importance of the entities in the cost function. Apartfrom the abovementioned issues, MPC tackles with the disturbances in an effective way to bringback the outputto the desired set point.The above mentioned advantages of MPC make it suitable to be used for level control inthe Two Tank System which is basically a two input two output (TITO) system andhas

    constraints in the form of maximum voltage rating of the dc motors and user defined water levelconstraints.1.2 ObjectiveThe main objective of this project is to design and implement an MPC controllerfor levelcontrol in the Kentridge Coupled Tank system. The following sub-objectives takentogether formthe main objective-

    1. Developing a state space system model for the coupled tank system.2. Design an MPC controller in MATLAB for the developed system model.3. Experimentally verify the MPC control action on the system by communicating w

    ith thesystem through NI DAQmx 6024E.4. Study and demonstrate the effect of variation of MPC parameters: thereby choosingappropriate values of MPC parameters. Demonstrate the disturbance handling andconstraint handling capabilities of the controller.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    11/150

    1.3 Thesis OrganizationThe thesis has been organized into five chapters-Chapter 1 gives the motivation behind using MPC for the given system, main objectives of thethesis and the thesis organization itself.Chapter 2 gives an Overview of the Kentridge Coupled Tank system upon which theMPCcontrol phenomenon is to be demonstrated. Further, this chapter deals with Parameterdetermination for the system, model validation, sensor and motor calibrations. The use of FirstPrinciples for determining the state space equations for the system are described. Experimentalresults pertaining to parameter determination, sensor and motor calibration aregiven.Chapter 3 gives an introduction of Model Predictive Control methodology. This chapter consistsof the experimental results for implementation of MPC for level control in the Coupled TankSystem. Experimental results pertaining to three possible augmented state spacemodels and thesuitable choice of a particular model, as supported by the experimental resultshave been

    mentioned. Further, this chapter shows the controller action in case of simulated inputdisturbance.Chapter 4 shows the effect of variation of the three parameters viz., Predictionhorizon, ControlHorizon and Control input weighting factor ., and gives the proper choice of MPCparametersfor the present application. Further, experimental results to demonstrate the constraint handlingcapabilities have been given.

    Chapter 5 discusses the conclusion reached after the implementation and gives

    recommendations for further improvement.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    12/150

    C:\Documents and Settings\Administrator\My Documents\My Pictures\tanksys.JPGChapter 2 Parameter Determination and Calibrationof the Coupled Tank SystemLooking ahead:

    .Overview of the Kentridge Coupled Tank System.Parameter Determination for the Coupled Tank System.State space model based on determined parameters.Model validation.Sensor calibrations.Actuator (motor pump) calibrations

    2.1 Overview of the Kentridge Coupled Tank System

    Figure 2.1: Coupled tank System (Source-Specification Manual of Coupled Tank Control ApparatusPP100 from Kentridge Instruments Pte Ltd)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    13/150

    The Kentridge coupled tank system as shown in figure (2.1) consists of a towershapedtank mounted over a reservoir that is used to store excess of water [5]. A baffle plate inside thetank divides the tank into two vertical equal sections. The vertical position ofbaffle plate can beadjusted by means of a screw provided at the top, and thus the interaction or coupling betweenthe two tank sections (Tank 1 and Tank 2) can be controlled. An inlet is provided at the top ofeach tank section to let in a stream of water when driven by means two dc motors, respectivelyfor Tank 1 and Tank 2. Each of the two tanks is fitted with an outlet at the bottom and the outletis connected to the reservoir through a small hose. The hose carries manual clamps that functionas valves thereby controlling the rate of flow outward from the two tanks.Overflow drain pipes are also connected near the top of the two tanks, the overflowdrains connect back to the reservoir. The coupled tank system has two actuatorsand twofeedback sensors-

    .Actuators -pump motors (0 to 5 volt dc)

    .Capacitive sensors (output-0 to 5volt dc)

    The pump motors can be controlled either directly by a PWM signal or an analogvoltage(0-5volt). Electronic circuitry provided at the back of tank apparatus convertsthe analog voltageto a suitable PWM signal before feeding it to the pump motors. Capacitive probeshanging in thecentre of the two tanks are used as level sensors, output of these after being p

    rocessed by signalconditioning circuit, is made available as 0-5 volt dc. A scale is also attachedon the front side ofthe tank so that the water level can also be visually monitored.With the inlet valves (driven by the two motor pumps) being the two inputs to tank 1 andtank 2, respectively and the level of water in the two tanks being the desired output that is to becontrolled, the coupled tank system is thus a two input- two output (TITO) system.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    14/150

    2.1.1 Modes of Operation of Coupled Tank SystemThe coupled tank system can be used in either of the two modes-

    .Local mode.Remote mode

    In Local mode, the inlet to the two tanks can be controlled by the two respective potentiometersprovided at the back panel. In REMOTE mode, PWM or analog signal (0-5 volt) is applied to thepump motors to drive water into the two tanks through the inlets. The apparatusis used inREMOTE mode and analog voltage, for carrying out all the experiments in this thesis.2.2 Parameter DeterminationVarious methods are available in literature for determining a System Model [1],[6].Derivation of MPC control law is based on the state space model of the system and hence, anadequate state space model of the coupled tank system needs to be identified. Th

    e linearized statespace model for the coupled tank system can be determined in either of the two ways-

    .Performing tests on the plant by applying known input patterns (step test, relaytest,etc) and observing the plant outputs..The First Principle Method [1], wherein the plant dynamics can be represented byanon linear equation based upon the underlying physical and/or chemical phenomenon.

    The method of First Principles is used for working out the system model. Laterin Section(2.4), model validation is carried out by comparing the simulated output generated from thedetermined model by applying step input, against the actual plant output obtained by applyingstep input to the plant.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    15/150

    2.2.1 First Principle method for parameter determination

    The First Principle method for working out the State Space Model is based on the MassBalance equation [5] for the volume of water present inside the two tanks. At any given instantthe rate of change of volume of water present inside the tank can be expressed in terms of therate at which water flows into the tank through the inlet and the rate at whichwater flows out ofthe tank through the outlet valves. The Coupled Tank System dynamics can be visualized asshown in the Figure (2.2).

    Figure 2.2 Dynamics of Coupled tank SystemWhere,a1 = discharge coefficient from tank 1.

    a 2 =discharge coefficient from tank 2.a 3 =discharge coefficient between the two tanks, i.e., coupling coefficient between the twotanks. (a 3 will be positive for H1>H2 and negative for H1

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    16/150

    Qi2 = rate of flow of fluid into tank2 ( manifested in the form of control inputU2)Qo1 = rate of flow of fluid from tank 1Qo2 = rate of flow of fluid from tank 2Qo3 = rate of flow of fluid from tank 1 to tank 2 or from tank 2 to tank1 depending upon whetherH1>H2 or H1

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    17/150

    (2.6)(2.7)The equations (2.6) and (2.7) represent a non-linear relationship between the water level(H1 and H2 in the two tanks, respectively) and the discharge coefficients. Although, variousmethods are available in literature for non linear MPC [20], but if the operating point is knownand does not change quite often then it is convenient to linearize the system obtained by firstprinciples around the desired operating point. This makes the process significantly simpler andthe model works well in a region around the chosen operating point. The stretchof operatingband in which the linearized system gives a response similar to the actual non linear systemdetermines the sensitivity of the linearized system.2.2.1.2 LinearizationConsidering an incremental change of qi1 and qi2 in the two control inputs respectively,which subsequently cause an incremental change in height in the two tanks - h1 and h2,respectively.

    Hence, equations (2.6) and (2.7) can be re-written as ................. (2.8)...................... (2.9)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    18/150

    Now, subtracting equation (2.6) from (2.8) and (2.7) from (2.9) we have-(2.10)Similarly,(2.11)Knowing that as per Binomial expansion-(2.12)For , we can approximate this as (2.13)Now, putting the approximations given by equation (2.13) in equations (2.10) and(2.11) andrearranging we get-(2.14)(2.15)Where, qi1=q1 and qi2=q2Putting the above two equations together we have-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    19/150

    = +. (2.16). (2.17)Where,q1=input to tank1 (rate at which water is pumped into tank 1 cm3/sec)q2=input to tank2 (rate at which water is pumped into tank 2 cm3/sec)y1= output for tank1 (incremental change in height h1 of water from the operating point heightH1, in tank 1 -cm)y2= output for tank2 (incremental change in height h2 of water from the operating point heightH2, in tank 2 -cm)Now, assuming q1 = u1, q2 = u2h1=x1, h2=x2 (2.18)The continuous time state space equations of this two input- two output (TITO) system can berepresented as-= +. (2.19)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    20/150

    . (2.20)2.2.1.3 Determination of the parameters a1, a2 and a3-As obvious from the continuous time state space equations of the model given by(2.19)and (2.20), the following parameters need to be determined for working out the state spacematrices-

    (i) Area of cross section of the two tanks, A1 and A2, respectively, which aremeasured =32cm2.(ii) Operating points H1 and H2.

    These are user defined values and depend upon what the set point is. These aredefined each time the algorithm starts.

    (iii) Discharge coefficients

    Hence, basically the 3 discharge coefficients need to be determined.Correctness of the identified model is very crucial to MPC performance as the computations foroutput predictions involve the use of model at each sampling instant. Therefore,

    proper modelidentification needs to be done, which implies that the parameters should bedetermined carefully.The following two methods have been adopted to carry out for determination of thedischarge coefficients-

    (i) Method 1 - Conventional method of determining each of the 3 discharge coefficientsseparately [5], by making some mechanical adjustments in the coupledtank system.(ii) Method 2 - Simultaneous determination of the 3 discharge coefficients

    Linear least squares method of approximation is used to determine the parameters [3].

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    21/150

    Method 1:can be determined by making the following arrangements in the tank system-

    .Inlet to tank =0, i.e., Qi1 = Qi2 =0 for determining , respectively..Qo3 =0. i.e., the baffle between the two tanks is fully closed so that no waterleaks to orfrom either sides, in other words the interaction/coupling between the two tanksisstopped.

    Once, the above two arrangements are made, the mass balance equation (3.6) and (3.7) for tank 1(and similar for tank 2) come out to be as follows (2.21)(2.22)Rearranging these and integrating from H1 (0) to H1 (T) and H2 (0) and H2 (T) for tank 1 andtank 2, respectively we get-(2.23)(2.24)

    Solving we get-(2.25)(2.26)

    Procedure: The mechanical adjustments as specified above are made. For determining thedischarge coefficient, a number of readings are taken for H1 (0) and H1 (T) withthecorresponding time T. Similarly, for determining the discharge coefficient, a number of

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    22/150

    readings are taken for H2 (0) and H2 (T) with the corresponding time T. and aredetermined as per equations (2.25) and (2.26).

    S.No.

    Initial HeightH1(0) cm

    Final HeightH1(T) cm

    Time taken fordescent (T) -sec

    Dischargecoefficient

    1

    15

    5

    24

    4.365

    2

    20

    10

    21

    3.991

    3

    10

    4

    17

    4.375

    4

    12

    5

    19

    4.136

    5

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    23/150

    25

    10

    28

    4.200

    Table 2.1: Readings for determination of discharge coefficient()avg = 4.213.

    S.No.

    Initial HeightH2(0) cm

    Final HeightH2(T) cm

    Time taken fordescent (T) -sec

    Dischargecoefficient

    1

    15

    5

    22

    4.761

    2

    20

    10

    18

    4.656

    3

    10

    4

    15

    4.958

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    24/150

    4

    12

    5

    17

    4.622

    5

    25

    10

    25

    4.704

    Table 2.2: Readings for determination of discharge coefficient()avg= 4.740Determining discharge coefficientcan be determined by making the following arrangements-

    .Outflow for each of the two tanks is closed, i.e, Q01 = Q02 =0. And Q03 .0, i.e,baffle israised to allow coupling to happen.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    25/150

    .The inlet to each of the tanks is closed. Qi1 = Qi2 =0. Here, one of the inletscan be openedto let some fluid inside so that readings can be taken.

    Once, the above two arrangements are made, the mass balance equation (2.6) and (2.7) for tank 1(and similar for tank 2) come out to be as follows (2.27)(2.28)Now, with A1=A2=A (say), combining the equations (2.27) and (2.28) and integrating betweenthe limits (H1-H2) (0) and (H1-H2) (T) = (2.29)Solving, we get-(2.30)Again, the water level in the two tanks for various values of (H1-H2) (0) and (H1-H2) (T) withthe corresponding time T is noted down and tabulated as shown in table (2.3). The dischargecoefficient is determined using equation (2.30)

    S.No.Initialdifference inHeight (H1-H2)(0) cm

    FinalDifference inHeight (H1-H2)(T) cm

    Time taken for

    descent (T) -sec

    Dischargecoefficient(Couplingcoefficient) -

    1

    15

    0

    6

    20.655

    2

    12

    0

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    26/150

    4

    27.710

    3

    22

    0

    5.5

    27.289

    4

    25

    0

    6.5

    24.615

    5

    30

    0

    8.5

    20.646

    Table 2.3: Readings for determination of discharge coefficient

    ()avg = 24.183

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    27/150

    Method 2:Simultaneous determination of discharge coefficients- a1, a2 and a3. The Mass balance equationsfor the system dynamics as given by equations (2.6) and (2.7) (2.6)(2.7)Now, closing the input to the two tanks renders-

    .

    And also-

    .A1=A2=A(say).for we have and

    Substituting these in equations (2.6) and (2.7) and rearranging, we get-.= (2.31)= (2.32)Now,

    (i) The above two equations (2.31) and (2.32) are linear with respect to the parametersa1, a2 and a3.(ii) can be approximated as forward or backward difference of twoconsecutive readings for and , respectively.

    Backward difference method-i.e., and

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    28/150

    Forward Difference method andand have been calculated by using the backward difference method.Procedure adopted-A number of readings are taken for height (H1) in tank 1 and height (H2) in tank2 atintervals of . All the readings can be assembled in the form of matrixaccording to equations (2.31) and (2.32), as follows-From equation (2.31) -(2.33)Similarly from equation (2.32) (2.34)The equations (2.31) and (2.32) and thus the equations (2.33) and (2.34) hold simultaneously.Hence, writing the equations (2.33) and (2.34) jointly-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    29/150

    (2.35)In the above equation (2.35) let-, = , and=

    With the above assumptions equation (2.35) can be re-written as-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    30/150

    (2.36)The values of parameters a1, a2 and a3 can be worked out using linear least square solution forthe above equation.= (T)-1 T=> (2.37)(100 readings are taken full set of readings are put up in the Appendix-A)

    S.No.

    H1

    H2

    .H1

    1

    17.6008

    16.4072

    4.1953

    4.0506

    1.0925

    -0.1368

    -0.0666

    2

    17.5974

    16.4069

    4.1949

    4.0505

    1.0911

    -0.0335

    -0.0036

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    31/150

    3

    17.5876

    16.4045

    4.1938

    4.0502

    1.0877

    -0.0982

    -0.0241

    4

    17.5803

    16.3996

    4.1929

    4.0496

    1.0866

    -0.0732

    -0.0492

    5

    17.5753

    16.4013

    4.1923

    4.0499

    1.0835

    -0.0498

    0.0178

    6

    17.5640

    16.3934

    4.1909

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    32/150

    4.0489

    1.0819

    -0.1135

    -0.0796

    7

    17.5626

    16.3972

    4.1908

    4.0493

    1.0796

    -0.0137

    0.0378

    8

    17.5488

    16.3886

    4.1891

    4.0483

    1.0771

    -0.1386

    -0.0857

    9

    17.5480

    16.3920

    4.1890

    4.0487

    1.0752

    -0.0072

    0.0344

    10

    17.5344

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    33/150

    16.3850

    4.1874

    4.0478

    1.0721

    -0.1367

    -0.0698

    11

    17.5318

    16.3854

    4.1871

    4.0479

    1.0707

    -0.0258

    0.0035

    12

    17.5202

    16.3820

    4.1857

    4.0475

    1.0669

    -0.1155

    -0.0339

    13

    17.5136

    16.3779

    4.1849

    4.0470

    1.0657

    -0.0665

    -0.0407

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    34/150

    14

    17.5072

    16.3794

    4.1842

    4.0471

    1.0620

    -0.0635

    0.0143

    15

    17.4960

    16.3721

    4.1828

    4.0462

    1.0601

    -0.1126

    -0.0726

    16

    17.4933

    16.3758

    4.1825

    4.0467

    1.0571

    -0.0268

    0.0367

    17

    17.4791

    16.3671

    4.1808

    4.0456

    1.0545

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    35/150

    -0.1417

    -0.0866

    18

    17.4778

    16.3708

    4.1806

    4.0461

    1.0521

    -0.0134

    0.0372

    19

    17.4634

    16.3634

    4.1789

    4.0452

    1.0488

    -0.1440

    -0.0746

    20

    17.4602

    16.3648

    4.1785

    4.0453

    1.0466

    -0.0314

    0.0140

    21

    17.4474

    16.3606

    4.1770

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    36/150

    4.0448

    1.0425

    -0.1283

    -0.0416

    22

    17.4401

    16.3576

    4.1761

    4.0444

    1.0405

    -0.0727

    -0.0303

    23

    17.4321

    16.3587

    4.1752

    4.0446

    1.0361

    -0.0801

    0.0115

    24

    17.4200

    16.3520

    4.1737

    4.0438

    1.0335

    -0.1207

    -0.0675

    25

    17.4161

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    37/150

    16.3556

    4.1733

    4.0442

    1.0298

    -0.0392

    0.0363

    Table 2.4: Readings for simultaneous determination of a1, a2 and a3

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    38/150

    The values of discharge coefficients thus calculated come out to be-a1 = 4.0993a2 = 4.3702a3 = 25.2952Values obtained by linear least squares method in comparison with those obtainedbyconventional method

    MethodParameter

    Conventional method(Method 1)

    Linear least squares method(Method 2)

    a1

    4.213

    4.0993

    a24.740

    4.3702

    a3

    24.183

    25.1952

    Table 2.5: Comparison of results from Method 1 and Method 2As seen from the value of discharge coefficients obtained from Method 1 and Method 2(shown in table 2.5), the corresponding values of the three discharge coefficients are close butnot the same. As a result, the model so identified will be slightly different inboth the cases andconsequently the MPC performance will be different due to model uncertainty. Ifmodelidentified by method 1 is better than that identified by method 2, then MPC performance

    corresponding to method 1 will be better, and vice versa. Later, in chapter 3, it will be shownthrough experimental results that zero tracking error can be obtained by an appropriate choice ofaugmented state space model, even if the model is slightly incorrect representation of the actualplant.The state space matrices obtained by using parameter values from method 1 and method 2are presented in the next section.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    39/150

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    40/150

    2.3 State space model based on determined parametersRecalling the continuous time state space model from equations (2.19) and (2.20)= + (2.19)(2.20)Assuming,= Ap ,Bp, = Cp and= , =The state space equations can be expressed in the standard form as follows-= + Bp (2.38)(2.39)In equations (2.38) and (2.39) assuming-

    = , = U, and = Y

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    41/150

    Where all,, U and Y will be 2 dimensional vector. The equations (2.38) and (2.39) with theabove assumptions can be re-written as-= Ap.X + Bp.U (2.40)Y = Cp.X (2.41)Equations (2.40) and (2.41) represent the continuous time state space equationsfor the two input-two output coupled tank system.Now, with the values of all the ingredient parameters known, the values of the state spacematrices given by equations (2.40) and (2.41) can be worked out -

    .A1=A2=32 cm2..Discharge coefficients a1=4.213, a2=4.740 and a3=24.183 (Method 1).Discharge coefficients a1=4.0993, a2=4.3702 and a3=25.1952 (Method 2).Operating points H1 and H2. These can be chosen to be any value between 0 to 30cmas per the tank capacity. The only limitation in choosing the operating points is that-

    the difference in H1 and H2 cannot be more than 5cm. This limitation arises becauseof limitation in pumping rate of the motor pumps and the coupling between the twotanks. The maximum pumping rate (r) delivered by each of the two motors at 5 voltscomes out to be 36 cm3/sec.

    i.e., 0 cm3/sec = r = 36 cm3/sec. (2.42)Hence, the maximum difference in height H1 and H2 can be maintained if one of the motorpumps is working is at its full capacity (36 cm3/sec) while the other motor pump

    is off (0cm3/sec). This corresponds to a maximum difference of 5 cm as observed from experimentsperformed. Choosing H1= H2=15 cm for working out the state space matrices.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    42/150

    State space matrices with respect to parameters determined by Method 1:Ap=Bp =Cp= (2.43-a)The continuous time state space equations (2.40) and (2,41) are discretized using a sampling timeTs = 0.5 sec. The discretized state space matrices come out to be as follows-Ad=Bd =Cd= (2.44-a)State space matrices with respect to parameters determined by Method 2:Ap=Bp =Cp= (2.43-b)

    The continuous time state space equations (2.40) and (2.41) are discretized using a sampling timeTs = 0.5 sec. The discretized state space matrices come out to be as follows-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    43/150

    Ad=Bd =Cd= (2.44-b)2.4 Model ValidationAs mentioned earlier in section (2.2), step test also forms a suitable method for determiningthe system model. Here, Model Validation is carried out by comparing the simulated outputgenerated by applying step input signal to the system model determined by method1 and thatgenerated by system model determined by method 2, against the actual output generated byapplying the same step input signal to the actual plant.Procedure:

    1. Step input of step 0.5 volts (step change in rate = 4.7688cm^3/sec) is applied to motorpump 1. The output (water level) in the two tanks is allowed to settle at the new steadystate.

    2. While maintaining the input to motor pump 1 unchanged, a step input of 0.5 volts=( stepchange in rate = 4.9013cm^3/sec) is applied to motor pump 2 and the output in both thetanks is allowed to settle to new steady state value.

    As shown in the figure (2.3), the system model determined by both, method 1 andmethod 2,represents the actual system quiet closely. System model determined by Method 1represents the

    actual system better than that determined by method 2. Hence, in all future experiments, thesystem model determined by method 1 is considered.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    44/150

    050010001500200025002345678910Output tank1 (cm)Samplesstep test data (actual plant)simulated data from plant model (method 1)simulated data from plant model (method 2)0500100015002000250012345678910Output tank2 (cm)Samplesstep test data (actual plant)simulated data from plant model (method 1)simulated data from plant model (method 2)0500100015002000250078910111213STEP INPUT tank1 (cm)Samplesstep input to motor pump 10500100015002000250066.577.588.599.51010.511STEP INPUT tank2 (cm)Samplesstep input to motor pump 2

    Output tank 1

    Output tank 2

    Output tank 2

    Input tank 1

    Input tank 2

    Figure 2.3 Model Validation

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    45/150

    2.5 Sensor and Actuator Calibrations:As shown in the figure (2.4), the input for the Capacitive Level Sensors is thelevel of waterin the respective tanks, while its output is analog voltage in the range of 0 to5 volt dc. Input tomotor pumps in analog voltage (0 to 5 volts), while output is rate of flow of water given incm3/sec.2.5.1 Sensor Calibrations

    Figure 2.4: Input-output entities for Level SensorsThe MPC control algorithm needs to update the states (as defined by state spacemodel)at each sampling instant and incorporates these in making future predictions over the predictionhorizon (Np). The values received from the level sensors through the Data Acquisition Card (NIDAQmx 6024E) are analog voltages (0-5volt dc). Hence, these have to be suitablyconverted tothe corresponding height (water level) value (0-30cm) in order to be suitably incorporated in thecontrol algorithm.

    Major issues in calibrations:(i) The input-output relationship for both the sensors is almost but not entirely linear.Higher order input-output relationship equations need to be considered for greateraccuracy.(ii) The input-output relationship (linear or non-linear) is not consistent throughout thelength of the sensors. For this reason, calibrations are worked out by specifyingvirtual regions of the sensors as shown in figure (2.6)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    46/150

    Level Sensor 1:

    Level Sensor 2:

    Region 1

    0 to 11 cm

    0 to 10 cm

    Region 2

    11 cm to 20 cm

    10 cm to 19 cm

    Region 3

    20 cm to 30 cm

    19 cm to 30 cm

    Table 2.6: Division of Regions along the length of level sensorsProcedure: Calibrations are done separately for the two sensors, as both have slightly differentinput-output relationship. Water level is maintained at various levels, the height of water is readmanually using the scale attached to the tank system and the corresponding voltage value is readfrom the DAQ. Readings thus obtained, have been tabulated as shown in Table (2.7) and Table(2.8) for level sensor 1 and level sensor 2, respectively.

    Region 1

    Region 2

    Region 3

    Water level(cm)

    Voltage(volts)

    Water level(cm)

    Voltage(volts)

    Water level(cm)

    Voltage

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    47/150

    (volts)

    3.5

    0.8083

    11.4

    1.9563

    20.0

    3.2291

    3.8

    0.8323

    12.3

    2.0665

    20.4

    3.29324.1

    0.8739

    13.4

    2.2340

    21.0

    3.3912

    4.8

    0.9567

    14.6

    2.4153

    21.5

    3.4634

    5.6

    1.0600

    15.7

    2.6003

    22.0

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    48/150

    3.5419

    6.5

    1.1686

    16.7

    2.7550

    22.5

    3.6071

    7.0

    1.2509

    17.6

    2.8753

    23.0

    3.67727.8

    1.3626

    18.7

    3.0508

    8.6

    1.4803

    19.7

    3.2112

    9.2

    1.5746

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    49/150

    10.0

    1.6617

    11.0

    1.7980

    11.8

    1.9563

    Table 2.7: Calibrations for Level Sensor 1

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    50/150

    Region 1

    Region 2

    Region 3

    Water level(cm)

    Voltage(volts)

    Water level(cm)

    Voltage(volts)

    Water level(cm)

    Voltage(volts)

    2.9

    0.2308

    10.6

    1.9563

    19.5

    3.2291

    3.0

    0.2749

    11.6

    2.0665

    19.9

    3.2932

    3.4

    0.3290

    12.6

    2.2340

    20.2

    3.3912

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    51/150

    3.5

    0.3725

    13.7

    2.4153

    20.8

    3.4634

    3.8

    0.4118

    14.5

    2.6003

    21.5

    3.5419

    4.4

    0.5214

    15.7

    2.7550

    21.8

    3.6071

    5.1

    0.7066

    16.9

    2.8753

    22.5

    3.6772

    6.2

    1.0412

    17.9

    3.0508

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    52/150

    7.0

    1.2354

    18.9

    3.2112

    7.8

    1.3748

    8.5

    1.4969

    9.2

    1.6354

    10.6

    1.8880

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    53/150

    Table 2.8: Calibrations for Level Sensor 2

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    54/150

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    55/150

    3.23.253.33.353.43.453.53.553.63.653.7195200205210215220225230235y = 67*x - 16y = 17*x2 - 54*x + 1.9e+002y = 10*x3 - 91*x2 + 3.2e+002*x - 2.4e+002y = - 1.2e+002*x4 + 1.6e+003*x3 - 8.5e+003*x2 + 2e+004*x - 1.7e+004data 1linearquadraticcubic4th degree2002052102152202252303.23.253.33.353.43.453.53.553.63.653.7y = 0.015*x + 0.25y = - 5.8e-005*x2 + 0.04*x - 2.4data 1linearquadratic2030405060708090100110-0.500.511.522.5y = 0.022*x - 0.41y = - 5.2e-005*x2 + 0.029*x - 0.59y = - 1.9e-006*x3 + 0.00032*x2 + 0.006*x - 0.17y = 9.6e-008*x4 - 2.7e-005*x3 + 0.0027*x2 - 0.089*x + 1.1data1linearquadraticcubic4th degree0.20.40.60.811.21.41.61.822030405060708090100110120y = 44*x + 19y = 5.4*x2 + 34*x + 22y = 10*x3 - 27*x2 + 63*x + 16y = - 16*x4 + 78*x3 - 1.2e+002*x2 + 1.1e+002*x + 7.2data 1linear

    quadraticcubic4th degreeRegion 3-Figure 2.7: Sensor 1 conversions-region3Level Sensor 2 conversions:

    Voltage to height conversion

    Height to voltage conversion

    Region 1-

    Height to voltage conversion

    Voltage to height conversion

    Figure 2.8: Sensor 2 conversions-region1

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    56/150

    1001101201301401501601701801901.61.822.22.42.62.833.23.43.6y = 0.019*x - 0.13y = - 6.2e-006*x2 + 0.021*x - 0.26y = - 3.6e-007*x3 + 0.00015*x2 - 0.0023*x + 0.84data 1linearquadraticcubic1.822.22.42.62.833.23.43.6100110120130140150160170180190200y = 52*x + 6.8y = 0.88*x2 + 48*x + 13y = 2.8*x3 - 22*x2 + 1.1e+002*x - 38y = 5.9*x4 - 60*x3 + 2.3e+002*x2 - 3.2e+002*x + 2.4e+002data 1linearquadraticcubic4th degree1952002052102152202253.53.63.73.83.944.14.24.3y = 0.019*x - 0.075y = 6e-005*x2 - 0.0063*x + 2.5data 1linearquadratic3.53.63.73.83.944.14.24.3180190200210220230240y = 53*x + 4.5y = - 9.8*x2 + 1.3e+002*x - 1.4e+002y = 28*x3 - 3.4e+002*x2 + 1.4e+003*x - 1.8e+003y = 3.2e+002*x4 - 5e+003*x3 + 2.9e+004*x2 - 7.4e+004*x + 7.1e+004data 1linearquadratic

    cubic4th degreeRegion 2-Figure 2.9: Sensor 2 conversions-region2

    Height to voltage conversion

    Voltage to height conversion

    Region 3-Figure 2.10: Sensor 2 conversions-region3

    Height to voltage conversion

    Voltage to height conversion

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    57/150

    22.533.544.51214161820222426283032height in tank 1-cmVoltage generated - voltsregion1single linear fitregion 2region 305010015020025030000.511.522.533.544.55voltage generated by sensor 1-voltsheight in tank 1-mmregion1single linear fitregion 2region 3050100150200250300-10123456voltage generated by sensor 2-voltsheight in tank 2-mmregion 1single linear fitregion 2region 322.533.544.5510121416182022242628height in tank 2-cmVoltage generated - voltsregion 1sing;e linear fitregion 2region 3The inconsistency in the sensor conversions from one region to the other can bebetter observedby plotting the linear conversion functions for all the 3 regions simultaneously.

    Figure 2.11: Sensor 1 conversions for all 3 regions

    Sensor 1: voltage to height conversion

    Sensor 1: Height to voltage conversion

    Figure 2.12: Sensor 2 conversions for all 3 regions

    Sensor 2: Height to voltage conversion

    Sensor 2: voltage to height conversion

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    58/150

    2.5.2 Motor Calibrations

    Figure 2.13: Input-output entities for Motor PumpsMajor issues in Motor Calibrations-

    (i) Motor calibrations are comparatively simpler with respect to sensor calibrations. Heretoo, calibrations are carried out separately for pump motor 1 and pump motor 2.(ii) In order to determine the volume of water flowing into the tanks per unit time for agiven analog voltage fed to the motor, the outlet valves for both the tanks areclosed.

    Procedure: DAQ output lines are initialized and analog voltage is fed to the pump motors(separately for both) in steps of 0.5 volt for a sufficiently long time (10-20 sec) for eachiteratively increasing voltage. After the level in both the tanks settles to a steady state value forthe present voltage step, the level of water is read manually from the attachedscale. The readings

    thus obtained, have been tabulated in table (2.9) and table (2.10) for motor pump 1 and 2,respectively. The process is repeated for each step voltage. Then, the area of cross of the tanksand the time for reaching the present steady state being known, the volume of water and the rateat which it is pumped (r) pumped into the tanks can be calculated as follows-Total volume of water pumped in (V)= . Area of cross section (A)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    59/150

    Rate of flow (r) = (2.45)Calibrations for Motor Pump 1

    S.No.

    AppliedVoltage(volts)

    Initiallevel inTank 1(L1i) -cm

    Initiallevel inTank 2(L2i) - cm

    Finallevel inTank 1

    (L1f) -cmFinallevel inTank 2(L2f) -cm

    Totalincreasein level[(L1f- L1i)+ (L2f-

    L2i) ] -cm

    Time(sec)

    Rate offlow (r) cm^3/sec

    1

    0.5

    2.0

    2.0

    2.0

    2.0

    0

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    60/150

    20

    0

    2

    0.75

    2.0

    2.0

    2.9

    2.9

    1.8

    20

    2.79

    3

    1.002.9

    2.9

    4.5

    4.5

    3.2

    20

    4.96

    4

    1.25

    4.5

    4.5

    7.1

    7.1

    5.2

    20

    8.06

    5

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    61/150

    1.50

    7.1

    7.1

    10.5

    10.5

    6.8

    20

    10.54

    6

    1.75

    10.5

    10.5

    14.614.6

    8.2

    20

    12.71

    7

    2.00

    14.6

    14.6

    19.6

    19.6

    10.0

    20

    15.5

    8

    2.25

    2.0

    2.0

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    62/150

    4.7

    4.7

    5.4

    10

    16.74

    9

    2.50

    4.7

    4.7

    7.7

    7.7

    6.0

    1018.6

    10

    2.75

    7.7

    7.7

    11.0

    11.0

    6.6

    10

    20.46

    11

    3.00

    11.0

    11.0

    14.6

    14.6

    7.2

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    63/150

    10

    22.32

    12

    3.25

    14.6

    14.6

    18.5

    18.5

    7.8

    10

    24.18

    13

    3.5018.5

    18.5

    22.9

    22.9

    8.8

    10

    27.28

    14

    3.75

    22.9

    22.9

    27.5

    27.5

    9.2

    10

    28.52

    15

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    64/150

    4.00

    15.0

    15.0

    20.0

    20.0

    10.0

    10

    31.00

    16

    4.25

    5.0

    5.0

    10.210.2

    10.4

    10

    32.24

    17

    4.50

    10.2

    10.2

    15.8

    15.8

    11.2

    10

    34.72

    Table 2.9: Calibrations for Motor Pump 1

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    65/150

    Calibrations for Motor Pump 2

    S.No.

    AppliedVoltage(volts)

    Initiallevel inTank 1(L1i) -cm

    Initiallevel inTank 2(L2i) - cm

    Finallevel inTank 1(L1f) -cm

    Finallevel inTank 2(L2f) -cm

    Totalincreasein level[(L1f- L1i)+ (L2f-L2i) ] -cm

    Time(sec)

    Rate offlow (r) cm^3/sec

    1

    0.5

    2

    2

    2

    2

    0

    10

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    66/150

    0

    2

    0.75

    2

    2

    2

    2

    0

    10

    0

    3

    1.00

    2

    2

    2.2

    2.2

    0.4

    10

    1.24

    4

    1.25

    2.2

    2.2

    2.7

    2.7

    1

    10

    3.10

    5

    1.50

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    67/150

    2.7

    2.7

    3.6

    3.6

    1.8

    10

    5.58

    6

    1.75

    3.6

    3.6

    5.0

    5.0

    2.8

    10

    8.68

    7

    2.00

    5.0

    5.0

    6.8

    6.8

    3.6

    10

    11.16

    8

    2.25

    6.8

    6.8

    9.1

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    68/150

    9.1

    4.6

    10

    14.26

    9

    2.50

    9.1

    9.1

    11.8

    11.8

    5.4

    10

    16.74

    10

    2.75

    2.0

    2.0

    5.0

    5.0

    6.0

    10

    18.60

    11

    3.00

    5.0

    5.0

    8.5

    8.5

    7.0

    10

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    69/150

    21.70

    12

    3.25

    8.5

    8.5

    12.3

    12.3

    7.6

    10

    23.56

    13

    3.50

    12.3

    12.3

    16.5

    16.5

    8.4

    10

    26.04

    14

    3.75

    16.5

    16.5

    21.0

    21.0

    9.0

    10

    27.94

    15

    4.00

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    70/150

    21.0

    21.0

    25.9

    25.9

    9.8

    10

    30.38

    16

    4.25

    5.0

    5.0

    10.2

    10.2

    10.4

    10

    32.24

    17

    4.50

    10.2

    10.2

    15.7

    15.7

    11.0

    10

    34.10

    Table 2.10: Calibrations for Motor Pump 2Input-output conversion equations worked out based on the obtained readings areshown infigure (2.14) and figure (2.15) for pump motor 1 and 2, respectively.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    71/150

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    72/150

    0510152025303500.511.522.533.544.55y = 0.12*x + 0.35y = 0.00061*x2 + 0.096*x + 0.47y = - 3.3e-005*x3 + 0.0023*x2 +0.073*x + 0.52y = - 3.1e-007*x4 - 1.1e-005*x3 + 0.0019*x2 + 0.077*x + 0.52y = 2.9e-007*x5 - 2.6e-005*x4 + 0.00077*x3 - 0.008*x2 + 0.12*x + 0.49y = - 5.6e-009*x6+ 8.8e-007*x5 - 4.9e-005*x4 + 0.0012*x3 - 0.011*x2 + 0.13*x + 0.49data 1linearquadraticcubic4th degree5th degree6th degree0.511.522.533.544.5-50510152025303540y = 8.4*x - 2.8y = - 0.37*x2 + 10*x - 4.6y = 0.21*x3 - 2*x2 + 14*x - 6.5y = - 0.04*x4 + 0.62*x3 - 3.3*x2 + 16*x - 7.2y = - 0.11*x5 + 1.3*x4 - 5.7*x3 + 9.8*x2 +3.7*x - 3.6y = 0.083*x6 - 1.4*x5 + 8.6*x4 - 27*x3 + 41*x2 - 18*x + 1.7y = 0.12*x7 - 1.9*x6 + 13*x5 - 45*x4 + 83*x3 - 83*x2 + 52*x - 13data 1linearquadraticcubic4th degree5th degree6th degree7th degree

    051015202530350.511.522.533.544.55y = 0.11*x + 0.77y = 7.6e-005*x2 + 0.1*x + 0.78y = 6.5e-005*x3 - 0.0032*x2 + 0.15*x + 0.72y = - 5.3e-006*x4 + 0.00042*x3 - 0.011*x2 + 0.2*x + 0.68y = 5e-007*x5- 4.7e-005*x4 + 0.0017*x3 - 0.026*x2 + 0.26*x + 0.65y = - 2.9e-008*x6 + 3.5e-006*x5 - 0.00016*x4 + 0.0037*x3 - 0.042*x2 + 0.3*x + 0.64data 1linearquadraticcubic4th degree5th degree6th degree0.511.522.533.544.5-505101520253035y = 9.3*x - 7.1y = 0.06*x2 + 9*x - 6.8y = - 0.51*x3 + 3.9*x2 + 0.87*x - 2.3y = 0

    .3*x4 - 3.5*x3 + 14*x2 - 12*x + 2.8y = - 0.13*x5 + 1.9*x4 - 11*x3 + 29*x2 - 26*x+ 6.9y = - 0.017*x6 + 0.13*x5 + 0.39*x4 - 6.5*x3 + 23*x2 - 21*x + 5.8data 1linearquadraticcubic4th degree5th degree6th degreeMotor 1conversions

    Figure 2.14: Motor 1 conversionsMotor 2conversions

    Rate to voltage conversion

    Voltage to rate conversion

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    73/150

    Rate to voltage conversion

    Voltage to rate conversion

    Figure 2.15: Motor 2 conversions

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    74/150

    Chapter 3 MPC Implementation on CoupledTank SystemLooking Ahead:

    .Introduction to Model Predictive Control..The State Space Model..Implementation of MPC on the Coupled Tank System.Disturbance Handling capabilities of MPC

    3.1 Introduction to Model Predictive ControlModel Predictive Control (MPC) is a control methodology wherein an appropriatesystem model is used to predict the future plant output over a user defined prediction horizon andconsequently an optimal control input sequence over a control horizon is determined by solvingan optimization problem that minimizes the error function (difference between set point and

    predicted output, over the prediction horizon) while respecting the system constraints. The firstinput of the control input sequence determined by the optimization algorithm isapplied to theactuator and the remaining control inputs are neglected. The new plant output/state is observedand the whole process is repeated at each sampling instant.The system model used for predicting the future output over the prediction horizon is theState Space Model. The major advantage of MPC methodology lies in the fact thatit can handlemultivariable system very efficiently while handling the system input and output

    constraints.MPC provides good tracking of the output and an efficient way to deal with input andoutput disturbance. This enables the algorithm to operate the plant very near tothe systemconstraints [1], and hence the plant delivers a near optimal performance. The overall functioningof the MPC can summarized in the following steps-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    75/150

    algo2(i) Given the present plant output/state, the system model is used to predict the futureoutput over the prediction horizon (Np).(ii) The system constraints and tracking error are formulated into cost functionwhich issolved as an optimization problem, and the optimal control input sequence isdetermined over the control horizon (Nc).(iii) The first input of the optimal control input sequence is applied to the actuator and theremaining are neglected.(iv) New plant output(s)/state(s) are observed and the whole process is repeated.

    Structural Overview Of MPC algorithm is shown in figure (3.1).

    Figure 3.1 : Structure of MPC

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    76/150

    3.1.1 The receding horizon concept:MPC is also commonly known as Receding Horizon Control because only the firstinput of the control horizon long control sequence is actually applied to the actuator in place, andthe remaining control inputs are neglected[1]. The process repeats at each sampling instant andhence the control horizon receeds by one at each iteration.

    Figure 3.2 : Receding Horizon Concept3.1.2 Set point improvement:Model predictive control methodology allows the luxury to choose the set point near to thespecified constraint. Normally, the plant should not be operated near the constraint to be able todeal with unexpected disturbances. But, if the control action is good enough todeal withunexpected disturbances, as it is with MPC, the plant can be operated very nearto the specifiedconstraints [1]. Hence optimal performance can be achieved.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    77/150

    This is illustrated in the Figure 3.3. The system output (a) has high varianceto disturbanceand hence, the set point has to be as far as possible from the constraint. System output (b) showsslightly better control action. Using predictive control allows to choose set point near theconstraint, as in (c).

    Figure 3.3 : Set point improvement [1]3.2 The State Space Model:The formulation of control law in MPC methodology is based on linear discrete time statespace model of the system. The continuous time state space equations (as per equations 2.40 and2.41) -= Ap.X + Bp.U (2.40)Y = Cp.X (2.41)are discretised using a sampling time Ts to obtain the discrete time state spacemodel-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    78/150

    X (k+1) = Ad .X (k) + Bd.U (k) (3.1-a)Y (k) = Cd.X (k) (3.1-b)Where,X (k) is n. dimensional state vector.U (k) is m. dimensional input vector.Y (k) is p. dimensional output vectorAd = discrete time state matrix of order n x n.Bd = discrete time input matrix of order n x m.Cd = discrete time output matrix of order p x n.For the present application of two input-two output coupled tank system, the vector dimensionsand order of state space matrices will be given as X (k) is 2 dimensional state vector representing the incremental height of water(h1 and h2) intank 1 and tank 2, respectivelyU (k) is 2 dimensional input vector representing the rate of flow of water (r1 and r2) into tank 1and tank 2, respectively.Y (k) is 2 dimensional output vector representing the incremental height of water (h1 and h2) intank 1 and tank 2, respectively.Ad = discrete time state matrix of order 2 x 2.Bd = discrete time input matrix of order 2 x 2.

    Cd = discrete time output matrix of order 2 x 2.Alternatively, state space model with incremental input can be used. This has theadvantage of eliminating steady state error and to achieve offset free tracking.The cost functionso formulated is used to penalize the incremental input (.u) rather than the input (u) itself.From the discrete time state space equations (3.1-a) and (3.1-b), we can write-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    79/150

    , andIncorporating these in the discrete time state space equations, following 3 augmented state spacemodels can be worked out-

    (a) Model 1-

    = . +[Cd 0]. (3.2)

    (b) Model 2-

    = . +[Cd I]. (3.3)

    (c) Model 3-

    = . +[0 I]. (3.4)All these 3 augmented state space model can be re-written in a generalized formwith state vectorrepresented by . (k) and the sate space matrices represented by A, B and C .. (k+1) = A . (k) + B .U (k) (3.5)Y (k) = C . (k) (3.6)

    The state vector . (k) and the state space matrices A, B and C will be given asshown in table(3.1)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    80/150

    Model 1

    Model 2

    Model 3

    State space matrix A

    State space matrix B

    State space matrix C

    [Cd 0]

    [Cd I]

    [0 I]

    State vector . (k)

    Table 3.1: Augmented state space modelsOf the above 3 augmented models, the Model 2 and Model 3 produce offset free tracking even ifthe model is inaccurate and/or disturbances are present. Experimental results supporting this factare given in the next section.3.2.1 Choice of Appropriate Augmented State Space Model

    Choice of an appropriate augmented state space model is crucial to the performance of thecontroller. Identifying a system model which is an exact replica of the actual plant is quietdifficult. Hence, proper selection ensures offset free tracking [1] of the set point even if there areerrors in the system modelling.The aim of using the augmented state space equation is to incorporate the incremental inputinstead of the input itself, in the cost function.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    81/150

    The cost function for deriving MPC control law is given as (Please refer Appendix for detailedderivation of the cost function) -J=2 + . 2 (3.7)If instead, the incremental input was not used, then the cost function would have been-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    82/150

    J=2 + . 2 (3.8)Now, for the cost function given by equation (3.8), the entities - tracking error and U control input will not be simultaneously equal to zero most of the time. In fact,and U=0 will be inconsistent most of the time. Hence, the cost minimization willnot be optimaland will be equal to the norm of and U.Alternatively, if the cost function given by equation (3.7) is used, the condition0 and .U=0 can be satisfied simultaneously in steady state. Hence, optimal costminimization(J=0) can be achieved.3.2.2Making Unbiased Predictions-In steady state, predictions will be unbiased if-y(k)ss (model) = y(k)ss(plant) (3.9)Predictions based on Model 1-C= [Cd 0] and . (k) =Hence, Y (k) = C. . (k)

    . Y(k) = [Cd 0] , in steady state X(k) = Xss and U(k) = Uss

    . Y(k)ss(model) = Cd. Xss (3.10)

    Then, equation (3.10) will hold true only if model is accurate. Hence, model 1 is sensitive tomodeling error.Now, considering Model 3-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    83/150

    C=[0 I] and . (k) = .Predictions are made according to the equation Y (k) = C. . (k).Then, in steady state Y (k)plant = Yss

    . Y(k) = =[0 I]

    . Y (k)ss(model) = 0. .Xss + I.Yss (plant)

    . Y(k)ss(model) = Yss(plant) (3.11)

    Similarly, with Sate Space Model 2-Y (k)ss(model) = Cp. .Xss + I.Yss (plant) (3.12)Now, for the case of coupled tank system, when control input is not zero, ripples exist on thesurface of water in the tank. Hence, even in steady state .Xss. 0. Therefore, from equation (3.12)Y (k)ss(model) = Yss(plant) may or may not be true.Hence, the augmented state space model 3, as given by equation (3.4) will be themost suitableoption to be used in the present case of coupled tank system. Experimental results highlightingthis fact have been shown in the figure (3.4).

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    84/150

    0501001501213141516171819output tank 2 - Y2 (cm)Samplesoutput - TANK 2model 1model 2model 3 *set point050100150-505101520253035Control input U2 (cm3/sec)Samplescontrol input-TANK 2model 1model 2model 3 *0501001501111.51212.51313.51414.51515.516output tank 1 Y1 (cm)Samplesoutput - TANK 1model 1model 2model 3*set point050100150051015202530Control input U1 (cm3/sec)Samplescontrol input-TANK 1model 1model 2model 3 *Figure 3.4: Comparison of 3 Augmented State Space ModelsAll further experiments have been carried out using the augmented state space model 3 given by equation(3.4).3.3. Solving the Quadratic Programming ProblemThe MPC control law is formulated as a Quadratic Programming (QP) problem [3] basedon the discrete time state space equations of the system model. The QP problem aims at

    minimizing the cost function-min T.Q. + cT(3.13-a)subjected to the constraints E = g (3.13-b)

    Tank 1-

    Tank 2-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    85/150

    (Refer Appendix B for detailed derivation of MPC control law)The control algorithm for solving the above QP problem was implemented in MATLAB.Many algorithms are available in literature concerning optimization problems [1,3, 10, 17],Interior point method (IPM) and Active Set Method (ASM) being the most common. Along withthese, MATLAB provides a function quadprogfor solving standard quadratic programmingproblem, and this was employed to solve the MPC optimization. The following command inMATLAB is used to generate the optimal control input sequence-.U = quadprog (Q, c, E, g)3.4 Implementation of MPC for level control in the Coupled TankSystem-MPC is to be implemented for level control in the coupled tank system, for whichthesystem constraints (input slew rate, input and output constraints) have to be accounted for. Thecontroller should generate optimal control input by solving the QP problem so asto drive thewater level to the desired set point and should provide efficient disturbance handling.

    Major Issues in Implementation of MPC on Coupled Tank SystemBefore the controller is implemented on the coupled tank system, the following two issuesneed to be looked into-

    .Operating region for the control action.Use of Manual Control to drive the water level inside the operating region.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    86/150

    3.4.1 Operating Region for the control actionRecalling from section 2.1.1.2 in chapter 2, the process model was developed from the non-linear Mass Balance Equations expressing the height of water in the two tanks asa function ofthe discharge coefficients (a1, a3 and a3) and area of cross-section of the tanks (A1 and A2).(2.6)(2.7)After linearizing this model around the operating point (desired set point) H1 and H2 for tank 1and tank 2, respectively the linearized model obtained was given as-(2.14)(2.15)Where all the symbols used are same as defined in chapter 2.The overall non linear system can thus be represented as pieces of regions in which thelinear approximation is valid [8]. The only issue concerning this linearized model is that itrepresents the actual system correctly only in a small region (Operating Band) around the chosenoperating points H1 and H2. Now, if initially the level of water in the 2 tanksrests near the

    bottom and it is supposed to track a set point far away (outside the range of validity of the linearapproximation) from the current water level. In this case the system identifiedis not valid duringthe course of output going from initial level to the operating region and hence,the control actionthus produced might be undesirable.

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    87/150

    3.4.2 Use of Manual Control -In order to deal with such a situation, manual control is used to bring the output in the twotanks into the Operating band and then the MPC control action is allowed to takeover (as shownin figure 3.5). The stretch of the operating region determines the sensitivity of the plant model.As observed from experiments performed on the Coupled tank System, the linearized modelrepresents the actual non linear system to a good extent within a region of 5-6cm around thechosen operating points H1 and H2.Procedure: Before starting the MPC control action, the present level of water isread from thelevel sensors by initializing the DAQ. If the level is found to be outside the operating regioncorresponding to the desired set points, manual control is switched ON till thelevel reacheswithin the operating region and then MPC control action takes over. Or else, ifthe initial sensorreadings depict the water level already inside the operating region, manual control is not used.

    Figure 3.5: Use of Manual control to drive the water level inside the Operatingregion

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    88/150

    3.4.3 Experimental SetupThe block diagram for implementation of closed loop MPC on the coupled tank system is shownin the figure (3.6)

    Figure 3.6: Implementation of Closed loop control on the Coupled TankSystem Block DiagramThe closed loop MPC is implemented on the coupled tank system by communicating withthe system through NI DAQmx 6024E, while the control algorithm runs in MATLAB (VersionR 2009). The analog input and output lines of the DAQ are initialized simultaneously in order tosend the control signals to the pump motors and the input lines are used to readthe present waterlevel, with both these tasks performed during each sampling time while the optimal controlsignal is also generated simultaneously in the same iteration.

    The state space model given by equation (3.4) is used. The limitations of motorpumpcapacity of 0-36 cm3/sec is incorporated as input constraints and the optimal co

    ntrol law with

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    89/150

    constraints is implemented by solving the QP problem using quadprog. function available inMATLAB.The figure (3.7) shows in detail, the experimental set up for implementation ofclosed loopMPC on the Coupled Tank System.

    Figure 3.7: Experimental Setup for Implementation of MPC on Coupled TankSystem

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    90/150

    3.4.4 Experimental resultsMPC control action is implemented for the following values-Set point tank 1 (H1) = 15 cm; Set point tank 2 (H2) =18 cmConstraints-

    (i) Input constraints (limitations of pumping rate r1 and r2 of the two motor pumps 1 and2, respectively)

    Motor1- 0 cm3/sec = r1 = 35.1363 cm3/secMotor2- 0 cm3/sec = r2 = 34.1162 cm3/sec(ii) Slew rate constraints (.r1 and .r2)--5 cm3/sec = .r1 = 15 cm3/sec-5 cm3/sec = .r2 = 15 cm3/sec(iii) Output constraints (Y)-0 cm = y1 = 18.23 cm0 cm = y2 = 20.85 cm ; where y1 and y2 represent the water level in tank 1 and tank2,respectively.The discrete time state space matrices as work out to be as follows-Ad=Bd = , Cd=

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    91/150

    02040608010012014016018010121416Output tank1 (cm)Samples020406080100120140160180051015Control input U1 (cm3/sec)Samples0204060801001201401601801214161820Output tank2 (cm)Samples0204060801001201401601802426283032Control input U2 (cm3/sec)SamplesImplementation Results-Figure 3.8: MPC implementation resultsAs seen from the experimental results in figure (3.8), the controller is able totrack the desired setpoints in the 2 tanks, while respecting the specified input, output and slew rate constraints. In theabove implementation of MPC, the following MPC parameters were used-Prediction horizon (Np)=30; Control Horizon (Nc)=10 ;bControl weighting factor (.) =3.5.The choice of appropriate MPC parameters is also very crucial to controller performance and hasbeen dealt with in greater detail in chapter 4 under the topic Tuning parameters.Implementation Results for other set points

    Tank 2-

    Tank 1-

    The system model developed from First Principles of Mass balance equations is dependenton the choice of operating points (H1 and H2) around which the linearization hasto be carriedout. Hence system model identified will be different for different set of operat

    ing points. Also, as

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    92/150

    05010015068101214Output tank1 (cm)Samples050100150010203040Control input U1 (cm3/sec)Samples050100150810121416Output tank2 (cm)Samples050100150010203040Control input U2 (cm3/sec)Samplesdiscussed in chapter 2, the sensor calibrations are not consistent throughout their respectivelengths. The program running in MATLAB has been so designed that it carries outthelinearization each time new pair of operating points is specified. The choice ofthe set point alsodetermines the choice of the sensor input-output conversion equation depending upon the region(region 1, 2 or 3) in which the set point falls. All these issues have been taken care off in theprogram in order to make the control mechanism robust in terms of the choice ofoperating point.Experimental results for choice of few other randomly chosen pair of operating points areshown in figures (3.9), (3.10) and (3.11).

    (a) H1=12 cm, H2=13.5 cm

    Tank 2-

    Tank 1-

    Figure 3.9: MPC implementation for H1-12cm, H2=13.5cm

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    93/150

    05010015014161820Output tank1 (cm)Samples050100150010203040Control input U1 (cm3/sec)Samples05010015012141618Output tank2 (cm)Samples050100150-2002040Control input U2 (cm3/sec)Samples0501001501618202224Output tank1 (cm)Samples050100150010203040Control input U1 (cm3/sec)Samples0501001501516171819Output tank2 (cm)Samples050100150-2002040Control input U2 (cm3/sec)Samples(b) H1=17cm , H2=15cm

    Tank 1-

    Tank 2-

    Figure 3.10: MPC implementation for H1-12cm, H2=13.5cm

    (c) H1=20cm, H2=17cm

    Tank 2-

    Tank 1-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    94/150

    Figure 3.11: MPC implementation for H1-12cm, H2=13.5cm

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    95/150

    05010015020025030012141618Output tank1 (cm)Samples05010015020025030005101520Control input U1 (cm63/sec)Samples0501001502002503001214161820Output tank2 (cm)Samples0501001502002503002224262830Control input U2 (cm3/sec)Samples3.5 Disturbance Handling Capabilities of MPCDisturbances are very common in all systems. These may occur in the form of fluctuationsof input voltage or sudden change of system output as a result of interaction with an externalenvironmental source. An efficient controller should be such that it reacts appropriately to suchdisturbances and brings back the system output to the desired set point.In the present implementations, a constant input disturbance is simulated and applied to themotor pumps such that the MPC control algorithm remains unknown of this disturbance andresorts to compensatory action once it starts receiving undesired values from the level sensors.

    A constant input disturbance of -0.5 volt (which corresponds to a drop of 5 cm3/sec in the

    flow rate from the motor pumps) is simulated and applied to Motor 1. After the disturbancerecedes and the output is brought back to the desired set point in both the tanks, a similarconstant input disturbance is applied to Motor 2. The experimental results as shown in the figure(3.12) demonstrate efficient disturbance handling capabilities of the controller. The controllerbrings back the water level to the specified set point and while doing so it takes care of the factthat the constraints are not violated.

    Tank 2-

    Tank 1-

    Figure 3.12: Disturbance handling capabilities of the Controller

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    96/150

    Chapter 4- Tuning of MPC parameters and MPCConstraint Handling CapabilitiesLooking Ahead:

    .Tuning of MPC parameters (Np, Nc and .).Constraint Handling Capabilities of the controller

    4.1 Tuning of MPC parametersProper choice of MPC tuning parameters viz., prediction horizon (Np), control horizon (Nc)and the control weighting factor (.) is crucial to the performance of the controller. The effect ofvariation of the three MPC parameters is studied one at a time keeping the othertwo constant.4.1.1 Tuning the Prediction Horizon (Np)The prediction horizon (Np) signifies how far into the future the control algorithm looksfor making the predictions pertaining to the system output, based upon the system model. Thecontrol law then aims at minimizing the error between the predicted output and t

    he desiredreference trajectory over the prediction horizon. Prediction horizon (Np) also influences theclosed loop system response; short prediction horizon may lead to response having someoscillations around the set point before finally settling down to the desired set point.The effect of variation of the prediction horizon (Np) is analyzed by keeping the other twoparameters constant-Control Horizon (Nc) = 7; Control weighting factor (.) =1.5.Prediction horizon tuning results are shown in the figure (4.1)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    97/150

    02040608010012014016018011.51212.51313.51414.51515.516output tank 1 Y1 (cm)Samplesoutput - TANK 1 : Nc=7,lambda=1.5Np=11Np=20Np*=30Np=50Np=70Np=100020406080100120140160180-202468101214control input-TANK1 : Nc=7 , lambda= 1.5Np=11Np=20Np*=30Np=50Np=70Np=10002040608010012014016018013141516171819output tank 2 Y2 (cm)Samplesoutput - TANK 2 : Nc=7,lambda=1.5Np=11Np=20Np*=30Np=50Np=70Np=10002040608010012014016018022242628303234Control input U2 (cm3/sec)Samplescontrol input-TANK 2 : Nc=7,lambda=1.5Np=11Np=20Np*=30Np=50Np=70Np=100TFigure 4.1: Effect of variation of Prediction Horizon (Np)As obvious from the experimental results shown in figure (4.1), a higher predictionhorizon causes lesser overshoot and the output settles to the desired set pointfaster than that withsmaller prediction horizon. As per the present application of Coupled Tank System is concerned,Np=30 would be an appropriate choice.4.1.2 Tuning the Control Horizon (Nc)

    Tank 1-

    Tank 2-

    The computational load on the MPC algorithm is directly proportional the magnitude of

    control horizon (Nc). The control horizon (Nc) determines the number of controlsteps that willbe calculated in order to achieve the control objective of minimizing the tracking error over the

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    98/150

    020406080100120140160180-20246810121416Control input U1 (cm3/sec)Samplescontrol input-TANK 1 : Np=30,lambda=1.5Nc=2Nc=7Nc*=10Nc=15Nc=2502040608010012014016018016182022242628303234Control input U2 (cm3/sec)Samplescontrol input-TANK 2 : Np=30,lambda=1.5Nc=2Nc=7Nc*=10Nc=15Nc=25prediction horizon. The control horizon should not be more than the prediction horizon (Np).Increasing the control horizon beyond a certain limit (usually about one-third of the predictionhorizon) does not do any favor to the system performance, but only adds to the computationalload.Effect of variation of control horizon (Nc) is analyzed by keeping the other twoparametersconstant at the following values-

    Prediction horizon (Np) =30; Control Weighting factor (.) =1.5.Figure 4.2: Effect of variation of the control horizon (Nc)

    Tank 2-

    Tank 1-

    As obvious from the experimental results shown in figure (4.2), increasing control horizonabove 10 does not cause any improvement in the performance but only adds to thecomputational

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    99/150

    02040608010012014016018011.51212.51313.51414.51515.51616.5output tank 1 Y1 (cm)Samplesoutput - TANK 1 : Np=30, Nc=10lambda=1.5lambda*=3.5lambda=7lambda=15lambda=50lambda=100020406080100120140160180-4-202468101214Control input U1 (cm3/sec)Samplescontrol input-TANK 1 : Np=30,Nc=10lambda=1.5lambda*=3.5lambda=7lambda=15lambda=50lambda=10002040608010012014016018013141516171819output tank 2 Y2 (cm)Samplesoutput - TANK 2 : Np=30, Nc=10lambda=1.5lambda*=3.5lambda=7lambda=15lambda=50lambda=100020406080100120140160180232425262728293031Control input U2 (cm3/sec)Samplescontrol input-TANK 2 : Np=30,Nc=10lambda=1.5lambda*=3.5lambda=7lambda=15lambda=50lambda=100load. Hence, control horizon (Nc) =10 would be an appropriate choice for the presentapplication.4.1.3 Tuning the Control Weighting Factor (.)

    The control weighting factor (.) determines the relative importance between thetrackingerror and the control input. Higher the value of ., higher will be the weightagetowardsminimizing the control signal with respect to the tracking error in the cost function. Hence, as a

    result of high value of control weighting factor (.) , the system will be more sluggish and willtake a long time to settle down to the desired set point.Figure 4.3: Effect of variation of Control Weighting Factor (.)

    Tank 2-

    Tank 1-

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    100/150

    Increasing . on other hand also helps in improving the robustness of a system havingmodel mismatch [9]. Therefore, a compromised value of . should be chosen. As perthe presentapplication, . =3.5 seems to be an appropriate choice as per the experimental results shown inthe figure (4.3).4.2 Constraint Handling Capabilities of the ControllerAbility to respect the system constraints is one the most unique features of MPCmethodology. Almost all practical systems come with certain constraints. Actuators can haveconstraints in terms of limited operating range and slew rate constraints depending upon theresponse time of systems. In general, the following three types of constraints [2] are known toexist commonly-

    (i) Slew rate constraints (.r).(ii) Input constraint (r).(iii) Output constraints (y).

    4.2.1 Slew rate constraints-Need for considering and imposing slew rate constraints-The motors used to pump in water into the tanks operate in the range of 0-5volts. The motor isable to handle a step increase or decrease of 5 volts.i.e, -5 = .u = 5 works well for the motor.But, this range of voltage change corresponds to a sudden change of rate of inflow of water of35cm3/sec.-36 cm3/sec = .r = 36 cm3/sec

    Considering the worst case of rise in voltage from 0 to 5volt will cause 36cm3of water to

    be pumped into the tank in 1 second. This creates a splash on the surface of water, which mightlead to a false sensor reading, which further might even correspond to a value outside the output

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    101/150

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    102/150

    02040608010012014016018010111213Output tank1 (cm)Samples02040608010012014016018005101520Control input U1 (cm3/sec)Samples0204060801001201401601801011121314Output tank2 (cm)Samples02040608010012014016018015202530Control input U2 (volts)Samples02040608010012014016018010111213Output tank1 (cm)Samples020406080100120140160180010203040Control input U1 (cm3/sec)Samples02040608010012014016018010121416Output tank2 (cm)Samples020406080100120140160180010203040Control input U2 (cm3/sec)Samples(b) -5 cm3/sec = .r = 5 cm3/sec

    Tank 1-

    Tank 2-

    Figure 4.4-b: Slew rate constraints - 5 cm3/sec = .r = 5 cm3/sec

    (c) -15 cm3/sec = .r = 15 cm3/sec

    Tank 2-

    Tank 1-

    Figure 4.4-c: Slew rate constraints - 15 cm3/sec = .r = 15 cm3/sec

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    103/150

    02040608010012014016018010111213Output tank1 (cm)Samples020406080100120140160180010203040Control input U1 (cm3/sec)Samples02040608010012014016018010121416Output tank2 (cm)Samples020406080100120140160180010203040Control input U2 (cm3/sec)Samples(d) -20 cm3/sec = .r = 20 cm3/sec

    Tank 1-

    Tank 2-

    Figure 4.4-d: Slew rate constraints - 20 cm3/sec = .r = 20 cm3/sec

    Figure 4.4: Constraint Handling Capabilities (Slew rate constraints)4.2.2 Input (u) constraints-The input constraints for the motor are: 0 volt = u = 5 volt. But, for safety reasons andalso because the tank system starts reverberating at voltage higher than 4.5 volt, the voltageconstraints actually imposed are: 0 volt = u = 4.5 volt.This translates to rate constraints of-Motor1- 0 cm3/sec = r1 = 35.1363 cm3/secMotor2- 0 cm3/sec = r2 = 34.1162 cm3/secSlew rate and output constraints are maintained at the following levels-

    -5 cm3/sec = .r = 5 cm3/sec

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    104/150

    02040608010012014016018010111213Output tank1 (cm)Samples020406080100120140160180010203040Control input U1 (cm3/sec)Samples02040608010012014016018010121416Output tank2 (cm)Samples020406080100120140160180010203040Control input U2 (cm3/sec)Samples0 cm = y1 = 12.6 cm0 cm = y2 = 14.3 cmExperimental results demonstrating the constraint handling capabilities of the controllerpertaining to the specified input constraints are shown in figures (4.5-a), (4.5-b) and (4.5-c).

    (a) 0 cm3/sec = r1 = 35.1363 cm3/sec ; 0 cm3/sec = r2 = 34.1162 cm3/sec

    Tank 1-

    Tank 2-

    Figure 4.5-a: Input constraints (0 cm3/sec = r1 = 35.1363 cm3/sec; 0 cm3/sec = r2 = 34.1162 cm3/sec)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    105/150

    02040608010012014016018010111213Output tank1 (cm)Samples020406080100120140160180010203040Control input U1 (cm3/sec)Samples02040608010012014016018010121416Output tank2 (cm)Samples020406080100120140160180010203040Control input U2 (cm3/sec)Samples02040608010012014016018010111213Output tank1 (cm)Samples0204060801001201401601800102030Control input U1 (cm3/sec)Samples02040608010012014016018010121416Output tank2 (cm)Samples0204060801001201401601800102030Control input U2 (cm3/sec)Samples(b) 0 cm3/sec = r1 = 30.94 cm3/sec ; 0 cm3/sec = r2 = 30.94 cm3/sec

    Tank 1-

    Tank 2-

    Figure 4.5-b: Input constraints ((0 cm3/sec = r1 = 30.94 cm3/sec; 0 cm3/sec = r2= 30.94 cm3/sec))

    (c) 0 cm3/sec = r1 = 28.5571 cm3/sec ; 0 cm3/sec = r2 = 28.4770 cm3/sec

    Figure 4.5-c: Input constraints (0 cm3/sec = r1 = 28.5571 cm3/sec; 0 cm3/sec = r

    2 = 28.4770 cm3/sec)

    Tank 1-

    Tank 2-

    Figure 4.5: Constraint Handling Capabilities (Input Constraints)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    106/150

    020406080100120140160180101520Output tank1 (cm)Samples020406080100120140160180051015Control input U1 (cm3/sec)Samples02040608010012014016018010152025Output tank2 (cm)Samples020406080100120140160180253035Control input U2 (cm3/sec)Samples4.2.3 Output (y) constraints-The capability of the mpc controller to handle output constraints can be demonstrated if aloosely tuned controller is able to keep the plant output (precisely its overshoot) below themaximum value given by the constraint. Overshoot and thus constraint violation can be avoidedby properly tuning the controller, but here loose tuning is done just for the sake of demonstratingits ability to respect the constraints.MPC parameters chosen- Np=10, Nc=5, .=1.Slew rate and input (u) constraints are chosen as follows--5 cm3/sec = .r = 15 cm3/sec0 cm3/sec = r1 = 35.1363 cm3/sec;0 cm3/sec = r2 = 34.1162 cm3/secExperimental results demonstrating the constraint handling capabilities of the controllerpertaining to the specified output constraints are shown in figures (4.6-a), (4.

    6-b) and (4.6-c).(a) 0 cm = y1 = 18.23 cm ; 0 cm = y2 = 20.85 cm

    Tank 2-

    Tank 1-

    Figure 4.6-a: Output constraints (0 cm = y1 = 18.23 cm; 0 cm = y2 = 20.85 cm)

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    107/150

    0204060801001201401601801012141618Output tank1 (cm)Samples020406080100120140160180051015Control input U1 (cm3/sec)Samples0204060801001201401601801214161820Output tank2 (cm)Samples020406080100120140160180253035Control input U2 (cm3/sec)Samples0204060801001201401601801112131415Output tank1 (cm)Samples020406080100120140160180051015Control input U1 (cm3/sec)Samples0204060801001201401601801214161820Output tank2 (cm)Samples0204060801001201401601802628303234Control input U2 (cm3/sec)Samples(b) 0 cm = y1 = 16.28 cm ; 0 cm = y2 = 19.29 cm

    Tank 2-

    Tank 1-

    Figure 4.6-b: Output constraints (0 cm = y1 = 16.28 cm; 0 cm = y2 = 19.29 cm)

    (c) 0 cm = y1 = 15.00 cm ; 0 cm = y2 = 18.25 cm

    Tank 2-

    Tank 1-

    Figure 4.6-c: Output constraints (0 cm = y1 = 15.00 cm; 0 cm = y2 = 18.25 cm)

    Figure 4.6: Constraint Handling Capabilities -Output constraints

  • 8/13/2019 Application of Mpc to Cts2-Correcetd

    108/150

    Chapter 5 Conclusion and Recommendationsfor further ImprovementsLooking Ahead:

    .Conclusions reached after implementation of MPC on the Coupled Tank System.Recommendations and scope for further improvements

    5.1 ConclusionFrom the experimental results obtained, it is concluded that MPC has been implementedsuccessfully for level control in the Coupled Tank System, which was the primaryobjective ofthe project. MPC therefore, comes out to be a suitable control methodology for set point trackingand its inherent capability to account for system constraints proves to be likethe icing on a cake.The system state space model was developed using the Mass balance equations forvolumeof water contained in the tank. The non linear equations thus obtained were line

    arized aroundthe desired operating point and consequently the discrete time state space modelfor the systemwas developed. Augmented state space model (Model 3 Eq. 2.4) with incremental input insteadof the input itself is used in the implementations in order to ensure offset free tracking of the setpoint.Further, a constant input disturbance was introduced in the two motor pumps andthe abilityof the controller to bring back the outputs in the two tanks to the desired setpoint wasdemonstrated. Experiments were carried out for tuning of MPC parameters viz, the