6.PID Controller
6.PID Controller
PID Controller
6.1 Introduction
A Proportional – Integral - Derivative (PID)
controller is a control loop feedback controller
widely used in industrial control systems.
A PID controller calculates an error value as the
difference between a measured process variable
and a desired set-point. The controller attempts
to minimize the error by adjusting the process
through use of a manipulated variable.
The PID controller algorithm involves three
separate constant parameters, and is accordingly
sometimes called three-term control:
the proportional, the integral and derivative
values, denoted P, I, and D.
P depends on the present error,
I on the accumulation of past errors, and
D is a prediction of future errors
Some applications may require using only one or
two actions to provide the appropriate system
control. This is achieved by setting the other
parameters to zero. A PID controller will be called
a PI, PD, P or I controller in the absence of the
respective control actions.
6.2 PID Structure
Consider the simple system shown in Figure
below:
R(s) E(s) U(s) Y(s)
+
PID Plant
_
PV
The transfer function of the PID controller looks
like the following:
𝐾𝑖 𝐾𝑑𝑠2 + 𝐾𝑝𝑠+ 𝐾𝑖
𝐾𝑝 + + 𝐾𝑑𝑠 =
𝑠 𝑠
The error signal will be sent to the PID controller,
and the controller computes both the derivative
and the integral of this error signal. The signal
(U(s)) just past the controller is now equal to the
proportional gain (Kp) times the magnitude of the
error plus the integral gain (Ki) times the integral
of the error plus the derivative gain (Kd) times the
derivative of the error.
𝑑𝑒
𝑢ሺ 𝑡ሻ = 𝐾𝑝𝑒+ 𝐾𝑖 න 𝑒𝑑𝑡 + 𝐾𝑑
𝑑𝑡
This signal (u) will be sent to the plant, and the
new output (Y) will be obtained. This new
output (Y) will be sent back to the sensor again
to find the new error signal (e). The controller
takes this new error signal and computes its
derivative and its integral again. This process
goes on and on.
6.3 The characteristics of P, I, and D controllers
• A proportional controller (Kp) will have the
effect of reducing the rise time and will
reduce ,but never eliminate, the steady-state
error.
• An integral control (Ki) will have the effect of
eliminating the steady-state error, but it may
make the transient response worse.
• A derivative control (Kd) will have the effect of
reducing the overshoot, and improving the
transient response.
Effects of each of controllers Kp, Kd, and Ki on a
closed-loop system are summarized in the table
shown below.
Controller Rise Time Overshoot Settling Time Steady state
Error
Kp Decrease Increase Small Change Decrease
𝑋(𝑠) 1
function :
= 2
𝐹(𝑠) 𝑠 + 10𝑠+ 20
Open-loop step response
Let's first view the open-loop step response.
Create a new m-file and add in the following
code:
num=1;
den=[1 10 20];
step (num,den)
𝑋(𝑠) 𝐾𝑝
= 2
𝐹(𝑠) 𝑠 + 10𝑠+ (20 + 𝐾𝑝)
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)
𝑋(𝑠) 𝐾𝑑𝑠+ 𝐾𝑝
is:
= 2
𝐹(𝑠) 𝑠 + (10 + 𝐾𝑑)𝑠+ (20 + 𝐾𝑝)