









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Write down your results in the supplied fields during the lab. You will need these ... The PID controller, with which we will control the water.
Typology: Study Guides, Projects, Research
1 / 17
This page cannot be seen from the preview
Don't miss anything!










Department of Automatic Control Lunds tekniska högskola Last update May 2019
You log in using the account name lab_tanka. Leave the password field empty. The two windows of the graphical user interface are opened automatically at login together with MATLAB, running in console mode.
Write down your results in the supplied fields during the lab. You will need these during lab 2.
The purpose of this lab is to provide understanding of fundamental concepts and principles in automatic control. We will also get acquainted with the PID controller, being the most commonly occurring controller in industry.
The lab process consists of a pump and two tanks connected in series. The process actually consists of two pumps and four tanks, but we will only use the left half of the setup, shown in figure 1. The PID controller, with which we will control the water level in the tanks, is implemented in a PC.
Figur 1: Lab setup (of which the left half is used).
Preparations
In order to get as much as possible out of the lab, you should be familiar with the following concepts:
You should also have read through this lab manual.
Study appendix A, B, explaining the user interface, prior to continuing with the lab. Make especially sure that the valves of the process are correctly positioned according to the instructions in the appendix. Ask your lab assistant if anything is unclear.
This section deals with important concepts in automatic control. We will also get acquainted with properties of the process by manually controlling the water level in the tanks.
What is Good Control?
The reason one wishes to control a process is to have it behave in a desired way. This may involve the process becoming more accurate, more reliable or more economic. In some cases the uncontrolled process is unstable and good control is necessary in order not to damage it (which sometimes can cause extensive damage). Hence, good control can mean different things in different applications. When it comes to the tank process of this lab, the following requirements could be appropriate:
These properties are important in most applications. Can you think of further requi- rements one would like to put on good control?
level reference student (^) process
disturbance
control signal (^) actual level
Figur 3: Open loop system
to what is demonstrated below. Hence, in our case, open loop control means that the level control is not based on observations of the current water level.
Prior to experimenting with open loop control, we must construct a simple model of the tank process. Log in using the account information provided in the beginning of the manual (if you have not already done so). The controller should now be in manual mode. This enables you to directly set the control signal (which is proportional to the pump voltage) and thereby the flow to the upper tank.
Assignment 2.3 Adjust the control signal (the slider labeled um) to correspond to a measurement signal of approximately 0.5 in the upper tank. Use the plot to confirm that the measurement signal y has reached stationarity. It is not important that you obtain exactly the prescribed measurement signal. Rather, you should write down the measurement signal you obtain (in the vicinity of 0.5) which was reached in stationa- rity and the value of the corresponding stationary control signal.
Comment: Either of the two graphical user interface windows can be used to read the control signal and measurement signal, respectively. Identify how this is done prior to continuing with the laboration. (Ask the assistant if you feel uncertain regarding the user interface.)
Repeat the experiment for the measurement values (approximately) 0.3 and 0.7, re- spectively. Transcribe your measurements to the below diagram, plotting the control signal as a function of the corresponding stationary water level. Do not forget that the curve should go through the origin. Why? Can you explain the shape of the curve? We can assume that the flow through the pump is proportional to the pump voltage. (What can be a reasonable explanation if the shape of the curve does not coincide with your expectation?)
Hint: Compare with exercise 1.5 from the course.
0.3 0.5 0.
measurement
measurement control signal control signal
Comment: The actual pump characteristics are not linear from voltage (control signal) to flow. A qualitative illustration of the actual characteristics is shown in Figure 4.
flow
voltage
Figur 4: Pump characteristics
Low voltages result in no flow. Voltages above u 0 yield a flow, which increases ap- proximately quadratically with the voltage. In order to hide this inconvenient nonli- nearity a cascaded controller is used in this laboration. The pump flow is measured using a Venturi-tube and an inner controller (hidden from the user) ensures that the flow follows the reference given by the user, i.e., you. See Figure 5.
flow reference controller
control signal pump
flow
Figur 5: Inner pump flow control loop
Assignment 2.4 Adjust the control signal um so that the measurement signal y from the upper tank settles at 0.5. Try, using the model from the previous assignment, to increase the measurement signal to 0.8 by means of um while your lab partner is obscuring the physical process and the part of the screen showing the measurement signal. What happens if your lab partner opens BV1 without notice?
Closed Loop Control
You now have access to the measurement signal y and your visual impressions can be used to create a feedback connection in order to control the level, cf. Figure 6.
Assignment 2.5 Once again try to increase the measurement signal from 0.5 to 0.8. What limits the time it takes to alter the level? Observe that you are still intended to control the tank manually, i.e. using the um slider.
the block diagram of the PID controller will be active (white) while the I and D blocks are inactive (light blue). (Click on a block to toggle between active and inactive.)
The control signal u is computed as
u(t) = K (r(t) − y(t))
where r is the reference and y the measurement. In our case this means that the pump voltage becomes proportional to the control error e = r − y. The constant K is the gain of the controller.
Assignment 3.1 We shall now investigate how the properties of the controller de- pend on the gain K. Return to the upper tank and set the reference to r= 0 .5 prior to each experiment.
Investigate how well the level tracks reference changes. Start with K= 5. Increase the reference to r= 0 .7. Wait until the level becomes constant and then reset the reference to r= 0 .5. Are the results to positive and negative reference changes symmetric?
Repeat the experiment for K = 3 and K = 10. How does the control error and speed depend on the gain K?
Now increase K to 20 and repeat the above described reference change. Does the result differ from that corresponding to K = 10? Explain.
Study how the system behaves at load disturbances. Generate step-disturbances by means of the lever BV1 and impulse disturbances by pouring water directly into the upper tank. How does the behavior change with varying K?
How is the system affected by measurement noise? Vary the gain K and study espe- cially the behavior of the control signal. Give a reasonable value for K.
Assignment 3.2 Next we will experiment with P control of the lower tank by changing Tank Selection from Upper to Lower. Repeat the experiment in assign- ment 3.1. Try with e.g. K = 1 , 3 , 10.
Assignment 3.3 Discuss the difference between P control of the upper and lower tank. Are the results satisfactory? Any issues? Give reasonable values for K in either case. What limits K in either case?
PI Control
A problem with P control, which we have already witnesses, is that it gives rise to a persisting control error. It is natural to increase the control signal while the mea- surement is lower than the output, in order to eliminate this error. One way of doing this is to let the control signal depend also on the integral of the control error. In a PI controller, u is computed as
u(t) = K
e(t) +
Ti
∫ (^) t
0
e( τ)d τ
where e is the control error, i.e., e = r − y. The pump voltage is now given as the sum of two terms. The first one consists of a constant K times the control error and is called the P part (cf. P controller). The second term is a constant K/Ti times the integral of the control error. This part of the sum is hence refered to as the I part (integral part) and changes as long as the reference and output differ, see Figure 7.
Ti is called the integral time, since it is of dimension time. Observe that Ti does not affect the integration bounds.
r y I
t t
Figur 7: The I part changes as long as the control error presides.
If the control signal u saturates, i.e., reaches its max or min value and a non-zero control error e persists, problems can arise in connection to the integral part since it continues to grow despite the control signal saturation. Once (if) the control error vanishes, a large overshoot or even instability might result, due to the excessively large accumulated integral part. The phenomenon is called integrator wind-up. The lab software contains a built-in wind-up protection, a so called anti-windup scheme.
Assignment 3.4 Experiment with PI control of the upper tank. Vary the integral time Ti and study how the system responds to reference and load changes. Let K = 5 and change Ti from 20 down to 1.
e
t t′^ t′^ + Td
Figur 8: The derivative part is used to estimate future control errors.
We have now witnessed how changes in the P, I and D parts affect the behavior of the control system. This is naturally of great help, but when tuning a controller one also needs suitable initial values for K, Ti and Td. If the process to be controlled is slow, one might have to wait hours, or even days, between experiments.
Model Based Controller Synthesis If a mathematical model of the process is avai- lable, it can be used to compute controller parameters. This is usually refered to as model based synthesis and will be treated in laboration 2.
Experimental Methods Another way to obtain controller parameters is by perfor- ming simple experiments, yielding knowledge of the process dynamics. Subsequent- ly, known rules of thumb are used to tune the controller. The experimental methods do not guarantee a suitable controller tuning but often result in a descent starting point for further tuning. The perhaps most used, but not necessarily the best, methods are those of Ziegler and Nichols.
Auto-tuning some commercially available PID controller have built in functions for automatic controller tuning. These functions are often based on experimental met- hods.
Assignment 4.1 Demonstration The lab assistant demonstrates (if time allows) how a commercial controller can be used for controlling the tank process. Especially, automatic tuning is demonstrated.
Assignment 5.1 Summarize the most important differences between open loop (manual control, lookup table) and closed loop (feedback) control.
Assignment 5.2 Discuss the pros and cons of P, PI and PID control of the upper and lower tank, respectively. Especially, answer the following questions and complete the below table.
How does a too large/small K affect control performance? (How does the response to reference and load changes behave? How does the control signal and the stationary error behave?)
What happens to the control performance if the integral time Ti is small/large?
How does the derivative time Td affect the control performance? Is there any diffe- rence between the upper and lower tank?
Table of suitable controller tunings (bring it to laboration 2!)
Ti= Ti=
T =d T =d
Ti= Ti=
upper tank lower tank
❅
❅❅
❆
❆❆