Modeling and control of a District Heating System 10 th SEMESTER PROJECT,AALBORG UNIVERSITY 2010 THE DEPARTMENT OF ELECTRONIC SYSTEMS
Modeling and control of a District Heating System10th SEMESTER PROJECT, AALBORG UNIVERSITY 2010THE DEPARTMENT OF ELECTRONIC SYSTEMS
Control Engineering
10th Semester
Fredrik Bajers Vej 7
Telephone 96 35 86 90
http://es.aau.dk
Title:Modeling and control of a DistrictHeating System
Theme:Intelligent Autonomous systems
Project period:Spring 2010
Project group:10gr939
Group members:Anders Jochumsen
Supervisor:Associate Professor Klaus Trangbæk
Publications: 9
Pages: 78 (117 including appendix)
Finished: June 3rd, 2010
Synopsis:
The purpose of this project is to design a modelbased control system, allowing district heating sys-tems to follow a novel, energy saving, infrastruc-ture. The control objective is to track a constant dif-ferential pressure reference for multiple end users,with varying consumptions. Throughout the projecta laboratory model provided by Grundfoss A/S, ofa scaled district heating system, is used as platform.A first principles model is derived and its parame-ters fitted by use of parameter estimation, throughmeasurements on the laboratory model. Based onthe derived model, Linear and Linear ParameterVarying (LPV) -state space descriptions are found.An Extenden Kalman Filter (EKF) is designed forestimation of flows and consumptions, based on dif-ferential pressure measurements. The performanceof the EKF is concluded satisfactory, enabling inde-pendence of consumption sensors.In the project, two overall control methods areinvestigated. The first method is standard Lin-ear Quadratic (LQ) control, based on the linearstate space description. An LQ controller are de-signed and implemented, showing satifactory per-formance. The second class of control methods in-vestigated are those referred to as LPV methods.With basis in the LPV model and the EKF, twoLPV methods are planned applied. Due to massivenumerical problems in the solving of Linear Ma-trix Inequalities, neither of the methods were im-plemented.
Preface
This thesis concerns the modeling and control of a scaled district heating system. The project is composed dur-ing the period from September 3rd 2009 to June 3nd 2010, as part of a 10th semester project at the departmentof Intelligent Autonomous Systems (IAS), at Aalborg University.
Group 1039, Aalborg University
Anders Jochumsen
Contents
1 Introductory 21.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Description of scaled laboratory model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.4 Outline of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
I Modelling 7
2 Derivation of model 112.1 Pipe model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Pump model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.3 Valve model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.4 Piecing the components together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Parameter estimation 163.1 Input signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2 Estimation and verification of parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.3 Estimation of valve friction as a function of valve position . . . . . . . . . . . . . . . . . . . 24
4 Linearisation 264.1 Linearisation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Deriving a linear state space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.3 Discrete time state space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.4 Pump delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
II Control 31
5 Linear Quadratic controller 365.1 Optimal control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365.2 Introducing reference and integral action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.3 Implementation of the LQ controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.4 Simulation of the LQ controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6 Observer Design 52
6.1 Design of Kalman filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.2 Design of Extended Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556.3 Observer verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7 Linear Parameter Varying Control 607.1 LPV background and analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.2 Identification of an LPV model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617.3 LPV control design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
III Epilogue 71
8 Conclusion 75
IV Appendices 79
A Matrices 80A.1 Matrices used in section 2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80A.2 Matrices used in section 4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81A.3 Matrices used in section 5.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83A.4 Matrices used in section 7.2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
B Measurement journals 87B.1 Analysing the consumer valves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87B.2 Pump delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89B.3 Measurement of pipe frictions proportions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
C Simulations of the LQ controller 94
Chapter 1Introductory
This chapter will introduce the reader to the project, which this thesis concerns. The first section is a generalintroduction to the problem at hand. Then follows a section with a brief description of the test environment.This is followed by a presentation of the scope of the project and an outline of the content of the thesis.
1.1 Introduction
The motivation behind this project originates in the context of the planning of a new housing sector. Accordingto a technical report from Energistyrelsen [1], a new housing sector calls for a redesign of the whole districtheating system, the primary reason being, that too much heat are lost along the pipelines of the current network.In order to describe the problem with the current network, the basic idea of the current design are depicted infig 1.1.
Figure 1.1: The structure of current district heating systems. (figure from [2, p.3])
At the left side of the figure, there is a thermal plant, which, via a feeding pipe, provides hot water to theconsumers, at the right side. The water is moved to the consumers by a single (large) pump. According to [3,p.2] The consumer flow rate is best controlled when the differential pressures across the heat exchangers areconstant. In a one pump configuration the pressure are highest right after the pump and decreases as a functionof the distance to the pump. To be able to deliver a sufficient pressure difference at the consumers, the diameterof the main pipe has to be relatively large. Cooling of an object is directly proportional to its surface area, and
Introductory 3
calculations performed in [1, p.33-48] shows that the heat loss from a pipe decreases quite dramatically whenthe diameter (i.e the surface) of the pipe are made smaller. In order to reduce the pipe surface a novel approachto district heating system infrastructure are proposed in e.g [1] [4].
The basic structure of the proposed infrastructure are depicted on fig 1.2. This method utilizes multiple pumpsalong the feeding pipe and a pump at each consumer. First of all, this allows the main pipe to be considerablysmaller than in the current infrastructure, because a larger pressure drop can be overcome by the increased num-ber of pumps. Secondarily the pumps introduced at the consumers gives an increased controllability allowinga constant differential pressure for each consumer, and with pumps operating in series, district heating systemscan be made somewhat robust to defect pumps.
Figure 1.2: The proposed structure of a new district heating system. (figure from [2, p.3])
1.2 Description of scaled laboratory model
To investigate different control approaches for the new kind of district heating system a scaled laboratorymodel has been designed by Grundfoss A/S. This model will serve as test environment throughout the project.A picture of the scaled laboratory model are displayed at fig 1.3 and the hydraulic network of the model areshown on fig 1.4. The system consists of one main pipe and four branches. Each branch contains a computercontrolled valve, simulating the primary side of a heat exchanger that would be present at a real life consumer.The input to the system are the speed of six pumps, two, at the main pipe an one in each branch. Relativepressure sensors are placed on each side of the "‘main pipe"’ pumps and prior to the ”consumer” pumps.In addition to these, differential pressure sensors are placed over each of the consumer valves. The pumps,valves and sensors are connected to a computer with two I/O boards of type NI6703(DAC) and NI6024E(ADC)respectively. The ADC collects sensor data, whilst the DAC generates analog control signals (0-10V) to controlthe pumps and valves. The control signals for the pumps are led through an analog to PWM converter, suchthat the actual control signals received by the pumps, are PWM signals. On the laboratory computer the twoI/O-boards has been installed with Comedi drivers providing an interface to Simulink Real Time Workshop.The dimensions of the laboratory model has been designed, such that the input-output behaviour, except for atime scale factor, corresponds to that of a realistic district heating system.
4 1.2 Description of scaled laboratory model
Figure 1.3: Picture of the scaled laboratory model
q3
q1
q2
q4
Pm2Pm1
P3P
2P1 P
4
V 1 V 2 V 3 V 4
qm1
qm2
qm3
qm4
"long" pipe (R)
pump (P)
valve (V)
R 11
R 12 R 13
R 14
R22
R 21
R 23
R 24
R 31
R 32 R 33
R 34
R 41
R42
R43
R 44
pressure sensor
78 4 3
6 5 2 1
Figure 1.4: The hydraulic network of the scaled laboratory model.
Introductory 5
1.3 Objectives
The overall scope of the project is to apply control methods, capable of tracking a constant differential pres-sure reference for varying consumptions, utilizing a minimal number of sensors. Two control methods will beinvestigated and compared. The first method tested is standard Linear Quadratic (LQ) Control, which does nottake consumption disturbances into account. The second method is Linear Parameter Varying (LPV) Control,which if cast properly, can take disturbances known on-line, into account, with guaranteed stability. Utilizinga minimal number of sensors, calls for the use of an observer. Consequently an observer will be designed forestimation of flows and consumption, by use of Extended Kalman Filtering.
The controllers will be tested at a scenario resembling operation of a typical district heating system. In [2]an analysis are made of hot water consumption at real life end users. It is concluded that the dynamics ofthe consumption, almost exclusively consists of steps and that since heating exchangers functions as low passfilters, disturbances can be approximated by letting the position of the consumer valves change as ramp signals.[2] furthermore judges 0.1 [bar] as a reasonable differential pressure references, considering the proportions ofthe laboratory model. These conclusions are adopted in this thesis. Given a fixed differential pressure referenceof 0.1 [bar], the range of valve positions, over which the designed control systems should function, can beanalysed. This analysis is performed in Appendix B.1. Based on the analysis it is found that the controllersdesigned for the system, are to operate in the range of valve positions displayed in table 1.1.
Name Valve position(s) [%]Valve1 0-0.67Valve2 0-0.65Valve3 0-0.57Valve4 0-0.31
Table 1.1: The range of valve positions, over which a differential pressure of 0.1 bar should besustainable.
1.4 Outline of the thesis
The content of the thesis is divided into a number of chapters, which are outlined in this section to providesome overview of the thesis.
Chapter 2: Derivation of ModelIn this chapter, a first principles model of the scaled district heating system are derived. This is done by firstderiving the equations linking flow and pressure, for the pumps, pipes and valves, respectively. Based on theseequations the total system description are obtained by use of Kirchoffs 1st and 2nd law.
Chapter 3: Parameter EstimationIn this chapter the parameters of the first principles model are estimated. First an optimal set of input signals aredesigned by minimizing the ratio between the maximal and minimal parameter sensitivity. Then the estimationof the majority of the parameters are performed by use of a Gauss Newton search algorithm. The rest of theparameters are measured in appendix B.3
6 1.4 Outline of the thesis
Chapter 4: LinearisationIn this chapter a linear discrete time state space description are derived. The linearisation is performed usingfirst order Taylor approximations. At the end of the chapter, some considerations are made regarding the delaysof the system, resulting in an augmentation of the state space description.
Chapter 5: Linear Quadratic ControlIn this chapter an introduction to optimal control is given. Then a Linear Quadratic controller is designed basedon the discrete time state space description, introducing reference and integral action through augmentation ofthe state space description. The chapter concludes with some thoughts regarding implementation, and simula-tions of the controller.
Chapter 6: Observer DesignThis chapter starts with a discussion of different observer strategies, deciding for an Extended Kalman Filter(EKF). The EKF are designed to estimate flows and consumption, based on measurements of differential pres-sures over the consumer valves. The chapter concludes with a comparison between the EKF and a NormalKalman Filter, with access to consumption measurements.
Chapter 7: Linear Parameter Varying ControlThis chapter starts with a discussion of application of the LPV design methods presented in [5] and [6], in thecontext of the system and the EKF. Then part of the system is suggested Linear Parameter Varying and an LPVmodel are fitted, using the frictions of the consumer valves as parameter vector. After this a design based on[5] are presented and sought implemented.
Chapter 8: ConclusionThis chapter contains summaries of, and concluding remarks to, the subjects treated in the thesis
Part I
Modelling
8
Table of Contents
2 Derivation of model 112.1 Pipe model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Pump model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.3 Valve model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.4 Piecing the components together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Parameter estimation 163.1 Input signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2 Estimation and verification of parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.3 Estimation of valve friction as a function of valve position . . . . . . . . . . . . . . . . . . . 24
4 Linearisation 264.1 Linearisation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Deriving a linear state space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.3 Discrete time state space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.4 Pump delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
10 TABLE OF CONTENTS
Chapter 2Derivation of model
This part concerns the modeling of the scaled district heating system. An analogy between electrical andhydraulic circuits, exists, such that voltages and currents can be replaced with, respectively, pressures and flows.The hydraulic network of the district heating system consists entirely of three basic components: pipelines,pumps and valves. This means that equations describing the entire system can be made based on equationslinking flows and pressure drops of the individual components. The aims of the next 3 sections will thereforebe to find equations linking flows and pressure drops for the pipelines, pumps and valves, respectively.
2.1 Pipe model
The pipe model is derived under the assumption that the flow is uniformly distributed along a cross section ofthe pipe, and that the flow is turbulent. Given a turbulent flow, the following pipe model applies [7, p.59-60]:
J · dqdt
= ∆Hpipe −∆Hfric (2.1)
Where:
• ∆Hpipe is the pressure across the pipe
• q is the flow
• J are a constant parameter of the pipe
• ∆Hfric are a the pressure loss due to friction
The pressure loss caused by friction ∆Hfric are, under the condition of a turbulent flow, according to [7,p.59-60] given as the following:
∆Hfric =0.316 · lρv2
Re0.25 · 2d(2.2)
Where
• where l is the length of the pipe
12 2.2 Pump model
• ρ is the density of the fluid
• v is the velocity of the fluid
• d is the diameter of the pipe
• Re is the Reynolds number
In [7, p.59] the Reynolds number are given as:
Re =v · dhvk
(2.3)
where
• v is the velocity of the fluid
• dh is the hydraulic diameter of the pipe
• vk is the kinematic viscosity
Incertion of eq 2.3 into eq 2.2 gives the following expression for the pipe friction:
∆Hfric =0.316 · lρv2
( v·dh
vk)0.25 · 2d
∆Hfric =0.316 · lρ( qA )2
(qA ·dh
vk)0.25 · 2d
∆Hfric = Kpipe · q1.75 (2.4)
where
• Kpipe are a constant parameter of the pipe
2.2 Pump model
The pumps of the system are centrifugal pumps, which according to [8, p. 47] can be modeled as equation 2.5:
∆Hpump = Pmax((n
nmax)2 − (
q
qmax)2) (2.5)
Where:
• ∆Hpump is the pressure across the pump
• Pmax is the maximal pressure the pump can deliver
• n is revolution speed
• nmax is the maximal revolution speed
• q is the flow through the pump
• qmax is the maximal flow through the pump
Derivation of model 13
Figure 2.1: The relasioship between control signal and pump speed (from [9])
As described in section 1.2, the control signals to the pumps are PWM signals. The pumps each have an internalcontroller, which based on the duty cycle of the PWM signal controls the revolution speed as depicted on fig2.1. From the figure it is seen that the term n
nmaxof equation 2.5 can be replaced by a variable U, defined as:
U =
1 for D < 10%− 4
3 ·D + 1.133 for D >= 10 and D <= 85%0 for D > 85%
(2.6)
Where
• D is the duty cycle of the control signal
Insertion of U into 2.5 gives the final pump equation:
∆Hpump = Pmax · U2 − Pmaxq2max
· q2 (2.7)
2.3 Valve model
According to [10, p.320] valves are normally viewed as pipe fittings. This means that the pressure across thevalve, at a fixed valve position, can be modeled by a quadratic relationship with the flow through the valve:
∆Hvalve = Kv · q2 (2.8)
Where
• ∆Hvalve is the pressure across the valve
• Kv is a valve constant, which changes with the position of the valve
• q is the flow through the valve
14 2.4 Piecing the components together
2.4 Piecing the components together
As stated at the beginning of the chapter the hydraulic network of the scaled district heating system consistsentirely of pipelines, pumps and valves. Equations linking pressure and flow, for each of the three, has beenfound in the previous section, and now the components must be pieced together into state space form, suitablefor model based controller design in later chapters. In the following, the analogy between electric circuits andhydraulic networks are exploited, in the sense that flow can be viewed as current and pressure can be viewedas voltage. Applying Kirchoff’s 1st and 2nd law to the system, displayed for convenience in fig 2.2, gives thefollowing equations:
Kirchoff’s 1st law:
qm1 = q1 + q2 + q3 + q4 (2.9)
qm2 = q2 + q3 + q4 (2.10)
qm3 = q3 + q4 (2.11)
qm4 = q4 (2.12)
Kirchoff’s 2nd law:
∆HPm1 −∆HR11 −∆HR12 + ∆HP1 −∆HV1 −∆HR13 −∆HR14 = 0 (2.13)
∆HPm1 −∆HR11 −∆HR21 −∆HR22 + ∆HP2 −∆HV2 −∆HR23 (2.14)
−∆HR24 −∆HR14 = 0 (2.15)
∆HPm1 −∆HR11 −∆HR21 + ∆HPm2 −∆HR31 −∆HR32 + ∆HPm1
−∆HV3 −∆HR33 −∆HR34 −∆HR24 −∆HR14 = 0 (2.16)
∆HPm1 −∆HR11 −∆HR21 + ∆HPm2 −∆HR31 −∆HR41 −∆HR42
+∆HP4 −∆HV4 −∆HR43 −∆HR44 −∆HR34 −∆HR24 −∆HR14 = 0 (2.17)
Insertion of the pipe, pump and valve models (eqs. 2.1, 2.7 and 2.8) along with the flows of eqs. 2.9-2.12,yields the following set of equations:
(J11 + J14) · qm1 + (J12 + J13) · q1 =Pmax · (U2
m1 + U21 )− ( Pmax
Qmax2 )(q2m1 + q2
1)−Kv1 · q21 − (K11 +K14) · q1.75
m1 − (K12 +K13) · q1.751
(2.18)
(J11 + J14) · qm1 + (J21 + J24) · qm2 + (J22 + J23) · q2 =Pmax · (U2
m1 + U22 )− ( Pmax
Qmax2 )(q2m1 + q2
2)−Kv2 · q22 − (K11 +K14) · q1.75
m1 − (K21 +K24) · q1.75m2
−(K22 +K23) · q1.752
(2.19)
(J11 + J14) · qm1 + (J21 + J24) · qm2 + (J31 + J34) · qm3 + (J32 + J33) · q3 =Pmax · (U2
m1 + U2m2 + U2
3 )− ( Pmax
Qmax2 )(q2m1 + q2
m3 + q23)−Kv3 · q2
3 − (K11 +K14) · q1.75m1
−(K21 +K24) · q1.75m2 − (K31 +K34) · q1.75
m3 − (K32 +K33) · q1.753
(2.20)
Derivation of model 15
q3
q1
q2
q4
Pm2Pm1
P3P
2P1 P
4
V 1 V 2 V 3 V 4
qm1
qm2
qm3
qm4
"long" pipe (R)
pump (P)
valve (V)
R 11
R 12 R 13
R 14
R22
R 21
R 23
R 24
R 31
R 32 R 33
R 34
R 41
R42
R43
R 44
pressure sensor
78 4 3
6 5 2 1
Figure 2.2: Diagram of the scaled laboratory models hydraulic system
(J11 + J14) · qm1 + (J21 + J24) · qm2 + (J31 + J34) · qm3 + (J41 + J44) · qm4 + (J42 + J43) · q4 =Pmax · (U2
m1 + U2m2 + U2
4 )− ( Pmax
Qmax2 )(q2m1 + q2
m3 + q24)−Kv4 · q2
1 − (K11 +K14) · q1.75m1
−(K21 +K24) · q1.75m2 − (K31 +K34) · q1.75
m3 − (K41 +K44) · q1.75m4 − (K42 +K43) · q1.75
4
(2.21)
Eqs. 2.18-2.21 can be written into one compact matrix equation as follows:
J
q1
q2
q3
q4
= −Kv ·
q21
q22
q23
q24
+R ·
U2m1
U21
U22
U2m2
U23
U24
− S ·
q21
q22
q23
q24
q2m1
q2m2
q2m3
q2m4
− T ·
q1.751
q1.752
q1.753
q1.754
q1.75m1
q1.75m2
q1.75m3
q1.75m4
(2.22)
Where
• J ,Kv , R, S and T are coeficint matrices (displayed in appendix A)
2.4.1 Chapter Summary
This chapter has described the scaled district heating system mathematically. This where done by first setting upequations linking flow and pressure for the systems individual components (namely: pumps, pipes and valves),and then combine these equations by use of Kirchoffs 1st and 2nd law. The model description of eq. 2.22resulted. Eq. 2.22 constitutes the model to be used in the following chapters and the aim of the next chapter,will be to determine its parameters.
Chapter 3Parameter estimation
The purpose of this chapter is to estimate the parameters of equation 2.22. The estimation is performed witha Matlab toolbox called SENSTOOLS developed by Morten Knudsen at AAU [11]. The toolbox utilizes aGauss-Newton search algorithm on a specified simulation model to minimize the cost function defined as:
errn =
√ΣNk=1(y(k)− ysim(k))2
ΣNk=1(y(k)2)· 100% (3.1)
Where
• ysim(k) are the simulated output
• y(k) are the measured output
Given the fact that the valve constants Kv1 , Kv2 , Kv3 , Kv4 are functions of the valve position, which for timebeing is assumed unknown, the parameter estimation is performed with fixed valve position. Based on the anal-ysis of appendix B.1 the tests are performed with consumer valve positions of respectively, 45%, 45%, 40%and 23%.
Since the system has no flow sensors, the model will contain a scale factor that cannot be determined. Thereforethe estimations will be performed with 1 parameter ”locked” and at the end of the section it will, through thecost function of eq. 3.1, be verified whether the error is unaffected when performing another estimation withthe parameter ”locked” to a different value. Since 1 parameter has to be locked, it is chosen to assign the pipefriction K11 the value 1e5, because this gives flows that are considered of a physically realistic magnitude.
3.1 Input signal
In order to obtain as accurate parameter estimates, as possible, an appropriate input signal are designed for thetest. The input signal are designed for the output of the model to have high relative sensitivity to changes inthe parameters, estimated. The measure used for sensitivity are the one presented in [11, p.52-53], where therelative parameter sensitivities are calculated based on the normed relative Hessian matrix Hrn defined as in
Parameter estimation 17
eq. 3.2.
Hrn = y−1RMS · L ·H · L (3.2)
yRMS =
√√√√ 1N
N∑k=1
y2(k) (3.3)
L = diag(ΘN ) (3.4)
Where
• H are the Hessian of the model in the provided starting guess of parameters
• Θ are the parameters, to be estimated
• N are the number of parameters, to be estimated
For nonlinear systems the amplitude distribution are described to be important in [11, p.73], and an input classof square wave signals superimposed by ramp functions, are recommended. Following this recommendation,reduces the task of designing the input signal to a problem of choosing amplitude and frequency for a ”squareramp” signal based on the model description derived in section 2.4. To help choosing amplitudes and frequen-cies the sensitivity ratio R are introduced
R =SmaxSmin
=√λmax√λmin
(3.5)
Where
• λmax is the largest eigenvalue of the normed Hessian (Hrn)
• λmin is the smallest eigenvalue of the normed Hessian (Hrn)
Having a small sensitivity ratio is desirable, because the larger the sensitivity ratio is, the larger the correlationbetween some of the parameters are, making the parameter estimates less precise. In order to obtain an inputsignal with a small sensitivity ratio, the sensitivity ratio are calculated for "‘square ramp waves"’ where thefrequency are varied whilst the amplitude is fixed at 0.5. During calculations it is found that the sensitivity forthe Qmax parameter are particularly low. As a consequence, it will in the next section, be investigated whetherthe terms includingQmax are redundant. The sensitivity ratios calculated, excludingQmax, are plotted in figure3.1 and it is seen to have a minimum at around 0.65 Hz. The increase in sensitivity ratio, when moving awayfrom the minimum frequency are relatively flat, meaning that frequencies in the area of 0.2-2 Hz all should beapplicable as fundamental frequencies in a good input signal.
Having analysed the sensitivity ratio with regards to frequency and found that it should be some where around0.65 Hz, the sensitivity ratio are now calculated with varying amplitudes and a constant frequency of 0.65 Hz.Amplitude in this context is the difference from ”wave top” to 0.5, which is 50% of the maximum input signal.The calculated sensitivity ratios are plotted in figure 3.2 where the sensitivity ratio can be seen to be smallestwhen the amplitude are largest at 0.5. From 0.2 and up the decay are quite slow, meaning that amplitudesbetween 0.2 and 0.5 should be used in the input signal. The sensitivity ratios of fig 3.1 and 3.2 are calculatedwith the M-files ”optimalt_input_frequency.m” and ”optimalt_input_amplitude.m”, on the attached CD.
Based on the analysis of sensitivity ratios the input signal of fig 3.3 has been chosen. The input signals are
18 3.1 Input signal
0 0.5 1 1.50
50
100
150
200
Frequency [Hz]
R=
Sm
ax/S
min
Figure 3.1: Sensitivity ratio as a function of frequency
0 0.1 0.2 0.3 0.4 0.50
50
100
150
200
Amplitude of input square waves
R=
Sm
ax/S
min
Figure 3.2: Sensitivity ratio as a function of amplitude
Parameter estimation 19
0 100 2000
0.2
0.4
0.6
0.8
1Pump m1
0 100 2000
0.2
0.4
0.6
0.8
1Pump 1
0 100 2000
0.2
0.4
0.6
0.8
1Pump 2
0 100 2000
0.2
0.4
0.6
0.8
1Pump m2
0 100 2000
0.2
0.4
0.6
0.8
1Pump 3
0 100 2000
0.2
0.4
0.6
0.8
1Pump 4
Figure 3.3: The input signals applied to the pumps
calculated with the M-file ”input_til_parameter_estimering.m” and consists of square waves with frequency0.65 Hz and random amplitude, superimposed by a ramp signal with the same frequency and random slope.Although the signals were called random in the above, the inputs for pump m1, 1 and 2 has been biased a littlein order to get differential pressures, that are in the same order of magnitude for ”end user” valves 1,2 and 3,4.
3.2 Estimation and verification of parameters
In this section, the parameters of eq. 2.22 are estimated from measurements made on the laboratory model,with the input signal designed in the previous section, applied. The parameters of eq. 2.22 are summarizedbelow:
• Pipe frictions: K11, K12, K13, K14, K21, K22, K23, K24 K31, K32, K33, K34, K41, K42, K43, K44
• Pump coeficient: Pmax, Qmax
• Inertia coeficients: J11, J12, J13, J14, J21, J22, J23, J24 J31, J32, J33, J34, J41, J42, J43, J44
• Valve coeficients: Kv1, Kv2, Kv3, Kv4
3.2.1 Reduction of parameters for estimation
Before the part of the estimation, which utilizes SENSTOOLS, are performed, some simplifications are made.First of all it is noticed that some of the pipes have identical dimensions and are difficult to tell apart through
20 3.2 Estimation and verification of parameters
measurements, with the available sensors. Because of this the equalities of table 3.1 will be assumed for the restthe report. It is noticed that the coefficient that are set equal in table 3.1 always appears in pairs in the model,meaning that the predictions of the respective differential pressures are invariant to the size of the individualcoefficients, as long as the sum of the pairs are ”correct”.
K11=K14 K12=K13
K21=K24 K22=K23
K31=K34 K32=K33
K41=K42 K41=K43
K41=K44
J11=J14 J12=J13
J21=J24 J22=J23
J31=J34 J32=J33
J41=J42 J41=J43
J41=J44
Table 3.1: Assumptions regarding friction and inertia coefficients of the pipes
Second of all, it is chosen to determine the proportion between the pipe frictions by use of the pressure sen-sors on the laboratory model, independently from the estimation of the rest of the parameters. The reason isprimarily that the placement of these sensors makes it easy and straightforward and that the robustness of SEN-STOOLS tends to be quite poor for larger number of parameters and measurements. The proportions betweenthe pipe frictions are determined in Appendix B.3 and summarized below:
K12 = 5.30 ·K11
K21 = 0.58 ·K11
K22 = 6.98 ·K11
K31 = 0.89 ·K11
K32 = 5.20 ·K11
K41 = 2.75 ·K11 (3.6)
3.2.2 Estimation of the remaining parameters
The remaining parameters are estimated by use of the M-file ”estparametre.m”, which can be found on theattached CD. Fig 3.4 shows the measured output vs a simulated, using the estimated parameters. The modelseems to be predicting the actual system behaviour decently with an average error of 20.77% (with the errorbeing defined by eq. 3.1). The average error of 20.77% are obtained, for a model structure excluding theterms where Qmax appears. The M-file ”estparametre_S.m” (also to be found on the CD) performs the sameestimation for a model structure where the terms with Qmax are included. An average error of 20.74% areobtained. Since the average errors are close to identical, the terms including theQmax parameter are concludedredundant.In order to validate the estimated parameters, a new independent measurement are made with an input signalmade by the same M-file as the original input signal, but being different because the step sizes and slopesare decided by a random number generator. The measured outputs are displayed in figure 3.6, along with asimulated response using the parameters estimated before. The error between estimate and measurement arein this case 22.29 %, which are considered about the same. The simulated response of figure 3.6 looks quite
Parameter estimation 21
similar to the fitted response of fig 3.4 and beacause of this the quality of the parameter estimates are concludedsufficient. At the beginning of the chapter it was claimed that the system has a scale factor that cannot bedetermined without flow sensors, and hence the pipe friction K11, where "‘locked"’ at 1e5. In order to verifythat this was a legitimate decision the parameter estimation is performed on the same data set with the pipefriction K11 locked at 1e7, which is different by a factor of 100. The fit using these parameters are presentedin fig 3.5 and results in an average error of 20.79%, which is very close to the average error obtained forK11=1e5. The similarities between the fits of fig 3.4 and 3.5 are also pronounced and hence it is concluded thatthe system does have a scale factor, which cannot be determined from the differential pressure sensors alone.The parameter estimates, obtained are presented below:
J11 = 860
J12 = 1617
J21 = 193.6
J22 = 1531
J31 = 697.3
J32 = 1934
J41 = 476.5
Pmax = 1.41
K11 = 1e5
Kv1(0.45) = 2.37e6
Kv2(0.45) = 2.36e6
Kv3(0.40) = 3.20e6
Kv4(0.23) = 3.17e6
22 3.2 Estimation and verification of parameters
0 50 1000
0.1
0.2
0.3
0.4
0.5Differential Pressure1
Pre
ssur
e [B
ar]
Time[s]0 50 100
0
0.1
0.2
0.3
0.4
0.5Differential Pressure2
Pre
ssur
e [B
ar]
Time[s]
0 50 1000
0.1
0.2
0.3
0.4
0.5Differential Pressure3
Pre
ssur
e [B
ar]
Time[s]0 50 100
0
0.1
0.2
0.3
0.4
0.5Differential Pressure4
Pre
ssur
e [B
ar]
Time[s]
Figure 3.4: The measured and simulated outputs of the data set that the parameter estimation isperformed on. The estimation performed with K11=1e5.
Parameter estimation 23
0 50 1000
0.1
0.2
0.3
0.4
0.5Differential Pressure1
Pre
ssur
e [B
ar]
Time[s]0 50 100
0
0.1
0.2
0.3
0.4
0.5Differential Pressure2
Pre
ssur
e [B
ar]
Time[s]
0 50 1000
0.1
0.2
0.3
0.4
0.5Differential Pressure3
Pre
ssur
e [B
ar]
Time[s]0 50 100
0
0.1
0.2
0.3
0.4
0.5Differential Pressure4
Pre
ssur
e [B
ar]
Time[s]
Figure 3.5: The measured and simulated outputs of the data set that the parameter estimation isperformed on. The estimation performed with K11=1e7.
24 3.3 Estimation of valve friction as a function of valve position
0 50 1000
0.1
0.2
0.3
0.4
Differential Pressure 1
Pre
ssur
e [b
ar]
Time [s]0 50 100
0
0.1
0.2
0.3
0.4
Differential Pressure 2
Pre
ssur
e [b
ar]
Time [s]
0 50 1000
0.1
0.2
0.3
0.4
Differential Pressure 3
Pre
ssur
e [b
ar]
Time [s]0 50 100
0
0.1
0.2
0.3
0.4
Differential Pressure 4
Pre
ssur
e [b
ar]
Time [s]
Figure 3.6: The measured and simulated outputs of an independent set of data.
3.3 Estimation of valve friction as a function of valve position
The parameter estimation performed in the previous section, were with valve positions fixed at respectively,45%, 45%, 40% and 23%. The purpose of this section is to find a desription of how the respective valve fric-tions relates to the corresponding valve position. In order to do this, tests are made where the input signalsdesigned in sec. 3.1 are applied to the system, whilst the valve positions, one at a time, are fixed at a differentposition than the ones used in the previous section (45%, 45%, 40% and 23%). For each set of valvepositionsthe ”new” valve friction are estimated by use of the method used in the previous sections, with the estimatedparameters of sec. 3.2, incerted.
The estimated valve coefficients, are displayed in table 3.2.
3.3.1 Chapter Summary
In this chapter, the parameters of the system description derived in chapter 2, has been determined. The numberof parameters were first reduced through observations of symmetry, sensitivity calculations and by expressingthe pipe frictions as constant functions of one another through measurements (see appendix B.3). Then theremaining parameters were estimated by use of a Gauss Newton search algorithm for a fixed set of consumervalve positions. The Gauss Newton search algorithm were applied to a data set, consisting of measurementsobtained with an optimal set of input signals applied to the laboratory model. The input signals were designedto minimize the ratio between the maximal and minimal parameter sensitivity. A description of the frictions of
Parameter estimation 25
Valve position Kv1 Kv2 Kv3 Kv4
0 5.47e6 5.98e6 9.72e6 9.57e60.1 5.21e6 6.26e6 9.48e6 10.8e60.2 5.18e6 6.35e6 8.41e6 5.57e60.3 4.80e6 5.32e6 5.54e6 1.21e60.4 3.10e6 3.26e6 3.20e6 3.88e50.5 1.76e6 1.66e6 1.49e6 1.38e50.6 8.98e5 8.21e5 7.53e5 4.70e40.7 4.50e5 3.67e5 4.06e5 3.00e40.8 1.69e5 8.92e4 9.93e4 7.94e30.9 1.15e4 1.33e3 -1.10e4 1.06e41 1.24e3 -2.98e2 -1.89e4 5.40e3
Table 3.2: The friction coefficients of the valves at different valve positions
the consumer valves as function of the positions of the consumer valves, were obtained at the end of the chapterthrough estimations performed on different sets of consumer valve positions.The aim of the next chapter is to obtain a linear discrete time state space description, for control design, basedon the model description that has been derived in the current and previous -chapter.
Chapter 4Linearisation
The purpose of this chapter is to linearise the nonlinear system description derived in the previous chapters,obtaining a linear discrete time state space description, suitable for model based linear control in later chapters.First a brief presentation of the linearisation method, will be made. Then the linearisation method will beapplied to the system. After this the chapter will conclude with some thoughts on discretization, and pumpdelays.
4.1 Linearisation Method
The system will be linearised using first order Taylor approximations. In a first order Taylor approximation,each variable are substituted with an operating point value (steady-state value), and a small signal gain. A givenfunction are then approximated by its value in the operating point, plus a contribution from the small signalgain(s), which depends on the functions first derivative in the operating point.
In the one variable case, the first order Taylor approximation are described as in eq. 4.1 [12, p.707].
f(x) ≈ f(x) +δf(x)δx
x (4.1)
Where:
• f(x) is a function of the variable x.
• x is the operating point value.
• x is (x− x).
In case of multiple variables, eq. 4.1 can be extended to:
f(x1, x2, ....., xn) ≈ f(x1, x2, ....., xn) +δf(x1, x2, ....., xn)
δx1
∣∣∣∣x1=x1
x1 +
.....δf(x1, x2, ....., xn)
δx2
∣∣∣∣x2=x2
x2 +δf(x1, x2, ....., xn)
δxn
∣∣∣∣xn=xn
xn (4.2)
Linearisation 27
4.2 Deriving a linear state space model
In this section, the nonlinear system description will be linearised in accordance to the method presented aboveand put on state space form, with pump signals as input and the differential pressures over the consumer valvesas output. The equation detailing the dynamics of the system were derived in chapter 2.4 and its parameterswere fitted in chapter 3, resulting in a minor reduction of the model. After this reduction, the non-linear modelare written as follows:
J
q1
q2
q3
q4
= −Kv ·
q21
q22
q23
q24
+R ·
U2m1
U21
U22
U2m2
U23
U24
− T ·
q1.751
q1.752
q1.753
q1.754
q1.75m1
q1.75m2
q1.75m3
q1.75m4
(4.3)
Calculating the derivatives with respect to pump input (U) and flows (q), and insertion of operating points andsmall signal gains gives the following 1st order approximation:
J
q1
q2
q3
q4
= −Kv ·
2 · q1 · q1
2 · q2 · q2
2 · q3 · q3
2 · q4 · q4
+R ·
2 · Um1 · Um1
2 · U1 · U1
2 · U2 · U2
2 · Um2 · Um2
2 · U3 · U3
2 · U4 · U4
− T ·
1.75 · q0.751 · q1
1.75 · q0.752 · q2
1.75 · q0.753 · q3
1.75 · q0.754 · q4
1.75 · q0.75m1· qm1
1.75 · q0.75m2· qm2
1.75 · q0.75m3· qm3
1.75 · q0.75m4· qm4
(4.4)
Multiplying anything, that is not a small signal gain into the coefficient matrices and replacing qm1 , qm2 , qm3
and qm4 with their equivalents:
˜qm1 = q1 + q2 + q3 + q4
˜qm2 = q2 + q3 + q4
˜qm3 = q3 + q4
˜qm4 = q4
Gives the following:
J
q1
q2
q3
q4
= −Kvlin·
q1
q2
q3
q4
+Rlin ·
Um1
U1
U2
Um2
U3
U4
− Tlin ·
q1
q2
q3
q4
(4.5)
Where
• Kvlin,Rlin, Tlin are constant matrices, displayed in appendix A
28 4.3 Discrete time state space model
Inspection of equation 4.5 shows that it can be rewritten into state space form:
x = Ax + Bu (4.6)
y = Cx (4.7)
Where
x =
q1
q2
q3
q4
(4.8)
u =
Um1
U1
U2
Um2
U3
U4
(4.9)
A = J−1(−Kvlin− Tlin) (4.10)
B = J−1Rlin (4.11)
C = Kvlin(4.12)
4.3 Discrete time state space model
The linear state space representation of equation 4.6, 4.7 is in continuous time. In order to implement a modelbased controller in practice, a discrete representation of the form in equation 4.13, 4.14 is needed.
x(k + 1) = Φx(k) + Γu(k) (4.13)
y(k) = Hx(k) (4.14)
A method for discretization of a linear state space system are derived in [13, p.629-631]. The derivation takesa starting point in the solution to the continuous state space model which is written in equation 4.15 .
x(t) = eA(t−t0)x(t0) +∫ t
t0
eA(t−τ)Bu(τ)dτ (4.15)
When making a discretization the continuous time variable t is replaced with the sample number k. In thisderivation t = kT + T and t0 = kT where T is the sampling time. The solution over the k-th sample is shownin 4.16
x(kT + T ) = eATx(kT ) +∫ kT+T
kT
eA(kT+T−τ)Bu(τ)dτ (4.16)
In this discretization the Zero Order Hold method is used, meaning that the input u(τ) is kept constant through-out a sample period.
u(τ) = u(kT ) kT ≤ τ < kT + k (4.17)
Introducing the help variable η:
η = kT + T − τ (4.18)
Linearisation 29
Reduces Equation 4.16 to the following equation.
x(kT + T ) = eATx(kT ) +
(∫ T
0
eAηdη
)Bu(kT ) (4.19)
From which the discrete time state space matrices can be identified as:
Φ = eAT (4.20)
Γ =
(∫ T
0
eAηdη
)B (4.21)
H = C (4.22)
The method just described are implemented in the Matlab function c2d(sysc,Ts,’zoh’), where sysc are thecontinuous state space description, Ts the sample time and ’zoh’ refers to the discretization method.
4.4 Pump delay
This section addresses a problem with the pumps, which are not accounted for in the system representationso far. The problem is as the title suggests that there exist a significant delay from the input signals are sentfrom the Matlab Real Time Workshop until, the pumps actuate accordingly. The reason for this delay are so farunknown and will not be investigated in this project. Appendix B.2 documents the delays which are found tobe as presented in table 4.1.
Name Delay [s]Pumpm1 0.7Pump1 0.7Pump2 0.7Pumpm2 0.7Pump3 0.5Pump4 0.6
Table 4.1: The delays of the respective pumps
It is seen that the delays are quite substantial compared to the dynamics of the system (the time constants ofthe differential pressures over the consumer valves seems to be around or below 1 s). In addition to beingrelatively large, the delays also seems to vary from measurement to measurement, ranging from 0.5 s to 1.0 s.As mentioned in the introduction of the thesis, the laboratory model has been constructed with the intention ofresembling time scaled version of a realistic district heating system. It is noted that the delays are not madeintentionally and that the size of the delays are unrealistically large. A method for taking these delays intoaccount, when implementing on the laboratory model, can be to choose the sample time as approximately thelength of delays. By doing this a discrete time state space representation which takes the delays into account,can be made by augmenting the state vector with the last input signals, as in eq. 4.23:[
x(k + 1)u(k)
]=
[Φ Γ0 0
][x(k)
u(k − 1)
]+
[0I
]u(k)
(4.23)
30 4.4 Pump delay
4.4.1 Chapter Summary
In this chapter a linear discrete time state space description has been derived by use of first order Taylor ap-proximations. In addition, severe pump delays has been documented and inserted in the state space descriptionby augmentation of the state vector, with prior input signals. In the next chapter, a Linear Quadratic controllerwill be designed on the background of the linear discrete time state space description of eq. 4.23.
Part II
Control
32
Table of Contents
5 Linear Quadratic controller 365.1 Optimal control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365.2 Introducing reference and integral action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.3 Implementation of the LQ controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.4 Simulation of the LQ controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6 Observer Design 526.1 Design of Kalman filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.2 Design of Extended Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556.3 Observer verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7 Linear Parameter Varying Control 607.1 LPV background and analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.2 Identification of an LPV model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617.3 LPV control design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
34 TABLE OF CONTENTS
TABLE OF CONTENTS 35
This part will concern the design of two different controllers for the scaled district heating system. The firstare constructed by use of standard LQ-design. The second will be designed by transforming the system intoLPV form and then apply the LPV methods described in [5] and [6]. Furthermore an Extended Kalman filterare designed for estimation of the flows through the consumer valves and for estimation of the friction of theconsumer valves. This is done in order to reduce the amount of sensors on which the controllers dependsand because e.g. the LQ-controller uses state feedback of the flows. Because of the unrealistically large pumpdelays documented in Appendix B.2 it is chosen to perform the majority of the control design on a model wherethe delays has been reduced. The majority of the tests performed will consequentially be made as simulationson the non-linear model with reduced delays.
Chapter 5Linear Quadratic controller
The aim of this chapter is to design a Linear Quadratic (LQ) controller for the scaled district heating system,capable of keeping the differential pressures over the consumer valves at a constant level of 0.1 [Bar]. First ageneral introduction to optimal control is presented. Then a LQ feedback controller is designed with referenceand integral action. After the design has been described, the chapter will be concluded by simulations and ashort description of the implementation
5.1 Optimal control
The concept of optimal control is to find an input signal, which minimizes some performance function. In thisproject, the performance function relates to the states and input signals of a linearized model of the districtheating system, and it is chosen to be quadratic with respect to these. This gives a performance function withthe form of eq.5.1, which is a special case of optimal control referred to as LQ control.
I =N∑
k=0
H(x(k),u(k)) =N∑
k=0
xT (k)Q1x(k) + uT (k)Q2u(k) (5.1)
Where
• N is the finite time horizon
• Q1 is the weighting matrix of the states
• Q2 is the weighting matrix of the inputs
• x(k) is the state vector
• u(k) is a vector with the input signals
The performance function can be viewed as a way of weighting the size of control signals versus state sizes. Ina system with n states and p inputs the performance function for a given system can be expanded to:
I =N∑
k=0
(xT (k)Q1x(k) + uT (k)Q2u(k)
)+ xT (N)QNx(N) (5.2)
Linear Quadratic controller 37
QN is introduced to perform a separate weighting of the last value of the states. QN will have dimensions(n × n), Q2 will have dimensions p × p and Q1 will have dimensions n × n. All three matrices are positivesemi definite[14, p. 9].
It can be found that for a first order system, the inputs, u(k), are proportional to the current state, x(k), foreach step. Thus the performance function can be rewritten as a quadratic function of the current state x(k) forthe samples k . . . N :
u = −Kx(k) (5.3)
JNk (x(k)) = xT (k)S(k)x(k) (5.4)
where the matrices K(k) and S(k) describes the linear properties from u(k) to x(k) and the quadratic solutionto x(k) respectively. K(k) is of dimension (p × n) and S(k) is of dimension (n × n). The general dynamicexpression for the quadratic solution of x(k) can be described as [14, p. 10]:
JNk (x(k)) = minu(k)
[H(x(k),u(k)) + JNk+1(x(k + 1))] (5.5)
which describes the iterative properties of the solution to the quadratic form of x(k).
Inserting the expressions for H(x(k),u(k)) and JNk+1(x(k + 1)) and solving this for the control signal u(k),the equation will yield the minimum performance[14, p. 10]:
JNk (x(k)) = minu(k)
[xT (k)Q1x(k) + uT (k)Q2u(k) + xT (k + 1)S(k + 1)x(k + 1)] (5.6)
= minu(k)
[xT (k)Q1x(k) + uT (k)Q2u(k) + (Φx(k) + Γu(k))TS(k + 1)(Φx(k) + Γu(k))]
(5.7)
To find the optimal control signal u∗, which minimizes the performance function at time k, it is differentiatedand put equal to zero[14, p. 11]:
δJNk (x(k))δu(k)
= 2Q2u + 2ΓTS(k + 1)(Φx(k) + Γu(k)) = 0 (5.8)
If [Q2 + ΓTS(k + 1)Γ] is invertible, it can be solved with respect to the optimal control signal u∗(k):
u∗(k) = −[Q2 + ΓTS(k + 1)Γ]−1ΓTS(k + 1)Φx(k) (5.9)
From 5.9, the proportional gain K(k) can then be recognised as:
K(k) = [Q2 + ΓTS(k + 1)Γ]−1ΓTS(k + 1)Φ (5.10)
If Equation 5.10 is inserted into Equation 5.6 S(k) can be recursively expressed as:
S(k) = Q1 + KT (k)Q2K(k) + ((Φ− ΓK(k))TS(k + 1)(Φ− ΓK(k))) (5.11)
5.1.1 Stationary LQ Control
It is chosen to use the values of K(0) and S(0) determined for N → ∞, in calculating the controller gains.This yields, that the K(k) and S(k) of eqs. 5.10 and 5.11 will go toward steady state, when the performanceindex’s sum tends toward infinity[14, p. 19]. As N goes toward infinity, K(0) = K(k) = K(k+ 1) = K andS(0) = S(k) = S(k + 1) = S, are solutions to the steady state Riccati equations:
K = [Q2 + ΓTSΓ]−1ΓTSΦ (5.12)
S = Q1 + ΦTSΦ− ΦTSΓ[Q2 + ΓTSΓ]−1ΓTSΦ (5.13)
38 5.2 Introducing reference and integral action
In eqs. 5.12 and 5.13 the design parameters are the Q1 and Q2 matrices. It is easily seen that the number ofdesign parameters increases exponentially (r2 + n2) with the number of states (n) and inputs (r). In order toreduce the number of design parameters, the Q1 and Q2 matrices could be chosen as diagonal, reducing thenumber of design parameters to r + n. In this case, the diagonal elements of Q1(i, i) and Q2(j, j) can beinterpreted as relative punishment of xi(k) and uj(k). This is not done, since relative punishment of flows andpump speeds, not makes much sense when the purpose is to track a constant differential pressure reference.It is however noted that punishment of control error and change in control signal would be meaningful tuningparameters. Punishing control error rather than state size, falls naturally in the next section, where Q1(i, i) willbe exposed to a simple transformation, as part of the method for introducing a reference signal. In order topunish change in pump inputs rather than the absolute size of the pump inputs, the system representation of eq.4.23 are rearranged such that the control signal are changed from pump input to the difference between currentand last pump input. [
x(k + 1)u(k)
]=
[Φ Γ0 I
][x(k)
u(k − 1)
]+
[0I
][u(k)− u(k − 1)]
(5.14)
Where
• Φ is the state matrix of eq. 4.23
• Γ is the input matrix of eq. 4.23
5.2 Introducing reference and integral action
Calculating the feedback control law with the LQ method, presented in the section above, based on the systemrepresentation of eq. 5.14, will not make sense, since eq. 5.14 alone contains no information of the reference.Apart from the problem of no reference, eq. 5.14 will inevitably have some error in its prediction of the systembehaviour, due to linearisation and general modeling errors, which will be causing a steady state control error.To combat these two problems, the system description of eq. 5.14 will in the following two subsections beaugmented, making reference and integral error part of the system description.
5.2.1 Introducing the reference
The reference can be related to the system through an output error defined as:
e(k) = r(k)− y(k) (5.15)
Where
• e(k) is the error,
• r(k) is the reference
• y(k) are the actual output
Linear Quadratic controller 39
As stated in the previous section it is desirable(necesarry) to punish control error rather than state size. Thiscalls for the performance function to have a form of eq. 5.16
I =N−1∑k=0
(eT (k)Q1ee(k) + uT (k)Q2u(k)) (5.16)
In order to minimise 5.16, the system state vector xs(k) is augmented with the reference xr(k), giving theaugmented system, described by [14, p. 31]:[
xs(k + 1)xr(k + 1)
]=
[Φs 00 Φr
][xs(k)xr(k)
]+
[Γs0
]u(k) (5.17)
e(k) =[−Hs Hr
] [xs(k)xr(k)
](5.18)
Where
• Hr is the reference model output matrix
• Hs is the old output matrix
• Φr is the state matrix of the reference model
• Φs is the state matrix of eq. 5.14
• Γs is the input matrix of eq. 5.14
It is chosen to model the reference as a step, giving the following Hr and Φr
Hr = Φr =
1 0 0 00 1 0 00 0 1 00 0 0 1
(5.19)
With the augmented system description at hand the performance function can be rewritten as:
I =N−1∑k=0
(eT (k)Q1ee(k) + uT (k)Q2u(k)) (5.20)
=N−1∑k=0
((Hx(k))TQ1e(Hx(k)) + uT (k)Q2u(k)) (5.21)
=N−1∑k=0
(xT (k)HTQ1eHx(k) + uT (k)Q2u(k)) (5.22)
=N−1∑k=0
(xT (k)Q1x(k) + uT (k)Q2u(k)) (5.23)
Where
Q1 =
[−HTsHTr
]Q1e
[−Hs Hr
](5.24)
Since eq. 5.23 has the same structure, as the original performance function in eq. 5.1, the method described insection 5.1 can be applied directly to find a feedback gain matrix K(k). The feedback matrix will be divided
40 5.2 Introducing reference and integral action
into a part containing the gains for state feedback and a part containing the gains for reference feedback, asdescribed by eq. 5.25
K(k) =[Ks(k) Kr(k)
](5.25)
5.2.2 Integral action
As stated previously the linearized model will have some inaccuracies, causing the closed loop system withfeedback gains of eq. 5.25 to have steady state errors. A compensation for this can be made by rewriting theperformance function to punish the integrated control error xi, along with the control error e(k), and the inputsignal u(k)[14, p. 45]:
I =N−1∑K=0
(eT (k)Q1ee(k) + xTi (k)Q1ixi(k) + uT (k)Q2u(k)) (5.26)
The integrated control error can be modeled as:[14, p. 42]:
xi(k + 1) = xi(k) + e(k) (5.27)
= xi(k) + r(k)− y(k) (5.28)
Augmenting the system representation to include the integrated control error gives the following:
x(k + 1) =
Φs 0 00 Φr 0−Hs Hr I
x(k) +
Γs00
u(k) = Φx(k) + Γu(k) (5.29)
y(k) =[Hs 0 0
]x(k) (5.30)
e(k) =[−Hs Hr 0
]x(k) = Hex(k) (5.31)
xi(k) =[0 0 I
]x(k) = Hix(k) (5.32)
Where
• x(k) =[xTs (k) xTr (k) xTi (k)
]TFor the system representation of eqs. 5.29-5.32, the performance function can be rewritten as [14, p. 43]:
I =N−1∑k=0
(eT (k)Q1ee(k) + xTi (k)Q1ixi(k) + uT (k)Q2u(k)) (5.33)
=N−1∑k=0
(xT (k)[HTe Q1eHe + HTi (k)Q1iHi(k)]x(k) + uT (k)Q2u(k)) (5.34)
=N−1∑k=0
(xT (k)Q1x(k) + uT (k)Q2u(k)) (5.35)
where:
Q1 = HTe Q1eHe + HTi Q1iHi (5.36)
=
HTs Q1eHs −HTs Q1eHs 0−HTr Q1eHs HTr Q1eHr 0
0 0 Q1i
(5.37)
Linear Quadratic controller 41
With the values of the matrices Φ, Γ, Q1 and Q2, the performance function is now on standard form, and canbe solved for K(k) and S(k) using the techniques discussed earlier. The feedback control law will be on theform:
u(k) = −Kx(k) =[Ks Kr Ki
]xs(k)xr(k)xi(k)
(5.38)
From the control law above, the flows of the system (xs(k)) can be recognised as the only part, which is neitherknown exactly through calculation or prior measurements. This means that xs(k), must be estimated by anobserver of some kind. Since the description of observer design and verification has proven to be somewhatextensive it is chosen to let this be the subject of a separate chapter (namely, chapter 6). In the following theimplementation of the control law will be discussed briefly and simulations will be made, using the observerdesigned in chapter 6.
5.3 Implementation of the LQ controller
The aim of this section is to show how the control law of eq. 5.38 are implemented. The closed loop system,with the controller structure of eq. 5.38 and an Extended Kalman Filter used as observer, are depicted in fig5.1. The controller is designed based on a model linearized around operating points of pump speeds, flowsand differential pressures. OP1 in figure 5.1 are the operating point for the differential pressures, OP2 are theoperating point for the pump speeds and OP3 are the operating point for the flows.
The block diagram in fig 5.1 shows how the linear control derived in the previous section are implemented withrespect to reference, plant and observer. It does however not take actuator limitations and interaction with thelaboratory model, into account. The remaining part of this section will be devoted to design of anti windup anda quick look at the additions needed when moving from computer simulations to simulations on the laboratorymodel.
5.3.1 Anti windup
This subsection will briefly address the precautions taken against windup. Windup can occur whenever acontroller design, with some form of integral action, has not taken actuator limitations into account. Whenactuator saturation happens, the control signal stops changing and if the error signal continues to be appliedto the integrator input, the integrator output will keep growing, potentially causing a large overshoot when the
plantKi
KsKrHr
r e yuXi
Xr Xs +
-
+
-
-
-
OP1 EKF
- +
+
OP2+
-
OP3
Figure 5.1: Blockdiagram of the closed loop system with the LQ controller.
42 5.3 Implementation of the LQ controller
plantKi
Ka
KsKrHr
r e yuXi
Xr Xs +
-
+
-
--
-
- +
OP1 EKF
- +
+
OP2+
-
OP3
Figure 5.2: The LQ controller with anti windup inserted.
error signal finally changes sign.The method used for antiwindup are adapted from [13, p. 669-672]. A block diagram of the LQ controllerwith anti windup is depicted in fig 5.2. From the figure it can be seen that the method basically prevents one ormore of the integrated errors from growing when an actuator saturates. The weighting from the saturation ofthe different actuators to the respective integral errors are performed with the Ka matrix. The Ka matrix usedare displayed below in 5.39.
Ka =
0.05 0.2 0 0 0 00.05 0 0.2 0 0 00.05 0 0 0.05 0.2 00.05 0 0 0.05 0 0.2
(5.39)
5.3.2 Operation on the laboratory model
Interactions with the laboratory model are performed in Simulink Real Time Workshop, making operation onthe ”real” system quite similar to making simulations, on e.g the nonlinear model, in ordinary Simulink. Themain difference between an ordinary Simulink implementation of the LQ controller in fig 5.2 and a Real TimeSimulink implementation, lies in the plant ”block”. When simulating in ordinary Simulink, the plant ”block”consists of the nonlinear model. When operating on the laboratory model, the plant ”block” obviously consistsof the laboratory model. Seen from the Real Time Workshop, however, the laboratory model are representedby interfaces to the pumps, valves and sensors. The interfaces are written as S-functions using functions fromthe comedi library, and where available from the beginning of the project. A sketch of how the interfacingbetween controller and plant are performed in Real Time Workshop are depicted in fig 5.3. The control signaland measurement -blocks contains the S-functions mentioned in the above. The pump correction block correctsthe calculated pump signals in accordance to eq. 2.6.
Linear Quadratic controller 43
Figure 5.3: Sketch of how the interfacing between controller and plant are performed in RealTime Workshop
5.4 Simulation of the LQ controller
As mentioned at the introduction of this part, it is chosen to perform the majority of the control design onthe nonlinear model with the delays reduced. This is done in order to preserve some of the incentive behindmaking somewhat sophisticated control for the system, since the pump delays documented in Appendix B.2,are considered unrealistically large. As mentioned earlier, the length of the time delays are approximately thesame as the systems time constant and furthermore seems to variate from time to time. In order to show, thatthe LQ design works on the laboratory model, step responses on the real system are shown on fig 5.4, withthe corresponding control signals shown on fig 5.5. Having shown that the controller are capable of trackinga reference on the laboratory model the attention now turns to simulations, with reduced delays. The pumpdelays of the nonlinear model are chosen to 0.1 s. By choosing a sample time equal to the delay, the discretetime state space representation of Appendix A.3 is obtained, in accordance with 5.14.
5.4.1 Test description
The test are first and foremost, designed to reflect the performance under conditions that a real life controllershould be able to operate. In most real life systems the differential pressure reference will change once at startupand otherwise stay at a fixed value. The real challenge for the controller will be to suppress the disturbancescaused by change in consumption. In order to reflect the aim of the controller in the testing, it is chosen toperform a test where the controller has to follow a fixed differential pressure reference at 0.1 [bar] for the 81combinations of valve positions that can be made from the set in 5.40.
Valve position 1 = 0, 0.45, 0.67
Valve position 2 = 0, 0.45, 0.65
Valve position 3 = 0, 0.40, 0.57
Valve position 4 = 0, 0.23, 0.31 (5.40)
The set consists of the extreme points of the range of valve positions (found in appendix B.1) over whichthe controller should function, plus one medium position for each valve. It is chosen to change the valves asramp functions, with slopes such that it takes 10 s to move from extreme to medium position or visa versa and20 s from extreme to extreme. An input series of valve positions obeying the above are displayed at fig 5.6.
44 5.4 Simulation of the LQ controller
0 10 20 30 40 50 60 70 80 90 1000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
0 10 20 30 40 50 60 70 80 90 1000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
0 10 20 30 40 50 60 70 80 90 1000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
0 10 20 30 40 50 60 70 80 90 1000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure 5.4: Differential pressure measurements on the laboratory model, with the LQ controllerapplied. A step in reference is given from 0.1 to 0.15 [bar] at time 50 s for all four differentialpressures.
0 10 20 30 40 50 60 70 80 90 100
0.4
0.6
Pump m1
Time[s]
0 10 20 30 40 50 60 70 80 90 100
0.4
0.6
Pump 1
Time[s]
0 10 20 30 40 50 60 70 80 90 100
0.4
0.6
Pump 2
Time[s]
0 10 20 30 40 50 60 70 80 90 100
0.4
0.6
Pump m2
Time[s]
0 10 20 30 40 50 60 70 80 90 100
0.4
0.6
Pump 3
Time[s]
0 10 20 30 40 50 60 70 80 90 100
0.4
0.6
Pump 4
Time[s]
Figure 5.5: The pump inputs applied during the measurements in fig 5.4
Linear Quadratic controller 45
0 2000 4000 6000 8000
0
0.1
0.2
0.3
0.4
0.5
0.6
valve 1
time [s]0 2000 4000 6000 8000
0
0.1
0.2
0.3
0.4
0.5
0.6
valve 2
time [s]
0 2000 4000 6000 8000
0
0.1
0.2
0.3
0.4
0.5
0.6
valve 3
time [s]0 2000 4000 6000 8000
−0.05
0
0.05
0.1
0.15
0.2
0.25
0.3
valve 4
time [s]
Figure 5.6: The positions of the valves during simulation.
Although it is tough to see from the figure, the valve inputs does consist of ramps of duration 10-20 s appliedto one, or more, of the valves at a time. The ramps are always followed by steadiness for 90-80 s for all of thevalves, enabling the responses to die out, before the valve positions are changed again. The valve inputs can bereproduced by the m-file ”ventil_input.m” on the attached CD.
5.4.2 test results
Simulation of the LQ controller with the valve positions of fig 5.6 applied as disturbance, yields a time seriesof 8100 s. In order to obtain some level of detail, the plotting of relevant outputs from the simulation has beensplit up into 9 smaller time series. The outputs chosen relevant are the differential pressure over the consumervalves and control effort in terms of the respective pump inputs. In order to save space in the main report, onlyselected parts will be displayed here. The full sequence of plots are placed in appendix C, along with tablesshowing, settling times, overshoots and steady state errors. The differential pressures and pump inputs, of thefirst 900 s are depicted in figs 5.7 and 5.8. It is noted that the reference is set to 0.05 [bar] for the first 50 s, andat time 50 s is stepped up to 0.1 [bar], where it stays for the remaining part of the simulation. Close ups aroundthe time of the step are depicted in figs 5.9 and 5.10.
The worst performance in terms of settling time and steady state error, occurs around the valve change af-ter 8000 s. Close ups around 8000s are depicted in figs 5.11 and 5.12. It is not surprising that the steady stateerror is largest around time 8000s, where the respective valve positions either changes to, or are at, their max-imum values. Since the valves are opened maximally, the largest actuation will be needed here and actuator
46 5.4 Simulation of the LQ controller
limitations will therefore be most pronounced for this set of valve positions, if present. Tests on the simulationmodel has revealed that the outputs of the simulation model are a little smaller than the outputs of the laboratorymodel, when all pumps are at full speed for the valve positions in question. This means that actuator limitationsare guaranteed to cause steady state errors, because the maximal valve positions are found in appendix B.1 asthe positions where the differential pressures are 0.1 [bar], with maximal pump excitation. Actuator limitations,however, does not account for the entire offset. The control effort at fig 5.12 reveals that only main pump 1are given maximal signal, even though the steady state errors obviously will become smaller if the rest of thepump signals are increased. Normally the integral action will make sure that this increase takes place, but dueto the anti windup method, the integral action is counterfitted as soon as main pump 1 violates its saturationthreshold. It is expected that part the steady state errors can be removed by a more carefull tuning of the gainsrelating to anti windup and integral action.
The worst performance in terms of overshoot, occurs around the valve change at 5400 s. Close ups around5400s are depicted in figs 5.13 and 5.14. There is not too much to be said about the behaviour displayed inthe figures. The reason that the overshoot is relatively large here, is that three of the valves changes frommaximally opened to closed, thus calling for an abrupt decrease in control signal. Looking at the overshoots intables C.1-C.3, shows that it is a general tendency that the overshoot in general are largest, when one valve ormore changes from maximally opened to closed (i.e every 300 s).
5.4.3 Chapter Summary
In this chapter, an LQ controller has been designed for the scaled district heating system. The designed con-troller consists of three gain matrices, relating to, state feedback, introduction of reference and integral action,respectively. The controller design has due to the unrealistically large pump delays, primarily been verifiedthrough simulations on the non-linear model with the pump delays reduced to 0.1 s. In addition a somewhatdecent step response was shown, for an implementation of the controller on the laboratory model, with a sampletime of 1 S.The next chapter, will consider the design of the observer, which was partly introduced in the implementationsection as provider of flow estimations.
Linear Quadratic controller 47
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure 5.7: The simulated differential pressures, from time 0-900 s.
48 5.4 Simulation of the LQ controller
0 100 200 300 400 500 600 700 800 9000
0.5
1pump m1
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump 1
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump 2
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump m2
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump 3
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure 5.8: The pump inputs, from time 0-900 s.
Linear Quadratic controller 49
40 45 50 55 60 65 700
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
40 45 50 55 60 65 700
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
40 45 50 55 60 65 700
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
40 45 50 55 60 65 700
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure 5.9: A close up of the differential pressures around the step in reference, from 0.05 to 0.1[Bar] at time 50 s.
40 45 50 55 60 65 70
0.20.40.6
Pump m1
Time[s]
40 45 50 55 60 65 70
0.20.40.6
Pump 1
Time[s]
40 45 50 55 60 65 70
0.20.40.6
Pump 2
Time[s]
40 45 50 55 60 65 70
0.20.40.6
Pump m2
Time[s]
40 45 50 55 60 65 70
0.20.40.6
Pump 3
Time[s]
40 45 50 55 60 65 70
0.20.4
0.6
Pump 4
Time[s]
Figure 5.10: A close up of the pump inputs around the step in reference, from 0.05 to 0.1 [Bar]at time 50 s.
50 5.4 Simulation of the LQ controller
8000 8005 8010 8015 8020 8025 8030 8035 8040
0.04
0.06
0.08
Valve 1
DP
1
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 8040
0.04
0.06
0.08
Valve 2
DP
2
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 8040
0.04
0.06
0.08
Valve 3
DP
3
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 8040
0.04
0.06
0.08
Valve 4
DP
4
Time[s]
Figure 5.11: A close up of the differential pressures, around the worst case performance withrespect to settling times and steady state error.
8000 8005 8010 8015 8020 8025 8030 8035 80400
0.5
1
Pump m1
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 80400
0.5
1
Pump 1
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 80400
0.5
1
Pump 2
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 80400
0.5
1
Pump m2
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 80400
0.5
1
Pump 3
Time[s]
8000 8005 8010 8015 8020 8025 8030 8035 80400
0.5
1
Pump 4
Time[s]
Figure 5.12: A close up of the pump inputs, around the worst case performance with respect tosettling times and steady state error.
Linear Quadratic controller 51
5400 5405 5410 5415 5420 5425 5430 5435 54400.05
0.1
Valve 1
DP
1
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400.05
0.1
0.15Valve 2
DP
2
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400.05
0.1
0.15Valve 3
DP
3
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400.05
0.1
0.15Valve 4
DP
4
Time[s]
Figure 5.13: A close up of the differential pressures, around the worst case performance withrespect to overshoot.
5400 5405 5410 5415 5420 5425 5430 5435 54400
0.5
1
Pump m1
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400
0.5
1
Pump 1
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400
0.5
1
Pump 2
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400
0.5
1
Pump m2
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400
0.5
1
Pump 3
Time[s]
5400 5405 5410 5415 5420 5425 5430 5435 54400
0.5
1
Pump 4
Time[s]
Figure 5.14: A close up of the pump inputs, around the worst case performance with respect toovershoot.
Chapter 6Observer Design
The purpose of this section is to describe the design and implementation of an observer capable of estimatingthe flows of the system. The section begins with a short presentation of the estimation methods considered andbased on this a strategy for how the estimation are to be performed and implemented will be chosen.
Linear Kalman FilterAs the name implies a linear Kalman Filter works on a linear system model. The performance of the filter reliesheavily on the states being in a neighborhood of an operating point or the actual physical system to be nearlylinear. A downside in the context of this project seems to be that there is a quadratic relationship between theflows and the pressure drops caused by friction, and that the valve frictions are time varying. A solution couldbe to design multiple linear Kalman Filters for different operating points and linearize the model on-line withrespect to the valve positions. Though possible, the flow estimations of a solution utilizing normal Kalmanfiltering will require measurements of both differential pressure and consumption/valve position.
Extended Kalman FilterThe principle behind an Extended Kalman Filter (EKF) are the same as for the linear Kalman filter, in the sensethat the states are estimated as the most likely given the specified noise distributions, propagated through a sys-tem model. The difference is that the EKF instead of using a model linearized in a fixed operating point, usesits previous state prediction as operating point in calculating the noise propagation and calculates preliminaryestimates based on a nonlinear system representation instead of a linear. The downside of the method is that itis not guaranteed to converge and that the noise distribution, due to linearisation, can become quite inaccuratefor systems displaying highly nonlinear behavior. The linearisation between each sample, requires the modelto be differentiable and this can be a problem for complex systems which either are difficult or impossible todifferentiate analytically and/or runs with very small sample periods.
Unscented Kalman FilterThe unscented Kalman filter diverge from the EKF in the way, that it propagates noise by simulating a numberof so called sigma points through the nonlinear model, giving a more precise picture of the distribution of thenoise when the system is highly nonlinear. The only immediate downside for this method versus the normaland the EKF, is that the complexity of design and implementation seems to be quite a bit larger.
Estimation strategy
Observer Design 53
transformValve positions
Differentialpressures
EKF
KF(Kv)
Kv
q
Kvcompare
compare
q
DP
Figure 6.1: Sketch of the strategy used to verify the designed observer
Based on the short presentation of considered methods above, it is chosen to perform the state estimation byan EKF. The EKF are chosen over the normal Kalman filter primarily to rely on as few sensors as possible.The EKF are chosen over the unscented Kalman filter because it is estimated that if implemented correctly,the extended Kalman filter will suffer little or no lack in performance with respect to the performance of anunscented Kalman filter, whilst the amount of work spend on implementation are expected to be less becauseof the, for this particular system, straightforward calculation of the Jacobian.In order to verify the performance of the EKF it is chosen to compare the estimates made by the EKF to esti-mates made by a normal Kalman filter, in the way depicted on fig 6.1, where the normal Kalman filter ”knows”the valve frictions. In order to follow this procedure the next two sections will concern the design of a normalKalman filter and an extended Kalman filter, respectively.
6.1 Design of Kalman filter
Prediction by use of a normal Kalman filter consists of a prediction step and an update step. In the predictionstep the a priori states, outputs and covariance matrix are calculated based on the previous state estimates and alinear system description, as follows ([15, p.121]):
xk(−) = Φkxk−1(+) + Γkuk−1 (6.1)
zk(−) = Hkxk(−) (6.2)
P (−) = ΦkPk−1(+)ΦTk +Qk−1 (6.3)
54 6.1 Design of Kalman filter
where:
xk(−) is the a priori small signal state vectorΦk is the state matrix of the linear modelxk−1(+) is the a posteriori small signal state vector of the previous sampleΓk is the output matrix of the linear modeluk−1 is the input signals of the previous samplezk(−) is the a priori system outputHk is the output matrix of the linear modelP (−) is the a priori covariance matrixPk−1(+) is the a posteriori covariance matrix of the previous sampleQk−1 is the covariance of the process noise
(6.4)
In the update step, a posteriori state estimates and an a posteriori covariance matrix are calculated based onsensor measurement and the outcome of the prediction step:
Kk = Pk(−)HTk (HkPk(−)HT
k +Rk)−1 (6.5)
xk(+) = xk(−) + Kk(zk − zk) (6.6)
Pk(+) = (I − KkHk)Pk(−) (6.7)
where:
Kk is the Kalman gainRk is the covariance matrix of the measurement noisezk is the measured system outputI is a unity matrix
(6.8)
A basic requirement, which needs to be fulfilled, for the above algorithm to work is that the system is observ-able. The observability is examined, by computing the rank of the observability matrix. If the rank is equal tothe number of states, having full rank, the system is observable [13, p.634]:
rank(O) = rank
Hk
HkΦk...
HkΦn−1k
(6.9)
The system representation were derived in eq. 5.14, and are repeated below:[x(k + 1)
u(k)
]=
[Φ Γ0 I
][x(k)
u(k − 1)
]+
[0I
][u(k)− u(k − 1)]
y(k) =[H 0
] [ x(k)u(k − 1)
] (6.10)
Calculating eq 6.9 for the system representation above gives:
Φk =
[Φ Γ0 I
]
Hk =[H 0
]rank(O) = 8
Observer Design 55
Since the representation has 10 states, it is not observable. Of the 10 states, only the 4 flows are of interestand it is chosen to base the observer design on a system representation that does not take the pump delay intoaccount:
x(k + 1) = Φx(k) + Γu(k)
y(k) = Hx(k) (6.11)
The missing pump delays, will simply be compensated for by externally feeding the observer with old inputsignals. Calculating eq. 6.9 for the system representation of eq. 6.11 gives
rank(O) = 4 (6.12)
Meaning that this representation is observable.
Implementing the Kalman filterThe Kalman filter are implemented in the function normalt_kalman.m which can be found on the CD, thefunction utilizes the algorithm presented in the above using differential pressures measured over the consumervalves as zk and delayed pump inputs as uk, to estimate the flows (xk). As depicted on fig 6.1, the filter hasan additional input available in form of valve friction coefficients (Kv) which are calculated on backgroundof measured valve positions. In order to profit for this additional knowledge, the matrices ΦK , ΓK and HK
are calculated each sample by the method of section 4.2. The operating point around which the matrices arecalculated remains stationary during operation.
6.2 Design of Extended Kalman Filter
As with a normal Kalman filter, prediction by use of an Extended kalman filter consists of a prediction step andan update step. In the prediction step the a priori states, outputs and covariance matrix are calculated based onthe previous state estimates and the nonlinear system description in the following way ([15, p.180]):
xk(−) = f(xk−1(+), uk−1) (6.13)
zk(−) = h(xk(−)) (6.14)
Pk(−) = Φk−1Pk−1(+)ΦTk−1 +Qk−1 (6.15)
where:
xk(−) is the a priori state vectorf(xk−1(+), uk−1) is the state transition modelzk(−) is the a priori system outputh(xk(−)) is the observation modelPk(−) is the a priori covariance matrixΦk−1 is the Jacobian of the state transition modelPk−1(+) is the a posteriori covariance matrix of the previous sampleQk−1 is the covariance of the process noise
(6.16)
In the update step, a posteriori state estimates and an a posteriori covariance matrix are calculated based onsensor measurement and the outcome of the prediction step:
Kk = Pk(−)HTk (HkPk(−)HT
k +Rk)−1 (6.17)
xk(+) = xk(−) + Kk(zk − zk) (6.18)
Pk(+) = (I − KkHk)Pk(−) (6.19)
56 6.3 Observer verification
where:
Kk is the Kalman gainHk is the Jacobian of h(xk(−))Rk is the covariance matrix of the measurement noisezk is the measured system outputI is a unity matrix
(6.20)
Implementing the EKF algorithm will be slightly more complicated than the implementation of the algorithmof the normal Kalman filter in the previous section, because measurements of valve positions, now are regardedunknown. The strategy for merging the estimation of flows and valve coefficients into one observer, will be toaugment the state vector of eq. 6.11 with Kv1 , Kv2 , Kv3 , Kv4 and then design a Kalman filter for the augmentedsystem.
Augmenting the systemTransforming Kv1 , Kv2 , Kv3 , Kv4 into states, calls for an augmention of the system description in eq. 6.11.This is accomplished by following the method of section 4.1 in linearizing the nonlinear system of eq. 2.22with respect to Kv as well as flows (q) and pump inputs (u). The intermediate calculations will be omitted, andthe result presented straight away as:[
x(k + 1)Kv(k + 1)
]=
[Φ J−1q2
0 I
][x(k)
Kv(k)
]+
[Γ0
]u(k)
H = [Kv q2]
[x(k)
Kv(k)
](6.21)
Investigating observability by means of eq. 6.9 yields:
rank(O) = 8 (6.22)
Proving 6.21, to be observable.
Implementing the extended Kalman filterThe EKF are implemented in the function extended_kalman.m which can be found on the CD. The functionutilizes the algorithm presented in the above, with differential pressure measured over the consumer valves aszk and delayed pump inputs as uk. In order to prevent unwanted oscillations, primarily at startup it has beennecessary to insert constraints for how much the states are allowed to change between samples. These limitsare set to 10% for the flows and 5% for the valve coeficients. A more precise constraint on the valve coeffi-cients can, if nescesarry, be found by first transforming the valve coefficients into valve positions and then usethe constraint directly on valve position, since the maximum rate of change in valve position are a measurableconstant.
6.3 Observer verification
The purpose of this section is to judge whether the performance of the EKF are satisfactory and/or usable aspart of the control system. The verification are performed in the way depicted on figure 6.1, where the esti-mated valve coefficients are compared to values calculated on the background of measured valve positions andwhere the estimated flows are compared to estimations made by a linear Kalman filter with knowledge of thevalve positions. It is chosen to perform the test, with the signals of fig 6.2 applied as inputs. As seen from the
Observer Design 57
0 200 400 6000.3
0.4
0.5
0.6
Pump m1
Inpu
t sig
nal [
%]
Time[s]0 200 400 600
0.5
0.55
0.6Pump 1
Inpu
t sig
nal [
%]
Time[s]0 200 400 600
0.55
0.6
0.65
Pump 2
Inpu
t sig
nal [
%]
Time[s]
0 200 400 6000.35
0.4
0.45
0.5
0.55Pump m2
Inpu
t sig
nal [
%]
Time[s]0 200 400 600
0.45
0.5
0.55Pump 3
Inpu
t sig
nal [
%]
Time[s]0 200 400 600
0.45
0.5
0.55Pump 4
Inpu
t sig
nal [
%]
Time[s]
0 200 400 6000.2
0.4
0.6Valve 1
posi
tion
[%]
Time[s]0 200 400 600
0.2
0.4
0.6Valve 2
posi
tion
[%]
Time[s]
0 200 400 6000.2
0.4
0.6Valve 3
posi
tion
[%]
Time[s]0 200 400 600
0.2
0.4
0.6Valve 4
posi
tion
[%]
Time[s]
Figure 6.2: The pump and valve signals for the test of the observer.
58 6.3 Observer verification
0 200 400 6000
0.5
1
1.5
2
2.5x 10−4 Valve 1
Time[s]
Flo
w th
roug
h va
lve
1
estimated (KF)estimated (EKF)
0 200 400 6000
0.5
1
1.5
2
2.5x 10−4 Valve 2
Flo
w th
roug
h va
lve
2
Time[s]
0 200 400 6000
0.5
1
1.5
2
2.5x 10−4 Valve 3
Flo
w th
roug
h va
lve
3
Time[s]0 200 400 600
0
0.5
1
1.5
2
2.5x 10−4 Valve 4
Flo
w th
roug
h va
lve
4
Time[s]
Figure 6.3: The measured pressure over the consumer valves plotted along with the estimates ofthe extended and the normal Kalman filter
figure, all the pump inputs contains a step at time 100 [s]. The pump inputs are sized in a manner such that itapproximately corresponds to a step in differential pressure, from 0.10 to 0.15 [Bar], over all of the consumervalves. After the steps are applied at time 100 [s], the valve position controllers are applied relatively flat rampsignals of 60 s duration, at time 200, 300 400 and 500 [s], respectively.
The EKFs flow predictions are plotted on fig 6.3, along with the estimates made by the normal Kalman fil-ter. The estimates of the EKF are seen to follow the trend of the estimates of the normal Kalman filter, but witha steady state offset of varying size. This steady state offset arises primarily because the normal Kalman filterutilizes a linearized model of the system, with a stationary operating point. Fig 6.4 shows the estimated valvecoefficients along with values calculated with background in the measured valve positions. The M-file usedfor the transformation are called ”reverse_ventil_stilling.m” and can be found on the attached CD. The figureshows that the estimates are relatively close to the calculated values. The figure also reveals some correlationbetween the valve coefficient estimates and pump inputs (the step at time = 100 s) and the valve coefficientestimates and the position of the other valves (time:200-260,300-360,400-460,500-560). Since the noise on themeasurements of the differential pressures seems to be quite small in magnitude, the correlation are concludedcaused by inaccuracies in the non-linear model. Based on the tests the EKF is concluded good enough to useas part of the overall control design.
Observer Design 59
0 100 200 300 400 500 6000
1
2
3
4
5
6
7
x 106 Kv1
Time[s]
0 100 200 300 400 500 6000
1
2
3
4
5
6
7
x 106 Kv2
Time[s]
0 100 200 300 400 500 6000
1
2
3
4
5
6
7
x 106 Kv3
Time[s]
0 100 200 300 400 500 6000
1
2
3
4
5
6
7
x 106 Kv4
Time[s]
calculatedestimated (EKF)
calculatedestimated (EKF)
calculatedestimated (EKF)
calculatedestimated (EKF)
Figure 6.4: The estimated valve coefficients along with values calculated from the measuredvalve positions.
6.3.1 Chapter Summary
This chapter has described the design of an EKF, for estimation of flows and valve frictions. The EKF basesits estimations, solely on measurements of differential pressures. The EKF has been tested against a normalKalman filter, which bases its estimations on measurements of both, differential pressures and valve positions.The quality of the EKFs estimations were based on the tests judged to be decent enough for usage in controllerimplementations. The next chapter will concern the design of linear parameter varying controllers, whichamong other things will rely on the EKFs valve position estimates.
Chapter 7Linear Parameter Varying Control
The aim of this chapter is to design a Linear Parameter Varying (LPV) controller, capable of keeping thedifferential pressure of the consumer valves at a constant level of 0.1 [Bar] over the ranges of valve positionsdisplayed in table 1.1 in the introduction. The chapter will start off with a general introduction to LPV controland a brief discussion of two methods considered for the project. Then part of the system will be soughtidentified as LPV and the parameters of the suggested LPV model structure will be fitted. After this an LPVcontroller will be sought designed based on the LPV description.
7.1 LPV background and analysis
This section will provide an introduction to LPV control and a brief review of two design methods consideredapplicable to the project.LPV systems are time varying plants whose state space description are fixed functions of a vector of varyingparameters. This gives a state space description of the structure of eqs. 7.1 and 7.2:
x = A(θ(t)) · x+B(θ(t)) · u (7.1)
y = C(θ(t)) · x+D(θ(t)) · u (7.2)
where
• θ(t) is a vector of varying parameters
Very generally speaking, LPV methods takes advantage of the linearity with respect to the parameter vectorθ(t), in formulating a given control problem as a set of Linear Matrix Inequalities (LMIs). Fast and efficientalgorithms for LMI solving are widely available. In this project LMIs are set up in YALMIP and sought solvedusing SeDuMi. The solution to the LMIs will be a controller, which is automatically gain scheduled along theparameter vector. This has the benefits that the parameter vector does not need to be known a priori, whichmeans that parameters measured or estimated on-line are sufficient. Furthermore the parameter vector canchange arbitrarily fast, giving the LPV methods a potential advantage compared to e.g. gain scheduling the LQcontroller of chapter 5 between a finite grid of operating points. LPV control are thought highly relevant forthis project, because it is believed that part of the system can be described by a state space description with
Linear Parameter Varying Control 61
EKF LPV-controller
Plantq
Kv
refu DP
Figure 7.1: A configuration with an LPV controller designed by the method presented in [5].
EKF LPV-controller
Plantq
Kv
refu DP
Figure 7.2: A configuration with an LPV controller designed by the input-to-state stabilizing statefeedback method presented in [6].
matrices that depending affinely on the frictions of the consumer valves.
It is chosen to focus on two methods of LPV controller design. The methods are those of [5] and [6], re-spectively. The method of [5], yields a controller structure as in eqs. 7.3 and 7.4, where state estimation are anintegrated part of the controller:
xk = Ak(θ(t)) · xk +Bk(θ(t)) · y (7.3)
u = Ck(θ(t)) · xk +Dk(θ(t)) · y (7.4)
A controller with the structure of eqs. 7.3 and 7.4, can be applied to the system as depicted on figure 7.1.The method presented in [6] are of more modern date. The method enables separation between design of stateobservers and input-to-state stabilizing state feedbacks for discrete-time LPV systems. The design methodfurthermore, explicitly takes parameter uncertainties into account. A configuration, where input-to-state sta-bilizing state feedbacks are designed via this method, combined with the EKF are considered of interest andshown in figure 7.2. The potential advantage in the configuration of fig 7.2 relative to the configuration of fig7.1, is that the estimates of flows and valve frictions from the EKF, together gives an optimal prediction onbackground of the non-linear model. Using parameter estimates from the EKF and state estimates from anobserver integrated in the controller, makes the quality of the estimated states, more unclear.
In the following an LPV model are created. With background in this model, it is desired to design the controllersof the configurations in fig 7.1 and fig 7.2 in order to compare performances.
7.2 Identification of an LPV model
The aim of this section is, as indicated in the headline, to derive an LPV description of the system. As pre-viously mentioned, it is chosen to design the LPV controller for the non-linear simulation model, rather than
62 7.2 Identification of an LPV model
the actual system, due to unrealistically large pump delays. As a consequence, it is chosen to derive the LPVdescription on the background of the nonlinear simulation model as well. It is emphasized that the methodused would be the same regardless of test environment (simulation or laboratory model). The creation of theLPV description are divided into 3 subsections, which chronologically are: identification of a suitable modelstructure, estimation of the parameters in the identified models structure and finally verification of the obtainedmodel.
7.2.1 Model structure
The input-output behaviour of the system are significantly non-linear, since both squared flows and squaredinputs are used. The squared flows are furthermore multiplied by the valve frictions, which is time varying.In order to obtain an input-output behaviour close to linear, it is exploited that the flows approximately can bedescribed by the following equation:
dq(t)dt≈ (M1 +M2 · (Kv(t))) · q(t)2 +M3 · u(t)2 (7.5)
Where
• Kv(t) are the valve frictions
• q(t) are the flows
• u(t) are the inputs
• M1, M2, and M3 are constant matrices
The differential pressures are modeled by dpi(t) = Kvi(t) · qi(t)2. The coherence in eq. 7.5, indicates that fora subsystem with input u2 and output q2, the input-output behaviour are close to linear parameter varying, withrespect to the parameters θi = k
Kvi. The system with subsystem are depicted in fig 7.3, where the assumed
linear parameter varying part are framed in the dot-and-dash ellipse. It is suggested that the LPV part can bedescribed by the following model:
A(θ) = A0 + θ1 ·A1 + θ2 ·A2 + θ3 ·A3 + θ4 ·A4 (7.6)
B(θ) = B0 + θ1 ·B1 + θ2 ·B2 + θ3 ·B3 + θ4 ·B4 (7.7)
C(θ) = I (7.8)
where
• θi = 106
Kvi
• Ai are of size 4 times 4
• Bi are of size 4 times 6
• C are of size 4 times 4
Linear Parameter Varying Control 63
Pumps Pipe system
Consumer valves
u2
u qdp2
LPV system
Figure 7.3: The system depicted such that the part of the system that is suggested linear parametervarying, are inside the dot-and-dash ellipse.
7.2.2 estimation of parameters
The aim of this subsection is to estimate the parameters of the Ai and Bi matrices of the suggested LPV model(7.6-7.8). The estimation are performed by identifying LTI models for different valve positions, with identityoutput matrices. This will cause the states of the LTI models to be identically scaled and have a commonoperating point, which in return entails that the Ai and Bi parameters of eqs. 7.6 and 7.7 can be estimatedentrance-wise from e.g least squares minimization of the LTI models with respect to valve frictions.The estimation are performed with the M-file ”est_lpv_model.m”, which can be found on the attached CD. Asmentioned in the introduction to the chapter, it has been chosen to obtain test data from the simulation modelrather than the physical system. The data are obtained by using the inputs signals designed in section 3.1, forthe following valve positions:
Valve position 1 = 0, 0.45, 0.67 (7.9)
Valve position 2 = 0, 0.45, 0.65 (7.10)
Valve position 3 = 0, 0.40, 0.57 (7.11)
Valve position 4 = 0, 0.23, 0.31 (7.12)
34 combinations of valve positions can be made from the sets in 7.9-7.12. For each of those 81 combinations,an LTI state space model are estimated by use of the Matlab function ”pem.m” and scaled such that the outputmatrix is identity (C=I). The ”pem” function uses optimization to minimize a cost function of summed, squarederrors.For each entrance (A11, A12, ...B46) of the 81 estimated LTI systems, values has been fitted to the correspondingentrances of the Ai og Bi matrices in eq. 7.6 og 7.7. The data fitting are performed by use of the least squaresminimization, described by eqs. 7.13-7.17:
64 7.2 Identification of an LPV model
X =
1 θ1(1) θ2(1) θ3(1) θ4(1)1 θ1(2) θ2(2) θ3(2) θ4(2)...
......
......
1 θ1(81) θ2(81) θ3(81) θ4(81)
(7.13)
yA =
Aij(1)Aij(2)...Aij(81)
(7.14)
yB =
Bij(1)Bij(2)...Bij(81)
(7.15)
A0ij
A1ij
A2ij
A3ij
A4ij
= X\yA (7.16)
B0ij
B1ij
B2ij
B3ij
B4ij
= X\yB (7.17)
The A0, A1, A2, A3, A4, B0, B1, B2, B3 and B4, matrices are displayed in Appendix A.4.
7.2.3 Verification of the LPV model
The aim of this subsection is to verify that the LPV model obtained in the previous subsection, are adequate forcontroller design. Since the total possible combinations of valve positions are quite large, even for a resolutionas low as the one represented by eqs. 7.9-7.12 it has been chosen to just show two, worst case scenarios. Theworst case scenarios are found by calculating eqs. 7.18 and 7.19 for each of the 81 combinations of valvepositions, that can be made from eqs. 7.9, 7.10, and then plot the two that has the largest error.
err =4∑j=1
(N∑k=1
((ysim(k, j)− ylpv(k, j))2)) (7.18)
err =4∑j=1
(∑Nk=1((ysim(k, j)− ylpv(k, j))2)∑N
k=1(|ysim(k, j)|)) (7.19)
where
• ysim(k) is the output from the simulation model at the k’th sample.
• ylpv(k) is the output from the LPV model at the k’th sample.
Linear Parameter Varying Control 65
0 50 100 150−2
0
2
4
6
8
10
12
14x 10−8
time [s]
squa
red
flow
thro
ugh
Val
ve 1
0 50 100 150−5
0
5
10
15
20x 10−8
squa
red
flow
thro
ugh
Val
ve 2
time [s]
0 50 100 150−1
−0.5
0
0.5
1
1.5
2
2.5x 10−7
squa
red
flow
thro
ugh
Val
ve 3
time [s]0 50 100 150
0
0.2
0.4
0.6
0.8
1
1.2
1.4x 10−7
squa
red
flow
thro
ugh
Val
ve 4
time [s]
simulation modelLPV model
Figure 7.4: Comparison between the predictions of the simulation model and the LPVmodel, for the combination of valve positions that maximizes the error of eq 7.18 (valveposi-tion1=0,valveposition2=0.45, valveposition3=0.57,valveposition4=0,
• N is the total number of samples
Comparisons between the simulation model and the LPV model, for the valve positions maximizing eqs. 7.18and 7.19 are plotted in fig 7.4 and 7.5.
It can be seen that the LPV model predicts the squared flows through valve 1, 2 and 3 quite well considering itis worst case scenarios. The squared flows through valve 4, however, are in both cases predicted quite poorly.This seems to be a general trend, whenever either the position of valve 1, 2 or 3 tends toward the respectiveupper thresholds, whilst the position of valve 4 does not tend toward the upper threshold. The reason for thiscan perhaps be found by looking at the A matrices of the 81 LTI models that were fitted in 7.2.2. A generaltendency is that the off diagonal entrances in row 4 is substantially larger than the off diagonal entrances in row1, 2 and 3, indicating a larger cross coupling for the 4th loop. The cross coupling will have the percent wisebiggest impact on the total flow through valve 4 when the flows through valve 1, 2 or 3 are large, relative tothe flows through valve 4 (i.e when valve position 4 tends toward closed and valve positions 1, 2 or 3 tendstoward open). Large cross coupling in itself, though, should not prevent a process to be described accuratelyby a LPV model. Therefore the worst case mis-predictions, with regards to loop 4, suggests that the input-output behaviour of this part of the simulation model, is not linear in the θ parameter for the entire range ofθ’s. That being said, the squared flows through valve 4 are actually predicted decently for the majority of thecombinations of valve positions tried.Despite the problems, regarding loop 4, described above, the LPV model are found sufficient to controllerdesign. It is expected that the worse prediction of the squared flows through valve 4 can be accounted somewhatfor in the choice of uncertainties.
66 7.3 LPV control design
0 50 100 150−2
0
2
4
6
8
10
12
14x 10−8
time [s]
squa
red
flow
thro
ugh
Val
ve 1
0 50 100 150−0.5
0
0.5
1
1.5
2
2.5x 10−7
squa
red
flow
thro
ugh
Val
ve 2
time [s]
0 50 100 150−0.5
0
0.5
1
1.5
2
2.5x 10−7
squa
red
flow
thro
ugh
Val
ve 3
time [s]0 50 100 150
0
0.2
0.4
0.6
0.8
1
1.2
1.4x 10−7
squa
red
flow
thro
ugh
Val
ve 4
time [s]
simulation modelLPV model
Figure 7.5: Comparison between the predictions of the simulation model and the LPVmodel, for the combination of valve positions that maximizes the error of eq 7.19 (valveposi-tion1=0,valveposition2=0.65,valveposition3=0.57,valveposition4=0.23)
7.3 LPV control design
The purpose of this section is to design a control system, based on the LPV model derived in the previoussection. The method used, are the one derived in [5], which relies on solving optimization problems where thecontroller is calculated subject to obtain some quadratic H∞ performance. These problems are formulated asLinear Matrix Inequalities (LMI’s) set up in YALMIP and solved using the SeDuMi solver. The method ex-ploits that the derived LPV model are affine in its parameter dependency, and hence polytopic. The calculatedcontroller will have the form shown in eq. 7.20
xk = Ak(θ(t)) · xk +Bk(θ(t)) · y
u = Ck(θ(t)) · xk +Dk(θ(t)) · y (7.20)
where
• u is the control signals
• y is the control error
Linear Parameter Varying Control 67
r
+- K LPV
u++ y
z1+- dW1
e
W2
z2
Figure 7.6: The closed loop system
7.3.1 Standard form
The first step of the method is to put the problem on the standard form of eq. 7.21 x
z
y
=
A(θ) B1(θ) B2(θ)C1(θ) D11(θ) D12(θ)C2(θ) D21(θ) D22(θ)
· x
w
u
(7.21)
Where
• x is the state vector
• w is a vector of disturbance signals
• z is a vector of performance outputs
The core of the whole design method is to obtain some guaranteed quadratic H∞ performance from w to z.For the problem in question, two performance channels are chosen for minimization. One is from referenceto control error (i.e difference between system output and reference). The other is a weight on the controlleroutput. Given these two performance channels, the standard problem can be depicted as on fig 7.6 and writtenas in eq. 7.22.
xflows
xW1
xW2
z1
z2
e
=
A(θ) 0 0 0 0 B(θ)0 AW1 0 θ ·BW1 0 00 0 AW2 0 0 BW2
−C(θ) CW1 0 θ ·DW1 −I 00 0 CW2 0 0 DW2
−C(θ) 0 0 θ −I 0
·
xflows
xW1
xW2
r
d
u
(7.22)
Where
• AW1, BW1, CW1 and DW1 constitutes a state space description of W1 in fig 7.6.
• AW2, BW2, CW2 and DW2 constitutes a state space description of W2 in fig 7.6.
68 7.3 LPV control design
7.3.2 Input-output filtering
The design presented in [5], requires some of the matrices in the general LPV system description, to be constant.The matrices in question are B2(θ), C2(θ), D12(θ), D21(θ) and D22(θ). A problem arises, because some ofthese matrices are parameter dependent in the chosen standard form of eq. 7.22. As a solution to this problem,the control signals (u) are pre-filtered and the control errors (y) are post-filtered. The filtering is performed byaugmenting the standard form of eq. 7.22 as follows: x
xu
xy
=
A(θ) B2(θ) · Cu 00 Au 0By · C2(θ) 0 Ay
· x
xu
xy
+
B1(θ)0By ·D21(θ)
· w +
0Bu
0
· u
z = [C1(θ), D12(θ)Cu, 0] ·
x
xu
xy
+D11(θ) · w
y = [0, 0, Cy] ·
x
xu
xy
(7.23)
Where
• A(θ), B1(θ), B2(θ), C1(θ), C2(θ), D11(θ), D12(θ), D21(θ) refers to the general standard form matricesof eq. 7.21, such that e.g C2=[-C2(θ) 0 −CW2].
• Au, Bu, Cu and Du constitutes a state space description of the input filter.
• Ay , By , Cy and Dy constitutes a state space description of the output filter.
The bandwidth of the filters, must be picked larger than the desired bandwidth of the system, but not arbitrarilylarge since this can cause numerical problems in the calculation of the LMI’s, which is being set up in the nextsubsection.
7.3.3 Formulation of Linear Matrix Inequalities
The purpose of this subsection is to formulate the controller design problem as a set of LMI’s, based on thestandard form which after pre/post-filtering of the inputs/outputs has the structure of eq. 7.24: A(θ) B1(θ) B2(θ)
C1(θ) D11(θ) D12(θ)C2(θ) D21(θ) 0
=
A0 B10 B20
C10 D110 D120
C20 D210 0
+4∑i=1
Ai B1i0
C1iD11i
00 0 0
(7.24)
The LPV-controller’s task is to obtain a good quadratic H∞ performance, γ, for the defined performancechannel (w to z eq. 7.21). This will imply internal stability and that the induced 2-norm from w to z arebounded by γ:
||z||2 < γ||w||2 (7.25)
Quadratic H∞ performance, γ, requires the existence of a Lyapunov matrix Xcl>0 that satisfies eq. 7.26: Acl(θ)TXcl +XclAcl(θ) XclBcl(θ) Ccl(θ)T
Bcl(θ)T −γ · I Dcl(θ)T
Ccl(θ) Dcl(θ) −γ · I
< 0 (7.26)
Linear Parameter Varying Control 69
Where
• Acl(θ), Bcl(θ), Ccl(θ) and Dcl(θ) constitutes a state space description of the closed loop system.
The fact that Acl(θ), Bcl(θ), Ccl(θ) and Dcl(θ) depends on θ calls for an infinite number of equations of typeeq. 7.26 to be satisfied. However, since the LPV model are polytopic, it is a sufficient condition that eq. 7.26are satisfied at the vertexes. Since the LPV model furthermore satisfies eq. 7.24, the Lyapunov matrix Xcl canbe calculated from the solution (R,S) to the following LMIs, that minimizes γ:
[ηR 00 I
]T AiR+RATi RCT1iB1i
C1iR −γI D11i
BT1iDT
11i−γI
[ ηR 00 I
]< 0, i=1,2,.....,16 (7.27)
[ηS 00 I
]T ATi S + SAi SB1iCT1i
BT1iS −γI DT
11i
C1iD11i
−γI
[ ηS 00 I
]< 0, i=1,2,.....,16 (7.28)
[R I
I S
]≥ 0 (7.29)
Where
• Ai, B1i, C1i
, D11iare the matrices of the LPV model, calculated in the i’th vertex.
• ηR are the base of the null space of (BT2 ,DT12).
• ηS are the base of the null space of (C2,D21).
The Lyapunov matrix Xcl can now be calculated from the solutions, S and R, to eqs. 7.27-7.29. In order to dothis, two new variables, M and N are introduced. The variables are defined as any full-rank matrices, fulfillingeq. 7.30:
MNT = I −RS (7.30)
Given M and N matrices, the Lyapunov matrix Xcl, can be calculated from eq. 7.31:[S I
NT 0
]= Xcl
[I R
0 MT
](7.31)
Since the LPV model is polytopic and because the closed loop Lyapunov matrix Xcl are valid for all possibleparameter trajectories, one parameter dependent controller with quadratic H∞ performance γ, can be calcu-lated. This is done by first calculating controllers for each of the 16 vertexes, by insertion of Xcl and γ into eq.7.26 and then interpolate between these controllers as described by eq 7.32:
Ω(θ) =16∑i=1
αi
[AKi BKi
CKi DKi
](7.32)
where
• AKi, BKi, CKi and DKi are the controller gains at the obtained, solving eq. 7.26, for the respectivevertices.
• (α1, ......, α16) is a solution to the convex decomposition problem in eq 7.33:
70 7.3 LPV control design
θ =16∑i=1
αiωi (7.33)
• where ωi are the vertices of the parameter polytope.
7.3.4 Implementation failed
Regrettably the calculation of the controller gains in eq. 7.32 never succeeded, due to massive numerical diffi-culties. The source of the numerical difficulties are obviously unknown to the author, but if guesses has to bemade, the suspicion falls on poorly conditioned system matrices and the linear dependency of B(θ)’s columns.The condition numbers of the system matrices are tried reduced with the MATLAB function ”ssbal” beforeinsertion into the LMIs and reduction to 4 inputs has been tried as well showing no sign of improvements sofar.Because of the ongoing numerical problems, the deadline of the project has become an issue and it has conse-quentially been decided to cancel the planned design of input-to-state stabilizing state feedbacks, following theguide lines of [6]. The M-file, where the calculations of the controller gains of eq. 7.32 are attempted are calledlpv_control.m and placed on the attached CD.Since the LPV control design failed, no further testing are to be performed. Therefore the next chapter willbegin straight away, concerning the overall conclusions drawn from the project.
Part III
Epilogue
72
Table of Contents
8 Conclusion 75
74 TABLE OF CONTENTS
Chapter 8Conclusion
The goal of the project was to apply control methods to a scaled district heating system, with a novel infrastruc-ture, capable of tracking constant differential pressure references for varying consumptions, utilizing a minimalnumber of sensors. Two kinds of control methods was intended investigated and compared. The first wasstandard Linear Quadratic Control and the second was the somewhat more advanced class of control methodsreferred to as Linear Parameter Varying Control. In order to carry out the control design, the system weredescribed mathematically and an observer were designed.
The mathematical system description were derived by setting up equations linking flow and pressure for thesystems pumps, pipes and valves, and then combine these equations by use of Kirchoffs 1st and 2nd law. Theparameters of the model were then reduced through observations of symmetry, sensitivity calculations and byexpressing the pipe frictions as constant functions of one another through measurements. The remaining pa-rameters were estimated by use of a Gauss Newton search algorithm, on a data set consisting of measurementsobtained with an optimal set of input signals, designed to minimize the ratio between the maximal and minimalparameter sensitivity. A linear discrete time state space description, with pump signals as inputs, differentialpressures as outputs and flows as states, were obtained from the derived model, by use of first order Taylorapproximations.
The observer was designed as an Extended Kalman filter. The EKF was designed to estimate flows andconsumptions (in terms of valve frictions), solely based on measurements of differential pressures. The perfor-mance of the EKF was compared to the performance of a normal Kalman filter that was based on measurementsof both, differential pressures and valve positions. The quality of the EKFs estimations were based on the testsconcluded satisfactory and decent enough for usage as part of the controller implementations.
The LQ control design was carried out, with background in the linear discrete time state space descriptionand the flow estimates from the EKF. The controller was designed to consists of three gain matrices, relating to,state feedback, introduction of reference and integral action, respectively. The verification of the controller de-sign was, due to unrealistically large pump delays, primarily performed through simulations on the non-linearmodel with the pump delays reduced to 0.1 s. The performance of the LQ controller in the simulations weresatisfactory. The controller was also implemented on the laboratory model, with a sample time of 1 S, approx-imately corresponding to the time delays. The performance on the laboratory model was not subject to muchtesting, but concluded satisfactory, taking the size of the delays into account.
76
With background in the mathematical system description, part of the system was suggested linear parametervarying, with respect to a parameter vector consisting of the inverse consumer valve frictions. The parametersof the suggested LPV model structure was found by use of least squares minimization, based on 81 LTI modelsthat were fitted to different operating points for the consumer valve frictions. The verification of the LPV modelshowed input-output behaviors close that of the systems for the first three loops. For the fourth, however, someinconsistencies were noticed, but all in all the LPV model were concluded sufficient for control design. Withbasis in the LPV model and the EKF, designs by use of the LPV methods presented in [5] and [6] were plannedcarried out. The control problem were posed as a set of LMIs following the guide lines of [5], but regrettably thesolving of the LMIs never succeeded, due to massive numerical difficulties. Because of the time spend tryingto solve numerical problems and an urgent project deadline, the planned design of an input-to-state stabilizingcontroller based on [6], was put on hold.
Bibliography
[1] F. B. Halldor Kristjansson, B. Bøhm, N. K. Vejen, J. Rasmussen, K. P. Christensen, and N. Bidstrup,Fjernvarmeforsyning af lavenergiområder. DTU, Institut for Mekanik, Energi og Konstruktion, 2004,iSBN: 87-7475-315-0.
[2] S. Villumsen, A. Larsen, K. Mørk, and S. B. Mikkelsen, “Optimal control of a pump system, implementedwith fault detection,” 2009.
[3] K. Trangbæk, T. Knudsen, and C. S. Kallesøe, “Plug and play process control of a district heating system,”Proceedings of the European Control Conference 2009, 2009.
[4] T. Knudsen, K. Trangbæk, and C. S. Kallesøe, “Plug and play process control applied to a district heatingsystem,” Proceedings of the 17th World Congress The International Federation of Automatic ControlSeoul, Korea, 2008.
[5] P. Apkarian, P. Gahinet, and G. Becker, “Self-scheduled h-infinity control of linear parameter-varyingsystems: a design example,” 1995.
[6] W. Heemels, J. Daafouz, and G. Millerioux, “Observer-based control of discrete-time lpv systems withuncertain parameters,” 2009.
[7] P. W. Rasmussen, Hydrulik ståbi. Nyt teknisk forlag, 1996, iSBN: 9788757113259.
[8] “Modeldannelse,” February 2007, http://www.control.auc.dk/~pa/kurser/PR6model/modelnote.pdf.
[9] Grundfos, UPM 15. Grundfos, 2005.
[10] C. D. PERSIS and C. S. Kallesøe, “Proportional and proportional-integral controllers for a nonlinearhydraulic network,” Proceedings of the 17th World Congress The International Federation of AutomaticControl Seoul, Korea, pp. 319–324, 2008.
[11] “senstools,” Jan 2004, http://www.control.auc.dk/~vie/Courses/Sim_exp_modelbest/Simulering_eksperimentel_modelbestemmelse.html.
[12] D. E. Penney and C. H. Edwards, Calculus, 6th ed. Prentice Hall, 2002.
[13] G. F. Franklin, J. D. Powell, and A. Emami-Naeini, Feedback Control of Dynamic Systems, 5th ed. Pren-tice Hall, 2006.
[14] “Optimal control,” February 2009, http://www.control.aau.dk/~pa/kurser/Optimal/optnote.pdf.
78 BIBLIOGRAPHY
[15] M. S. Grewal and A. P. Andrews, Kalman Filtering: Theory and Practise Using MATLAB, Second Edition.John Wiley and Sons, Inc., 2001, iSBN: 0-471-39254-5.
Part IV
Appendices
Appendix AMatrices
In order to keep the main report fairly readable, some of the relatively space consuming matrices are placed inthis appendix.
A.1 Matrices used in section 2.4
Kv =
Kv1 0 0 00 Kv2 0 00 0 Kv3 00 0 0 Kv4
(A.1)
J =
J12 + J13 0 0 0 J11 + J14 0 0 00 J22 + J23 0 0 J11 + J14 J21 + J24 0 00 0 J32 + J33 0 J11 + J14 J21 + J24 J31 + J34 00 0 0 J42 + J43 J11 + J14 J21 + J24 J31 + J34 J41 + J44
(A.2)
R =
Pmax Pmax 0 0 0 0Pmax 0 Pmax 0 0 0Pmax 0 0 Pmax Pmax 0Pmax 0 0 Pmax 0 Pmax
(A.3)
S =
Pmax
Qmax2 0 0 0 Pmax
Qmax2 0 0 00 Pmax
Qmax2 0 0 Pmax
Qmax2 0 0 00 0 Pmax
Qmax2 0 Pmax
Qmax2 0 Pmax
Qmax2 00 0 0 Pmax
Qmax2Pmax
Qmax2 0 Pmax
Qmax2 0
(A.4)
Matrices 81
T =
K12 +K13 0 0 0 K11 +K14 0 0 00 K22 +K23 0 0 K11 +K14 K21 +K24 0 00 0 K32 +K33 0 K11 +K14 K21 +K24 K31 +K34 00 0 0 K42 +K43 K11 +K14 K21 +K24 K31 +K34 K41 +K44
(A.5)
A.2 Matrices used in section 4.2
Kvlin=
Kv1 · 2 · q1 0 0 00 Kv2 · 2 · q2 0 00 0 Kv3 · 2 · q3 00 0 0 Kv4 · 2 · q4
(A.6)
Rlin =
Pmax · 2 · Um1 Pmax · 2 · U1 0 0 0 0Pmax · 2 · Um1 0 Pmax · 2 · U2 0 0 0Pmax · 2 · Um1 0 0 Pmax · 2 · Um2 Pmax · 2 · U3 0Pmax · 2 · Um1 0 0 Pmax · 2 · Um2 0 Pmax · 2 · U4
(A.7)
Slin =
2 · Pmax
Qmax2Pmax
Qmax2Pmax
Qmax2Pmax
Qmax2
Pmax
Qmax2 2 · Pmax
Qmax2Pmax
Qmax2Pmax
Qmax2
Pmax
Qmax2Pmax
Qmax2 3 · Pmax
Qmax2 2 · Pmax
Qmax2
Pmax
Qmax2Pmax
Qmax2 2 · Pmax
Qmax2 3 · Pmax
Qmax2
(A.8)
82 A.2 Matrices used in section 4.2
Tli
n=
1.7
5·q
0.7
51
·(K
12
+K
13)
+1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
52
·(K
22
+K
23)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
+1.7
5·q
0.7
5m
2·(
K21
+K
24)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
+1.7
5·q
0.7
5m
2·(
K21
+K
24)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
+1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
5m
3·(
K31
+K
34)
+1.7
5·q
0.7
53
·(K
32
+K
33)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
+1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
5m
3·(
K31
+K
34)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
5m
1·(
K11
+K
14)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
+1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
5m
3·(
K31
+K
34)
1.7
5·q
0.7
5m
1·(
K11
+K
14)
+1.7
5·q
0.7
5m
2·(
K21
+K
24)
+1.7
5·q
0.7
5m
3·(
K31
+K
34)
+1.7
5·q
0.7
5m
4·(
K41
+K
44)
+1.7
5·q
0.7
54
·(K
42
+K
43)
(A
.9)
Matrices 83
A.3 Matrices used in section 5.4
B =
0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 0 0 01 0 0 0 0 00 1 0 0 0 00 0 1 0 0 00 0 0 1 0 00 0 0 0 1 00 0 0 0 0 1
(A.10)
C =
0.7868e3 0 0 0 0 0 0 0 0 00 0.5570e3 0 0 0 0 0 0 0 00 0 1.2096e3 0 0 0 0 0 0 00 0 0 1.1158e3 0 0 0 0 0 0
(A.11)
D =
0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0
(A.12)
84 A.3 Matrices used in section 5.4
A=
0.9
023
0.0
018
0.0
029
0.0
110
0.1
847e−
40.3
576e−
4−
0.0
815e−
4−
0.0
914e−
4−
0.0
313e−
4−
0.0
601e−
4
0.0
041
0.9
240
−0.0
061
0.0
057
0.1
551e−
4−
0.0
815e−
40.3
701e−
4−
0.1
335e−
4−
0.0
457e−
4−
0.0
878e−
4
0.0
016
−0.0
030
0.9
103
0.0
256
0.0
596e−
4−
0.0
313e−
4−
0.0
457e−
40.1
366e−
40.2
979e−
4−
0.1
613e−
4
0.0
031
−0.0
057
0.0
077
0.8
573
0.1
145e−
4−
0.0
601e−
4−
0.0
878e−
40.2
624e−
4−
0.1
613e−
40.4
236e−
4
00
00
10
00
00
00
00
01
00
00
00
00
00
10
00
00
00
00
01
00
00
00
00
00
10
00
00
00
00
01
(A.1
3)
Matrices 85
A.4 Matrices used in section 7.2.2
A0 =
−1.3379 0.1477 0.0719 0.26720.0819 −1.1408 −0.0242 0.26710.0528 0.0761 −1.1333 0.52890.0856 0.1296 0.2341 −1.5733
(A.14)
A1 =
0.1425 0.0042 0.0116 0.0170−0.0410 0.0247 0.0106 −0.0153−0.0184 −0.0018 0.0172 −0.0203−0.0238 −0.0008 −0.0351 0.0433
(A.15)
A2 =
0.0256 −0.0682 −0.0125 −0.01270.0256 0.1441 −0.0126 0.02680.0080 −0.0407 0.0189 −0.0112−0.0180 −0.0624 −0.0219 0.0754
(A.16)
A3 =
0.0534 −0.0057 −0.0302 −0.01290.0277 0.0788 −0.0029 −0.05920.0375 0.0197 0.3040 0.0909−0.0300 −0.0202 −0.1990 0.1399
(A.17)
A4 =
−0.0320 0.0313 0.0216 −0.16680.0068 0.0615 0.0480 −0.1644−0.0307 −0.0188 0.0522 −0.40270.0667 0.0466 0.0951 0.2857
(A.18)
B0 =
0.0596 0.1258 −0.0287 −0.0363 −0.0114 −0.02470.0432 −0.0207 0.1144 −0.0476 −0.0125 −0.03500.0116 −0.0077 −0.0159 0.0355 0.0905 −0.05220.0200 −0.0145 −0.0279 0.0643 −0.0397 0.1101
(A.19)
B1 =
0.0087 0.0182 −0.0053 −0.0055 −0.0026 −0.0036−0.0011 −0.0006 −0.0030 0.0016 −0.0002 0.00230.0001 −0.0004 0.0001 −0.0001 −0.0023 0.00250.0002 −0.0005 0.0007 −0.0003 0.0039 −0.0055
(A.20)
B2 =
−0.0017 −0.0036 0.0018 0.0020 0.0009 0.00100.0052 −0.0051 0.0170 −0.0075 −0.0034 −0.0057−0.0005 −0.0009 0.0020 −0.0012 −0.0030 0.0020−0.0010 0.0022 0.0026 −0.0045 0.0034 −0.0073
(A.21)
86 A.4 Matrices used in section 7.2.2
B3 =
−0.0048 −0.0072 0.0015 0.0018 −0.0023 0.0024−0.0072 −0.0006 −0.0124 0.0060 −0.0014 0.00630.0022 −0.0079 −0.0065 0.0161 0.0332 −0.0170−0.0033 0.0040 0.0053 −0.0119 0.0046 −0.0164
(A.22)
B4 =
0.0008 0.0021 −0.0041 0.0006 0.0004 0.0001−0.0049 0.0010 −0.0092 −0.0009 −0.0005 0.0001−0.0009 0.0038 0.0024 −0.0046 −0.0088 0.00740.0039 −0.0104 −0.0148 0.0276 −0.0231 0.0524
(A.23)
Appendix BMeasurement journals
B.1 Analysing the consumer valves
The purpose of the test to be performed in this section, are twofold.
1. To find out how much the consumer valves can be opened, before a differential pressure of 0.1 [Bar] isno longer sustainable.
2. To obtain an estimate of a decent initial operating point, of the valve positions, for the design of theLQ-regulator.
The test are performed by applying maximum pressure over one consumer valve at a time, while changing thevalve position slowly from 0%-100%. To clarify things a bit, table B.1 contains the information about pumpand valve inputs, for the different tests
Test Pumpm1Pump1 Pump2 Pumpm2
Pump3 Pump4 Valve1 Valve2 Valve3 Valve4
1 100% 100% 0% 0% 0% 0% 0-100% 0% 0% 0%2 100% 0% 100% 0% 0% 0% 0% 0-100% 0% 0%3 100% 0% 0% 100% 100% 0% 0% 0% 0-100% 0%4 100% 0% 0% 100% 0% 100% 0% 0% 0% 0-100%
Table B.1: The pump and valve inputs, for the different tests
Applying the inputs shown in table B.1 gives the measurements shown in fig B.1. It is seen, from the figure,that a differential pressure of 0.1 bar should be sustainable, for the range of valve positions displayed in tableB.2
88 B.1 Analysing the consumer valves
0 0.5 1
0
0.2
0.4
Test 1
DP
Val
ve 1
Position of Valve 1 [%]0 0.5 1
0
0.2
0.4
Test 2
DP
Val
ve 2
Position of Valve 2 [%]
0 0.5 1
0
0.2
0.4
0.6Test 3
DP
Val
ve 3
Position of Valve 3 [%]0 0.5 1
0
0.2
0.4
0.6Test 4
DP
Val
ve 4
Position of Valve 4 [%]
Figure B.1: Differential pressure over the respective consumer valves, with respect to the positionof the valves. Note that valve 4 has been reversed on the laboratory model.
Measurement journals 89
Name Valve position(s) [%]Valve1 0-0.67Valve2 0-0.65Valve3 0-0.57Valve4 0-0.31
Table B.2: The range of valve positions, over which a differential pressure of 0.1 bar should besustainable.
B.2 Pump delays
The purpose of this section is to document the delay from input to actuation for the respective pumps. In orderto find the delays, a test are performed where steps are applied to one pump at a time, while the valves areclosed. The pump inputs used in the test are displayed in fig B.2. The results of the measurement are depictedin figure B.3. Fig B.4 shows close up’s around the step times for relevant valves. The delays of the six pumpsare read off from fig B.4 and displayed in table B.3. In order to verify the delays in table B.3, another test is
Name Delay [s]Pumpm1 0.7Pump1 0.7Pump2 0.7Pumpm2 0.7Pump3 0.5Pump4 0.6
Table B.3: The delays of the respective pumps
made with the same input. This test generally shows larger delays than the ones found in the first test. Thelargest delay are shown in fig B.5, and can be seen to be approximately 1 s.
90 B.2 Pump delays
0 50 100 150
0
0.2
0.4
0.6
0.8
1
Pump1
time [s]
Inpu
t
0 50 100 150
0
0.2
0.4
0.6
0.8
1
Pump2
time [s]
Inpu
t
0 50 100 150
0
0.2
0.4
0.6
0.8
1
Pump3
time [s]
Inpu
t
0 50 100 150
0
0.2
0.4
0.6
0.8
1
Pump4
time [s]
Inpu
t
0 50 100 150
0
0.2
0.4
0.6
0.8
1
Pump5
time [s]
Inpu
t
0 50 100 150
0
0.2
0.4
0.6
0.8
1
Pump6
time [s]
Inpu
t
Figure B.2: The pump inputs used in the pump delay test.
0 50 100 1500
0.1
0.2
0.3
0.4
0.5
0.6consumer valve 1
dp 1
[bar
]
time [s]0 50 100 150
0
0.1
0.2
0.3
0.4
0.5
0.6consumer valve 2
dp 2
[bar
]
time [s]
0 50 100 1500
0.1
0.2
0.3
0.4
0.5
consumer valve 3
dp 3
[bar
]
time [s]0 50 100 150
0
0.1
0.2
0.3
0.4
0.5
consumer valve 4
dp 4
[bar
]
time [s]
Figure B.3: The measured differential pressures over the respective consumer valves, with thepump inputs of fig B.2 applied.
Measurement journals 91
138 139 140 141 142 143 144 1450
0.2
0.4
Pump 1
dp 1
[bar
]
time [s]118 119 120 121 122 123 124 1250
0.2
0.4
Pump 2
dp 1
[bar
]
time [s]
98 99 100 101 102 103 104 1050
0.2
0.4
Pump 3
dp 2
[bar
]
time [s]78 79 80 81 82 83 84 85
0
0.2
0.4
Pump 4
dp 3
[bar
]
time [s]
58 59 60 61 62 63 64 650
0.2
0.4
0.6Pump 5
dp 3
[bar
]
time [s]38 39 40 41 42 43 44 45
0
0.2
0.4
0.6Pump 6
dp 4
[bar
]
time [s]
Figure B.4: Close-up’s, picked out from the measured differential pressures of fig B.3.
138 139 140 141 142 143 144 1450
0.1
0.2
0.3
0.4
0.5
consumer valve 3
dp 3
[bar
]
time [s]
Figure B.5: Close up from another measurement, with the input signals of fig B.2 applied, show-ing a larger delay than the ones depicted in fig B.2.
92 B.3 Measurement of pipe frictions proportions
B.3 Measurement of pipe frictions proportions
The aim of this section is to measure the proportions between K11 and the rest of the pipe frictions used in themodel. As mentioned in chapter 3 some of the pipe frictions are assumed equal. This means that the proportionsof interest are those between K11, K12, K21, K22, K31, K32 and K41.The proportions are measured by use of the pressure sensors of the laboratory model. The placement of thepressure sensors can be viewed on fig B.6. From the figure it can be seen that the pressure over the relevant pipesegments can be measured when certain flows are zero. This means that proportions between the pipe frictionsof all the relevant pipe segments can be calculated from steady state pressure values of the 4 tests described intable B.4. The pump inputs and valve positions are selected, such that the non-zero flow is maximized, becausethis will maximize the pressure drops over the relevant pipe segments and thus reduce the impact of sensor bias.
The following pressure drops are measured in the respective tests:
• test1: HR11 and HR12
• test2: HR11, HR21 and HR22
• test3: HR11, HR31 and HR32
• test4: HR11 and (HR41 +HR42)
Test Pumpm1Pump1 Pump2 Pumpm2
Pump3 Pump4 Valve1 Valve2 Valve3 Valve4
1 100% 100% 0% 0% 0% 0% 100% 0% 0% 0%2 100% 0% 100% 0% 0% 0% 0% 100% 0% 0%3 100% 0% 0% 100% 100% 0% 0% 0% 100% 0%4 100% 0% 0% 100% 0% 100% 0% 0% 0% 100%
Table B.4: The pump and valve inputs, for 4 tests from which the proportions between the desiredpipe frictions can be determined.
The proportion between two pipe frictions are identical to the proportion between the pressure drops overthe respective pipes (as long as the flow is non-zero). Therefore all of the pipe frictions can be expressed as
q3
q1
q2
q4
Pm2Pm1
P3P
2P1 P
4
V 1 V 2 V 3 V 4
qm1
qm2
qm3
qm4
"long" pipe (R)
pump (P)
valve (V)
R 11
R 12 R 13
R 14
R22
R 21
R 23
R 24
R 31
R 32 R 33
R 34
R 41
R42
R43
R 44
pressure sensor
78 4 3
6 5 2 1
Figure B.6: The hydraulic network of the laboratory model, including pressure sensors.
Measurement journals 93
multiples of K11 by eq B.1.
Kxx =Hxx
H11·K11 (B.1)
In the following, the above listed pressure drops will be measured and the gains expressed as Hxx
H11in eq. B.1
will be calculated.
Test 1In the following PSx will denote the pressure measured by pressure sensor, x. The gain that are to be measuredin test 1 are H12
H11. This is done as follows:
H12
H11=PS6 − PS4
PS4 − PS7= 5.30 (B.2)
Test 2The gains that are to be measured in test 2 are H21
H11and H22
H11. This is done as follows:
H21
H11=PS4 − PS6
PS6 − PS7= 0.58 (B.3)
H22
H11=PS5 − PS4
PS6 − PS7= 6.98 (B.4)
Test 3The gains that are to be measured in test 3 are H31
H11and H32
H11. This is done as follows:
H31
H11=PS1 − PS3
PS6 − PS7= 0.89 (B.5)
H32
H11=PS2 − PS1
PS6 − PS7= 5.20 (B.6)
Test 4The gain that are to be measured in test 4 are H41
H11. This is done as follows:
H41
H11=
PS1 − PS2
2 · (PS7 − PS6)= 2.75 (B.7)
Appendix CSimulations of the LQ controller
This appendix contains the results of the simulation of the LQ controller. The differential pressures and pumpinputs are plotted in figs C.1 - C.18. The overshoot, settling times and steady state errors, relating to the valvechanges, are read off into tables C.1 - C.9.
overshoot overshoot overshoot overshootv.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0 - - - -0.45 0 0 0 0.0140 0.0024 0.0014 0.00160.67 0 0 0 0.0185 0.0022 0.0013 0.0014
0 0.45 0 0 0.0361 0.0142 0.0030 0.00300.45 0.45 0 0 0.0137 0.0018 0.0009 0.00110.67 0.45 0 0 0.0185 0.0016 0.0010 0.0012
0 0.65 0 0 0.0348 0.0165 0.0028 0.00300.45 0.65 0 0 0.0138 0.0009 0.0006 0.00060.67 0.65 0 0 0.0187 0.0008 0.0016 0.0019
0 0 0.40 0 0.0365 0.0361 0.0152 0.00220.45 0 0.40 0 0.0137 0.0018 0.0010 0.00120.67 0 0.40 0 0.0185 0.0017 0.0009 0.0010
0 0.45 0.40 0 0.0357 0.0138 0.0023 0.00270.45 0.45 0.40 0 0.0135 0.0014 0.0007 0.00080.67 0.45 0.40 0 0.0185 0.0012 0.0007 0.0011
0 0.65 0.40 0 0.0349 0.0165 0.0022 0.00300.45 0.65 0.40 0 0.0138 0.0007 0.0004 0.00060.67 0.65 0.40 0 0.0118 0.0094 0.0104 0.0110
0 0 0.57 0 0.0353 0.0328 0.0147 0.00940.45 0 0.57 0 0.0134 0.0010 0.0007 0.00060.67 0 0.57 0 0.0185 0.0011 0.0006 0.0009
Table C.1: The overshoot in differential pressure over the respective valves, for the different com-binations of valve positions. Here overshoot is defined with respect to the mean the differentialpressures during the last 20 seconds of each combination of valve positions.
Simulations of the LQ controller 95
overshoot overshoot overshoot overshootv.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0.45 0.57 0 0.0354 0.0132 0.0016 0.00260.45 0.45 0.57 0 0.0134 0.0007 0.0005 0.00030.67 0.45 0.57 0 0.0185 0.0008 0.0004 0.0011
0 0.65 0.57 0 0.0353 0.0137 0.0017 0.00340.45 0.65 0.57 0 0.0138 0.0028 0.0002 0.00080.67 0.65 0.57 0 0.0264 0.0264 0.0264 0.0272
0 0 0 0.23 0.0321 0.0288 0.0355 0.02640.45 0 0 0.23 0.0137 0.0018 0.0010 0.00120.67 0 0 0.23 0.0185 0.0016 0.0009 0.0010
0 0.45 0 0.23 0.0358 0.0138 0.0028 0.00240.45 0.45 0 0.23 0.0135 0.0013 0.0006 0.00080.67 0.45 0 0.23 0.0185 0.0012 0.0010 0.0007
0 0.65 0 0.23 0.0349 0.0166 0.0031 0.00250.45 0.65 0 0.23 0.0138 0.0007 0.0007 0.00040.67 0.65 0 0.23 0.0118 0.0094 0.0111 0.0105
0 0 0.40 0.23 0.0355 0.0337 0.0151 0.00940.45 0 0.40 0.23 0.0135 0.0013 0.0007 0.00090.67 0 0.40 0.23 0.0184 0.0011 0.0006 0.0008
0 0.45 0.40 0.23 0.0355 0.0135 0.0023 0.00230.45 0.45 0.40 0.23 0.0134 0.0010 0.0005 0.00060.67 0.45 0.40 0.23 0.0185 0.0009 0.0007 0.0007
0 0.65 0.40 0.23 0.0351 0.0166 0.0024 0.00250.45 0.65 0.40 0.23 0.0138 0.0005 0.0005 0.00040.67 0.65 0.40 0.23 0.0189 0.0189 0.0197 0.0195
0 0 0.57 0.23 0.0326 0.0264 0.0238 0.01890.45 0 0.57 0.23 0.0133 0.0006 0.0005 0.00050.67 0 0.57 0.23 0.0185 0.0012 0.0004 0.0006
0 0.45 0.57 0.23 0.0353 0.0130 0.0016 0.00230.45 0.45 0.57 0.23 0.0134 0.0004 0.0004 0.00030.67 0.45 0.57 0.23 0.0120 0.0083 0.0077 0.0082
Table C.2: The overshoot in differential pressure over the respective valves, for the differentcombinations of valve positions. (continued)
96
overshoot overshoot overshoot overshootv.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0.65 0.57 0.23 0.0330 0.0104 0.0077 0.00770.45 0.65 0.57 0.23 0.0116 0.0021 0.0067 0.00680.67 0.65 0.57 0.23 0.0267 0.0267 0.0267 0.0267
0 0 0 0.31 0.0334 0.0334 0.0334 0.03530.45 0 0 0.31 0.0134 0.0010 0.0006 0.00080.67 0 0 0.31 0.0185 0.0011 0.0009 0.0007
0 0.45 0 0.31 0.0354 0.0133 0.0027 0.00170.45 0.45 0 0.31 0.0134 0.0008 0.0004 0.00060.67 0.45 0 0.31 0.0185 0.0008 0.0011 0.0005
0 0.65 0 0.31 0.0353 0.0157 0.0039 0.00190.45 0.65 0 0.31 0.0139 0.0009 0.0010 0.00010.67 0.65 0 0.31 0.0243 0.0243 0.0256 0.0244
0 0 0.40 0.31 0.0307 0.0243 0.0244 0.02430.45 0 0.40 0.31 0.0134 0.0007 0.0004 0.00060.67 0 0.40 0.31 0.0185 0.0012 0.0006 0.0005
0 0.45 0.40 0.31 0.0353 0.0131 0.0023 0.00170.45 0.45 0.40 0.31 0.0134 0.0005 0.0002 0.00050.67 0.45 0.40 0.31 0.0139 0.0052 0.0053 0.0046
0 0.65 0.40 0.31 0.0350 0.0112 0.0046 0.00460.45 0.65 0.40 0.31 0.0111 0.0018 0.0039 0.00370.67 0.65 0.40 0.31 0.0279 0.0279 0.0279 0.0279
0 0 0.57 0.31 0.0316 0.0316 0.0359 0.03160.45 0 0.57 0.31 0.0134 0.0003 0.0003 0.00040.67 0 0.57 0.31 0.0142 0.0150 0.0142 0.0142
0 0.45 0.57 0.31 0.0321 0.0142 0.0142 0.01420.45 0.45 0.57 0.31 0.0135 0.0002 0.0002 0.00020.67 0.45 0.57 0.31 0.0232 0.0236 0.0232 0.0232
0 0.65 0.57 0.31 0.0263 0.0172 0.0107 0.01070.45 0.65 0.57 0.31 0.0121 0.0075 0.0095 0.00950.67 0.65 0.57 0.31 0.0210 0.0210 0.0210 0.0210
Table C.3: The overshoot in differential pressure over the respective valves, for the differentcombinations of valve positions. (continued)
Simulations of the LQ controller 97
settling time settling time settling time settling timev.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0 - - - -0.45 0 0 0 0.40 0 0 00.67 0 0 0 1.60 0 0 0
0 0.45 0 0 0 2.40 0 00.45 0.45 0 0 0.40 0 0 00.67 0.45 0 0 1.60 0 0 0
0 0.65 0 0 0 1.00 0 00.45 0.65 0 0 0.40 0 0 00.67 0.65 0 0 1.60 0 0 0
0 0 0.40 0 0 0 2.80 00.45 0 0.40 0 0.40 0 0 00.67 0 0.40 0 1.50 0 0 0
0 0.45 0.40 0 0 2.30 0 00.45 0.45 0.40 0 0.40 0 0 00.67 0.45 0.40 0 1.60 0 0 0
0 0.65 0.40 0 0 1.00 0 00.45 0.65 0.40 0 0.40 0 0 00.67 0.65 0.40 0 1.20 0.60 0.60 0.10
0 0 0.57 0 0 0 0.90 00.45 0 0.57 0 0.40 0 0 00.67 0 0.57 0 1.60 0 0 0
0 0.45 0.57 0 0 2.10 0 00.45 0.45 0.57 0 0.40 0 0 00.67 0.45 0.57 0 1.60 0 0 0
0 0.65 0.57 0 0 0.70 0 00.45 0.65 0.57 0 0.50 0 0 00.67 0.65 0.57 0 1.60 0.70 0.90 0.10
Table C.4: The settling times for the differential pressure over the respective valves, for thedifferent combinations of valve positions. Here settling time is defined as (±5%) with respectto the mean the differential pressures during the last 20 seconds of each combination of valvepositions.
98
settling time settling time settling time settling timev.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0.23 0 0 0 2.600.45 0 0 0.23 0.40 0 0 00.67 0 0 0.23 1.50 0 0 0
0 0.45 0 0.23 0 2.30 0 00.45 0.45 0 0.23 0.40 0 0 00.67 0.45 0 0.23 1.60 0 0 0
0 0.65 0 0.23 0 1.00 0 00.45 0.65 0 0.23 0.50 0 0 00.67 0.65 0 0.23 1.20 0.70 0.20 0.50
0 0 0.40 0.23 0 0 2.70 00.45 0 0.40 0.23 0.40 0 0 00.67 0 0.40 0.23 1.50 0 0 0
0 0.45 0.40 0.23 0 2.20 0 00.45 0.45 0.40 0.23 0.40 0 0 00.67 0.45 0.40 0.23 1.60 0 0 0
0 0.65 0.40 0.23 0 1.00 0 00.45 0.65 0.40 0.23 0.50 0 0 00.67 0.65 0.40 0.23 1.30 0.80 0.30 0.50
0 0 0.57 0.23 0 0 0.90 00.45 0 0.57 0.23 0.40 0 0 00.67 0 0.57 0.23 1.60 0 0 0
0 0.45 0.57 0.23 0 2.00 0 00.45 0.45 0.57 0.23 0.40 0 0 00.67 0.45 0.57 0.23 1.10 0.30 0.80 0.30
0 0.65 0.57 0.23 0 0.30 0 00.45 0.65 0.57 0.23 0.70 0 0 00.67 0.65 0.57 0.23 1.70 0.80 0.90 0.40
Table C.5: The settling times for the differential pressure over the respective valves, for thedifferent combinations of valve positions. (continued)
Simulations of the LQ controller 99
settling time settling time settling time settling timev.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0.31 0 0 0 0.400.45 0 0 0.31 0.40 0 0 00.67 0 0 0.31 1.60 0 0 0
0 0.45 0 0.31 0 2.10 0 00.45 0.45 0 0.31 0.40 0 0 00.67 0.45 0 0.31 1.60 0 0 0
0 0.65 0 0.31 0 0.90 0 00.45 0.65 0 0.31 0.50 0 0 00.67 0.65 0 0.31 1.50 0.70 0 1.00
0 0 0.40 0.31 0 0 2.60 00.45 0 0.40 0.31 0.40 0 0 00.67 0 0.40 0.31 1.60 0 0 0
0 0.45 0.40 0.31 0 2.00 0 00.45 0.45 0.40 0.31 0.40 0 0 00.67 0.45 0.40 0.31 1.20 0.20 0.40 0
0 0.65 0.40 0.31 0 0.40 0 00.45 0.65 0.40 0.31 0.60 0 0 00.67 0.65 0.40 0.31 1.70 0.80 0.10 1.10
0 0 0.57 0.31 0 0 0.90 00.45 0 0.57 0.31 0.40 0 0 00.67 0 0.57 0.31 1.30 0 0.70 0.70
0 0.45 0.57 0.31 0 1.90 0 00.45 0.45 0.57 0.31 0.40 0 0 00.67 0.45 0.57 0.31 1.40 0.20 0.70 0.90
0 0.65 0.57 0.31 0 0.80 0 00.45 0.65 0.57 0.31 0.90 0 0 00.67 0.65 0.57 0.31 2.10 0.80 0.80 1.00
Table C.6: The settling times for the differential pressure over the respective valves, for thedifferent combinations of valve positions. (continued)
100
st.st. error st.st. error st.st. error st.st. errorv.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0 - - - -0.45 0 0 0 0 0 0 00.67 0 0 0 0 0 0 0
0 0.45 0 0 0 0 0 00.45 0.45 0 0 0 0 0 00.67 0.45 0 0 0 0 0 0
0 0.65 0 0 0 0 0 00.45 0.65 0 0 0 0 0 00.67 0.65 0 0 0 0 0 0
0 0 0.40 0 0 0 0 00.45 0 0.40 0 0 0 0 00.67 0 0.40 0 0 0 0 0
0 0.45 0.40 0 0 0 0 00.45 0.45 0.40 0 0 0 0 00.67 0.45 0.40 0 0 0 0 0
0 0.65 0.40 0 0 0 0 00.45 0.65 0.40 0 0 0 0 00.67 0.65 0.40 0 0.0094 0.0094 0.0094 0.0094
0 0 0.57 0 0 0 0 00.45 0 0.57 0 0 0 0 00.67 0 0.57 0 0 0 0 0
0 0.45 0.57 0 0 0 0 00.45 0.45 0.57 0 0 0 0 00.67 0.45 0.57 0 0 0 0 0
0 0.65 0.57 0 0 0.0028 0 00.45 0.65 0.57 0 0 0 0 00.67 0.65 0.57 0 0.0264 0.0264 0.0264 0.0264
Table C.7: The steady state errors for the differential pressure over the respective valves, for thedifferent combinations of valve positions.
Simulations of the LQ controller 101
st.st. error st.st. error st.st. error st.st. errorv.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0.23 0 0 0 00.45 0 0 0.23 0 0 0 00.67 0 0 0.23 0 0 0 0
0 0.45 0 0.23 0 0 0 00.45 0.45 0 0.23 0 0 0 00.67 0.45 0 0.23 0 0 0 0
0 0.65 0 0.23 0 0 0 00.45 0.65 0 0.23 0 0 0 00.67 0.65 0 0.23 0.0094 0.0094 0.0094 0.0094
0 0 0.40 0.23 0 0 0 00.45 0 0.40 0.23 0 0 0 00.67 0 0.40 0.23 0 0 0 0
0 0.45 0.40 0.23 0 0 0 00.45 0.45 0.40 0.23 0 0 0 00.67 0.45 0.40 0.23 0 0 0 0
0 0.65 0.40 0.23 0 0 0 00.45 0.65 0.40 0.23 0 0 0 00.67 0.65 0.40 0.23 0.0189 0.0189 0.0189 0.0189
0 0 0.57 0.23 0 0 0 00.45 0 0.57 0.23 0 0 0 00.67 0 0.57 0.23 0 0 0 0
0 0.45 0.57 0.23 0 0 0 00.45 0.45 0.57 0.23 0 0 0 00.67 0.45 0.57 0.23 0.0077 0.0077 0.0077 0.0077
0 0.65 0.57 0.23 0 0.0071 0 00.45 0.65 0.57 0.23 0.0067 0.0067 0.0067 0.00670.67 0.65 0.57 0.23 0.0334 0.0334 0.0334 0.0334
Table C.8: The steady state errors for the differential pressure over the respective valves, for thedifferent combinations of valve positions. (continued)
102
st.st. error st.st. error st.st. error st.st. errorv.pos.1 v.pos.2 v.pos.3 v.pos.4 valve1 valve2 valve3 valve4
0 0 0 0.31 0 0 0 00.45 0 0 0.31 0 0 0 00.67 0 0 0.31 0 0 0 0
0 0.45 0 0.31 0 0 0 00.45 0.45 0 0.31 0 0 0 00.67 0.45 0 0.31 0 0 0 0
0 0.65 0 0.31 0 0.0009 0 00.45 0.65 0 0.31 0 0 0 00.67 0.65 0 0.31 0.0243 0.0243 0.0243 0.0243
0 0 0.40 0.31 0 0 0 00.45 0 0.40 0.31 0 0 0 00.67 0 0.40 0.31 0 0 0 0
0 0.45 0.40 0.31 0 0 0 00.45 0.45 0.40 0.31 0 0 0 00.67 0.45 0.40 0.31 0.0046 0.0046 0.0046 0.0046
0 0.65 0.40 0.31 0 0.0054 0 00.45 0.65 0.40 0.31 0.0037 0.0037 0.0037 0.00370.67 0.65 0.40 0.31 0.0316 0.0316 0.0316 0.0316
0 0 0.57 0.31 0 0 0 00.45 0 0.57 0.31 0 0 0 00.67 0 0.57 0.31 0.0142 0.0142 0.0142 0.0142
0 0.45 0.57 0.31 0 0 0 00.45 0.45 0.57 0.31 0 0 0 00.67 0.45 0.57 0.31 0.0232 0.0232 0.0232 0.0232
0 0.65 0.57 0.31 0.0125 0.0148 0.0125 0.01250.45 0.65 0.57 0.31 0.0220 0.0220 0.0220 0.02200.67 0.65 0.57 0.31 0.0430 0.0430 0.0430 0.0430
Table C.9: The steady state errors for the differential pressure over the respective valves, for thedifferent combinations of valve positions. (continued)
Simulations of the LQ controller 103
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
0 100 200 300 400 500 600 700 800 9000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.1: The simulated differential pressures, from time 0-900 s.
0 100 200 300 400 500 600 700 800 9000
0.5
1pump m1
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump 1
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump 2
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump m2
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1pump 3
Time[s]
Pum
p in
put
0 100 200 300 400 500 600 700 800 9000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.2: The pump inputs, from time 0-900 s.
104
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.3: The simulated differential pressures, from time 900-1800 s.
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.5
1pump m1
Time[s]
Pum
p in
put
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.5
1pump 1
Time[s]
Pum
p in
put
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.5
1pump 2
Time[s]
Pum
p in
put
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.5
1pump m2
Time[s]
Pum
p in
put
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.5
1pump 3
Time[s]
Pum
p in
put
900 1000 1100 1200 1300 1400 1500 1600 1700 18000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.4: The pump inputs, from time 900-1800 s.
Simulations of the LQ controller 105
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.5: The simulated differential pressures, from time 1800-2700 s.
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.5
1
pump m1
Time[s]
Pum
p in
put
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.5
1pump 1
Time[s]
Pum
p in
put
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.5
1pump 2
Time[s]
Pum
p in
put
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.5
1pump m2
Time[s]
Pum
p in
put
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.5
1pump 3
Time[s]
Pum
p in
put
1800 1900 2000 2100 2200 2300 2400 2500 2600 27000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.6: The pump inputs, from time 1800-2700 s.
106
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.7: The simulated differential pressures, from time 2700-3600 s.
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.5
1pump m1
Time[s]
Pum
p in
put
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.5
1pump 1
Time[s]
Pum
p in
put
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.5
1pump 2
Time[s]
Pum
p in
put
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.5
1pump m2
Time[s]
Pum
p in
put
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.5
1pump 3
Time[s]
Pum
p in
put
2700 2800 2900 3000 3100 3200 3300 3400 3500 36000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.8: The pump inputs, from time 2700-3600 s.
Simulations of the LQ controller 107
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.9: The simulated differential pressures, from time 3600-4500 s.
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.5
1pump m1
Time[s]
Pum
p in
put
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.5
1pump 1
Time[s]
Pum
p in
put
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.5
1pump 2
Time[s]
Pum
p in
put
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.5
1pump m2
Time[s]
Pum
p in
put
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.5
1pump 3
Time[s]
Pum
p in
put
3600 3700 3800 3900 4000 4100 4200 4300 4400 45000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.10: The pump inputs, from time 3600-4500 s.
108
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.11: The simulated differential pressures, from time 4500-5400 s.
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.5
1
pump m1
Time[s]
Pum
p in
put
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.5
1pump 1
Time[s]
Pum
p in
put
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.5
1pump 2
Time[s]
Pum
p in
put
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.5
1pump m2
Time[s]
Pum
p in
put
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.5
1pump 3
Time[s]
Pum
p in
put
4500 4600 4700 4800 4900 5000 5100 5200 5300 54000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.12: The pump inputs, from time 4500-5400 s.
Simulations of the LQ controller 109
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.13: The simulated differential pressures, from time 5400-6300 s.
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.5
1
pump m1
Time[s]
Pum
p in
put
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.51
pump 1
Time[s]
Pum
p in
put
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.5
1
pump 2
Time[s]
Pum
p in
put
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.51
pump m2
Time[s]
Pum
p in
put
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.51
pump 3
Time[s]
Pum
p in
put
5400 5500 5600 5700 5800 5900 6000 6100 6200 63000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.14: The pump inputs, from time 5400-6300 s.
110
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.15: The simulated differential pressures, from time 6300-7200 s.
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.5
1pump m1
Time[s]
Pum
p in
put
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.5
1pump 1
Time[s]
Pum
p in
put
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.5
1pump 2
Time[s]
Pum
p in
put
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.5
1pump m2
Time[s]
Pum
p in
put
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.5
1pump 3
Time[s]
Pum
p in
put
6300 6400 6500 6600 6700 6800 6900 7000 7100 72000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.16: The pump inputs, from time 6300-7200 s.
Simulations of the LQ controller 111
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.05
0.1
0.15
0.2Valve 1
DP
1
Time[s]
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.05
0.1
0.15
0.2Valve 2
DP
2
Time[s]
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.05
0.1
0.15
0.2Valve 3
DP
3
Time[s]
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.05
0.1
0.15
0.2Valve 4
DP
4
Time[s]
Figure C.17: The simulated differential pressures, from time 7200-8100 s.
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.5
1pump m1
Time[s]
Pum
p in
put
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.5
1pump 1
Time[s]
Pum
p in
put
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.5
1pump 2
Time[s]
Pum
p in
put
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.5
1pump m2
Time[s]
Pum
p in
put
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.5
1pump 3
Time[s]
Pum
p in
put
7200 7300 7400 7500 7600 7700 7800 7900 8000 81000
0.5
1
pump 4
Time[s]
Pum
p in
put
Figure C.18: The pump inputs, from time 7200-8100 s.