PID Lab Handout

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

ME 470 Spring 2017

PID Control for Process Automation


ME 470: Mechanical Engineering Systems Laboratory

Figure 1: The Festo Automatic Bottling Station

Lab Objectives
In this lab you will apply the knowledge you have learned in your control systems courses
to design the operating parameters of an automatic bottling station. You will then
analyze the results of your control scheme by investigating how well it can control the
level of water in each of the bottles it fills and by performing an error analysis on these
results.

In this lab you will:

 Learn about the practical usage of control systems for process automation
 Apply and tune a PID controller that maintains the filling level of a dosing tank used
in an automated bottling station
 Evaluate the effectiveness of your control scheme in maintaining the fill level of
the bottles produced by the plant

1
ME 470 Spring 2017

Background
Control systems play an important and integral role in the modern world. They can be
found in devices and systems all around us, ranging from cars and houses to airplanes
and factories. Automatic control of systems has helped to bring about technological
advances in engineering and science, most notably in the fields of modern
manufacturing and industrial processes. These systems have allowed for the ability to
perform tasks with greater speed and accuracy, which in turn has helped to increase
productivity and enabled the automation of many routine and repetitive industrial
processes.

One of the most commonly used control methods in industry today is Proportional-
Integral-Derivative control (PID control). PID controllers are used in a wide range of
industrial processes including the control of pressure, temperature, humidity, viscosity,
flow and motion. The popularity of PID control systems stems from the general
applicability of the PID control algorithm for most control systems and the high level of
performance that can be obtained from PID controllers when they have been properly
tuned. PID controllers can be especially useful when mathematical models of the plant
are not known and alternative, analytical design methods cannot be used to develop
the control system.

Basic Terminology of Control Systems


Open-loop Control: An open-loop control process (Figure 2) is a process taking place
within a system whereby one or more input variables exert influence on output variables
based on a predetermined model of the system. The distinguishing feature of open-loop
systems is the open sequence of actions; i.e. the output variable is not measured and
does not have any direct influence on the input variable.

Figure 2: Open-loop controller

Closed-loop control Process: In a closed-loop control process (Figure 3) the output


variable is continuously monitored, fed back, and compared with a reference variable.
Depending on the outcome of this comparison, the input variable of the system is
influenced in such a manner as to minimize the error between the output variable and
the reference variable despite influencing disturbances.

2
ME 470 Spring 2017

Figure 3: Closed-loop controller

Process variable (Controlled variable): The process variable is the variable that is
measured and controlled in a closed-loop system. This variable is used as a feedback
input to the system.

Set Point (Reference variable): The set point specifies the desired value for the process
variable. The difference between the set point and the process variable that is fed back
into the system is calculated and provided as an error signal input for the controller.

Controller output (Manipulated variable): Automatic closed-loop control can only take
place if the machine or system offers a possibility for influencing the process variable. The
variable via which the process variable can be influenced is called the manipulated
variable. The output from the controller is used to manipulate this variable.

Disturbance: A disturbance is any input into the system that affects the process variable,
other than the systems own actions. Disturbances can occur in any controlled system
and are often the reason why a closed-loop control is necessary.

PID Control
The equation used to calculate the output of a PID controller is shown below:
𝑡
𝑑
𝑈(𝑡) = 𝐾𝑝 𝑒(𝑡) + 𝐾𝑖 ∫ 𝑒(𝑡)𝑑𝑡 + 𝐾𝑑 𝑒(𝑡) (1)
𝑑𝑡
0
𝑈(𝑡) – Controller Output

𝐾𝑝 – Proportional gain, a tuning parameter

𝐾𝑖 - Integral gain, a tuning parameter

𝐾𝑑 - Derivative gain, a tuning parameter

𝑇𝑖 – Integral Time

𝑇𝑑 – Derivative Time

The proportion gain, 𝐾𝑝 , is also referred to as the proportional component, 𝐾𝑖 is referred


to as the Integral component (Integral gain), and 𝐾𝑑 is referred to as the Derivative
component (derivative gain).

3
ME 470 Spring 2017

Characteristics of P, I, and D Controllers


Using the P component, the controller output is proportional to the current error signal. If
the error signal is large, the value of the controller output is also large; if the error signal is
small, the value of the controller output is also small. In the case of the I component, the
error value is added over time, i.e. it is integrated. For example, if a positive error signal
exists for some time, the value of the controller output continues to increase since it is the
result of summation over time. This process continues until the system deviation is zero. I-
controllers or I components in controllers are typically used to eliminate steady state
errors.

With the D component the speed of change of the system is evaluated. This is also called
differentiation of the error signal. If the error changes rapidly, the manipulated variable
value is large. If the system deviation changes slowly, the manipulated variable value is
small. A controller with the D component alone does not make any sense, since a
manipulated variable would only be available if there is a change in system deviation. A
controller can consist of a single component, for example a P controller or an I controller.
A controller can also be a combination of several components however, such as PI or
PD. The most common form of a continuous-action controller is the PID controller.

A proportional controller will have the effect of reducing the rise time and will reduce,
but never eliminate, the steady-state error. An integral controller will have the effect of
eliminating the steady-state error, but it may make the transient response worse. The
addition of a derivative component to a controller will have the effect of increasing the
stability of the system, reducing the overshoot, and improving the transient response.

PID Tuning
While the gains for a PID controller can be tuned manually through trial and error, the
process can be tedious and time consuming. Fortunately, a number of tuning methods
exist for experimentally calculating the optimal PID gains for a given system. One of the
most well-known of these techniques is the Zeigler-Nichols PID tuning method which we
will use in this lab.

Zeigler-Nichols Tuning Rules (critical gain)


The Zeigler-Nichols tuning technique is an empirical method for determining a PID control
scheme. While simple to use, the Zeigler-Nichols scheme is not always the correct method
to employ as it generally creates a PID system with an aggressive startup and large
overshoot. Many other methods of tuning PID systems also exist.

The following steps need to be carried out to tune a PID controller using Zeigler-Nichols
critical gain method:

- Set Ti = ∞ and Td = 0 (alternatively you can just use a P controller)


- Start the controller using a Kp = 0
- Slowly increase Kp until you reach the critical value Kcr, at which point the process
variable starts to exhibit sustained oscillation. Pcr is the period of oscillation that
occurs at the ultimate gain Kcr.

4
ME 470 Spring 2017

- Use the values of the critical gain (Kcr) and the corresponding critical period of
oscillation (Pcr) along with the tuning rules provided in Table 1 to calculate the
gains for the PID controller.

Table 1: Zeigler-Nichols tuning rules

Type of Controller Kp Ti Td
P 0.5 Kcr ∞ 0
PI 0.45 Kcr 0.84 Pcr 0
PID 0.6 Kcr 0.5 Pcr 0.125 Pcr

Associated Course Material


 You can refer to your Control Systems text for more information on PID control: Nise,
Norman S, (2015) Control Systems Engineering. p.475. Seventh edition, John Wiley &
Sons Inc.
 Read Class notes (from ME 483 course) related to PID controller
 Some resources that might be helpful in connecting the material in ME 483 to Zeigler-
Nichols PID tuning are:
o http://faculty.mercer.edu/jenkins_he/documents/TuningforPIDControllers.pdf
o http://www.nptel.ac.in/courses/101108047/module2/Lecture%204.pdf

Experimental Configuration
For this lab you will be using a Festo didactic automated bottling station. The Bottling
station is part of a larger modular production learning system composed of a filtration
station, a mixing station, a reaction station and a bottling station used for teaching
process automation (Figure 4). The automated bottling station will be used in this lab to
demonstrate the use of control systems for automated production applications. The
function of the bottling station is to automatically fill empty bottles with a specific amount
of liquid according to a recipe defined by the operator.

5
ME 470 Spring 2017

Filtration Mixing Reaction Bottling

Station Station Station Station

Figure 4: Festo Didactic Modular Production Systems for Process Automation (Festo MPS-PA)

The bottling station consists of the following components, shown in Figure 5:

Holding Tank: Stores the liquid to be added to the bottles in the bottling process.

Capacitive Proximity Sensors: Two capacitive proximity sensors are mounted on the side
of the holding tank, one near the top and the other near the bottom. These sensors are
used to indicate when the maximum and minimum filling quantity of the holding tank
have been reached.

Measuring Tank: Holds a specific amount of liquid for the dosing process.

Ultrasonic Acoustic Sensor: An analog acoustic sensor is mounted above the measuring
tank and is used to measure the fill level of the tank.

Pump: A centrifugal pump is used to transfer liquid form the holding tank to the measuring
tank.

Conveyor belts: Two Conveyor belts, mounted at 90° from each other, are used to
continuously transport empty bottles to the filling position. The belts are driven by two
constant speed, geared motors.

Solenoid Valve: A solenoid valve is located below the measuring tank. This valve is
opened in order to fill the empty bottles. The duration of time for which the valve is open
determined the amount of fluid that is transferred to the bottles.

6
ME 470 Spring 2017

Feed Separator: Bottles are stopped at the filling position using a pneumatic feed
separator. Fingers attached to the ends of the cylinders are used to stop bottles as well
as to separate bottles that have been filled from the rest of the empty bottles.

Diffuse Light sensors: Three light sensors are used to detect when bottles are present on
the conveyor belt. The first is located at the start of the conveyor belt to indicate that a
bottle has been added to the conveyor, the second is located in front of the feed
separator to indicate that a bottle is available to be filled and the last one is located at
the end of the conveyor to indicate that a bottle has been filled and is ready to be
removed from the conveyor.

Connection board: A connection board serves as the interface for electrical input/output
(I/O) signal to the various components of the system. The board contains terminals for
both analog and digital signals to be sent and received from the various sensors and
actuators mounted on the system.

7
ME 470 Spring 2017

Figure 5: Components of the automated bottling station

8
ME 470 Spring 2017

Lab Procedure
In order to control the bottling station you will need to use the Ziegler-Nichols PID tuning
technique to experimentally determine the critical gain for the system. Along with the
critical gain, Kcr (the point at which the output first exhibits sustained oscillation) the
corresponding period of oscillation Pcr must be found. The procedure for doing this is
outlined below:
1) Ensure that the Easyport USB is properly wired to the computer and the bottling
station. Refer to Appendix 1 for a wiring diagram if necessary.
2) The “closed loop control – continuous” window of the Fluid Lab - PA application
software should be open on the computer. If it has not already been opened,
then follow the instructions in Appendix 2 for details on how to open and
configure the Fluid Lab - PA software for the bottling station.
3) The graph that occupies the main part of the window is used to plot the values
of the set point (SP – black line), the process variable (PV – red line) and the
controller output (CO – green line). The Y axis on the left is used to display the
actual values of the set point and the process variable (liquid level) in liters, while
the Y axis on the right is use to display the normalized values of all three variables
on a scale from 0-1.
The first step for tuning the PID controller for the liquid level is to determine the
critical gain Kcr and corresponding period Pcr.
Select the P tab located on the bottom right hand corner of the window and set
Kp = 25.

4) Enter a value of 0.33 (1 liter) for the set point – we are using 1/3 of the volume of
the dosing tank which is 3 liters in volume.

9
ME 470 Spring 2017

Set to 0.33

5) Check to insure that the metering tank is empty, then click on the start button
located near the bottom right hand corner of the window to start running the
controller.

Start controller

6) While the controller is running observe the response of the system on the graph
and wait until the liquid level stabilizes. Once the level has stabilized slowly
increase Kp in increments of 5 until the liquid level starts to oscillate continuously
with constant amplitude similar to the figure below.

The Kp value when the system first exhibits this oscillatory response is the critical
gain (Kcr) of the system.

10
ME 470 Spring 2017

7) Once you have determined the critical gain for the system, stop the controller.
Create a folder for your group on the desktop and save an image of the screen
as well as the data on the graph by using the buttons shown in the following
figure:

Stop controller

Save screen image Save data

Note: in the saved data the following parameters are used w – set point (0-1), x –
process variable (0-1), and y – controller output (0-10).
8) Use the graph to measure the period of oscillation (Pcr) that corresponds to the
critical gain Kcr.
Note: You can right click on the graph and enable the graph palette located
under “visible items” to zoom in on the graph and accurately measure the value
of Pcr.
Graph Palette

Pcr

Enable Graph Palette

(Right click menu)

11
ME 470 Spring 2017

Tasks
1. Calculate the values Kp and Ti for a PI controller using the Zeigler-Nichols tuning
method.
2. Use these values to run the controller using the “PI[DIN]” controller in Fluid Lab and
save the screen image and data of the run to your groups’ folder.
3. Calculate the values Kp, Ti, and TD for a PID controller using the Zeigler-Nichols
tuning method.
4. Use these values to run the controller using the “PID” controller in Fluid Lab and
save the screen image and data of the run to your groups’ folder.

After you are done with these tasks, reconnect the bottling station to the PLC controller
and run the bottling process in automatic mode using the tuned PID gains you have
calculated.

5. Measure the amount of water that is added to each of you bottles using the
control system you have generated.

Report your findings by writing an appropriate technical report.

Questions for Discussion


 What is the importance of the PID controller used in the Bottling station for this Lab?
 Describe and compare the performance of the tuned PI and PID controllers using
the rise time, Peak time, overshoot, and steady state error of the system.
 Compare the response of the tuned PI and PID controllers with regards to the
controller output signal (green plot) and discuss what effect each might have on
the pump?
 The drinks manufacturer wants to fill the bottles with 12 ml of fluid. Does you control
scheme achieve this aim?
o Discuss the accuracy of your control solution – use appropriate error analysis
& statistical techniques in your discussion to validate your claims. For
example, comment on the variability in your solution using confidence
intervals or similar metrics.
o How could your control system be improved to better achieve this ’12 ml’
goal?

12
ME 470 Spring 2017

Appendix 1: Wiring Diagram for Easyport USB Connection

Figure 6: Wiring diagram and labeling scheme for Easyport USB system

13
ME 470 Spring 2017

Appendix 2: Opening and configuring FluidLAB-PA for the Festo Bottling Station

1) Double-click the FluidLAB-PA shortcut icon on the desktop to Launch the


application

Launch FluidLab-PA Application

2) The application will open and automatically connect to the Easyport USB device.
Once a connection has been established, click on the file icon next to the setup
button to load the configuration file for the Bottling Station.

Open Configuration file

14
ME 470 Spring 2017

3) In the file dialog box that opens, select the text file named “Bottling_Station” and
click OK.

Select ‘Bottling_Station’ file

Select OK

4) Back in the main window, select the “Closed-loop control – Continuous” button to
open a new window for tuning the PID controller for the bottling station.

Open Closed-loop control - continuous

15
ME 470 Spring 2017

5) In the window that Opens set the cycle time to 0.05 and enable digital output 0

Set cycle time to 0.05

Enable digital Output 0

You are now ready to start tuning the PID controller

16

You might also like