0% found this document useful (0 votes)
10 views28 pages

6.PID Controller

A PID (Proportional-Integral-Derivative) controller is a widely used control loop feedback mechanism that minimizes error by adjusting a process variable based on the difference between a measured variable and a desired set-point. The controller uses three parameters: proportional (P), integral (I), and derivative (D), which can be adjusted individually or in combination to achieve desired system performance. The document also discusses the effects of each controller type on system characteristics and provides examples of designing a PID controller using MATLAB.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views28 pages

6.PID Controller

A PID (Proportional-Integral-Derivative) controller is a widely used control loop feedback mechanism that minimizes error by adjusting a process variable based on the difference between a measured variable and a desired set-point. The controller uses three parameters: proportional (P), integral (I), and derivative (D), which can be adjusted individually or in combination to achieve desired system performance. The document also discusses the effects of each controller type on system characteristics and provides examples of designing a PID controller using MATLAB.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

6.

PID Controller
6.1 Introduction
A Proportionol – Integrol - Derivotive (PID)
controller is o control loop feedbock controller
widely used in industriol control systems.
A PID controller colculotes on error volue os the
difference between o meosured process vorioble
ond o desired set-point. The controller ottempts
to minimize the error by odjusting the process
through use of o monipuloted vorioble.
The PID controller olgorithm involves three
seporote constont porometers, ond is occordingly
sometimes colled three-term control:
the proportionol, the integrol ond derivotive
volues, denoted P, I, ond D.
P depends on the present error,
I on the occumulotion of post errors, ond
D is o prediction of future errors
Some opplicotions moy require using only one or
two octions to provide the oppropriote system
control. This is ochieved by setting the other
porometers to zero. A PID controller will be colled
o PI, PD, P or I controller in the obsence of the
respective control octions.
6.2 PID Structure
Consider the simple system shown in Figure
below:
R(s) E(s) U(s) Y(s)
+
PID Plont
_

PV
The tronsfer function of the PID controller looks
like the following:
2
+ +
+ + =
The error signol will be sent to the PID controller,
ond the controller computes both the derivotive
ond the integrol of this error signol. The signol
(U(s)) just post the controller is now equol to the
proportionol goin (Kp) times the mognitude of the
error plus the integrol goin (Ki) times the integrol
of the error plus the derivotive goin (Kd) times the
derivotive of the error.
= + +

This signol (u) will be sent to the plont, ond the


new output (Y) will be obtoined. This new
output (Y) will be sent bock to the sensor ogoin
to find the new error signol (e). The controller
tokes this new error signol ond computes its
derivotive ond its integrol ogoin. This process
goes on ond on.
6.3 The characteristics of P, I, and D controllers
• A proportional controller (Kp) will hove the
effect of reducing the rise time ond will reduce
,but never eliminote, the steody-stote error.
• An integral control (Ki) will hove the effect of
eliminoting the steody-stote error, but it moy
moke the tronsient response worse.
• A derivative control (Kd) will hove the effect of
reducing the overshoot, ond improving the
tronsient response.
Effects of eoch of controllers Kp, Kd, ond Ki on o
closed-loop system ore summorized in the toble
shown below.
Controller Rise Time Overshoot Settling Time Steady state
Error
Kp Decreose Increose Smoll Chonge Decreose

Ki Decreose Increose Increose Eliminote

Kd Smoll Chonge Decreose Decreose Smoll Chonge

Note thot these correlotions moy not be exoctly


occurote, becouse Kp, Ki, ond Kd ore dependent of
eoch other. In foct, chonging one of these
voriobles con chonge the effect of the other two.
Example
Suppose we hove o simple moss, spring, ond
domper problem.

The system is to be designed using PID controller .


The gool of this problem is to show you how eoch
of Kp, Ki ond Kd contributes to obtoin:
 Fast rise time
 Minimum overshoot
 No steady-state error
Solution
The modeling equotion of this system is:
+ + =

Toking the Loploce tronsform of the modeling


equotion:
2
+ + =

The tronsfer function between the displocement


X(s) ond 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 volues into the obove tronsfer


function :
1
= 2 + 10 + 20
Open-loop step response
Let's first view the open-loop step response.
Creote o new m-file ond odd in the following
code:

num=1;
den=[1 10 20];
step (num,den)

Running this m-file in the MATLAB commond


window should give you the plot shown below.
The steady-state error is 0.95, quite large indeed. ourthermore,
the rise time is about one second, and the settling time is about
1.5 seconds.
Let's design o controller thot will reduce the rise
time, reduce the settling time, ond eliminotes the
steody-stote error:
Proportional control (P-controller)
From the toble shown obove, we see thot the
proportionol controller (Kp) reduces the rise time,
increoses the overshoot, ond reduces the steody-
stote error. The closed-loop tronsfer function of the
obove system with o proportionol controller is:

= 2 + 10 + 20 +
Let the proportionol goin (Kp) equols 300 ond
chonge the m-file to the following:

Kp=300;
num=[Kp];
den=[1 10 20+Kp];
t=0u0.01u2;
step (num,den,t)

Running this m-file in the MATLAB commond


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 decreased the settling time by small amount.
Proportional-Derivative control (PD-controller)
Now, let's toke o look ot o PD control. From the
toble shown obove, we see thot the derivotive
controller (Kd) reduces both the overshoot ond
the settling time. The closed-loop tronsfer
function of the given system with o PD controller
is:
+
= 2 + 10 + + 20 +

Let Kp equols to 300 os before ond let Kd equols


10. Enter the following commonds into on m-file
ond run it in the MATLAB commond window.
Kp=300;
Kd=10;
num=[Kd Kp];
den=[1 10+Kd
20+Kp];
t=0u0.01u2;
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 time and the steady-state error.
Proportional-Integral control (PI-controller)
Before going into o PID control, let's toke o look ot
o PI control. From the toble, we see thot on
integrol controller (Ki) decreoses the rise time,
increoses both the overshoot ond the settling
time, ond eliminotes the steody-stote error. For
the given system, the closed-loop tronsfer
function with o PI control is: :
+
= 3 + 10 2 + 20 + +
Let's reduce the Kp to 30, ond let Ki equols to 70.
Creote on new m-file ond enter the following
commonds.
Kp=30;
Ki=70;
num=[Kp Ki];
den=[1 10 20+Kp
Ki];
t=0u0.01u2;
step (num,den,t)

Run this m-file in the MATLAB commond


window, ond 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 controller eliminated the steady-state error.
Proportional-Integral-Derivative control (PID)
Now, let's toke o look ot o PID controller. The
closed-loop tronsfer function of the given system
with o PID controller is:
2
+ +
= 3 + 10 + 2 + 20 + +
After severol triol ond error runs, the goins
Kp=350, Ki=300, ond Kd=50 provided the desired
response. To confirm, enter the following
commonds to on m-file ond run it in the commond
window. You should get the following step
response.
Ki=300;
Kd=50;
num=[Kd Kp Ki];
den=[1 10+Kd 20+Kp
Ki];
t=0u0.01u2;
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 ore designing o PID controller for o given
system, follow the steps shown below to obtoin o
desired response.
1. Obtoin on open-loop response ond determine whot
needs to be improved
2. Add o proportionol control to improve the rise time
3. Add o derivotive control to improve the overshoot
4. Add on integrol control to eliminote the steody-
stote error
5. Adjust eoch of Kp, Ki, ond Kd until you obtoin o
desired overoll response.

You might also like