You are on page 1of 16

Digital Level Control

One and Two Loops


Proportional and Integral Control
Single-Loop and Cascade Control

Introduction

This experiment offers a look into the broad field of process control. This area of
controls is important in the chemical, flow, and power industries.

In this experiment (Figure 2), the water level (or head) of the lower tank is controlled
with three different algorithms:

1. Proportional control (P control)


2. Proportional + integral control (PI control)
3. Cascade control

The controller senses level from only the lower tank for proportional and proportional +
integral control and from both the top and bottom tank levels for cascade control. With
this feedback, the controller then adjusts the flow rate into the upper tank to keep the
lower tank level constant.

As is typical of process controllers like the Foxboro 743CB controller, the controller can
be operated in automatic (AUTO) or manual (MAN) modes. When the controller is in
manual mode, its control function is disabled and thus the process runs open loop. With
the controller in automatic mode, the process runs in closed-loop control. We have used
single-loop control in previous experiments and will use it in this experiment.

We shall also use cascade control in this experiment. In cascade control, two coupled
loops are configured. The control output from one loop is used as input to the second
control loop. This is useful in situations where two loops can be configured so that what
happens in the first loop anticipates what will happen subsequently in the second loop.

Typical Closed-Loop Operation

R E U F C
+- GC GA GP

B
H
Figure 1 shows a typical SISO control loop.

Figure 1 - Typical SISO Control Loop

In single-loop mode, the tank level system controls H2, the level in the lower tank. Thus
C = H2. Thus R is the desired tank level: R = H2R. As usual the error drives the
controller. In this loop the controller is the Foxboro digital controller. The controller
outputs a digital signal to the actuator, the flow control valve in this system. The
controller tells the valve what percentage
Qi Qd

K t1
H1 Top
L Transducer
Tank

R1
Q1

K t2
Bottom
H2 Tank L Transducer
Disturbance
Pump

F
R2
Qo
Main
Pump
Reservoir

Lumped Valve Constant


Kv Valve S
I Transducer
y
Positioner C

Foxboro
Air Controller
Supply

Standard Instrument Society of America (ISA) Line Symbols:

Pneumatic Signal
Electrical Signal
Hydraulic Signal

Figure 2 - Two Tank Experiment Set-up


opening to go to. The variable usually used for valve opening is Y. Thus U = Y. This
valve opening then governs the flow to the top tank, a part of the plant. Thus F = Qi.

The above loop is called a regulator loop. Regulator loops are control loops whose
purpose is to keep a system operating at a steady level in the face of disturbances, events
that tend to upset that level operation. It is typical in regulator loops to control the loop’s
operation about a steady state operating point. The values of the signal variables (H2R, E,
Y, Qi, H, B) at the steady state operating point are taken as a reference. For loop
calculations they are considered the 0 about which the loop operates. What is then
controlled are the deviations of the variable of interest away from the operating point.
Thus the loop variables are h2R, e, y, qi, h, and b. You will need to be aware of the fact
that all control loop calculations are based on deviations from the steady-state values
when you model the system in Simulink.

Figure 3 shows the single control loop for the two tank system.
h 2R e y q i h2
+- G C G vlv G P

Figure 3 - Two Tank Single Loop

At steady state, h2 = h2R = 0. So e = 0, y = 0, and qi = 0. Obviously the valve has some


opening and water is flowing. The zeros in the loop merely mean that the loop is
functioning at that steady state level. This is an important feature to keep in mind. When
the loop is at its normal steady state operating position, the readout for H2 on the
controller panel will say something like 27 inches and that Y = 45%. It is important to
remember that these values are H2 + h2 and Y + y, even though the control action works
solely on the deviation quantities, e and y. In fact if you want to change the tank level
from, say, 27 inches to 29 inches, you do not change h2R from 0 to 2. Rather you change
H2R from 27 to 29. The digital controller figures out from this that h2 was changed from 0
to 2.

q d

h e y q q h
2R v i 2
+- GC G vlv +- GP

The loop in Figure 3 is missing one important flow signal, the disturbance. The
disturbance enters the loop between the actuator and the plant (Figure 4). In this case the
disturbance is the disturbance flow, qd. Normally this is 0.0 gpm.
Figure 4 - Loop with Disturbance Flow

Note also that the sensor has been removed. In the real system, the pressure at the bottom
of each tank is sensed, converted to a pneumatic signal, then converted to an electrical
signal that is read by the digital controller. All of this is transparent to the user, so
effectively the loop has unity feedback.

Referring to the schematic in Figure 4, introducing a disturbance flow qd into tank 1 will
cause the following changes: The head h1 will increase and cause an increase in the flow
q1 through the orifice R1. The increased flow into tank 2, q1, will increase the head in
tank 2, h2.

The process variable h2 is fed back to the controller through the pressure transducer Kt2
and compared with the setpoint, h2R. (When two loops are used, h1 is also fed back to the
controller through Kt1.) The disturbance causes a negative error (e = h2r - h2). As the
level in tank 2 rises, the error e becomes increasingly negative. This causes y to take on
an increasingly negative value. Thus the flow control valve starts to shut, decreasing Qi,
i.e. developing a negative qi. The tank level may fluctuate, but eventually the system will
settle to a new steady state. Flow from the valve will decrease, compensating for the
increased disturbance flow.

Single-Loop, Proportional Control

Proportional control is a commonsensical idea. Remember that a feedback controller acts


on error. So the actuating signal for the controller is the error. With a proportional
controller, Gc is simply a constant, Kp. So the vigor of the control signal is proportional
to the error, that is,

U = Kp * E

So the larger E is, the larger U will be. This type of control makes sense. If the actual
value of the controlled variable strays far from its desired value, a large U will be applied
to try to force it back to its desired value, the setpoint (R).

As applied to the two tank experiment, single-loop proportional control is manifest as


shown:
h (in) e (in)
2R y (% valve opening)
+- Kp Plant

h (in)
2

Figure 5 - Single-Loop Proportional Control


Actually, the control calculation for level is not performed in inches but rather in percent.
The bottom tank is 40 inches high. So a 1 inch deviation of tank level = 1/40 or 2.5%
deviation of the entire tank height. This is transparent to the user of the Foxboro
controller. If he/she changes the desired tank level from the normal 27 inches to 29
inches, for example, the controller knows that this means h2R = 2 inches = 2/40 = 5%. So
internally the controller is using deviations from steady state operating levels and it is
converting all level measurements into percent of tank range. A more accurate
representation of the loop, as the controller manages it is

H
2R
(in) h (in) h (%)
2R 1 2R e (%) y (%) 40
+ +- Kp Plant
- 40 1

H h (%)
2RSS 2 h (in)
(in) 2

++
H (in)
2

Figure 6 - Internal Control Scheme for Single-Loop, P-Only Control

In the two tank single-loop experiment, the reference setpoint, H2RSS , is equal to 27
inches. With H2R = 27 all the deviation variables are 0. To complete the above example,
let the system operator increase tank 2’s setpoint to 29 inches. He/she would set H2R to
29 in the Foxboro controller. The controller would calculate h2R = 2 in = 5% from this
and apply it to the control loop input. This would produce e = 5%. This input to the
proportional controller would create a positive y. The valve would open from its steady
state position to allow more flow into tank 1. Tank 2’s level would rise and maybe
fluctuate. Eventually it would settle at a higher level (hopefully 29 inches).

Single-Loop, Proportional + Integral (PI) Control

Implementing single-loop PI control merely involves replacing the P-only controller in


the previous section with a PI controller. The loop configuration remains the same.

Integral control involves something called reset. The relationship between integral gain
and reset time is discussed in the next section.

The controller relationship is:

y = Kp * ( e + KI * Integral(e dt ) )
where e = h2R - hR.

In Laplace notation, this becomes:

Y = Kp * E * ( 1 + Ki/s )
Reset Function and Bias (Integral)

We saw in class that a Type 0 system subjected to a step input will have non-zero ess.
From the time-domain relationship above, we see that the controller will continue to put
out a command signal (y) as long as the error is not 0. The error is integrated over time.
So if the error persists, y will increase with the integral of e.

A PI controller has both proportional and integral gains. Its structure is


e y
KP ++

K I
s

Figure 7 - PI Control Structure

Thus
KI
y = KP +
s

An equivalent form is commonly used: 

1
y = KP * 1 +


*e
τs


Here τ is the reset time.

In the time domain 

1
y = KP * e +


e dt
τ


1
y = KP * 1 +


dt e
τ


If a sudden unit error is injected into the system, at t = 0+, y = Kp. The entire control
output is generated by the proportional term. If we can maintain the error constant, the
above equation becomes

Note that at time t = τ, the contribution to y provided by the integral term is equal to the
contribution provided by the proportional term. This is where the term reset comes from.
It is the time needed with a constant error for the integral action to reset the action of the
proportional term. In the Foxboro controller, reset time is given in minutes. In Foxboro
control terminology, reset time is called IF.
Another peculiarity of the Foxboro controller and almost all other process controllers is
that KP is not given directly. What is given in its place is proportional band. This is the
percentage of output variable range needed to make the actuator stroke 100%. The
Foxboro controller calls this PF. For your calculations PF = 100/KP.

Double-Loop, Proportional, Cascade Control

Although proportional control is a reasonable idea, it has the flaw that control actions do
not take place until the loop error (E) deviates from zero. So a proportional controller
only reacts to error. It cannot anticipate error and therefore cannot react before the error
develops. Cascade control is an answer to this shortcoming. Cascade control anticipates
an error before that error develops. For this portion of the experiment, cascade control
will sense a deviation in level in the top tank and react to it to reduce future error in the
lower tank before it develops.

Cascade control is often used in process control to anticipate changes before they have an
effect disturbing the system. Cascade control refers to the closing of two or more
concentric loops. The inner loop’s reference, R, is given a floating value equal to the
outer loop’s output, C.

In this section, which describes the cascade controller we will implement, the subscripts 1
and 2 are used to identify the terms associated with the inner and outer loops,
respectively. These correspond also to the top tank (1) and the bottom tank (2).

h 2R e2 h1R e1 y h1 h
Top Bottom
+- K p2 +- K p1
Tank Tank

Figure 8 - Cascade Control Configuration with P-Only Controllers

Again, the reference height, h2R, is considered to be zero at the normal operating level.
The normal operating valve level and the normal operating lower tank height are also
considered to be 0.
Single-Loop
Objective

Run one loop in proportional only control with feedback from H2 and a gain of Kp = 5.
Also run one loop in proportional + integral control with feedback from H2, Kp = 2.5,
and τ = 1.85 minutes. For each loop, plot H2 as a function of time for a step flow
disturbance into the top tank.

For the Foxboro 743CB controller, proportional faceplate (PF) and integral faceplate (IF)
are used to represent proportional gain (Kp) and integral gain (Ki), where

PF = 100/Kp and IF = τ

Procedure:
Proportional Control:

1. Connect the system as shown in Figure 2. The pump cord should be plugged into the
wall behind the tanks.
2. Program the controller using the Proportional Control Action from the Foxboro
handout.
3. Press the SEL key until the green dot on the screen lies above the most far left
vertical bar (setpoint, h2r) on the display screen. Press the ∆/∇ key until the display
shows a setpoint value of 27.00 in.
4. Press SEL key until the green dot on the screen lies above the most far right vertical
bar (output, Y) on the display screen.
5. Bring the output, Y (the far right bar on the display screen), to 44, using the ∆/∇ key.
6. Select manual mode by pressing the A/M button.
7. Turn on the main pump and close the bottom tank valve.
8. When the head of the bottom tank, H2, reaches ≈ 26 inches, open the bottom tank
valve and select automatic mode by pressing the A/M button.
9. Let the system reach steady state (hint: the middle bar on the display screen should
indicate about ≈ 27 inches).
10. Press the SEL key several times until the green dot on the screen lies above the most
far right vertical bar (output, Y) on the display screen.
11. Put in a step disturbance by turning on the disturbance pump and record H1, H2, and
Y at 10-second intervals until H2 reaches steady state.
12. Measure the disturbance flow, Qd, immediately after the run by turning off the main
pump, plugging tank 1 (upper tank) and timing the change in H1.

Proportional + Integral (PI) Control:


1. Switch the system to manual mode by pressing the A/M button. Bring the output, Y,
to 44. Turn off the disturbance pump and turn on the main pump.
2. Program the controller using the Proportional Plus Integral Control Action from the
Foxboro handout.
3. Close the bottom tank valve.
4. When the head of the bottom tank, H2, reaches ≈ 26 inches, open the bottom tank
valve and select automatic mode by pressing the A/M button.
5. Let the system reach steady state (hint: the middle bar on the display screen should
indicate ≈ 27 inches).
6. Press the SEL key several times until the green dot on the screen lies above the most
far right vertical bar (output, Y) on the display screen.
7. Put in step disturbance by turning on the disturbance pump and recording H1, H2,
and Y at 10-second intervals until H2 reaches steady state.

Two-Loop (Cascade) Proportional Control


Objective:

Run two loops with feedback from H1 and H2 at a proportional gain of Kp1 = 2.0 and Kp2
= 2.0.

Procedure

1. Turn both pumps off.


2. Program the controller using Cascade Proportional Control Action from the Foxboro
handout.
3. Press the SEL button for 5 seconds until the display shows TOPTANK.
4. Select remote setpoint by pressing R/L button (the display screen should show R).
5. Select automatic mode by pressing the A/M button.
6. Press the SEL button for 5 seconds until the display shows BOTTOMTK.
7. Select automatic mode by pressing the A/M button.
8. Turn on the main pump and let the head of the bottom tank reach steady state (hint:
H2 steady state will not be 27 in.).
9. Press the SEL button for 5 seconds until the display shows TOPTANK.
10. Press the SEL key several times until the green dot on the screen lies above the most
far right vertical bar (output, Y) on the display screen.
11. Turn on the disturbance pump.
12. Record H1, H2, and Y at 10-second intervals until H2 reaches steady state.
Getting System Constants

After running Cascade Proportional Control, turn the disturbance pump off and make sure
the TOPTANK screen is displayed (if not, press SEL for 5 seconds until it displays).
Select manual mode by pressing the A/M key and local setpoint by pressing the R/L key.

1. Valve constant Kv: With the controller in manual, plot the flow through the
flowmeter for various controller output, Y, over the operating range. The operating
range is between the maximum and minimum values of Y obtained during closed-
loop tests. Q = Kv * Y, where Kv units are in3/(sec*%). Locate the flow which
corresponds to the center of the operating range and linearize at the point. Indicate
operating range on your plot.
2. Restriction, R1 and R2: R2 is given as 2.25 seconds/in2. For R1, plot the head, H1,
for various flows Q by changing controller output. Allow the head to reach steady
state for each data point. Make sure you are in the operating range for H1. The
operating range is between the maximum and minimum values of H1 obtained
during closed-loop tests. Indicate the operating range on your plot. Linearize the H1
vs. Q curve by finding the slope at the center of the operating range.
3. With the Foxboro controllers, the controller reads the tank heights in inches directly.
There is no need to model the transducers. So the transducer constants Kt1 and Kt2 =
1.
4. The tank area A is found by direct measurement.

Report

Determine the block diagram for the system with both single and double feedback loops.
For each system, derive the differential equation relating tank level, h2, to disturbance
flow, qd. Simulate each system using Simulink. For a step input in qd, examine the
following cases: Kp=5 for Single-Loop, Proportional Control; Kp=2.5, τ = 1.85 minutes
for Single-Loop, Proportional Plus Integral Control; and Kp1 =2.0, Kp2 =2.0 for Two-
Loop, Proportional, Cascade Control. On a plot for each system, directly compare the
simulated results with those from your experiments. From the transfer function for the
Single-Loop, Proportional Control and the Two-Loop, Proportional, Cascade Control
cases, analytically determine the expected percent overshoot, steady-state error, and
settling time in response to a step input in qd. Compare these analytical predictions to the
results of your experiments.

Of the three systems considered, which has the best performance? Why?
Two Tanks with Interaction

In class and in lab we looked at a two tank system without interaction. This means that
the tanks are stacked on top of each other. The top tank drains into the bottom tank. But
the bottom tank level plays no role in determining the flow out of the top tank. We
developed two equations, one relating input flow Qi and tank head H, the other relating
input flow and output flow Qo. These relationships are good only for tanks that do not
interact.

Since I started teaching this lab, I have always wondered about the merits of a two tank
experiment without interaction vs. one with interaction. In this part of the lab, we will
use our simulation tools to answer this question. The primary question to answer is how
would the two tank system function if the tanks were placed side by side (Figure 9). Let’s
use all of the same equipment but simply move the top tank down so that its bottom is
level with that of the other tank. We shall also make the top tank as tall as the bottom
tank. Let’s also keep the disturbance flow going into the first tank. Let the valve
between the two tanks stay at 5.5 inches below the tank bottoms.
Q
d

Q
i

L L
H1 Tank 1 H2 Tank 2

R1 R2
Q1 Qo

Figure 9 - Two Tanks with Interaction

You need to know the steady state operating level of the two tanks in order to calculate R1
and R2. Let’s assume we are using the same equipment. The Hss used to calculate the
resistance of the tank outlet valve is the difference in head across the valve. Thus if we
use the same equipment, H2ss will be the same as it was with the tanks vertically arranged.
H1ss will exceed H2ss by the tank level of the top tank when the tanks are vertically
arranged. For example, if the existing system’s steady state levels are H1ss ≈ 10 in and
H2ss ≈ 27 in, then for the side-by-side tanks, H1ss ≈ 37 in and H2ss ≈ 27 in.

This, by the way, is a good example of how simulation is used in the real world. A
change is contemplated in a system. The engineers involved want to know how the
revised system will function. This exercise is a perfect example of the utility of your
simulation tools.

System Relationships

The following relationships use the deviation quantities as discussed above. These are
the deviations of system variables away from the reference steady state.

The interaction flow is Q1. This flow can be in either direction. If we consider flow from
tank 1 to tank 2 to be positive, then in terms of the deviation quantities,

H 1 (s) Q 1(s)
1
+-
R1

H 2 (s)
H1 ( s ) − H 2 ( s )
Q1 ( s ) =
R1

Here R1 is the resistance of the valve. See the course handout on modeling fluid systems.

The block diagram is shown to the right of the equation. Note that the capital letters as
system variables does not imply absolute quantities. Rather Qi(s) = L{qi(t)}, for example.

By mass continuity, the change in volume of fluid in a tank is equal to what comes in
minus what goes out. Since the fluid here is incompressible, the mass balance becomes a
volume balance.
Q i (s) H 1(s)
1
+- A s 1

Q 1 (s)

L{V&
1} = A1 H1 ( s ) s = Qi ( s ) − Q1 ( s )

For the first tank

L{V&
2 } = A2 H 2 ( s ) s = Q1 ( s ) − Qo ( s )

Q 1 (s) H 2(s)
1
+- A s 2

Q o (s)
For the second tank
The flow out of the second tank is the same for a regular tank without interaction.
H 2(s) Q o(s)
1
R2
H 2 ( s)
Qo ( s ) =
R2

These pieces need to be assembled into a plant model. Also the plant needs an actuator
and a controller. Remember that in the control loop for this system, the input is h2R. The
output is h2. Last, the disturbance flow will need to be added to the system model.

Procedure

Build a block diagram of the system. Include the plant, the controller,the actuator, and
the disturbance flow.

Use the above as a guide to develop a Simulink model of the two tank model with
simulation. For your physical quantities, use all values from the two tank experiment
without interaction. Make both tanks the same height (40 inches). If you have not run
the two tank experiment yet, borrow data from a group who has in order to start your
modeling.
With the model constructed, install first a P-only controller, using the same gain as in the
lab experiment. Inject a step disturbance into the system. Record the response. Perform
the same operation with a PI controller.

Lab Report

Compare the simulations for the two tank without interaction and the two tank with
interaction. This can be done qualitatively and quantitatively.

For the qualitative analysis, work out in symbolic form the closed loop transfer function
for both two tank systems. I recommend as a beginning just using Gc in a block. Once
you have worked out the transfer functions, you can replace Gc with both the P and the PI
controllers for the comparison. Your transfer functions should be H2/Qd. I think you will
wind up with second order systems for the P-only cases. From these you should be able
to work up expressions for Kss, ζ, and ωn for each system and compare them. I cannot
tell right off the bat how the systems with PI control will come out. If you have third
order systems, you may have to put in actual numbers to determine whether or not you
have a dominant second order system. But if you need to do this, do it and then compare
the numerical results.

For the quantitative analysis, make two sets of three plots, one set for the P-only control,
the other for the PI control. The three plots should be H1 vs. t, H2 vs. t, and Y vs. t. On
each plot, plot the results of the two models together, i.e. with and without interaction.
From the plots you should be able to work out Kss, ζ, and ωn for each system. Do this
and compare them.
Your discussion should revolve around the comparison of the symbolic closed loop
transfer functions of each system and also a comparison of the two plots.

Also, if there are any difficulties you encountered in constructing the two tank with
interaction model, discuss these in your report.

You might also like