Академический Документы
Профессиональный Документы
Культура Документы
r(t) y(t)
The reference signal is compared in the controller with the actual water level
y(t). This gives the control error e(t) = r(t) y(t). The input voltage to the
pump is then generated as a constant K
a
times the control error e(t).
This principle is called P-control (proportional). The controller the com-
puter implements is called a P-controller. A block scheme of the control
system is given in gure 4.
9
K
a
1
System
r(t) e(t) u(t) y(t)
Figure 4: Block scheme for level control.
We wil l now investigate how the control ler gain K
a
inuences the
behavior of the system. Set a reference value. What water level is
obtained for this reference value?
Reference: . . . . . . cm
Water level: . . . . . . cm
Control error: . . . . . . cm
A remaining error is easy to understand: We found out in experiment 3.1
how many volts were needed to obtain a desired level. From the relation
u(t) = K
a
r(t) y(t)
= K
a
e(t)
we see than an control input u(t) volts forces us to have an error u(t)/K
a
volt. To see this, assume the error is 0. This leads to u(t) = 0. Water will
then ow out, and we will not be able to keep the error at 0!
Try another reference level. What happens?
Reference: . . . . . . cm
Water level: . . . . . . cm
Control error: . . . . . . cm
Now increase K
a
. What happens?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
From the experiments, we have learned that a small control error requires
large control inputs already for small errors. We therefore choose K
a
large.
10
What happens with the control input when K
a
is increased?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conclusion:
When setting the gain in a P-controller, we are trying to achieve to contra-
dicting things. We want to use a large gain to obtain a small stationary error.
however, we have seen that an increasing gain leads to an amplication of
measurement noise, and increased oscillatory behaviour. We will now try to
avoid these problems by modifying the controller.
3.2.3 Experiment: PI-control
If we select a nite value on T
I
, the controller will implement the following
control
u(t) = K
a
e(t) +
1
T
I
t
0
e()d
(1)
Reduce K
a
to approximately 1 and use 0 < T
I
< , suitable value for T
I
is roughly 15.
Compared to the control input used in the closed/loop control experiment
3.2 (P-control), we have added a term proportional to the time/integral of
the error signal.
Use one of the reference values in experiment 3.1. What is the voltage
from the I-part when the level has stabilized?
You can see the contribution from the I-part by setting Show P-, I- and
D-part to On.
Stationary level: . . . . . . . . . . . . cm.
Voltage from the I-part: . . . . . . . . . . . . V .
Compare the voltage you measured on the I-part with the control inputs
you measured in experiment 3.1. Make sure the extra outlet is closed!
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The reason for the new result is that the integral keeps growing (or decreas-
11
ing) until the integral of the control error e(t) is zero, and thus the control
error is zero.
You have now investigated how the control system manages to have the
output y(t) follow the reference r(t). This is often called the servo-problem.
A similar problem is to keep the output at a constant level, despite dis-
turbances acting on the system. This is most often called the disturbance
rejection problem. A block scheme for the disturbance rejection problem is
shown in gure 5.
Disturb the system by increasing the outow (open the extra outlet).
What happens?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
In gure 5, v(t) represents the extra water let out.
F G
1 1
r(t) e(t) u(t)
v(t)
y(t)
Figure 5: Block scheme for the disturbance rejection problem.
By modifying the control structure, we have managed to get rid of the
stationary control error completely, without the adverse eects a large K
a
gave in a simple P-controller.
Once again study the servo-problem. Investigate if you can achieve good
control by varying T
I
. Test what happens if you perform steps in the
reference. How does T
I
inuence the results?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
Conclusion:
The I-part handles the stationary error in a feedback control system. It can
however have negative eects on stability.
3.2.4 Experiment: PID-control
We will now study the last part in a PID-controller. To understand the D-
part, we will rst study a PD-controller, and then conclude everything in a
complete PID-controller.
A PD-controller uses the derivative of the control error as follows
u(t) = K
a
e(t) + T
D
de(t)
dt
In other words, we are trying to predict the future error by looking at the
derivative of the error. We can see this from a simple rst order Taylor
expansion of the error T
D
seconds ahead
e(t + T
D
) e(t) + T
D
de(t)
dt
Investigate how T
D
inuences the step response. Start by smal l
(T
D
< 0.5)! Use K
a
= 1, T
I
=inf and = 0. Make sure to reset the
I-part (Click on Reset integral). What happens when T
D
is increased?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To explain the answer to the question above, let us study how the measure-
ment signal y(t) = h
1
(t) is inuenced by a dierentiation. Let the measure-
ment consist of two parts, the true value y
s
(t) and measurement noise n(t)
which can be described using a sinusoidal signal
y(t) = y
s
(t) + n(t) = y
s
(t) + a sin t
The contribution to the control input from the D-part is (T
D
och K
a
omitted)
dy(t)
dt
=
dy
s
(t)
dt
+ a cos t
It is easily realized that high-frequency noise will be amplied strongly by an
ideal derivation. To avoid this amplication, the derivative part is extended
with a low-frequency lter, and is thus implemented as
D(s) =
T
D
s
T
D
s + 1
E(s)
13
How can the equation above be interpreted (approximately) for large/smal l
s?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How does inuence the control input in the equations above? What
happens with a smal l and large respectively?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
With P-, I- och D-parts used, the equation for the controller is
U(s) = K
a
1 +
1
T
I
s
+
T
D
s
T
D
s + 1
E(s)
Use values for K
a
and T
I
which gave good control in experiment 3.2.3.
Investigate if you can achieve good control by varying T
D
and . Test in
particular if K
a
and T
I
can be increased and decreased respectively, when
we introduce the derivative part. Suitable values on T
D
and are 2 and
1 respectively.
Howe does the inuence of the measurement noise change when T
D
and
are altered?
Result: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conclusion:
The D-part damps the oscillatory behavior. It can unfortunately amplify
the measurement noise, an eect which however can be reduced by using a
non-ideal derivative part, i.e. a low-pass ltered derivative.
Conclusions
Conclude the inuence from the dierent parts of a PID controller.
P: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
15
4 Level control of the double-tank.
We will now control a slightly harder system. Connect the lower tank by
changing the right switch to its lower setting. We now have two tanks cou-
pled in series where the water in the upper tank ows to the lower tank, and
we want to control the level in the lower tank.
Try to nd a PID-control ler with a rise-time below 5 s and an over-shoot
below 10 %. The requirements are for a step from the level 10 cm with an
amplitude of 1 cm.
PID-controller rise-time Over-shoot
K
a
= T
I
= T
D
= =
K
a
= T
I
= T
D
= =
K
a
= T
I
= T
D
= =
K
a
= T
I
= T
D
= =
K
a
= T
I
= T
D
= =
As you maybe notice, it is fairly hard to simply guess the values for the PID-
controller, when certain specications are given. In the second laboratory
exercise, we will see how model-based control design can help.
16
A Preparations
A.1 Introduction
The purpose of these exercises are to prepare for this laboratory session,
revolving around the control of a water tank system.
The exercises should be thoroughly worked through, and this whole note
should have been read before the session starts.
A.2 Open-loop control
In the rst part of the lab, open-loop control is studied. A joystick is used
to generate a voltage. The joystick is connected to a water pump, pumping
water to the tank. The level in the tank is measured and converted to a
voltage. The joystick and the tank system is connected via a computer, to
get the measured signals presented in a convenient fashion.
1 A sketch of the process is given in gure 1. The joystick is connected
directly to the pump. Draw this system using a block scheme. What
physical quantities are in- and output signal in the dierent blocks?
2 Assume the pump can be described as a static system, meaning the
ow to the tank is changed directly when the voltage to the pump is
change, i.e.
q(t) = K
pump
u(t)
What is the transfer function from voltage to ow. What is the dimen-
sion?
3 The relationship between inow and level in the tank can approximately
be described with the dierential equation
A