Basic Course Laboratory Exercise 1 PID Control, Study Guides, Projects, Research of Laboratory Practices and Management

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

2021/2022

Uploaded on 08/01/2022

fioh_ji
fioh_ji 🇰🇼

4.5

(70)

814 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Automatic Control Basic Course
Laboratory Exercise 1
PID Control
Department of Automatic Control
Lunds tekniska högskola
Last update May 2019
Practical Things
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.
1. Introduction
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).
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Basic Course Laboratory Exercise 1 PID Control and more Study Guides, Projects, Research Laboratory Practices and Management in PDF only on Docsity!

Automatic Control – Basic Course

Laboratory Exercise 1

PID Control

Department of Automatic Control Lunds tekniska högskola Last update May 2019

Practical Things

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.

1. Introduction

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:

  • open and closed loop system
  • block diagram
  • set point (reference), measurement and control signal

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.

2. Fundamental Concepts

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:

  • We obviously want the actual water level in the tank to coincide with the desi- red level (such that measurement = reference).
  • If the reference changes, we want the tank level to settle quickly at the new value, without large oscillations.
  • The control should be able to handle load disturbances such as external flows and measurement noise, i.e. disturbances acting on the measurement signal.
  • Finally, we desire the control signal to the pump not to be extensively “jerky” since this leads to unnecessary wear.

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.

u 0

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.

4. Tuning Methods

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.

5. Summary

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

K =

K = K =

K =

PID

PI

P

K = K=

❅❅

AV

❆❆

AV2 BV

BV

AV

BV

AV

V

BV

Figur 9: Controls of the laboration process

A. Physical User Interface for Laborations 1 and 2

This appendix deals with the hardware and software interface used in laborations 1 and 2.

Controls

Figure 9 shows a picture of the laboration process. During this laboration, we will use controls BV1, AV3, AV4, which shall be pressed in/down at the start of the laboration. Controls AV1, AV2, BV2 shall be pressed in while BV3, V5, BV4 shall be pressed down. This is important in order for numerical values in the manual to coincide with those in reality.

B. Graphical User Interface for Laborations 1 and 2

Below follows a short description of the software interface used during the tank labs. The interface consists of two windows: the ”Process” and ”Controller” window, re- spectively.

The Process Window

This window gives an overview of the process and shows the interconnection between the process objects, see figure 10. Physical objects are shown to the right of the ver- tical central line. For example, a picture of the pump and an animations of the water tanks are shown. To the left of the central line, objects implemented in the computer are shown. The most important of these are the PID controller. But there are also various controls and switches.

By using the mouse or keyboard one can carry out the following operations:

Manual/PID. By clicking on the upper switch, one toggles between manual and PID control of the pump. The current mode is indicated by the title bar of the window and the routing of the virtual wires.

Upper/Lower tank. By clicking on the lower switch, one toggles between control of the upper and lower tank. I.e, whether the measurement signal should come from the upper or lower level sensor. Also this is shown in the title bar of the window and on the routing of the virtual wires.

Manual control. The control marked um is used to directly control the pump in ma- nual mode. The value is changed by dragging the triangle to a desired location, using the mouse. Alternatively, one can click in the box and enter a desired value.

Figur 10: Process View.

C. P & I diagram of the tank process

Figure 12 shows the P& I diagram (Process and Instrumentation diagram) for the tank process, according to the Swedish Standard SS-ISO 14617 part 1 to 10.

Figur 12: P & I diagram of the tank process

Tabell 1: Symbol Description

Flow transmitter in control loop 10. Stand-alone field mounted element (circle).

Differential Pressure Transmitter in control loop 10. Stand-alone field mounted element (circle).

Pump in control loop 10. Stand-alone field mounted element (circle).

Tank A.

Level converter (Y) in control loop 10. Computer function (hexagon) board- mounted accessible for monitoring (solid line).

Switch (Y) for Level Controller in control loop 10. It determines which level signal (Tank A or B) is sent to the input of the level controller. Computer func- tion (hexagon) board-mounted accessible for monitoring (solid line).

Level Indicator Controller in control loop 10. Computer function (hexagon) board-mounted accessible for monitoring (solid line).

Flow Controller in control loop 10. Computer function (hexagon) board- mounted accessible for monitoring (solid line).

Manual (H) set point Controlling in control loop 10. Computer function (hexa- gon) board-mounted accessible for monitoring (solid line).

Valve manually actuated.

Pump.

Thick solid process line. It shows the process piping.

Software link.

Electric line.