You are on page 1of 13

Process Control Laboratory Exercise No.

5
PID Controller Using Matlab

1. Objective:
The activity aims to understand PID Controller using MATLAB

2. Intended Learning Outcomes (ILOs):


The students shall be able to:
2.1 Understand PID actions using MATLAB.
2.2 Understand the effect of PID Controller in step responses using MATLAB.

3. Discussion:

PID (proportional integral derivative) control is one of the earlier control strategies. Its early
implementation was in pneumatic devices, followed by vacuum and solid state analog electronics, before
arriving at todays digital implementation of microprocessors. It has a simple control structure which was
understood by plant operators and which they found relatively easy to tune.

A typical structure of a PID control system is shown in Fig. 6.1, where it can be seen that in a PID
controller, the error signal e(t) is used to generate the proportional, integral, and derivative actions, with the
resulting signals weighted and summed to form the control signal u(t) applied to the plant model. A
mathematical description of the PID controller is:

where u(t) is the input signal to the plant model, the error signal e(t) is defined as e(t) = r(t) y(t) , and r(t) is
the reference input signal.

1
The behavior of the proportional, integral, and derivative actions will be demonstrated
individually through this activity.

4. Resources:
Matlab
5. Procedure:
1. Consider a transfer function expressed as, G(s) = 1 / (s + 1 )^3 If a proportional control strategy
is selected, i.e., Ti and Td 0 in the PID control strategy, for different values of Kp, the
closed-loop responses of the system can be obtained by inputting these MATLAB commands;

>> G=tf(1,[1,3,3,1]);
for Kp=[0.1:0.1:1], G_c=feedback(Kp*G,1); step(G_c), hold on; end
figure; rlocus(G,[0,15])

Record the results.

2. If we fix Kp =1 and apply a PI (proportional plus integral) control


strategy for different values of Ti , we can use the following MATLAB
commands;

>> Kp=1; s=tf(s);


for Ti=[0.7:0.1:1.5]
Gc=Kp*(1+1/Ti/s); G_c=feedback(G*Gc,1); step(G_c), hold on end

Record the results.

3. Fixing both Kp and Ti at 1, i.e., Ti = Kp = 1, when the PID control strategy is used, with different
Td, we can use the MATLAB statements;

>> Kp=1; Ti=1; s=tf(s);


for Td=[0.1:0.2:2]
Gc=Kp*(1+1/Ti/s+Td*s); G_c=feedback(G*Gc,1); step(G_c), hold on end
Record the results.
4. Determine the transfer functions using MATLAB from the block diagrams as shown below and
apply procedure 1 to 3 to obtain the step response and root locus graph of it.

a.

2
b.

c.

d.

e.

f.

3
Record the results.

5. The derivative term may be preferred in the feedback path. Since the output does not change
instantaneously for a step input a smoother signal is produced by taking the derivative of the
output. This PID control strategy, which will be denoted PI-D, is shown in Fig. 5.2.

For the transfer function in procedure 1, by the following MATLAB statements:


>> G=tf(1,[1,3,3,1]); Ti=1; Td=1; Kp=1; N=10; s=tf(s);
Gc=Kp*(1+1/Ti/s+Td*s/(1+Td*s/N));
G_c=feedback(G*Gc,1); Gc1=Kp*(1+1/s/Ti);
H=((1+Kp/N)*Ti*Td*s2+Kp*(Ti+Td/N)*s+Kp)/(Kp*(Ti*s+1)*(Td/N*s+1));
G_c1=feedback(G*Gc1,H); step(G_c,G_c1)

The closed-loop step responses for the system with PID and PI-D are obtained.

Record the results.


6. Do the same thing to all transfer function and record all the data.

Course: ECE 006 Laboratory Exercise No.: 05


Group No.: Section: CH42FB1
Group Members: Date Performed: 03/11/17
OCAMPO, Mark Jared Van T. Date Submitted: 03/11/17
Instructor:
Engr. Crispulo Maranan
6. Data and Results:
Procedure No. Output in the command window

4
1

5
2

6
3

Procedure No. Transfer function and outputs


4a

7
8
4b

9
4c

10
7.Conclusion:

In this exercise we were able to know how can we see the effect of certain model of PID Controller in the
system is. You can say that using this controller, error and disturbances can be determined and that using
this will surely help the operation and plant management.

8. Further Readings:
Ferraris, G. and Manenti, F. (2010). Interpolation and regression models for the chemical engineer:
solving numerical problems. Germany: Wiley-VCH Verlag
Filo, O. (2010). Information processing by biochemical systems: neural network type configurations.
New Jersey: Wiley.
Gopal, S. (2009). Bioinformatics: a computing perspective. India: McGraw-Hill Science/Engineering
Math.
Jaluria, Y. (2012). Computer methods for engineering with MATLAB applications (2 nd ed.). Boca,
Raton,Florida: CRC Press.
Knopf, F. C. (2012). Modeling, analysis and optimization of process and energy systems.Hoboken,
New Jersey: John Wiley and Sons.
Velten, K. (2009). Mathematical modeling and simulation: introduction for scientists and engineers.
Singapore: Wiley-VCH.
Society for Industrial and Applied Mathematics 2007

11
9. Assessment (Rubric for Laboratory Performance):
TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES
RUBRIC FOR MODERN TOOL USAGE
(Engineering Programs)
Student Outcome (e): Use the techniques, skills, and modern engineering tools necessary for engineering
practice in complex engineering activities.
Program: Chemical Engineering Course: CHE 530D1 Section: _______ ____Sem SY ________
Performance Unsatisfactory Developing Satisfactory Very Satisfactory Score
Indicators 1 2 3 4
Apply Fails to identify Identifies Identifies modern Recognizes the
appropriate any modern modern techniques and is benefits and
techniques, techniques to techniques but able to apply constraints of
skills, and perform fails to apply these in modern
modern discipline- these in performing engineering tools
tools to specific performing discipline-specific and shows
perform a engineering discipline- engineering task. intention to apply
discipline- task. specific them for
specific engineering engineering
engineering task. practice.
task.
Demonstrate Fails to apply Attempts to Shows ability to Shows ability to
skills in any modern apply modern apply fundamental apply the most
applying tools to solve tools but has procedures in appropriate and
different engineering difficulties to using modern effective modern
techniques problems. solve tools when solving tools to solve
and modern engineering engineering engineering
tools to problems. problems. problems.
solve
engineering
problems.
Recognize Does not Recognizes Recognizes the Recognizes the
the benefits recognize the some benefits benefits and need for benefits
and benefits and and constraints of and constraints of
constraints constraints of constraints of modern modern
of modern modern modern engineering tools engineering tools
engineering engineering engineering and shows and makes good
tools. tools. tools. intention to apply use of them for
them for engineering
engineering practice.
practice.
Total Score
Mean Score = (Total Score / 3)
Percentage Rating = (Total Score / 12) x 100%
Evaluated by: ______________________________________ _______________
Printed Name and Signature of Faculty Member Date
12
13

You might also like