CS Lect. 4 PID helping material
CS Lect. 4 PID helping material
Aasar Ahmad
2 Design Specifications
• often use design specifications to describe what the
system should do and how it is done.
• These specifications are unique to each individual
application and often include specifications about relative
stability, steady-state accuracy (error), transient-
response characteristics
• In some applications there may be additional
specifications on sensitivity to parameter variations, that
is, robustness, or disturbance rejection.
Aasar Ahmad
3 Design Specifications
• The design of linear control systems can be carried out in
either the time domain or the frequency domain.
• For instance, steady-state accuracy is often specified with
respect to a step input, a ramp input, or a parabolic input,
and the design to meet a certain requirement is more
conveniently carried out in the time domain.
• Other specifications such as maximum overshoot, rise time,
and settling time are all defined for a unit-step input and,
therefore, are used specifically for time-domain design
Aasar Ahmad
4 Design Specifications
• Thus, the choice of whether the design should be
conducted in the time domain or the frequency domain
depends often on the preference of the designer.
• We should be quick to point out, however, that in most
cases, time-domain specifications such as maximum
overshoot, rise time, and settling time are usually used
as the final measure of system performance.
Aasar Ahmad
5 Various Controller Configurations
Aasar Ahmad
6 Fundamental Principles of Design
• After a controller configuration is chosen, the designer must
choose a controller type that, with proper selection of its element
values, will satisfy all the design specifications.
• Engineering practice usually dictates that one choose the simplest
controller that meets all the design specifications.
• In most cases, the more complex a controller is, the more it costs,
the less reliable it is, and the more difficult it is to design.
• Choosing a specific controller for a specific application is often
based on the designer's past experience and sometimes intuition,
and it entails as much art as it does science.
Aasar Ahmad
7 PID
This chapter examines a particular control structure that has become almost universally
used in industrial control. It is based on a particular fixed structure controller family, the so-
called PID controller family. These controllers have proven to be robust and extremely
beneficial in the control of many important applications.
PID stands for: P (Proportional)
I (Integral)
D (Derivative)
Aasar Ahmad
PID
8
Aasar Ahmad
9 Historical Note
• PID control is one of the earlier control strategies
• Early feedback control devices used the ideas of
proportional, integral and derivative action in their
structures.
• Its early implementation was in pneumatic devices,
followed by vacuum and solid state analog
electronics, before arriving at today’s digital
implementation of microprocessors..
Aasar Ahmad
10 Historical Note
• It has a simple control structure which was
understood by plant operators and which they found
relatively easy to tune.
• According to a survey for process control systems
conducted in 1989, more than 95 of the control loops
were of the PID type
Aasar Ahmad
Why PID Control
• Simple, easy to use
• Wide Application: Petrochemical, Pharmaceuticals, Food,
Chemical, Aerospace and Semiconductor, etc.
• Robust: Insensitive to changes to plant parameter and
disturbance.
Aasar Ahmad
13 PID Block Diagram
Aasar Ahmad
14 PID Mathematically
Consider the input error variable, e(t):
Let p(t) = Kp*e(t) {p proportional to e }
Let i(t) = Ki* ∫e(t)dt {i integral of e }
Let d(t) = Kd* de(t)/dt {d derivative of e}
Aasar Ahmad
15 Four Modes of Controllers
Aasar Ahmad
16 Four Modes of Controllers
Aasar Ahmad
Tips for Designing a PID Controller
When you are designing a PID controller for a given system, follow the steps shown
below to obtain a desired response.
1. Obtain an open-loop response and determine what needs to be improved
Aasar Ahmad
21 PI Equations
Aasar Ahmad
23 PI Control
Aasar Ahmad
24 PD Controller
Aasar Ahmad
26 PD Controller
Aasar Ahmad
27 PID Controller
Aasar Ahmad
28 PID Controller Characteristics
Aasar Ahmad
29 Design of PID Controllers
Aasar Ahmad
31 Example Problem
The modeling equation of this system is
Aasar Ahmad
32 Example Problem
The goal of this problem is to show you how each of kp, ki , and kd
contributes to obtain
• Fast rise time
• Minimum overshoot
• No steady-state error
Aasar Ahmad
Open-Loop Control - Example
num=1; 1
den=[1 10 20];
G( s )
2
step(num,den) s 10s 20
num=[Kp];
Step Response
1.2 From: U(1)
1
0.8
Amplitude
0.8
t=0:0.01:2;
To: Y(1)
0.7
0.6
K=300 0.6
Amplitude
step(num,den,t)
To: Y(1)
K=100
0.5
0.4
0.4
0.2
0.3
0 0.2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec.)
Proportional - Derivative - Example
Now, let's take a look at a PD control. From the table shown above, we see that the
derivative controller (Kd) reduces both the overshoot and the settling time. The
Kd s Kp
closed-loop transfer function of the given system with a PD controller is:
T( s )
Kp=300; 2
s ( 10 Kd ) s ( 20 Kp )
Step Response
From: U(1)
1.4
Kd=10; 1
Step Response
From: U(1)
1.2
num=[Kd Kp]; 1
0.9
0.8
0.8 0.7
To: Y(1)
Amplitude
0.6
t=0:0.01:2;
To: Y(1)
0.5
0.4 0.4
step(num,den,t) 0.2
0.3
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0.1
Time (sec.) 0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
This plot shows that the derivative controller reduced both the overshoot and
Time (sec.)
the settling time, and had a small effect on the rise time and the steady-state
error
Proportional - Integral - Example
The integral controller (Ki) decreases the rise time, increases both the overshoot
and the settling time, and eliminates the steady-state error
Kp s Ki
T( s )
MATLAB Example 3 2
s 10s ( 20 Kp ) s Ki
Kp=30; Step Response
From: U(1)
1.4
Ki=70; 1.2
1.4
Step Response
From: U(1)
num=[Kp Ki]; 1
1.2
Ki=70
Amplitude
Ki=100
Amplitude
0.8
To: Y(1)
0.6
t=0:0.01:2; 0.4
0.6
0.4
step(num,den,t) 0.2
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
Time (sec.) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec.)
We have reduced the proportional gain (Kp) because the integral controller also
reduces the rise time and increases the overshoot as the proportional controller
does (double effect). The above response shows that the integral controller
eliminated the steady-state error
37
Proportional-Integral-Derivative Example
Now, let's take a look at a PID controller. The closed-loop transfer function of the
given system with a PID controller is:
After several trial and error runs, the gains Kp = 350, ki = 300, and kd = 50 provided the
desired response
Aasar Ahmad
Proportional-Integral-Derivative(PID) Control
38
Aasar Ahmad
39 PID by MATLAB Implement Example
• Consider a system with transfer function
T=10K/[(1*2)s^2+ (1+2)s+1+AK]
Step Response
Change it manually 1.5
Amplitude
0.5
0
0 0.003 0.006 0.009 0.012 0.015 0.018
Time (sec.)
Aasar Ahmad
40 PID by MATLAB Implement Example 2
• Consider a system with transfer function
T=(K*S+Ki)/[S^3+ 3*S^2+(2+K)*S+Ki]
Aasar Ahmad
41
step response
1.4
1.2
y(t) 0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
t
Aasar Ahmad
42 Tuning a PID
Aasar Ahmad
43
Trial and Error Tuning
Aasar Ahmad
44
Automatic PID Tuning
Aasar Ahmad
45 Ziegler-Nichols Tuning of PID
Regulators
• J. G. Ziegler and N. B. Nichols recognized that the step
responses of a large number of processes control
systems exhibits a process reaction curve
• Ziegler & Nichols gave two methods for tuning the
controller
• Open-Loop Tuning Method or Process Reaction Method
• Based on a stability boundary
Aasar Ahmad
Ziegler-Nichols Open-Loop Tuning Method or
46
Process Reaction Method
This method remains a popular technique for tuning controllers that
use proportional, integral, and derivative actions. The Ziegler-Nichols
open-loop method is also referred to as a process reaction method,
because it tests the open-loop reaction of the process to a change in
the control variable output. This basic test requires that the response
of the system be recorded, preferably by a plotter or computer. Once
certain process response values are found, they can be plugged into
the Ziegler-Nichols equation with specific multiplier constants for the
gains of a controller with either P, PI, or PID actions.
Aasar Ahmad
Ziegler-Nichols Open-Loop Tuning Method or Process
47
Reaction Method
Aasar Ahmad
Ziegler-Nichols Open-Loop Tuning Method or Process
48 Reaction Method
Aasar Ahmad
Ziegler-Nichols Open-Loop Tuning Method or Process
49
Reaction Method
Aasar Ahmad
50 Sample of MATLAB Implement
Consider a system with transfer function
T=2/[(S+2)*(0.18*S^2+0.6*S+1)]
With L=0.38;R=1;
Aasar Ahmad
4
51
2
3 5
Aasar Ahmad
52
Step Response
1.5
y(t)
0.5
0
0 1 2 3 4 5 6 7 8 9 10
t
Aasar Ahmad
Ziegler-Nichols
53
closed-loop tuning method
Aasar Ahmad
Ziegler-Nichols
54
closed-loop tuning method
Aasar Ahmad
55 Z.-N. Tuning of PID Regulators
Method Two
Based on a
stability
boundary
Aasar Ahmad
56 Worked out Example
Problem
You're a controls engineer working for Flawless Design company when
your optimal controller breaks down. As a backup, you figure that by
using coarse knowledge of a classical method, you may be able to
sustain development of the product. After adjusting the gain to one set
of data taken from a controller, you find that your ultimate gain is
4.3289.
From the adjusted plot below, determine the type of loop this graph
represents; then, please calculate K, Ti, and Td for all three types of
controllers.
Aasar Ahmad
57 Worked out Example
Solution
From the fact that this graph oscillates
and is not a step function, we see that
this is a closed loop. Thus, the values
will be calculated accordingly.
We're given the Ultimate gain, Ku =
4.3289. From the graph below, we see
that the ultimate period at this gain is
Pu = 6.28
Aasar Ahmad
58 Worked out Example
Aasar Ahmad
Numerical Example
Consider a plant with a model given by
Find the parameters of a PID controller using the Z-N oscillation method. Obtain a graph of
the response to a unit step input reference and to a unit step.
60 Example
Aasar Ahmad
61 Example
Ku = 8 and Pu =3.62
Aasar Ahmad
62 Example
Aasar Ahmad
63 General comments about
The differentcontroller
methodologies oftuning
controller tuning, known as Ziegler-Nichols
method have been illustrated. It is to be remembered that the
recommended settings are obtained from extensive experimentation with
number of different processes; there is no theoretical basis behind these
selections. As a result, a better combination of the P, I, D values may always
be found, that will give less oscillation and better settling time. But with no
a-priori knowledge of the system, it is always advisable to perform the
experimentation and select the controller settings, obtained from Ziegler-
Nichols method. But there is always scope for improving the performance of
the controller by fine-tuning. So, Ziegler-Nichols method provides initial
settings that will give satisfactory, result, but it is always advisable to fine-
tune the controller further for the particular process and better performance
is expected to be achieved
Aasar Ahmad
64 General Comments about
Controller Tuning
Nowadays digital computers are replacing the
conventional analog controllers. P-I-D control actions are
generated through digital computations. Digital outputs
of the controllers are converted to analog signals before
they are fed to the actuators. In many cases,
commercial software are available for Auto tuning the
process.
Aasar Ahmad
65 General Comments about Controller
Tuning
a) Why is the proportional gain Kp for PI control is less than the
value for P-only control?
b) Why Kp for PID control is more than that PI?
Solution
c) Addition of integral control action to P-only control tends to
make the closed loop system more oscillatory; in order to
overcome this problem, the suggested value of Kp with ZN
tuning is reduced.
d) Addition of derivative action again damps down the oscillation;
as a result larger value of Kp in a PID controller is permissible.
Aasar Ahmad