Beruflich Dokumente
Kultur Dokumente
EXERCISE 11
This English version is based on the Finnish version of the document. The original
Finnish version was written in 1976 by Markku Nihtilä and put to electrical format in
2001 by Timo Oksanen. The exercise was upgraded in 2002 with PC / Matlab
connection. This version of the document includes those new parts of the exercise.
L.E.
Feedback control is used in practice in many control applications. The benefits of this
control method are that it is possible to keep some physical quantity at a strict level or
change the value of the quantity, e.g. pressure, temperature etc, quickly and despite of
the disturbances that might occur.
The basic requirement that a control system should be able to fulfill is stability. This
means that a controlled system should remain stable in all circumstances. The quality
of the control can be measured by analysing the accuracy, speed and robustness of a
control system.
2 Feedback control
The figure 1 shows the principal structure of feedback control. In feedback control we
want the output signal to follow the reference signal as precisely as possible. We
measure the output of the process and create an “error signal” e = r – ym. Error signal
is an input signal for the controller. The controller creates the control signal (based on
the error signal) and controls the process (actually the controller controls an actuator
which controls the process).
Measurement
signal ym
Sensor
3 Different controllers
If the output signal of the process grows, the measurement signal grows as well. This
means that the error signal becomes smaller and the control signal becomes smaller
too. This makes the process output signal to go down, which means that error signal
goes towards zero and the output of the process towards reference value.
2
3.1 P-controller
In P-control, the output of the controller (control signal) is directly proportional to the
error signal.
u (t ) = Ke(t ) , (1)
where K is controller’s gain. Often P-control is not enough to make the output go to
reference and there will be steady-state deviation.
3.2 PI-controller
1
t
u (t ) = K e(t ) + ∫ e(t )dt , (2)
TI 0
3.3 PID-control
1
t
de(t )
u (t ) = K e(t ) + ∫ e(t )dt + TD , (3)
TI 0 dt
where TD is derivation time constant. The derivation term acts like predictor, because
the speed of change of the error signal affects the control signal. The derivation term
has a large effect in systems where disturbances are present, because disturbances are
often fast. This means that fast changes in error signal (=disturbances) might even
push the process to unstable state. On the other hand, the D-term might speed up the
controlled system.
3
4 Control system analysis and controller tuning
The choosing of the controller’s parameters is process sensitive. You must use
different parameters in fast and slow processes. The disturbances also affect the
choise of parameters. The choosing can be done by step response method or by
oscillation boundary method (värähtelyrajamenetelmä in Finnish), which is based on
frequency analysis.
Analysing the stability of a control system can be done with frequency response of
the open loop system. Frequency response of an open loop system shows how the
system behavies without the feedback loop (in frequency plane). The structure of an
open loop system is presented in figure 3.
4
The figure 4 shows the principle of frequency response. A sinusoid signal is fed into
the system and the gain and phase of the output signal is recorded. This is done on
every frequency. Thus a frequency response of the system is created.
where arg(…) means phase. If G ( jω ) = 1 and arg ( G(jω ) ) = −180D , the system is on
1
Kv = , when arg ( G(jω ) ) = −180D and (5)
G ( jω )
Figure 5 shows how the gain and phase margins can be defined from Bode diagram.
Kv
φv
ω2 ω1
5
4.2 Tuning the controller
The requirements set for a controller can be partly contradictory. A controlled closed
system should be stable and the perfomance of the controller should be good, meaning
that the control is fast and accurate. For example, the better the performance of the
controller, the less stable the closed system. That is why one must make compromises
to fulfill all the requirements. The goal is to make the system fast, but on the other
hand, the system should not be taken close to the oscillation boundary, where small
changes in the system (e.g. noise) could make the system unstable.
The step response method can be used to tune the parameters of a controller, if it is
possible to feed a step into open system (no control nor feedback). If a step of height
K1 is fed into the system and the output of the system behaves as in figure 6, one can
draw a tangent to the turning point of the output signal. The height of the output
signal is then K2. Delay (T1) and rising time (T2) are calculated as in figure 6.
u(t)
K1
y(t)
K2
t0
T1 T2
Using the Ziegler-Nichols criterion the parameters of the controller can be derived
from these measurements. The criterion is explained later in this report. The
parameters of the controller are presented in table 1.
6
Table 1: Controller parameters in step response method.
7
P-term is increased while the system is on the oscillation boundary. Figure 7 shows
the block diagram of the closed system.
The P-term is increased until the output of the system looks as in figure 8. The
oscillation is critical.
The oscillation period is calculated from the figure above and it is Tcr = 3.5 s. The P-
term of the controller is 8 and that is why Kcr = 8. PID-controller parameters are:
P = 4.8, I = 1.75 and D = 0.44 (according to formulas in table 2). It has to be noticed
that in Simulink the parameters for a PID-block are interpreted in a different way than
in oscillation boundary method. The method gives parameters for PID-controller of
type of equation (3), but in Simulink the equation of the controller is
t
I de(t )
U ( s ) = P + + Ds, or u (t ) = Pe(t ) + I ∫ e(t ) + D . (7)
s 0
dt
8
P=K
K
I= , (8)
TI
D = KTD
where P, I and D are parameters in Simulink and K, TI and TD are the values obtained
by the oscillation boundary method. As the parameter values are fed into the Simulink
model and a step is fed into the system reference, the output behaves as in figure 9.
As it can be seen in the figure, the overshoot is about 60 %, but the second “top” of
the output signal has overshoot of only 12 %. The ratio between these overshoots is
approximately 4, which it should be according to the Ziegler-Nichols criterion.
Generally the criterion might not work in all processes, but it gives a good initial
values for the parameters when tuning a more complex system. It is also possible that
overshoots are not approvable in some systems and the method can not be used.
5 A flow process
In the laboratory, the first part of the exercise is about analysing a flow process model
and tuning a controller for that. The process model has been transformed to circuit
analog model so the behavior of the model can be analysed and different kind of
controllers can be tuned for the process. The process consists of three containers that
have a similar time constant. The process is presented in figure 10.
9
disturbance valve
flow input flow
actuator
measurement
controller
h
The goal of the exercise is to control the level (h) of the last container. The block
diagram of the controlled system is presented in figure 11.
disturbance
controlled quantity +
process
+
measurement actuating
signal
-
error variable controller actuator
+
reference signal
10
6 Temperature control system
Another part of the laboratory exercise deals with a real miniature process, where the
temperature of air flow is controlled. Figure 12 presents the heating process.
On the left end of a tube there is a motor that blows air towards the right end of the
tube. Next to the motor there is a heating element that warms the air. The temperature
can be measured from three different positions in the tube.
11
Figure 14: Signal flow chart of the controlled system.
The temperature range of the process is 30...60 °C. There is a transport delay in the
process (transit time delay), because it takes some time for the air to travel through the
tube (from motor to sensor). The air flow can be controlled only manually by
adjusting a choker next to the motor. There are many disturbances present in the
process, so it is not ideal.
The controller of the process in PC is actually a PID block in Simulink. This means
that the parameters that are calculated using the step response and oscillation
boundary methods have to be transformed to Simulink form using equation (8). Of
12
course, if the program itself calculates the parameters they are in right form and no
transformation is needed. For comparison, tables 3 and 4 show the parameter
equations for the controllers from the program manual. If equation (8) is used,
parameters in tables 1 and 2 become exactly the same as in tables 3 and 4. So when
the parameters are calculated, you must always know how the controller is
implemented!
Table 3: Controller parameters in step response method (Simulink form).
13
7 Preliminary exercises
rocking lever
input flow
disturbance flow
2. a) Plot a Bode diagram for the flow process of figure 10, when transfer
1
function of each container is G ( s ) = .
s +1
b) Calculate the controller parameters (P-, PI- and PID-controllers) for the
process that satisfy the Ziegler-Nichols criterion by using the oscillation
boundary method.
c) Design a P-controller for the process so that the gain margin is 10 dB.
14
e) How many percentages is the steady state error when using this P-
controller?
f) Is it possible to find a P-controller for the process so that there would not be
any oscillation in the step response? State reasons!
g) What kind of a controller is used if closed loop system step response looks
like as in figure 17.
3. a) How does the position of the choker affect the process gain and transport
delay in the heating process?
b) How does the position of the temperature sensor in the tube affect the
process gain and transport delay?
c) How does the position of the temperature sensor affect the relative stability
of the closed system?
d) What are the main disturbance factors of the process when control is
considered?
15
8 Exercises in laboratory
1. Tune P-, PI- and PID-controllers for the flow process (figure 10) using step
response method. Write down the parameter values into the preliminary
exercise paper.
2. Tune the same parameter values using the oscillation boundary method.
3. Do the step response experiments using all three controllers (from exercise 2).
Draw the diagrams of the responses and attach them to your preliminary
exercise paper. Do the responses fulfill the Ziegler-Nichols criterion?
5. Draw diagrams of closed system when using P- and PI-control so that the
disturbance flow (voltage) of the system changes from 0 - 4 V. Analyse the
disturbance compensation properties of the controllers.
>> cd(‘c:\MatlabR11\Labra11’)
>> pt326
7. Check that the temperature sensor is in the middle position. Start the heating
process. Set switch SW2 to lower position and set value of the temperature to
zero. Double click the Process balance button. Click Set zero button in the
Process balance window.
8. Turn switch SW2 to upper position and set value to 8. Wait a little while so
that the tube gets warm.
9. Type 45 into the edit window provided on the Matlab screen, and click “Set
Slope”. Close the Process balance window.
16
measurement. Analyse the results on the screen. Notice, that only a P-
controller (with gain 1) is used during these measurements. Turn the switch
SW2 to lower position and print the step responses of the open loop so that
you change the sensor position between each test.
11. Close the Stethoscope window and open “Open loop control” window. Double
click the “Heating POWER” block on the screen. You may manually change
the set value of the process. Click Play button (in the top of Simulink model)
to turn on the measurement and control mode. Notice that there is no
controller nor feedback used at the moment (this means direct control).
12. Stop the measurements and close “Open loop control” window. Don’t save
any changes. Double click Stop Practical button. Open “Time domain
identification” window. You can estimate the process model parameters in this
window. The transfer function of the process model is:
K
G(s) = ⋅ e − sτ ,
(Ta s + 1)(Tb s + 1)
where K is process gain, Ta and Tb are time constants and τ is process delay
(dead time).
13. Choose step size 0.85 and click Data acquisition button. As the step response
appears on the screen, zoom into the beginning of the step. Define delay of the
process and type that to the appropriate window. Click Least squares button to
estimate the process parameters using least squares method. Compare the real
step response and the model step response. You may repeat the experiment
using some other delay. Clear the screen between the experiments. Do the
estimation with Surface method as well, which is Gaussian identification
based method. See also how the step size affects the estimation and the
parameters. Finally, send the parameters to Matlab (when you are satisfied
with the model).
14. Close the “Time domain identification” window. Open “PID Control”
window. Double click the Real-Time Task block and choose Internal from
Generator Flag menu. Open Reference TEMP. block. Load Settings.mat file
using the load menu. From the opening menu you may choose the reference
signal of the process to be constant, square, triangle, sinusoidal or random
17
signal. Choose Immediately to pass the changes immediately to the process.
Choose some reference signal and type the following parameters into the PID
controller: P = 0.017, I = 0.051 and D = 0.001. Start the measuring and control
and analyse the control, reference and output signals. Examine how the
controller parameters affect the control speed, accuracy and stability of the
process. Use different reference signals. Try to find “good” parameters for the
controller and write them down.
15. Close “PID Settings” and “PID Control” windows. Double click Stop Practical
button. Open “Ziegler-Nichols Transient Response” window. Here you can
tune the controller parameters using step response method. The response
should fulfill the Ziegler-Nichols criterion. Use largest step size and do step
response experiments. Send PID controller parameters to Matlab. Calculate
the values as well by hand and compare parameter sets with each others. Write
down the P- and PI-controller parameters as well. Close the window.
16. Return to “PID Controller” window and do same kind of experiments as in 14.
Use those PID controller parameters that you got before in 15. It is possible
that you have to change the max values of the PID parameters if the parameter
values are larger than those limits. Examine the process behavior with
different reference signals. See also how the P- and PI-controllers work (using
the parameters that you got for them before). Do the step responses fulfill the
Ziegler-Nichols criterion?
17. Double click the Stop Practical button. Move the sensor to the left position in
the tube. Return to “PID Control” window and redo the experiments in 16.
How does the position of the sensor affect the control properties? Move the
sensor to the right position and redo the experiments once again. Analyse!
18. Move the sensor back to the middle position. Choose manual reference signal
from Real-Time Task / Generator flag. Set the reference to maximum value
(1) and let it stay there for a moment. Then suddenly turn the reference to
zero. What phenomenon can detect in the response? Why does it happen?
18
controller gain and collect data again. Go on like this until the P-controlled
system is on the oscillation boundary. Then click End button and write down
each controllers’ parameters.
20. Close the “Ziegler-Nichols Ultimate Sensitivity” window and return to “PID
Controller” window. Examine how the controllers of 19. work. Do the
responses fulfill the Ziegler-Nichols criterion?
19