Control Systems Lect. 4 PID
Control Systems Lect. 4 PID
Lect. 4 PID
Basil Hamed
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.
Basil Hamed 2
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
Basil Hamed 3
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.
Basil Hamed 4
Various Controller Configurations
Basil Hamed 5
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.
Basil Hamed 6
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)
Basil Hamed 7
PID
• One of the commonly used controllers in the compensation
schemes is a PID controller
• PID applies a signal to the process that is proportional to the
actuating signal in addition to adding integral and derivative of
the actuating signal.
• These signal components are easily realized and visualized in
the time domain, PID controllers are commonly designed
using time-domain methods.
Basil Hamed 8
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..
Basil Hamed 9
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
Basil Hamed 10
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.
Basil Hamed 12
PID Block Diagram
Basil Hamed 13
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}
Basil Hamed 14
Four Modes of Controllers
Four modes of control commonly used for most
applications are:
Proportional (P)
Proportional plus Reset (PI)
Proportional plus Rate (PD)
Proportional plus Reset plus Rate (PID)
Basil Hamed 15
Four Modes of Controllers
Basil Hamed 16
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
Basil Hamed 20
PI Equations
Basil Hamed 22
PI Control
Basil Hamed 23
PD Controller
Basil Hamed 25
PD Controller
Basil Hamed 26
PID Controller
Basil Hamed 27
PID Controller Characteristics
Basil Hamed 28
Design of PID Controllers
• Based on the knowledge of P, I and D
– trial and error
– manual tuning
– simulation
Basil Hamed 30
Example Problem
The modeling equation of this system is
The transfer function between the displacement and the input then
becomes
Let
M = 1 kg b = 10 N s/m k = 20 N/m F = 1 N
Plug these values into the above transfer function
Basil Hamed 31
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
Basil Hamed 32
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
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 closed-loop transfer
function of the given system with a PD controller is: Kd s Kp
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
Kd=10
To: Y(1)
0.6 Kd=20
Amplitude
t=0:0.01:2;
0.6
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 the settling
Time (sec.)
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 10 s ( 20 Kp ) s Ki
Kp=30; Step Response
From: U(1)
Ki=70;
1.4
Step Response
From: U(1)
1.4
1.2
num=[Kp Ki]; 1
1.2
Ki=100
A m plitude
0.8
T o: 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
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
Basil Hamed 37
Proportional-Integral-Derivative(PID) Control
• For control over steady-state and transient errors we can
combine all three control strategies we have discussed is PID
control.
• PID combination is sometimes able to provide an acceptable
degree of error reduction simultaneously with stability and
damping.
Basil Hamed 38
PID by MATLAB Implement Example
• Consider a system with transfer function
T=10K/[(1*2)s^2+ (1+2)s+1+AK]
Change it manually
Step Response
1.5
Amplitude
0.5
0
0 0.003 0.006 0.009 0.012 0.015 0.018
Time (sec.)
Basil Hamed 39
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]
Basil Hamed 40
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
Basil Hamed 41
Tuning a PID
There is a fairly standard procedure for tuning PID controllers:
• Trial and Error Tuning
• Automatic PID Tuning
• Ziegler and Nichols Tuning
• Cohen-Coon Tuning
Basil Hamed 42
Trial and Error Tuning
Basil Hamed 43
Automatic PID Tuning
MATLAB provides tools for automatically choosing optimal PID
gains which makes the trial and error process described above
unnecessary. You can access the tuning algorithm directly using
pidtune or through a nice graphical user interface (GUI) using
pidtool.
Basil Hamed 44
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
Basil Hamed 45
Ziegler-Nichols Open-Loop Tuning Method or 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.
Basil Hamed 46
Ziegler-Nichols Open-Loop Tuning Method or Process
Reaction Method
To use the Ziegler-Nichols open-loop tuning method, you must perform the
following steps:
1. Make an open loop step test
2. From the process reaction curve determine the transportation lag =L or
dead time= td, the time constant or time for the response to change =
Basil Hamed 47
Ziegler-Nichols Open-Loop Tuning Method or Process
Reaction Method
Basil Hamed 48
Ziegler-Nichols Open-Loop Tuning Method or Process
Reaction Method
Basil Hamed 49
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;
Basil Hamed 50
4
3 5
Basil Hamed 51
Step Response
1.5
y(t)
0.5
0
0 1 2 3 4 5 6 7 8 9 10
t
Basil Hamed 52
Ziegler-Nichols closed-loop tuning method
• The Ziegler-Nichols closed-loop tuning method allows you to use the
ultimate gain value, Ku, and the ultimate period of oscillation, Pu, to
calculate K . It is a simple method of tuning PID controllers and can be
refined to give better approximations of the controller. You can obtain the
controller constants K , Ti , and Td in a system with feedback. The Ziegler-
Nichols closed-loop tuning method is limited to tuning processes that cannot
run in an open-loop environment
Basil Hamed 53
Ziegler-Nichols closed-loop tuning method
Basil Hamed 54
Z.-N. Tuning of PID Regulators Method
Two
Based on a
stability
boundary
Basil Hamed 55
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.
Basil Hamed 56
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
Basil Hamed 57
Worked out Example
Basil Hamed 58
Numerical Example
Consider a plant with a model given by
Basil Hamed 60
Example
Ku = 8 and Pu =3.62
Basil Hamed 61
Example
Basil Hamed 62
General comments about controller tuning
The different methodologies of 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
Basil Hamed 63
General Comments about Controller Tuning
Basil Hamed 64
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.
Basil Hamed 65