Вы находитесь на странице: 1из 28

Yıldız Technical University, Control and Automation Engineering

Control Laboratory Student Handouts

Experiment # 5
5. Coupled Water Tanks

5.1. Objectives

The Coupled-Tank plant is a “Two-Tank” module consisting of a pump with a water basin and
two tanks. The two tanks are mounted on the front plate such that flow from the first (i.e.
upper) tank can flow, through an outlet orifice located at the bottom of the tank, into the
second (i.e. lower) tank. Flow from the second tank flows into the main water reservoir. The
pump thrusts water vertically to two quick-connect orifices “Out1” and “Out2”. The two
system variables are directly measured on the Coupled-Tank rig by pressure sensors and
available for feedback. They are namely the water levels in tank 1 and 2. To name a few,
industrial applications of such Coupled-Tank configurations can be found in the processing
system of petro-chemical, paper making, and/or water treatment plants. During the course
of this experiment, you will become familiar with the design and pole placement tuning of
Proportional-plus-Integral-plus-Feedforward-based water level controllers.

This laboratory requires the student to design, though pole placement, controllers to
regulate the water level in multiple coupled-tank systems and track that water level to a
desired trajectory. First with the coupled-tank system in configuration #1, a Proportional-
plus-Integral (PI) scheme with feedforward action is used to control the water level in the
top tank (i.e. tank#1) from the power amplifier voltage. Then with the coupled-tank system
in configuration #2, another Proportional-plus-Integral (PI) scheme with feedforward action
is used to control the water level in the bottom tank (i.e. tank#2) from the water flow
coming out of tank #1, located above it.
At the end of this session, you should know the following:
 How to mathematically model the Coupled-Tank plant from principles in order to
obtain the two open-loop transfer functions characterizing the system, in the Laplace
domain. An understanding of the different tuning parameters in the controller.
 How to linearize the obtained non-linear equation of motion about the quiescent
point of operation.
 How to design, through pole placement, a Proportional-plus-Integral-plus-
Feedforward-based controller for the Coupled-Tank system in order for it to meet the
required design specifications for each configuration.
 How to implement each configuration controller(s) in real-time and evaluate its/their
actual performance.

5.2. System Requirements & Components

To complete this lab, the following hardware is required:


 Quanser VoltPAQ Power Module or equivalent.
 Quanser Q2-USB, Q8-USB, Q-PID, or equivalent.
 Quanser Coupled Tanks, as represented in Figure 5.1.
 PC equipped with the required software as stated in the Quarc user manual.

5.1
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.1. Coupled-Tank Plant Front and Back View

Figure 5.2. Base of the Coupled-Tank Plant

5.2
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.3. Quick-Connect “Out1” and “Out2” Coupling

Table 5.1. Coupled-Tank Component Nomenclature

The system's basic operating principle is as follows:

 The water in the reservoir at the bottom of the system is transferred to Tank 1 with
the help of pumps and hoses located above the engine. The water transferred to
Tank 1 is transferred indirectly to Tank 2 due to the hole at the bottom of the Tank1.
 Depending on the configuration used herein, the water level in Tank 1 or Tank 2 is
used to maintain the reference value. For this purpose, in both water tanks pressure
sensors that determine the water level and used as feedback signal are used.
 At the same time, to make the reference tracking problem little more difficult there is
one disruptive tap connected to the Tank 1. In necessity this tap is opened and
disturbance from the outside state simulation is performed.

5.3
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

 The control of the system is provided by adjusting the voltage supplies to the water
pump and taking the amount of the water to the tanks of the pump presses as
control signal.
 By using different sized seals which provides the water inlet and outlet system
parameters can be changed and also during the experiment how these parameter
changes affect the system response can be observed.

5.3. System Configuration


5.3.1. Configuration #1
This section of the lab should be read over and completely understood before attending the
lab. It is encouraged for the student to work through the derivations as well as to get a
thorough understanding of the underlying mechanics. For a complete listing of the symbols
used in this derivation as well as the model, refer to Appendix – 5.A - Nomenclature at the
last page of this handout.

Water pump fills the Tank1; Tank 2 is not used in this configuration. In this study, to control
the level of the water in Tank 1 or to have a desired water level a controller design is done
and applied to the system. By using different sized input-output seals mechanism can be
used for different designs.

Figure 5.4 – Configuration #1

5.4
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Tank #1 Level Specification:


In configuration #1, a single-tank system, consisting of 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-
Feedforward scheme.
In response, to a desired ±1 cm square wave level set point from tank 1 operating level
position, the water height behaviour should satisfy the following design performance
requirements:
 The operating level (a.k.a equilibrium height), L10 , in tank 1 should be as follows:
L10  15[cm]
 The percent overshoot should be:
PO1  11.0["%"]
 The 2% Settling Time should be less than 5 seconds, i.e.:
ts _ l  5.0[ s ]
 The response should have no steady-state error.

Figure 5.5. Tank 1 Level Loop: PI-plus-Feedforward Controller

5.5
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.6. Interface to the Actual Coupled-Tank System

5.3.1.1. Tank #1 Level Modelling – Non-linear Equation of Motion


The outflow rate from Tank 1 Fol can be expressed by:

Fo1  Ao1vo1 (5.1)

As a remark, the cross-section area of Tank 1 outlet hole can be calculated by:

1
Ao1   Do12 (5.2)
4
Assignment #1
Find the outflow rate and then obtain the first-order differential equation in L1 by using the
mass balance principle (HINT #2) for Tank 1. Use all the hints given.

HINT #1:
Applying Bernoulli’s equation for small orifices, the outflow velocity from tank 1, vo1 , can be
expressed by the following relationship:
vo1  2 gL1 (5.3)
HINT #2:
Mass balance principle for Tank 1 can be expressed in verbal way like;
INFLOW = OUTFLOW + ACCUMULATION
In here accumulation can be expressed as:
 
At1  L1  (5.4)
 t 

5.6
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

HINT #3:
The volumetric inflow rate to tank 1 is assumed to be directly proportional to the applied
pump voltage, such that:
Fil  K pV p (5.5)

Assignment #2
Due to the square root function applied to L1 , the first-order differential equation is non-
linear. Solve the differential equation for the voltage at the equilibrium point. And find the
V p 0 equation in terms of L10 and K p .

HINT #1
At equilibrium, all the time derivative terms equate zero.

Using the system’s specifications and the design requirement results to be:

V p 0  9.26[V ]

5.3.1.2. Tank #1 Level Modelling – Equation of Motion (EOM) Linearization and


Transfer Function

Applying the taylor’s series approximation about ( L10 , V p 0 ) the L1 expression can be
t
linearized as represented below:

 K V  Ao1 2 gL10 1 Ao1 2 gL11 K pV p1


L1  p p 0   (5.6)
t At1 2 gL10 At1 At1
Substituting V p 0 in Equation [5.6] with its expression (that you found in Assignment #2)
results to the following linearized EOM for the Tank 1 water level system:

 1 Ao1 2 gL11 K pV p1
L11    (5.7)
t 2 gL10 At1 At1
Applying the Laplace transform to Equation [5.7] and rearranging yields the desired open-
loop transfer function for the Coupled-Tank’s Tank 1 system, such that:

K dc _1
G1 ( s )  (5.8)
 1s  1
with:

K p gL10 2 gL10 At1 2


K dc _1  and 1 
Ao1 g Ao1 g

Such a system is stable since its unique pole (system of order one) is located on the left-
hand-side of the s-plane. By not having any pole at the origin of the s-plane, G1 (s) is of type
zero.

5.7
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Evaluating K dc _1 and  1 , accordingly to the system’s parameters and the desired design
requirements, gives:

V
K dc _1  3.2[ ] and 1  15.2[s]
cm

5.3.1.3. Tank #1 Level Controller Design : Pole Placement


By definition, at the static equilibrium point ( L10 , V p 0 ):

( L1  Lr _1 )  L10 and (V p  V p _ ff )  V p 0

Using equation found in Assignment #2, the voltage feedforward gain results to be:

Ao1 2 g
K ff _1  (5.9)
Kp
Evaluating Equation [5.9] with the system’s parameters leads to:

V
K ff _1  2.39[
] (5.10)
cm
Neglecting the feedforward action and carrying out block diagram reduction, Tank 1
normalized characteristic polynomial results to be:

(1  K dc _1 K p _1 ) s K dc _1 Ki _1
s2   0 (5.11)
1 1
Solving for the two unknowns K p _1 and K i _1 the set of two equations resulting from
identifying the coefficients of the second-order standard form:

21n1 1  1
K p _1  (5.12)
K dc _1
n12 1
K i _1  (5.13)
K dc _1
The minimum damping ratio to meet the maximum overshoot requirement, PO1 , can be
obtained. The following relationship results:

 1 
ln  PO1 
 100 
1  (5.14)
2
 1 
ln  PO1    2
 100 
The system natural frequency, n1 , can be calculated from Equation [12] as follows:

4
n1  (5.15)
1ts _1
Evaluating first Equations [5.14] and [5.15] accordingly to the desired design requirements,
then carrying out the numerical application of Equations [5.12] and [5.13] lead to the
following PI controller gains:
5.8
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

V   V 
K p _1  7.2   Ki _1  9.1 
 cm   s  cm 
Assignment #3

By using the given transfer functions of system and the given requirements (for damping
ratio and maximum overshoot) calculate the PI controller gains.

5.3.2. Configuration #2
Water pump fills Tank 1. Due to the hole under the Tank 1, it also fills Tank 2 indirectly.
Controller is designed to do level control of water in Tank 2. By using the different sized
input-output seals, mechanism can be used for different designs.

Figure 5.7. Configuration #2

Tank #2 Level Specifications:


In configuration #2, the pump feeds tank 1 and tank 1 feeds tank 2. The designed closed-
loop system is to control the water level in tank 2 (i.e. the bottom tank) from the water flow
coming out of tank 1, located above it. Similarly to configuration #1, the control scheme is
based on a Proportional-plus-Integral-plus-Feedforward law.

In response,to a desired ±1 cm square wave level setpoint from tank 2 operating level
position, the water height behaviour should satisfy the following design performance
requirements:

 The operating level (a.k.a equilibrium height), L20 , in tank 2 should be as follows:

5.9
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

L20  15[cm]
 The percent overshoot should be:
PO2  11.0["%"]
 The 2% Settling Time should be less than 5 seconds, i.e.:
ts _ 2  5.0[ s]
 The response should have no steady-state error.

Figure 5.8. Tank 2 Level Loop: PI-plus-Feedforward Controllers

Figure 5.9. Tank 2 Actual PI-plus-Feedforward Controller

5.10
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

5.3.2.1. Tank #2 Level Modelling – Non-linear Equation of Motion


The outflow rate from tank 2 can be expressed by:

Fo 2  Ao 2vo 2 (5.16)
As a remark, the cross-section area of the tank 2 outlet hole can be calculated by:

1
Ao 2   Do 2 2 (5.17)
4
Using Equation [5.17], the outflow rate from tank 2 given in Equation [5.16] becomes:

Fo 2  Ao 2 2 gL2 (5.18)
Using Equation [5.1] and Equation [5.3], the inflow rate to tank 2 is as follows:

Fi 2  Aol 2 gL1 (5.19)


Assignment #1
Find the outflow rate and then obtain the first-order differential equation in L2 by using the
mass balance principle (HINT #2) for Tank 1. Use all the hints given.

HINT #1:
Applying Bernoulli’s equation for small orifices, the outflow velocity from tank 2, vo 2 , can be
expressed by the following relationship:
vo 2  2 gL2 (5.20)
Inflow rate to tank 2 can be expressed as:
Fi 2  Aol 2 gL1 (5.21)
HINT #2:
Mass balance principle for Tank 2 can be expressed in verbal way like;
INFLOW = OUTFLOW + ACCUMULATION
In here accumulation can be expressed as:
 
At 2  L2  (5.22)
 t 

Assignment #2
Due to the square root function applied to L1 and L2 , the first-order differential equation is
non-linear.
Solve the differential equation for L10 gives the tank 1 water level at equilibrium. L10 results
to be a function of L20 .

HINT #1
At equilibrium, all the time derivative terms equate zero.

Using the system’s specifications and the design requirement must results to be:

L10  15[cm]

5.11
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

5.3.2.2. Tank #2 Level Modelling – Equation of Motion (EOM) Linearization and


Transfer Function
Applying the Taylor’s series approximation about ( L20 , L10 ):

  A 2 gL2  Aol 2 gL1 1 Ao 2 2 gL21 1 Ao1 2 gL11


L2  o 2   (5.23)
t At 2 2 gL20 At 2 2 gL10 At 2
Simplifying Equation [5.18] with Equation [5.19] results in the following linearized EOM for
the tank 2 water level system:

 1 Ao 2 2 gL21 1 Ao1 2 gL11


L21   (5.24)
t 2 gL20 At 2 2 gL10 At 2

Applying the Laplace transform to Equation [5.24] and rearranging yields the desired open-
loop transfer function for the Coupled-Tank’s tank 2 system, such that:

K dc _ 2
G2 ( s )  (5.25)
 2s 1
with:

Ao1 L20 At 2 gL20 2


K dc _ 2  and 2 
Ao 2 L10 Ao 2 g

Such a system is stable since its unique pole (i.e. system of order one) is located on the left-
hand-side of the s-plane. By not having any pole at the origin of the s-plane, G2 ( s) is of type
zero.

Evaluating K dc _ 2 and  2 , accordingly to the system’s parameters and the desired design
requirements, gives:

K dc _ 2  1.0[" cm / cm "] and  2  15.2[s]

5.3.2.3. Tank #2 Level Controller Design: Pole Placement

By definition, at the static equilibrium point ( L20 , L10 ) :

( L2  Lr _ 2 )  L20 and ( L1  ( Lr _1  L ff _1 ))  L10

Using the L10 expression that you found in Assignment #2, the level feedforward gain results to
be:

Ao 2 2
K ff _ 2  (5.26)
Ao12
Evaluating Equation [5.26] with the system’s parameters leads to:

5.12
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

K ff _ 2  1.0[" cm / cm "]

Carrying out block diagram reduction, tank 2 normalized characteristic polynomial results to
be:

(1  K dc _ 2 K p _ 2 ) s K dc _ 2 Ki _ 2
s2   0 (5.27)
2 2
The system’s desired characteristic equation is expressed by Equation [5.22]. Solving for the
two unknowns K p _ 2 and K i _ 2 the set of two equations resulting from identifying the
coefficients of Equation [5.22] with those of Equation [5.30], the PI controller gains can be
expressed as follows:

2 2n 2 2  1 n 2 2 2
K p_2  and Ki _ 2  (5.28)
K dc _ 2 K dc _ 2

The minimum damping ratio to meet the maximum overshoot requirement, PO2 , can be
obtained by solving Equation [5.23] for ae2 . The following relationship results:

 1 
ln  PO2 
 100 
2  (5.29)
2
 1 
ln  PO2    2
 100 
`
The system natural frequency, u n 2 , can be calculated from Equation [5.27] as follows:

4
n 2  (5.30)
 2t s _ 2
Evaluating first Equations [5.32] and [5.33] accordingly to the desired design requirements,
then carrying out the numericak application of Equation [5.31] leads to the following PI
controller gains:

1
K p _ 2  5.1[" cm / cm "] and Ki _ 2  1.7[ ]
s
Assignment #3

By using the given transfer functions of system and the given requirements (for damping
ratio and maximum overshoot) calculate the PI controller gains.

5.4. Lab Procedure

5.4.1. Wiring and Connections

This section described the standard wiring procedure for the Coupled-Tank specialty plant.
The following hardware, accompanying the Coupled-Tanks, is assumed.

5.13
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

 Power Amplifier: Quanser VoltPAQ or equivalent.


 Data Acquisition Card: Quanser Q2-USB, Q8-USB, Q-PID, or equivalent.
Table 5.2, below, provides a description of the standard cables used in the wiring of the
Coupled-Tank system.

Cable Designation Description


This cable connects an
analog output of the data
acquisition terminal board
to the power module for
proper power amplification.
2xRCA to 2xRCA

”From Digital-To-Analog” Cable


This cable connects the
output of the power
module, after amplification,
to the desired actuator (e.g.
4-pin-DIN to 6-pin-DIN gear pump).

“To Load” Cable


This cable carries analog
signals from one or two
plant sensors (e.g. pressure
6-pin-mini-DIN to 6-pin- sensors) to the amplifier,
mini-DIN where the signals can be
either monitored and/or
used by an analog
controller. The cable also
carries a ±12VDC line from
the amplifier in order to
“From Analog Sensors” Cable power a sensor and/or
signal conditioning circuitry.
This cable carries the analog
signals, previously taken
from the plant sensors (e.g.
pressure sensors),
unchanged, from the
amplifier to the Digital-To-
Analog input channels on
5-pin-DIN-to4xRCA the data acquisition
terminal board.

5.14
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

“To-Analog-To-Digital” Cable

Figure 5.10. Coupled Tank Wiring Diagram

Figure 5.11. Coupled Tank Wiring #1

5.15
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.12. Coupled Tank Wiring #2

Figure 5.13. Coupled Tank Wiring #3

5.16
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

5.4.2. Real Time Implementation


5.4.2.1. Configuration #1: Tank 1 PI-plus-Feedforward Level Control Loop

Please follow the steps described below:


Step 1. Load Matlab and set the Current Directory to your folder with the Coupled Tanks
lab files.
Step 2. Open the q_tanks1.mdl Simulink model file shown in Figure 10, below. The model
implements the system’s actual Proportional-plus-Integral (PI) closed-loop with
feedforward action.
Step 3. In order to use your actual coupled-tank system, the controller diagram directly
interfaces with your system hardware in the Coupled-Tank: Actual Plant block, as shown
in Figure 11.

Figure 5.14. Real-Time Implementation of the Tank 1 Level Control Loop: Configuration #1

5.17
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.15. Interface Subsystem to the Actual Coupled-Tank Plant Using the Q8 Card

To familiarize yourself with the diagram, it is suggested that you open the model sub-
systems to get a better idea of their composing blocks as well as take note of the I/O
connections. You should also check that the signal generator block properties are properly
set to output a square wave signal, of amplitude 1 and of frequency 0.05 Hz. The total level
set point for tank 1 should result to be a square wave of ±1 cm around the desired
equilibrium level. It should be noted that a simple low-pass filter of cut-off frequency 2.5 Hz
(set by “tau_t1”) is added to the output signal of the tank 1 level pressure sensor. This filter
is necessary to attenuate the high-frequency noise content of the level measurement. Such a
measurement noise is mostly created by the sensor’s environment consisting of turbulent
flow and circulating air bubbles. Although introducing a short delay in the signals, low-pass
filtering allows for higher controller gains in the closed-loop system, and therefore for higher
performance.
Moreover, as safety watchdog, the real-time controller will stop if the water level in either
tank 1 or tank 2 goes beyond 30 cm (set by “L1_MAX”) or 25 cm (set by “L2_MAX”),
respectively. This is implemented in Figure 11 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 type field to the data-acquisition board that is connected to the Coupled-Tank
system, e.g. Q4 HIL device.
Step 5. Before being able to run the actual control loop, the PI-plus-feedforward controller
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 setup_lab_tanks.m. However,
ensure beforehand that the CONTROLLER_TYPE flag is set to “MANUAL”. This file initializes
all the Coupled-Tank model parameters and user-defined configuration variables needed by
Simulink diagram. The quiescent voltage feedforward term V p _ ff , is added to V p _1 to
compensate for the known water withdrawal bias from the bottom of the tank 1 as well as

5.18
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

to help bringing the water level, L1 , to its operating position. You can now initialize in the
Matlab workspace the controller and feedforward gains which you have calculated before.
Step 6. Build the real-time code corresponding to your diagram, by using the QUARC | Build
option from the Simulink menu bar.
Step 7. Clicking on QUARC | Start should start the gear pump thrusting water filling tank 1 up
to its operating level . Then after a 15-second settling delay (in order to stabilize the system
at its operating point), the water level in tank 1 should start tracking the desired ±1 cm
square wave set point around the desired operating level L10 . As a remark, the initial settling
time for the system to reach its operating point is defined in Matlab by the parameter “TS”.
Step 8. In order to observe the system’s responses from the actual system, double-click on
the following scopes in the Simulink model: L1 Resp. (cm) and Vp(V). You should now be able
to monitor, as the water flows through the Coupled-Tank system, the actual water level in
tank 1 as it track its reference input. The corresponding commanded pump voltage, which is
proportional to the control effort spent, is sent to the power amplifier and can also be
monitored and plotted on-line.
Step 9. Assess the actual performance of the level response and compare it to the design
requirements. Measure your response actual percent overshoot and settling time. Are the
design specifications satisfied? Explain. If your level response does not meet the desired
design specifications of Section Controller Design Specifications given before, review your PI-
plus-Feedforward gain calculations and/or alter the closed-loop pole locations (i.e. PO1 and
t s _1 ) until they do.
Step 10. Specifically discuss in your lab report the following points:
How does you actual tank 1 level compare to the simulated response?
Is there a discrepancy in the results? If so, discuss some of the possible reasons.
From the plot of the actual level response, measure your system t s _1 and PO1 . Are
the values in agreement with the design specifications? If not exactly, find some of the
possible reasons.
Step 11. Once your results are as closely as possible in agreement with the closed-loop
requirements of configuration #1, your tank 1 level response should look similar to the one
displayed in Figure 12, below.
Step 12. Include in your lab report your final values for K p _1 , K i _1 and K ff _1 as well as the
resulting response plot of the actual and theoretical L1 versus Lr _1 . Also include from the
same run corresponding plot of V p . Ensure to properly document all your results and
observations before moving on the next section.
Step 13. You can now proceed the next section, which deals with the actual implementation
in real-time of your PI- plus-Feedforward level controller for tank 2 of the Coupled-Tank
system in configuration #2.

5.19
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.16. Actual and Theoretical Tank 1 Level Tracking Response: Configuration #1

5.4.2.2. Configuration #2: Tank 2 PI-plus-Feedforward Level Control Loop

Please follow the steps described below:

Step 1. Load Matlab and set the Current Directory to your folder with the Coupled Tanks lab
files.

Step 2. Open the q_tanks2.mdl Simulink model file shown in Figure 5.17, below. The model
implements a Proportional-plus-Integral (PI) closed-loop.

As mentioned before, the tank 2 water level control loop is based on top of tank 1 level
controller, as developed and tuned in the previous sections. The nested actual tank 1 level
control scheme is depicted in Figure 5.18, below. Similarly, the level controller diagram for
Coupled-Tank in configuration #2 also interfaces directly with your Coupled-Tank hardware,
as shown in Figure 5.15.

5.20
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.17. Real-Time Implementation of the Tank 2 Level Control Loop: Configuration #2

To familiarize yourself with the diagram, it is suggested that you open the model sub-
systems to get a better idea of their composing blocks as well as take note of the I/O
connections. You should also check that the signal generetor block properties are properly
set to output a square wave signal, of amplitute 1 and of frequency 0.018 Hz. The total level
setpoint for tank 2 should result to be a square wave of ±1 cm around the desired
equilibrium level L20 . Also, your model sampling time should be set to 1ms, i.e. Ts  103 s
and the solver type to “ode4 (Runge-Kutta)”.

It should be noted that a simple low-pass filter of cut-off frequency 2.5 Hz (set by “tau_t1”)
and 0.33 Hz (set by “tau_t2”) are added to the output signal of the tank 1 and tank 2 level
pressure sensors, respectively. These filters are necessary to attenuate the high-frequency
noise content of the level measurements. Such a measurement noise is mostly created by
the sensor’s environment consisting of turbulent flow and circulating air bubbles. Although
introducing a short delay in the signals, low-pass filtering allows for higher controller gains in
the closed-loop system, and therefore for higher performance.

Moreover, as safety watchdog, the real-time controller will stop if the water level in either
tank 1 or tank 2 goes beyond 30 cm (set by “L1_MAX”) or 25 cm (set by “L2_MAX”),
respectively. This is implemented in Figure 11 through the Dead Zone and Stop With Error
blocks.

5.21
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Figure 5.18. Real-Time Implementation of the Nested Tank 1 Level Control Loop: Configuration #2

Step 3. In the Coupled-Tanks: Actual Plant subsystem, click on the HIL Initialize block and set
the Board type field to the data-acquisition board that is connected to the Coupled-Tank
system, e.g. Q4 HIL device.

Step 4. Before being able to run the actual control loop, the PI-plus-feedforward controller
gains for 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-
feedforward controller gains for tank 1 of the Coupled-Tank system in configuration #1, as
previously implemented.

The quiescent level feedforward term L ff _1 , is added to L11 to compensate for the known
water withdrawal bias from the bottom of the tank 2 as well as to help bringing the water
level, L2 , to its operating position. You can now initialize in the Matlab workspace the
controller and feedforward gains which you have calculated before.

Step 5. Build the real-time code corresponding to your diagram, by using the QUARC | Build
option from the Simulink menu bar.

Step 6. Clicking on QUARC | Start should start the gear pump thrusting water filling up both
tank 1 and tank 2 up to their operating levels L10 and L20 , respectively . Then after 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 desired
operating level L20 . As a remark, the initial settling time for the system to reach its operating
point is defined in Matlab by the parameter “TS”.

Step 7. In order to observe the system’s responses from the actual system, double-click on
the following scopes in the Simulink model: L2 Resp. (cm), L1 Resp. (cm) and Vp(V). You
should now be able to monitor, as the water flows through the Coupled-Tank system, the
actual water levels in tanks 1 and 2 as they track their reference inputs. The corresponding
commanded pump voltage, which is proportional to the control effort spent, is sent to the
power amplifier and can also be monitored and plotted on-line.

5.22
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Step 8. Assess the actual performance of 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 specifications satisfied? Explain. If your level response does not meet the
desired design specifications of Section Controller Design Specifications given before, review
your PI-plus-Feedforward gain calculations and/or alter the closed-loop pole locations (i.e.
PO2 and ts _ 2 ) until they do.

Step 9. Specifically discuss in your lab report the following points:

How does you actual tank 2 level compare to the simulated response?

Is there a discrepancy in the results? If so, discuss some of the possible reasons.

From the plot of the actual level response, measure your system ts _ 2 and PO2 . Are
the values in agreement with the design specifications? If not exactly, find some of the
possible reasons.

Step 10. Once your results are as closely as possible in agreement with the closed-loop
requirements of configuration #2, your tank 2 level response should look similar to the one
displayed in Figure 5.19, below.

Figure 5.19. Actual and Theoretical Tank 2 Level Tracking Response: Configuration #2

5.23
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Step 11. From the same run, the corresponding water level in tank 1 is displayed in Figure
5.19, below.

Figure 5.19. Actual Tank 1 Level Tracking Response: Configuration #2

Step 12. Include in your lab report your final values for K p _ 2 , K i _ 2 and K ff _ 2 as well as the
resulting response plot of the actual and theoretical L2 versus Lr _ 2 . Also include from the
same run corresponding plots of L1 and V p . Ensure to properly document all your results and
observations before leaving the laboratory.

5.4.3. Post Lab Questions

After successfully completing your laboratory section, you should now begin to document
your report. This report should include:

I. Your solutions to the pre-lab assignments for both configurations.


II. Your designed controller gains to meet the system specifications and your steps at
calculating the results (also for both configurations).
III. After simulating your controller with your calculated gains, did the response match
what you had expected? Comment the results for both configurations.
IV. Did the actual systems (for config.1 and config.2) responses match your simulated
results? If not, what reasons could you conclude were responsible for the
discrepancies?
V. You also need to present a plot of your final system responses with the actual,
simulated and setpoint signals for both configurations.

5.24
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

5.4.3.1. Post Lab Questions

1. During the course of this lab, were there any problems or limitations encountered? If
so, what were they and how were you able to overcome them?
2. After completion of this lab, you should be confident in tuning this type of controller
to achieve a desired response. Do you feel this controller can meet any arbitrary
system requirement? Explain.

5.5. References

1. “Coupled Tanks User Manual”, Quanser Inc.


2. “Coupled Tanks Instructor Manual”, Quanser Inc.
3. QUARC Help (type doc QUARC to access).
4. QUARC Installation Guide.
5. “Coupled Water Tanks – Specialty Experiment: PI-plus-Feedforward Control.

5.25
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Appendix 5.A. Nomenclature and System Parameters


Table 5.3, below, provides a complete listing of the symbols and notations used in the
Coupled-Tank system mathematical modelling, as presented in this laboratory.

5.26
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Table 5.3. Coupled-Tank System Model Nomenclature

Table 5.4, below, provides a complete listing of the symbols and notations used in the design
of both control loops (i.e. the PI-plus-Feedforward loops for the water levels in tank 1 and
tank 2), as presented in this laboratory. Table 5.5 provides values of system parameters.

5.27
Yıldız Technical University, Control and Automation Engineering
Control Laboratory Student Handouts

Table 5.4. Coupled-Tank System Control Loops Nomenclature

Table 5.5. Coupled-Tank System Parameters

5.28

Вам также может понравиться