0% found this document useful (0 votes)
0 views

6.PID Controller

A PID (Proportional-Integral-Derivative) controller is a feedback control system used in industrial applications to minimize error between a measured process variable and a desired set-point by adjusting a manipulated variable. The controller consists of three parameters: proportional (Kp), integral (Ki), and derivative (Kd), each affecting system performance in terms of rise time, overshoot, settling time, and steady-state error. The document also provides examples and tips for designing an effective PID controller to achieve desired system responses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

6.PID Controller

A PID (Proportional-Integral-Derivative) controller is a feedback control system used in industrial applications to minimize error between a measured process variable and a desired set-point by adjusting a manipulated variable. The controller consists of three parameters: proportional (Kp), integral (Ki), and derivative (Kd), each affecting system performance in terms of rise time, overshoot, settling time, and steady-state error. The document also provides examples and tips for designing an effective PID controller to achieve desired system responses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

6.

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

Ki Decrease Increase Increase Eliminate

Kd Small Change Decrease Decrease Small Change

Note that these correlations may not be exactly


accurate, because Kp, Ki, and Kd are dependent of
each other. In fact, changing one of these
variables can change the effect of the other two.
Example
Suppose we have a simple mass, spring, and
damper problem.

The system is to be designed using PID controller .


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
Solution
The modeling equation of this system is:
𝑀𝑥ሷ+ 𝑏𝑥ሶ+ 𝑘𝑥 = 𝐹

Taking the Laplace transform of the modeling


equation:
𝑀𝑠2𝑋(𝑠) + 𝑏𝑠𝑋(𝑠) + 𝑘𝑋(𝑠) = 𝐹(𝑠)

The transfer function between the displacement


X(s) and the input F(s) then becomes:
𝑋(𝑠) 1
=
𝐹(𝑠) 𝑀𝑠2 + 𝑏𝑠+ 𝑘
Let :
• M = 1kg
• b = 10 N.s/m
• k = 20 N/m
• F(s) = 1

Plug these values into the above transfer

𝑋(𝑠) 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)

Running this m-file in the MATLAB command


window should give you the plot shown below.
The steady-state error is 0.95, quite
large indeed. Furthermore, the rise
time is about one second, and the
Let's design a controller that will reduce the rise
time, reduce the settling time, and eliminates the
steady-state error:
Proportional control (P-controller)
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
𝐹(𝑠) 𝑠 + 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)

Running this m-file in the MATLAB command


window should gives you the following plot:
The above plot shows that the
proportional controller reduced both
the rise time and the steady-state
error, increased the overshoot, and
Proportional-Derivative control (PD-controller)
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:
= 2
𝐹(𝑠) 𝑠 + (10 + 𝐾𝑑)𝑠+ (20 + 𝐾𝑝)

Let Kp equals to 300 as before and let Kd equals


10. Enter the following commands into an m-file
and run it in the MATLAB command window.
Kp=300;
Kd=10;
num=[Kd Kp];
den=[1 10+Kd
20+Kp];
t=0:0.01:2;
step (num,den,t)
This plot shows that the derivative
controller reduced both the
overshoot and the settling time,
and had small effect on the rise
Proportional-Integral control (PI-controller)
Before going into a PID control, let's take a look at
a PI control. From the table, we see that an
integral controller (Ki) decreases the rise time,
increases both the overshoot and the settling
time, and eliminates the steady-state error. For
the given system, the closed-loop transfer
function with a PI control is: :
𝑋(𝑠) 𝐾𝑝𝑠+ 𝐾𝑖
= 3
𝐹(𝑠) 𝑠 + 10𝑠2 + ൫20 + 𝐾𝑝൯𝑠+ 𝐾𝑖
Let's reduce the Kp to 30, and let Ki equals to 70.
Create an new m-file and enter the following
commands.
Kp=30;
Ki=70;
num=[Kp Ki];
den=[1 10 20+Kp
Ki];
t=0:0.01:2;
step (num,den,t)

Run this m-file in the MATLAB command


window, and you should get the following plot.
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
Proportional-Integral-Derivative control (PID)
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
𝐹(𝑠) 𝑠 + (10 + 𝐾𝑑)𝑠2 + ൫20 + 𝐾𝑝൯𝑠+ 𝐾𝑖
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 and run it in the command
window. You should get the following step
response.
Ki=300;
Kd=50;
num=[Kd Kp Ki];
den=[1 10+Kd
20+Kp Ki];
t=0:0.01:2;
step (num,den,t)
Now, we have obtained the system
with no overshoot, fast rise time, and
no steady-state error.
General 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
2. Add a proportional control to improve the rise time
3. Add a derivative control to improve the overshoot
4. Add an integral control to eliminate the steady-
state error
5. Adjust each of Kp, Ki, and Kd until you obtain a
desired overall response.

You might also like