








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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
To demonstrate the concept of proportional-integral-differential (PID) control. 2. COMPONENTS & EQUIPMENT. PC with MATLAB and Simulink toolbox installed.
Typology: Summaries
1 / 14
This page cannot be seen from the preview
Don't miss anything!
To demonstrate the concept of proportional-integral-differential (PID) control.
PC with MATLAB and Simulink toolbox installed.
In applications where a simple gain compensator is inadequate to achieve stability or other
performance specifications, a frequency-dependent (dynamic) compensator is needed. One of the
earliest such compensators was the PID controller. The PID control does not require a detailed
model of the plant, but is designed by continuously calculating an error value 𝑒
as the difference
between a desired setpoint (SP) and a measured process variable (PV) and applying a correction
based on proportional, integral, and derivative terms (denoted P, I, and D respectively), in other
words, “tuning”, its parameters, while the system is operational.
In practical terms it automatically applies accurate and responsive correction to a control
function. An everyday example is the cruise control on a car, where ascending a hill would lower
speed if only constant engine power is applied. The controller's PID algorithm restores the
measured speed to the desired speed with minimal delay and overshoot, by increasing the power
output of the engine.
A PID compensator has the transfer function of the following form:
𝑐
1
2
3
2
1
3
2
As an example, consider the following closed-loop configuration, which has two zeros and a
pole at the origin. One zero and one pole can be designed as ideal integrator; the other zero can be
designed as ideal derivative compensator
+
-
+
+
+
Figure 1. A block diagram of a PID controller in a feedback loop. r(t) is the desired process value or setpoint
(SP), and y(t) is the measured process value (PV).
Design Steps:
1
and set 𝐾
2
3
= 0 , while the system is operating.
Derive the new system transfer function with 𝐾
1
introduced. Tuning 𝐾
1
until system has an
acceptable step response i.e. drive 𝑒(𝑡) toward zero.
2
is to be adjusted. Derive the new system transfer
function with 𝐾
2
introduced. The term 𝐾
2
/𝑠 integrates error 𝑒(𝑡) and applies the result to the
plant, forcing 𝑒(𝑡) → 0. 𝐾
2
is varied until sufficiently small 𝑒
𝑠𝑠 0
is achieved.
introduced, which is varied to reduce
rise time of the output signal. This reduction of rise time occurs since 𝐾
3
provides extra “kick”
at the start, when 𝑒(𝑡) changes the most.
Detail process and example is attached in Appendix.
_Note:_* In some applications, the derivative term in the PID structure causes undesirable phenomena, such as high-
frequency noise or oscillations. In such cases, the compensator frequency response can be attenuated at high frequency
by introducing additional pole to reduce these stray effects.
Include the following elements in the report document:
Section Element
1
Theory of operation
Include a brief description of every element and phenomenon that appear during the experiments.
2
Prelab report
3
Results of the experiments
Experiments Experiment Results
1 Simulink model and simulation results for Experiment 1.
2 Simulink model and simulation results for Experiment 2.
3 “pidtool” screenshot and simulation results for Experiment 3.
4 MATLAB codes and simulation results for Experiment 4.
4
Answer the questions
Questions Questions
1
5
Conclusions
Write down your conclusions, things learned, problems encountered during the lab and how they were
solved, etc.
6
Images
Paste images (e.g. scratches, drafts, screenshots, photos, etc.) in Postlab report document (only .docx,
.doc or .pdf format is accepted). If the sizes of images are too large, convert them to jpg/jpeg format
first, and then paste them in the document.
Attachments (If needed)
Zip your projects. Send through WebCampus as attachments, or provide link to the zip file on Google
Drive / Dropbox, etc.
th
Ed.
I appreciate the help from faculty members and TAs during the composing of this instruction
manual. I would also thank students who provide valuable feedback so that we can offer better
higher education to the students.
Design Steps:
improvement in transient parameter is required.
Design PD controller to meet the transient response specifications.
Simulate the system to see if transient specification requirements are met.
Redesign if specifications are not met.
Design PI controller to yield the required steady state error specifications.
Determine the gains, K1, K2 and K3.
Simulate the system to see if all specification requirements are met.
Redesign if all the specification parameters are not met.
Design Example:
Given the system shown in figure below:
Design the PID controller that meets the following specifications:
maintain 20% overshoot
reduce peak time to 2/3 of the uncompensated system’s peak time
eliminate steady-state error
Step1: Uncompensated system performance:
achieves overshoot target;
Tp = 0.297 sec, must be reduced to ~0.2sec
𝑒(∞) = 0.156, must be reduced to 0
For the figure above,
𝑐
= tan 18 .37° ⇒ 𝑧
𝑐
Thus, PD controller is
𝑝𝑑
Root locus of the PD compensator is shown below:
From the root locus, PD gain is 5.34 at the desired point.
Steps 3 & 4: We simulate PD compensated systems to see if the transient specifications are met.
From simulation, we find reduction in rise time and improvement in steady state.
Step 5: Design ideal integrator to reduce steady state error. Any integral compensator zero will
work as long as the zero is placed closed to unity. Choosing ideal integrator:
𝑝𝑖
We sketch root locus of the PID controlled systems as shown below:
From the figure above, we the dominant poles at −7.516 ±j14.67 with associated gain of 4.6 for
damping ratio of 0.456.
Step 6: Now we determine K 1
2
and K 3
2
Matching the form of a PID controller as (𝐾 1
2
3
2
)/𝑠. Thus,
1
2
3
The goal of this problem is to show you how each of Kp, Ki and Kd contribute to obtain
Find Open Loop Response:
num = 1;
den = [1 10 20];
step(num, den);
Running this m-file in the MATLAB command window, you will get plot shown below.
The DC gain of the plant transfer function is 1/20, so 0.05 is the final value of the output to a unit
step input. This corresponds to the steady-state error of 0.95, quite large indeed. Furthermore, the
rise time is about one second, and the settling time is about 1.5 seconds. Let's design a controller
that will reduce the rise time, reduce the settling time, and eliminates the steady-state error.
Proportional control
From the table shown above, we see that the proportional controller (Kp) reduces the rise time,
increases the overshoot, and reduces the steady-state error. The closed-loop transfer function of
the above system with a proportional controller is:
𝑝
2
𝑝
Let the proportional gain (Kp) equals 300 and change the m-file to the following:
Kp=300;
num=[Kp];
den=[1 10 20+Kp];
t=0:0.01:2;
step(num,den,t)
Running this m-file in the MATLAB command window, you will get plot shown below.
Note: Alternatively, we could MATLAB function called cloop to obtain a closed-loop transfer
function directly from the open-loop transfer function (instead of obtaining closed-loop transfer
function by hand). The following m-file uses the cloop command that should give you the identical
plot as the one shown above.
num=1;
den=[1 10 20];
Kp=300;
[numCL, denCL]=cloop(Kp*num, den);
t=0:0.01:2;
step(numCL, denCL, t)
The above plot shows that the proportional controller reduced both the rise time and the steady-
state error, increased the overshoot, and decreased the settling time by a small amount.
Proportional-Derivative (PD) control
From the table shown above, we see that the derivative controller (Kd) reduces both the overshoot
and the settling time. The closed-loop transfer function of the given system with a PD controller
is:
𝑑
𝑝
2
𝑑
𝑝
Let Kp equals to 300 as before and let Kd equals 10, change the m-file to the following:
Kp=300;
Kd=10;
num=[Kd Kp];
den=[1 10+Kd 20+Kp];
t=0:0.01:2;
step(num,den,t)
Running this m-file in the MATLAB command window, you will get plot shown below.
This plot shows that the derivative controller reduced both the overshoot and the settling time, and
had small effect on the rise time and the steady-state error.
Proportional-Integral-Derivative control
Now, let's take a look at a PID controller. The closed-loop transfer function of the given system
with a PID controller is:
𝑑
2
𝑝
𝑖
3
𝑑
2
𝑝
𝑖
After several trial and error runs, the gains Kp=350, Ki=300, and Kd=50 provided the desired
response. To confirm, enter the following commands to an m-file.
Kp=350;
Ki=300;
Kd=50;
num=[Kd Kp Ki];
den=[1 10+Kd 20+Kp Ki];
t=0:0.01:2;
step(num,den,t)
Running this m-file in the Matlab command window, you will get plot shown below.
Now, we have obtained the system with no overshoot, fast rise time, and no steady-state error.