Sie sind auf Seite 1von 32

Specialty Plants

SpeciaIty Experiment:
PI-pIus-Feedforward
Water LeveI ControI
Coupled Water Tanks
Student Handout
Coupled-Tank Control Laboratory Student Handout
TabIe of Contents
1. Objectives............................................................................................................................1
2. Prerequisites.........................................................................................................................2
3. ReIerences............................................................................................................................2
4. Experimental Setup..............................................................................................................3
4.1. Main Components........................................................................................................3
4.2. Wiring..........................................................................................................................3
5. Controller Design SpeciIications.........................................................................................4
5.1. ConIiguration #1: Tank #1 Level SpeciIications.........................................................4
5.2. ConIiguration #2: Tank #2 Level SpeciIications.........................................................5
6. Pre-Lab Assignments...........................................................................................................6
6.1. Coupled-Tank System Representation and Notations.................................................6
6.2. Assignment #1: Tank 1 Level Modelling - Non-Linear Equation OI Motion (EOM). .
7
6.3. Assignment #2: Tank 1 Level Modelling - EOM Linearization and TransIer
Function..............................................................................................................................8
6.4. Assignment #3 Tank 1 Level Controller Design: Pole Placement...........................9
6.5. Assignment #4: Tank 2 Level Modelling - Non-Linear Equation OI Motion (EOM). .
12
6.6. Assignment #5: Tank 2 Level Modelling - EOM Linearization and TransIer
Function............................................................................................................................13
6.7. Assignment #6 Tank 2 Level Controller Design: Pole Placement.........................14
7. In-Lab Procedure...............................................................................................................17
7.1. Experimental Setup And Wiring................................................................................17
7.2. Real-Time Implementation ConIiguration #1: Tank 1 PI-plus-FeedIorward Level
Control Loop.....................................................................................................................17
7.2.1. Objectives...........................................................................................................17
7.2.2. Experimental Procedure.....................................................................................17
7.3. Real-Time Implementation ConIiguration #2: Tank 2 PI-plus-FeedIorward Level
Control Loop.....................................................................................................................22
7.3.1. Objectives...........................................................................................................22
7.3.2. Experimental Procedure.....................................................................................22
Appendix A. Nomenclature...................................................................................................28
Document Number: 558 Revision: 05 Page: i
Coupled-Tank Control Laboratory Student Handout
1. Objectives
The Coupled-Tank plant is a "Two-Tank" module
consisting oI a pump with a water basin and two
tanks. The two tanks are mounted on the Iront plate
such that Ilow Irom the Iirst (i.e. upper) tank can
Ilow, through an outlet oriIice located at the
bottom oI the tank, into the second (i.e. lower)
tank. Flow Irom the second tank Ilows into the
main water reservoir. The pump thrusts water
vertically to two quick-connect oriIices "Out1" and
"Out2". The two system variables are directly
measured on the Coupled-Tank rig by pressure
sensors and available Ior Ieedback. They are
namely the water levels in tanks 1 and 2. A more
detailed description is provided in ReIerence |1|.
To name a Iew, industrial applications oI such
Coupled-Tank conIigurations can be Iound in the
processing system oI petro-chemical, paper
making, and/or water treatment plants. During the
course oI this experiment, you will become
Iamiliar with the design and pole placement tuning
oI Proportional-plus-Integral-plus-FeedIorward-
based water level controllers. In the present
laboratory, the Coupled-Tank system is used in
two diIIerent conIigurations, namely conIiguration
#1 and conIiguration #2, as described in ReIerence
|1|. In conIiguration #1, the control challenge is to
track to a desired trajectory the water level in the
top tank (i.e. tank #1) Irom the voltage applied to
the pump. The coupled-tank system in
conIiguration #2 is an example oI state coupling. In
conIiguration #2, the control challenge is to track
to a desired trajectory the water level in the bottom
tank (i.e. tank #2) Irom the water Ilow coming out
oI the top tank (i.e. tank #1).
Figure 1 The Coupled-Tank Experiment
At the end oI the session, you should know the Iollowing:
How to mathematically model the Coupled-Tank plant Irom Iirst principles in order
to obtain the two open-loop transIer Iunctions characterizing the system, in the
Laplace domain.
Document Number: 558 Revision: 05 Page: 1
Coupled-Tank Control Laboratory Student Handout
How to linearize the obtained non-linear equation oI motion about the quiescent
point oI operation.
How to design, through pole placement, a Proportional-plus-Integral-plus-
FeedIorward-based controller Ior the Coupled-Tank system in order Ior it to meet
the required design speciIications Ior each conIiguration.
How to implement each conIiguration controller(s) in real-time and evaluate its/their
actual perIormance.
2. Prerequisites
To successIully carry out this laboratory, the prerequisites are:
i) To be Iamiliar with your Coupled-Tank plant main components (e.g. mechanical
design, actuator, sensors), your power ampliIier (e.g. VoltPAQ), and your data
acquisition card (e.g. MultiQ), as described in ReIerences |1|, |2|, and |3|.
ii) To be Iamiliar in using QUARC to control and monitor the plant in real-time and in
designing a controller through Simulink, as detailed in ReIerence |4|.
iii) To be Iamiliar with the complete wiring oI your Coupled-Tank specialty plant, as per
dictated in ReIerence |1|.
3. References
|1| Coupled Tanks User Manual.
|2| Data Acquisition Card User Manual.
|3| Power Amplifier User Manual.
|4| QUARC User Manual (type doc quarc in Matlab to access).
|5| QUARC Installation Guide.
Document Number: 558 Revision: 05 Page: 2
Coupled-Tank Control Laboratory Student Handout
4. ExperimentaI Setup
4.1. Main Components
To setup this experiment, the Iollowing hardware and soItware are required:
Power Module: Quanser VoltPAQ, or equivalent.
Data Acquisition Board: Quanser Q2-USB, Q8-USB, QPID, or equivalent.
Coupled-Tank Plant: Quanser Coupled Tanks, as represented in Figure 1.
Control Software: The QUARC-Simulink conIiguration, as
detailed in ReIerence |4|, or equivalent.
For a complete and detailed description oI the main components comprising this setup,
please reIer to the manuals corresponding to your conIiguration.
4.2. Wiring
To wire up the system, please Iollow the deIault wiring procedure Ior your Coupled Tanks
as Iully described in ReIerence |1|. When you are conIident with your connections, you can
power up the ampliIier.
Document Number: 558 Revision: 05 Page: 3
Coupled-Tank Control Laboratory Student Handout
5. ControIIer Design Specifications
In the present laboratory (i.e. the pre-lab and in-lab sessions), you will design and
implement two control strategies corresponding to conIiguration #1 and conIiguration #2 oI
the Coupled Tanks. Depending on the tanks' conIiguration and coupling, the purpose oI the
laboratory session is to regulate and track the water level in either tank #1 and/or tank #2.
5.1. Configuration #1: Tank #1 LeveI Specifications
In conIiguration #1, a single-tank system, consisting oI the top tank (i.e. tank 1), is
considered. The designed closed-loop system is to control the water level (or height) inside
tank 1 via the commanded pump voltage. It is based on a Proportional-plus-Integral-plus-
FeedIorward scheme.
In response to a desired +1-cm square wave level setpoint Irom tank 1 operating level
position, the water height behaviour should satisIy the Iollowing design perIormance
requirements:
1. The operating level (a.k.a. equilibrium height), L
10
, in tank 1 should be as Iollows:
= L
10
15 | | cm
2. The Percent Overshoot should be less than 1, i.e.:
PO
1
11.0 | | ""
3. The 2 Settling Time should be less than 5 seconds, i.e.:
t
s1
5.0 | | s
4. The response should have no steady-state error.
Document Number: 558 Revision: 05 Page: 4
Coupled-Tank Control Laboratory Student Handout
5.2. Configuration #2: Tank #2 LeveI Specifications
In conIiguration #2, the pump Ieeds tank 1 and tank 1 Ieeds tank 2. The designed closed-
loop system is to control the water level in tank 2 (i.e. the bottom tank) Irom the water Ilow
coming out oI tank 1, located above it. Similarly to conIiguration #1, the control scheme is
based on a Proportional-plus-Integral-plus-FeedIorward law.
In response to a desired +1-cm square wave level setpoint Irom tank 2 equilibrium level
position, the water height behaviour should satisIy the Iollowing design perIormance
requirements:
1. The operating level (a.k.a. equilibrium height), L
20
, in tank 2 should be as Iollows:
= L
20
15 | | cm
2. The Percent Overshoot should be less than 2, i.e.:
PO
2
10.0 | | ""
3. The 2 Settling Time should be less than 20 seconds, i.e.:
t
s2
20.0 | | s
4. The response should have no steady-state error.
Document Number: 558 Revision: 05 Page: 5
Coupled-Tank Control Laboratory Student Handout
6. Pre-Lab Assignments
6.1. CoupIed-Tank System Representation and Notations
A schematic oI the Coupled-Tank plant is represented in Figure 2, below. The Coupled-
Tank system's nomenclature is provided in Appendix A. As illustrated in Figure 2, the
positive direction oI vertical level displacement is upwards, with the origin at the bottom oI
each tank (i.e. corresponding to an empty tank), as represented in Figure 2.
Figure 2 Schematic oI the Coupled-Tank Plant
Document Number: 558 Revision: 05 Page: 6
Coupled-Tank Control Laboratory Student Handout
6.2. Assignment #1: Tank 1 LeveI ModeIIing - Non-Linear
Equation Of Motion (EOM)
Assignment #1 derives the mathematical model oI your Coupled-Tank system in
conIiguration #1, as described in ReIerence |1|. It is reminded that in conIiguration #1, the
pump Ieeds into Tank 1 and that tank 2 is not considered at all. ThereIore, the input to the
process is the voltage to the pump and its output is the water level in tank 1 (i.e. top tank).
The purpose oI the present modelling session is to provide you with the system's open-loop
transIer Iunction, G
1
(s), which in turn will be used to design an appropriate level controller.
Answer the Iollowing questions:
1. Using the notations and conventions described in Figure 2, above, derive the Equation
OI Motion (EOM) characterizing the dynamics oI tank 1. Is the tank 1 system's EOM
linear?
Hint #1:
The obtained EOM should be a Iunction oI the system's input and output, as previously
deIined. ThereIore, you should express the resulting EOM under the Iollowing Iormat:
=

t
L
1
( ) I , L
1
J
p
|1|
where f denotes a Iunction.
Hint #2:
The mass balance principle can be applied to the water level in tank 1.
Hint #3:
The volumetric inIlow rate to tank 1 is assumed to be directly proportional to the applied
pump voltage, such that:
= F
i1
K
p
J
p
|2|
Hint #4:
Applying Bernoulli's equation Ior small oriIices, the outIlow velocity Irom tank 1, v
o1
,
can be expressed by the Iollowing relationship:
= v
o1
2 g L
1
|3|
2. The nominal pump voltage V
p0
Ior the pump-tank 1 pair can be determined at the
system's static equilibrium. By deIinition, static equilibrium at a nominal operating point
(V
p0
, L
10
) is characterized by the water in tank 1 being at a constant position level L
10
due
to the constant inIlow rate generated by V
p0
. Express the static equilibrium voltage V
p0
as
a Iunction oI the system's desired equilibrium level L
10
and the pump Ilow constant K
p
.
Using the system's speciIications given in ReIerence |1| and the desired design
requirements, evaluate V
p0
.
Document Number: 558 Revision: 05 Page: 7
Coupled-Tank Control Laboratory Student Handout
6.3. Assignment #2: Tank 1 LeveI ModeIIing - EOM
Linearization and Transfer Function
In order to design and implement a linear level controller Ior the tank 1 system, the Laplace
open-loop transIer Iunction should be derived. However by deIinition, such a transIer
Iunction can only represent the system's dynamics Irom a linear diIIerential equation.
ThereIore, the EOM Iound in Assignment #1 should be linearized around a quiescent point
oI operation.
In the case oI the water level in tank 1, the operating range corresponds to small departure
heights, L
11
, and small departure voltages, V
p1
, Irom the desired equilibrium point (L
10
, V
p0
).
ThereIore, L
1
and V
p
can be expressed as the sum oI two quantities, as shown below:
= L
1
+ L
10
L
11
and
= J
p
+ J
p0
J
p1
|4|
Answer the Iollowing questions:
1. Linearize tank 1 water level's EOM Iound in Assignment #1 about the quiescent
operating point (L
10
, V
p0
).
Hint #1:
For a Iunction, f, oI two variables, L
1
and V
p
, a Iirst-order approximation Ior small
variations at a point (L
1
, V
p
) (L
10
, V
p0
) is given by the Iollowing Taylor's series
approximation:
= ( ) I , L
1
J
p
+ + ( ) I , L
10
J
p0



L
1
( ) I , L
10
J
p0
( ) L
1
L
10



J
p
( ) I , L
10
J
p0
( ) J
p
J
p0
|5a
|
Hint #2:
The obtained linearized EOM should be a Iunction oI the system's small deviations about
its equilibrium point (L
10
, V
p0
). ThereIore, you should express the resulting linear EOM
under the Iollowing Iormat:
=

t
L
11
( ) I , L
11
J
p1
|5b|
where f denotes a Iunction.
2. Determine Irom the previously obtained linear equation oI motion, the system's open-
loop transIer Iunction in the Laplace domain, as deIined by the Iollowing relationship:
= ( ) G
1
s
( ) L
11
s
( ) J
p1
s
|6|
Document Number: 558 Revision: 05 Page: 8
Coupled-Tank Control Laboratory Student Handout
Express the open-loop transIer Iunction DC gain, K
dc1
, and time constant,
1
, as Iunc-
tions oI L
10
and the system parameters. What are the order and type oI the system? Is it
stable? Evaluate K
dc1
and
1
accordingly to the system's parameters and the desired
design requirements.
As a remark, it is obvious that linearized models, such as the Coupled-Tank tank 1's
voltage-to-level transIer Iunction, are only approximate models. ThereIore, they should be
treated as such and used with appropriate caution, that is to say within the valid operating
range and/or conditions. However Ior the scope oI this lab, Equation |6| is assumed valid
over the pump voltage and tank 1 water level entire operating range, V
ppeak
and L
1max
,
respectively.
6.4. Assignment #3 - Tank 1 LeveI ControIIer Design: PoIe
PIacement
For zero steady-state error, tank 1 water level is controlled by means oI a Proportional-plus-
Integral (PI) closed-loop scheme with the addition oI a IeedIorward action, as illustrated in
Figure 3, below.
As depicted in Figure 3, the voltage IeedIorward action is characterized by:
= J
pff
K
ff1
L
r1
|7|
and:
= J
p
+ J
p1
J
pff
|8|
As it can be seen in Figure 3, the IeedIorward action is necessary since the PI control sys-
tem is designed to compensate Ior small variations (a.k.a. disturbances) Irom the linearized
operating point (L
10
, V
p0
). In other words, while the IeedIorward action compensates Ior the
water withdrawal (due to gravity) through tank 1 bottom outlet oriIice, the PI controller
compensates Ior dynamic disturbances.
Document Number: 558 Revision: 05 Page: 9
Coupled-Tank Control Laboratory Student Handout
Figure 3 Tank 1 Water Level PI-plus-FeedIorward Control Loop
The open-loop transIer Iunction G
1
(s) takes into account the dynamics oI the tank 1 water
level loop, as characterized by Equation |6| in Assignment #2. However due to the presence
oI the IeedIorward loop, G
1
(s) can also be written as Iollows:
= ( ) G
1
s
( ) L
1
s
( ) J
p
s
|9|
Answer the Iollowing questions:
1. Analyze tank 1 water level closed-loop system at the static equilibrium point (L
10
, V
p0
)
and determine and evaluate the voltage IeedIorward gain, K
II1
, as deIined by Equation
|7|.
2. Using tank 1 voltage-to-level transIer Iunction G
1
(s) determined in Assignment #2 and
the control scheme block diagram illustrated in Figure 3, derive the normalized
characteristic equation oI the water level closed-loop system.
Hint #1:
The IeedIorward gain K
II1
does not inIluence the system characteristic equation.
ThereIore, the IeedIorward action can be neglected Ior the purpose oI determining the
denominator oI the closed-loop transIer Iunction. Block diagram reduction can be carried
out.
Hint #2:
The system's normalized characteristic equation should be a Iunction oI the PI level
controller gains, K
p1
, and K
i1
, and system's parameters, K
dc1
and
1
.
3. By identiIying the controller gains K
p1
and K
i1
, Iit the obtained characteristic equation
Document Number: 558 Revision: 05 Page: 10
Coupled-Tank Control Laboratory Student Handout
to the second-order standard Iorm expressed below:
= + + s
2
2
1

n1
s
n1
2
0
|10|
Determine K
p1
and K
i1
as Iunctions oI the parameters
n1
,
1
, K
dc1
, and
1
.
4. Determine the numerical values Ior K
p1
and K
i1
in order Ior the tank 1 system to meet
the closed-loop desired speciIications, as previously stated.
Hint #1:
Tank 1 level response Percent Overshoot can be expressed as Iollows:
= PO
1
100 e


1

1
1
2
|11|
Hint #2:
Tank 1 level response 2 Settling Time can be expressed as Iollows:
= t
s1
4

1

n1
|12|
Document Number: 558 Revision: 05 Page: 11
Coupled-Tank Control Laboratory Student Handout
6.5. Assignment #4: Tank 2 LeveI ModeIIing - Non-Linear
Equation Of Motion (EOM)
Assignment #4 derives the mathematical model oI your Coupled-Tank system in
conIiguration #2, as described in ReIerence |1|. It is reminded that in conIiguration #2, the
pump Ieeds into tank 1, which in turn Ieeds into tank 2. As Iar as tank 1 is concerned, the
same equations as the ones previously developed in Assignments #1, #2, and #3 apply.
However, the water level Equation OI Motion (EOM) in tank 2 still needs to be derived.
The input to the tank 2 process is the water level, L
1
, in tank 1 (generating the outIlow
Ieeding tank 2) and its output is the water level, L
2
, in tank 2 (i.e. bottom tank).
The purpose oI the present modelling session is to provide you with the system's open-loop
transIer Iunction, G
2
(s), which in turn will be used to design an appropriate level controller.
Answer the Iollowing questions:
1. Using the notations and conventions described in Figure 2, above, derive the Equation
OI Motion (EOM) characterizing the dynamics oI tank 2. Is the tank 2 system's EOM
linear?
Hint #1:
The obtained EOM should be a Iunction oI the system's input and output, as previously
deIined. ThereIore, you should express the resulting EOM under the Iollowing Iormat:
=

t
L
2
( ) I , L
2
L
1
|13|
where f denotes a Iunction.
Hint #2:
The mass balance principle can be applied to the water level in tank 2.
Hint #3:
The volumetric inIlow rate to tank 2 is equal to the volumetric outIlow rate Irom tank 1,
that is to say:
= F
i2
F
o1
|14|
Hint #4:
Applying Bernoulli's equation through small oriIices, the outIlow velocity Irom tank 2,
v
o2
, can be expressed by the Iollowing relationship:
= v
o2
2 g L
2
|15|
2. The nominal water level L
10
Ior the tank1-tank2 pair can be determined at the system's
static equilibrium. By deIinition, static equilibrium at a nominal operating point (L
10
, L
20
)
is characterized by the water in tank 2 being at a constant position level L
20
due to the
Document Number: 558 Revision: 05 Page: 12
Coupled-Tank Control Laboratory Student Handout
constant inIlow rate generated Irom the top tank by L
10
. Express the static equilibrium
level L
10
as a Iunction oI the system's desired equilibrium level L
20
and the system's para-
meters. Using the system's speciIications given in ReIerence |1| and the desired design
requirements, evaluate L
10
.
6.6. Assignment #5: Tank 2 LeveI ModeIIing - EOM
Linearization and Transfer Function
In order to design and implement a linear level controller Ior the tank 2 system, the Laplace
open-loop transIer Iunction should be derived. However by deIinition, such a transIer
Iunction can only represent the system's dynamics Irom a linear diIIerential equation.
ThereIore, the EOM Iound in Assignment #4 should be linearized around a quiescent point
oI operation.
In the case oI the water level in tank 2, the operating range corresponds to small departure
heights, L
11
and L
21
, Irom the desired equilibrium point (L
20
, L
10
). ThereIore, L
2
and L
1
can
be expressed as the sum oI two quantities, as shown below:
= L
2
+ L
20
L
21
and
= L
1
+ L
10
L
11
|16|
Answer the Iollowing questions:
1. Linearize tank 2 water level's EOM Iound in Assignment #4 about the quiescent
operating point (L
20
, L
10
).
Hint #1:
For a Iunction, f, oI two variables, L
2
and L
1
, a Iirst-order approximation Ior small
variations at a point (L
2
, L
1
) (L
20
, L
10
) is given by the Iollowing Taylor's series
approximation:
= ( ) I , L
2
L
1
+ + ( ) I , L
20
L
10



L
2
( ) I , L
20
L
10
( ) L
2
L
20



L
1
( ) I , L
20
L
10
( ) L
1
L
10
|17a|
Hint #2:
The obtained linearized EOM should be a Iunction oI the system's small deviations about
its equilibrium point (L
20
, L
10
). ThereIore, you should express the resulting linear EOM
under the Iollowing Iormat:
=

t
L
21
( ) I , L
21
L
11
|17b|
where f denotes a Iunction.
2. Determine Irom the previously obtained linear equation oI motion, the system's open-
Document Number: 558 Revision: 05 Page: 13
Coupled-Tank Control Laboratory Student Handout
loop transIer Iunction in the Laplace domain, as deIined by the Iollowing relationship:
= ( ) G
2
s
( ) L
21
s
( ) L
11
s
|18|
Express the open-loop transIer Iunction DC gain, K
dc2
, and time constant,
2
, as
Iunctions oI L
20
, L
10
, and the system's parameters. What are the order and type oI the
system? Is it stable? Evaluate K
dc2
and
2
accordingly to the system's parameters and the
desired design requirements.
As a remark, it is obvious that linearized models, such as the Coupled-Tank's tank 2 level-
to-level transIer Iunction, are only approximate models. ThereIore, they should be treated as
such and used with appropriate caution, that is to say within the valid operating range
and/or conditions. However Ior the scope oI this lab, Equation |18| is assumed valid over
tank 1 and tank 2 water level entire range oI motion, L
1max
and L
2max
, respectively.
6.7. Assignment #6 - Tank 2 LeveI ControIIer Design: PoIe
PIacement
For zero steady-state error, tank 2 water level is controlled by means oI a Proportional-plus-
Integral (PI) closed-loop scheme with the addition oI a IeedIorward action, as illustrated in
Figure 4, below.
Figure 4 Tank 2 Water Level PI-plus-FeedIorward Control Loop
In the block diagram depicted in Figure 4, the water level in tank 1 is controlled by means
oI the closed-loop system previously designed in Assignment #3. This is represented by the
tank 1 closed-loop transIer Iunction deIined below:
Document Number: 558 Revision: 05 Page: 14
Coupled-Tank Control Laboratory Student Handout
= ( ) T
1
s
( ) L
1
s
( ) L
r1
s
|19|
Such a subsystem represents an inner (or nested) level loop. In order to achieve a good
overall stability with such a conIiguration, the inner level loop (i.e. tank 1 closed-loop
system) must be much Iaster than the outer level loop. This constraint is met by the
previously stated controller design speciIications, where t
s1
t
s2
.
However Ior the sake oI simplicity in the present analysis, the water level dynamics in tank
1 are neglected. ThereIore, it is assumed hereaIter that:
= ( ) L
1
t ( ) L
r1
t
i.e.
= ( ) T
1
s 1
|20|
Furthermore as depicted in Figure 4, the level IeedIorward action is characterized by:
= L
ff1
K
ff2
L
r2
|21|
and:
= L
r1
+ L
11
L
ff1
|22|
The level IeedIorward action, as seen in Figure 4, is necessary since the PI control system is
only designed to compensate Ior small variations (a.k.a. disturbances) Irom the linearized
operating point (L
20
, L
10
). In other words, while the IeedIorward action compensates Ior the
water withdrawal (due to gravity) through tank 2's bottom outlet oriIice, the PI controller
compensates Ior dynamic disturbances.
The open-loop transIer Iunction G
2
(s) takes into account the dynamics oI the tank 2 water
level loop, as characterized by Equation |18| in Assignment #5. However due to the
presence oI the IeedIorward loop and the simpliIying assumption expressed by Equation
|20|, G
2
(s) can also be written as Iollows:
= ( ) G
2
s
( ) L
2
s
( ) L
1
s
|23|
Answer the Iollowing questions:
1. Analyze tank 2 water level closed-loop system at the static equilibrium point (L
20
, L
10
)
and determine and evaluate the level IeedIorward gain, K
II2
, as deIined by Equation
|21|.
Document Number: 558 Revision: 05 Page: 15
Coupled-Tank Control Laboratory Student Handout
2. Using tank 2 level-to-level transIer Iunction G
2
(s) determined in Assignment #5 and the
control scheme block diagram illustrated in Figure 4, derive the normalized
characteristic equation oI the water level closed-loop system.
Hint #1:
Block diagram reduction can be carried out.
Hint #2:
The system's normalized characteristic equation should be a Iunction oI the PI level
controller gains, K
p2
and K
i2
, and system's parameters, K
dc2
and
2
.
3. By identiIying the controller gains K
p2
and K
i2
, Iit the obtained characteristic equation
to the second-order standard Iorm expressed below:
= + + s
2
2
2

n2
s
n2
2
0
|24|
Determine K
p2
and K
i2
as Iunctions oI the parameters
n2
,
2
, K
dc2
, and
2
.
4. Determine the numerical values Ior K
p2
and K
i2
in order Ior the tank 2 system to meet
the closed-loop desired speciIications, as previously stated.
Hint #1:
Tank 2 level response Percent Overshoot can be expressed as Iollows:
= PO
2
100 e


2

1
2
2
|25|
Hint #2:
Tank 2 level response 2 Settling Time can be expressed as Iollows:
= t
s2
4

2

n2
|26|
Document Number: 558 Revision: 05 Page: 16
Coupled-Tank Control Laboratory Student Handout
7. In-Lab Procedure
7.1. ExperimentaI Setup And Wiring
Even iI you do not conIigure the experimental setup entirely yourselI, you should be at least
completely Iamiliar with it and understand it. II in doubt, reIer to ReIerences |1|, |2|, |3|,
and/or |4|.
The Iirst task upon entering the lab is to ensure that the complete system is wired as Iully
described in ReIerence |1|. You should be Iamiliar with the complete wiring and
connections oI your Coupled-Tank system. II you are still unsure oI the wiring, please ask
Ior assistance Irom the Teaching Assistant assigned to the lab. When you are conIident with
your connections, you can power up the ampliIier. You are now ready to begin the lab.
7.2. ReaI-Time ImpIementation - Configuration #1: Tank 1
PI-pIus-Feedforward LeveI ControI Loop
7.2.1. Objectives
To tune through pole placement the PI-plus-IeedIorward controller Ior the actual
water level in tank 1 oI the Coupled-Tank system.
To implement with QUARC the PI-plus-IeedIorward control loop Ior the actual
Coupled-Tank's tank 1 level.
To run the obtained PI-plus-IeedIorward level controller and compare the actual
response against the controller design speciIications.
To run the system's simulation simultaneously, at every sampling period, in order to
compare the actual and simulated level responses.
7.2.2. ExperimentaI Procedure
Please Iollow the steps described below:
Step 1. Load Matlab and set the Current Directory to your Iolder with the Coupled Tanks
lab Iiles.
Step 2. Open the qtanks1.mdl Simulink model Iile shown in Figure 5, below. The mod-
el implements the system's actual Proportional-plus-Integral (PI) closed-loop with
IeedIorward action, as studied in Assignment #3.
Document Number: 558 Revision: 05 Page: 17
Coupled-Tank Control Laboratory Student Handout
Figure 5 Real-Time Implementation oI the Tank 1 Level Control Loop: ConIiguration #1
Step 3. In order to use your actual coupled-tank system, the controller diagram directly
interIaces with your system hardware in the Coupled-Tank. Actual Plant block, as
shown in Figure 6, below.
Fig
ure 6 InterIace Subsystem to the Actual Coupled-Tank Plant Using the Q8 Card
Document Number: 558 Revision: 05 Page: 18
Coupled-Tank Control Laboratory Student Handout
To Iamiliarize yourselI with the diagram, it is suggested that you open the model sub-
systems to get a better idea oI their composing blocks as well as take note oI the I/O
connections. You should also check that the signal generator block properties are
properly set to output a square wave signal, oI amplitude 1 and oI Irequency 0.05 Hz.
The total level setpoint Ior tank 1 should result to be a square wave oI +1cm around
the desired equilibrium level L
10
. It should be noted that a simple low-pass Iilter oI
cut-oII Irequency 2.5 Hz (set by taut1) is added to the output signal oI the tank 1
level pressure sensor. This Iilter is necessary to attenuate the high-Irequency noise
content oI the level measurement. Such a measurement noise is mostly created by the
sensor's environment consisting oI turbulent Ilow and circulating air bubbles. Al-
though introducing a short delay in the signals, low-pass Iiltering allows Ior higher
controller gains in the closed-loop system, and thereIore Ior higher perIormance.
Moreover, as a saIety watchdog, the real-time controller will stop iI the water level in
either tank 1 or tank 2 goes beyond 30 cm (set by L1MAX) or 25 cm (set by
L2MAX), respectively. This is implemented in Figure 6 through the Dead Zone and
Stop With Error blocks.
Step 4. In the Coupled-Tanks. Actual Plant subsystem, click on the HIL Initialize block
and set the Board tvpe Iield to the data-acquisition board that is connected to the
Coupled Tanks system, e.g. Q4 HIL device.
Step 5. BeIore being able to run the actual control loop, the PI-plus-IeedIorward control-
ler gains must be initialized in the Matlab workspace, since they are to be used by the
Simulink controller diagram. Start by running the Matlab script called
setuplabtanks.m. However, ensure beIorehand that the CONTROLLERTYPE Ilag
is set to MANUAL. This Iile initializes all the Coupled-Tank model parameters and
user-deIined conIiguration variables needed by the Simulink diagram. As seen in pre-
lab assignment #3, the quiescent voltage IeedIorward term, V
pII
, is added to V
p1
to
compensate Ior the known water withdrawal bias Irom the bottom oI tank 1 as well as
to help bringing the water level, L
1
, to its operating position. You can now initialize in
the Matlab workspace the controller and IeedIorward gains as calculated in Assign-
ment #3. Have your lab assistant check your values. With his or her approval you
can now enter your calculated values Ior K
p1
, K
i1
, and K
II1
in the Matlab workspace
by Iollowing the Matlab notations used Ior the controller gains as presented in Table
A.2 oI Appendix A. You are now ready to go ahead with compiling and running your
actual level controller Ior tank 1.
Step 6. Build the real-time code corresponding to your diagram, by using the QUARC [
Build option Irom the Simulink menu bar.
Step 7. Clicking on QUARC , Start should start the gear pump thrusting water Iilling
tank 1 up to its operating level L
10
. Then aIter a 15-second settling delay (in order to
stabilize the system at its operating point), the water level in tank 1 should start track-
Document Number: 558 Revision: 05 Page: 19
Coupled-Tank Control Laboratory Student Handout
ing the desired +1-cm square wave setpoint around the desired operating level L
10
. As
a remark, the initial settling time Ior the system to reach its operating point is deIined
in Matlab by the parameter TS.
Step 8. In order to observe the system's responses Irom the actual system, double-click
on the Iollowing scopes in the Simulink model: L1 Resp. (cm) and Jp (J). You should
now be able to monitor, as the water Ilows through the Coupled-Tank system, the ac-
tual water level in tank 1 as it track its reIerence input. The corresponding com-
manded pump voltage, which is proportional to the control eIIort spent, is sent to the
power ampliIier and can also be monitored and plotted on-line.
Step 9. Assess the actual perIormance oI the level response and compare it to the design
requirements. Measure your response actual percent overshoot and settling time. Are
the design speciIications satisIied? Explain. II your level response does not meet the
desired design speciIications oI Section Controller Design SpeciIications on page 4,
review your PI-plus-FeedIorward gain calculations and/or alter the closed-loop pole
locations (i.e. PO
1
and t
s1
) until they do. II you are still unable to achieve the required
perIormance level, ask your T.A. Ior advice.
Hint:
The L1 Resp. (cm) and the Jp (J) scopes automatically save the last 30 seconds oI
data to the Matlab workspace under the variables dataL1 and dataJp, respectively.
These variables can be used with Matlab to accurately measure the percent overshoot
and settling time. See ReIerence |4| Ior more inIormation on saving data Ior oIIline
analysis.
Step 10. SpeciIically discuss in your lab report the Iollowing points:
How does your actual tank 1 level compare to the simulated response?
i) Is there a discrepancy in the results? II so, discuss some oI the possible reasons.
ii) From the plot oI the actual level response, measure your system t
s1
and PO
1
. Are
the values in agreement with the design speciIications? II not exactly, Iind some oI
the possible reasons.
Step 11. Once your results are as closely as possible in agreement with the closed-loop
requirements oI conIiguration #1, your tank 1 level response should look similar to
the one displayed in Figure 7, below.
Step 12. Include in your lab report your Iinal values Ior K
p1
, K
i1
, and K
II1
as well as the
resulting response plot oI the actual and theoretical L
1
versus L
r1
. Also include Irom
the same run the corresponding plot oI V
p
. Ensure to properly document all your res-
ults and observations beIore moving on the the next section.
Step 13. You can now proceed to the next section, which deals with the actual imple-
mentation in real-time oI your PI-plus-FeedIorward level controller Ior tank 2 oI the
Coupled-Tank system in conIiguration #2.
Document Number: 558 Revision: 05 Page: 20
Coupled-Tank Control Laboratory Student Handout
Figure 7 Actual And Theoretical Tank 1 Level Tracking Response: ConIiguration #1
Document Number: 558 Revision: 05 Page: 21
Coupled-Tank Control Laboratory Student Handout
7.3. ReaI-Time ImpIementation - Configuration #2: Tank 2
PI-pIus-Feedforward LeveI ControI Loop
7.3.1. Objectives
To tune through pole placement the PI-plus-FeedIorward controller Ior the actual
water level oI the Coupled-Tank system's tank 2.
To implement in real-time with QUARC the PI-plus-FeedIorward control loop Ior the
actual tank 2 water level.
To run the obtained FeedIorward-plus-PI level controller and compare the actual
response against the controller design speciIications.
To run the system's simulation simultaneously, at every sampling period, in order to
compare the actual and simulated level responses.
To investigate the eIIect oI the nested PI-plus-FeedIorward level control loop
implemented Ior tank 1.
7.3.2. ExperimentaI Procedure
Please Iollow the steps described below:
Step 1.Load Matlab and set the Current Directory to your Iolder with the Coupled Tanks
lab Iiles
Step 2.Open the qtanks2.mdl Simulink model Iile shown in Figure 8, below. The model
implements a Proportional-plus-Integral-plus-FeedIorward closed-loop, as studied in
Assignment # 6.
As mentioned in the pre-lab assignments, the tank 2 water level control loop is based
on top oI tank 1 level controller, as developed and tuned in the previous sections. The
nested actual tank 1 level control scheme is depicted in Figure 9, below. Similarly, the
level controller diagram Ior the Coupled-Tank in conIiguration #2 also interIaces
directly with your Coupled-Tank hardware, as shown in Figure 6, above. To
Iamiliarize yourselI with the diagram, it is suggested that you open the model
subsystems to get a better idea oI their composing blocks as well as take note oI the
I/O connections. You should also check that the signal generator block properties are
properly set to output a square wave signal, oI amplitude 1, and oI Irequency 0.018
Hz. The total level setpoint Ior tank 2 should result to be a square wave oI +1cm
around the desired equilibrium level L
20
. Also, your model sampling time should be
set to 1 ms, i.e. T
s
10
-3
s and the solver type to ode4 (Runge-Kutta).
Document Number: 558 Revision: 05 Page: 22
Coupled-Tank Control Laboratory Student Handout
Figure 8 Real-Time Implementation oI the Tank 2 Level Control Loop: ConIiguration #2.
Figure 9 Real-Time Implementation oI the Nested Tank 1 Level Control Loop: ConIiguration #2
It should be noted that two simple low-pass Iilters oI cut-oII Irequency 2.5 Hz (set by
taut1) and 0.33 Hz (set by taut2) are added to the output signals oI the tank 1 and
tank 2 level pressure sensors, respectively. These Iilters are necessary to attenuate the
high-Irequency noise content oI the level measurements. Such a measurement noise is
mostly created by the sensors environment made oI turbulent Ilow and circulating air
bubbles. Although introducing a short delay in the signals, low-pass Iiltering allows
Document Number: 558 Revision: 05 Page: 23
Coupled-Tank Control Laboratory Student Handout
Ior higher controller gains in the closed-loop system, and thereIore Ior higher
perIormance.
Moreover, as a saIety watchdog, the real-time controller will stop iI the water level in
either tank 1 or tank 2 goes beyond 30 cm (set by L1MAX) or 25 cm (set by
L2MAX), respectively. This is implemented in Figure 6 through the Dead Zone and
Stop With Error blocks.
Step 3.In the Coupled-Tanks. Actual Plant subsystem, click on the HIL Initialize block
and set the Board tvpe Iield to the data-acquisition board that is connected to the
Coupled Tanks system, e.g. Q4 HIL device.
Step 4.BeIore being able to run the actual control loop, the PI-plus-IeedIorward
controller gains Ior tank 2 must also be initialized in the Matlab workspace, since
they are to be used by the Simulink controller diagram. However, keep in the Matlab
workspace the PI-plus-IeedIorward controller gains Ior tank 1 oI the Coupled-Tank
system in conIiguration #1, as previously implemented. As seen in pre-lab assignment
#6, the quiescent level IeedIorward term, L
II1
, is added to L
11
to compensate Ior the
known water withdrawal bias Irom the bottom oI tank 2 as well as to help bringing
the water level, L
2
, to its operating position. You can now initialize in the Matlab
workspace the controller and IeedIorward gains as calculated in Assignment #6. Have
your lab assistant check your values. With his or her approval you can now enter
your calculated values Ior K
p2
, K
i2
, and K
II2
in the Matlab workspace by Iollowing
the Matlab notations used Ior the controller gains as presented in Table A.2 oI
Appendix A. You are now ready to go ahead with compiling and running your actual
level controller Ior tank 2 oI the Coupled-Tank system in conIiguration #2.
Step 5.Build the real-time code corresponding to your diagram, by using the QUARC [
Build option Irom the Simulink menu bar.
Step 6.Clicking on QUARC , Start should start the gear pump thrusting water Iilling up
both tank 1 and tank 2 up to their operating levels, L
10
and L
20
, respectively. Then
aIter a 35-second settling delay (in order to stabilize the system at its operating point),
the water level in tank 2 should start tracking the desired +1-cm square wave setpoint
around the operating level L
20
. As a remark, the initial settling time Ior the system to
reach its operating point is deIined in Matlab by the parameter TS.
Step 7.In order to observe the system's real-time responses Irom the actual system,
double-click on the Iollowing scopes in the Simulink model: L2 Resp. (cm), L1 Resp.
(cm), and Jp (J). You should now be able to monitor on-the-Ily, as the water Ilows
through the Coupled-Tank system, the actual water levels in tanks 1 and 2 as they
track their respective reIerence inputs. The corresponding commanded pump voltage,
which is proportional to the control eIIort spent, is sent to the power ampliIier and can
also be monitored and plotted on-line.
Step 8.Assess the actual perIormance oI the level response in tank 2 and compare it to
the design requirements. Measure your response actual percent overshoot and settling
time. Are the design speciIications satisIied? Explain. II your level response does not
Document Number: 558 Revision: 05 Page: 24
Coupled-Tank Control Laboratory Student Handout
meet the desired design speciIications oI Section Controller Design SpeciIications on
page 4, review your PI-plus-FeedIorward gain calculations and/or alter the closed-
loop pole locations (i.e. PO
2
and t
s2
) until they do. II you are still unable to achieve
the required perIormance level, ask your T.A. Ior advice.
Hint:
The L1 Resp. (cm), L2 Resp. (cm), and the Jp (J) scopes automatically save the last
60 seconds oI data to the Matlab workspace under the variables dataL1, dataL2,
and dataJp, respectively. These variables can be used with Matlab to accurately
measure the percent overshoot and settling time. See ReIerence |4| Ior more
inIormation on saving data Ior oIIline analysis.
Step 9.SpeciIically discuss in your lab report the Iollowing points:
i). How does your actual tank 2 level compare to the simulated response?
ii).Is there a discrepancy in the results? II so, discuss some oI the possible reasons.
iii).From the plot oI the actual level response, measure your system t
s2
and PO
2
. Are
the values in agreement with the design speciIications? II not exactly, Iind some oI
the possible reasons.
Document Number: 558 Revision: 05 Page: 25
Coupled-Tank Control Laboratory Student Handout
Step 10.Once your results are as closely as possible in agreement with the closed-loop
requirements oI conIiguration #2, your level response in tank 1 should look similar to
the one displayed in Figure 10, below.
Figure 10 Actual And Theoretical Tank 2 Level Tracking Response: ConIiguration #2
Document Number: 558 Revision: 05 Page: 26
Coupled-Tank Control Laboratory Student Handout
Step 11.From the same run, the corresponding water level in tank 1 is displayed in
Figure 11, below.
Figure 11 Actual Tank 1 Level Tracking Response: ConIiguration #2
Step 12.Include in your lab report your Iinal values Ior K
p2
, K
i2
, and K
II2
as well as the
resulting response plot oI the actual and theoretical L
2
versus L
r2
. Also include Irom
the same run the corresponding plots oI L
1
and V
p
.
Step 13.You can now move on to writing your lab report. Ensure to properly document
all your results and observations beIore leaving the laboratory session.
Document Number: 558 Revision: 05 Page: 27
Coupled-Tank Control Laboratory Student Handout
Appendix A. NomencIature
Table A.1, below, provides a complete listing oI the symbols and notations used in the
Coupled-Tank system mathematical modelling, as presented in this laboratory. The
numerical values oI the system parameters can be Iound in ReIerence |1|.
Symbol Description Units Matlab
Aotations
K
p
Pump Volumetric Flow Constant cm
3
/s/V Kp
V
p
Actual Pump Input Voltage V Vp
V
p0
Steady-State Pump Voltage V Vp0
V
p1
Small Variation Around V
p0
V Vp11
V
pII
FeedIorward Pump Voltage V VpII
D
t1
Tank 1 Inside Diameter cm Dt1
D
o1
Tank 1 Outlet Diameter cm Do1
A
t1
Tank 1 Inside Cross-Section Area cm
2
At1
A
o1
Tank 1 Outlet Cross-Section Area cm
2
Ao1
F
i1
Volumetric InIlow Rate To Tank 1 cm
3
/s
F
o1
Volumetric OutIlow Rate From Tank 1 cm
3
/s
L
1
Tank 1 Water Level cm L1
L
10
Steady-State Water Level in Tank 1 cm L10
L
11
Small Variation Around L
10
cm L11
L
r1
Tank 1 ReIerence (a.k.a. Desired) Level cm Lr1
K
L1
Tank 1 Water Level Sensor Sensitivity cm/V KL1
D
t2
Tank 2 Inside Diameter cm Dt2
D
o2
Tank 2 Outlet Diameter cm Do2
A
t2
Tank 2 Inside Cross-Section Area cm
2
At2
A
o2
Tank 2 Outlet Cross-Section Area cm
2
Ao2
F
i2
Volumetric InIlow Rate To Tank 2 cm
3
/s
F
o2
Volumetric OutIlow Rate From Tank 2 cm
3
/s
L
2
Tank 2 Water Level cm L2
Document Number: 558 Revision: 05 Page: 28
Coupled-Tank Control Laboratory Student Handout
Symbol Description Units Matlab
Aotations
L
20
Steady-State Water Level in Tank 2 cm L20
L
21
Small Variation Around L
20
cm L21
L
r2
Tank 2 ReIerence (a.k.a. Desired) Level cm Lr2
K
L2
Tank 2 Water Level Sensor Sensitivity cm/V KL2
g Gravitational Constant on Earth cm/s
2
g
Table A.1 Coupled-Tank System Model Nomenclature
Table A.2, below, provides a complete listing oI the symbols and notations used in the
design oI both control loops (i.e. the PI-plus-FeedIorward loops Ior the water levels in tank
1 and tank 2), as presented in this laboratory.
Symbol Description Units Matlab / Simulink
Aotation
PO
1
Tank 1 Level Percent Overshoot PO1
t
s1
Tank 1 Level 2 Settling Time s ts1
K
p1
Tank 1 Level Proportional Gain V/cm Kp1
K
i1
Tank 1 Level Integral Gain V/s/cm Ki1
G
1
Open-Loop Tank 1 Level TransIer Function cm/V G1
K
dc1
Tank 1 Level Open-Loop DC Gain V/cm Kdc1

1
Tank 1 Level Open-Loop Time Constant s tau1

1
Tank 1 Level Damping Ratio zeta1

n1
Tank 1 Level Undamped Natural Frequency rad/s wn1
T
1
Closed-Loop Tank 1 Level TransIer Function cm/cm T1
PO
2
Tank 2 Level Percent Overshoot PO2
t
s2
Tank 2 Level 2 Settling Time s ts2
K
p2
Tank 2 Level Proportional Gain cm/cm Kp2
K
i2
Tank 2 Level Integral Gain 1/s Ki2
G
2
Open-Loop Tank 2 Level TransIer Function cm/cm G2
K
dc2
Tank 2 Level Open-Loop DC Gain cm/cm Kdc2
Document Number: 558 Revision: 05 Page: 29
Coupled-Tank Control Laboratory Student Handout
Symbol Description Units Matlab / Simulink
Aotation

2
Tank 2 Level Open-Loop Time Constant s tau2

2
Tank 2 Level Damping Ratio zeta2

n2
Tank 2 Level Undamped Natural Frequency rad/s wn2
K
II1
FeedIorward Pump Voltage Gain (ConIiguration
#1)
V/cm
1/2
KII1
K
II2
FeedIorward Tank 1 Level Gain (ConIiguration
#2)
cm/cm KII2
s Laplace Operator rad/s
t Continuous Time s
Table A.2 Control Loops Nomenclature
Document Number: 558 Revision: 05 Page: 30

Das könnte Ihnen auch gefallen