Académique Documents
Professionnel Documents
Culture Documents
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
SEVENTH SEMESTER
CONTROL SYSTEMS
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Name: ____________________________________________
Semester: _________________________________________
Batch: ____________________________________________
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
C ONTENTS
CONTENTS
1
INTRODUCTION TO MATLAB BASICS IN CONTROL SYSTEM
2
MATHEMATICAL MODELS
3
LTI MODELS
4
LTI MODELS (USING BLOCK DIAGRAM)
5
OPERATIONS ON LTI MODELS
6
STABILITY
7
STATE SPACE ANALYSIS
8
SIMULINK BASICS
9
STATE VARIABLE MODELS
10
STEADY STATE AND PERFORMANCE ANALYSIS
11 TRANSIENT RESPONSE & GAIN EFFECT
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 01
INTRODUCTION TO MATLAB BASICS IN CONTROL SYSTEM
OBJECTIVE
PROCEDURE
MATLAB is usually used in a command driven mode. When single line commands are
MATLAB processes these commands immediately and displays the result. MATLAB is
entered,
capable of executing sequences of commands that are stored in
also
files.
Que: What is the output of the following statements
Ans:
a=10?
MATRIX
In MATLAB, the basics computational unit is the matrix. Vectors and scalars are special cases
matrices. Matrix dimensions must be compatible for matrix
of
operations.
Que: >>a=[1 2 3;4 5
6]; >>b=[2 2 2;3 3 3];
>>c=[4 3 2;1 0 2;7 2
What is the output of
1];
command>>d=a+b?
Ans:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Que: When>>a*b?
Ans:
PLOT A FUNCTION
Que: Following statements are used to generate a sinusoidal function with 50Hz
>>t=0:0.002:0.04
frequency
;>>y=sin(2*pi*50*t)
;>>Plot(t,y)
;>>grid;
>>xlable(‘time(s)’)
;>>ylabel(‘y’)
;Title(‘sin(2*pi*50*t)’)
;The plot shows 10 values in one cycle how can you do to have 100 values in one
Ans:
cycle?
Que: The following statements are used to plot three phase voltage at
50Hz?
>>t=0:0.0002:0.04
;>>y1=sin(2*pi*50*t)
;>>y2=sin(2*pi*50*t-
>>
2*pi/3);
>>figure
y2=sin(2*pi*50*t+2*pi/3);
;>>hold;
>>plot(t,y1,’r’)
;>>
>>
plot(t,y2,’b’);
>>grid;
plot(t,y3,’g’);
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Sketch the
plot?
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 02
MATHEMATICAL MODELS
OBJECTIVE
PROCEDURE
SECTION 1
R= 1Ω
R= 1Ω R= 1Ω
V=5v
R= 1Ω R= 1Ω
Loop-1:
Loop-2:
Loop-3:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Write all the matrices required to calculate I1, I2 and I 3. Use Cramer’s
rule.
∆=
I1 = I2 = I3=
Matrix representation can be used for the loop equations of the circuit
above as IR=V, where R is the resistance matrix, I is the current matrix and V is
shown
voltage matrix. Once these matrices are declared, currents can be calculated
the
I=R^-1V.
as Once all the matrices are defined, enter the following
Command.
MATLAB
I=inv (R)*V
SECTION 2
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Two polynomials (3s^3 + 2s^2 + 1)(s + 4) can be multiplied as shown below and
apolynomial can be evaluated at a given value of the variable
as:
p = [3 2 0 1] ; q = [1
n4 =
] ;conv (p, q);
Multiply (3s^3 + 2s^2 + 1)(s + 4) manually and write the product and list
coefficients in descending powers of
of
s.
Ans:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
What is n and value? Multiply the polynomials p = 3s^3 + 3s^2 +1 and q = s^2 +
m
4 anually and verify that the MATLAB generates a correct product of the
Also verify the value of the resultant polynomial at s =
polynomials.
2.
n= value =
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 03
LTI MODELS
OBJECTIVE
DIAGRAM
x(t)
K
M f(t)
B
STEP RESPONSE
PLOT
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
● Calculate the natural undamped frequency ωn, damping ratio ς, and the
of oscillation ω for each case as shown in the following
frequency
table.
IMPULSE RESPONSE
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 04
OBJECTIVE
To learn how to compute the transfer function from the block diagram of a
system.
To compute the step
response.
To compute the impulse
response.
PROCEDURE
BLOCK DIAGRAM
MATLAB CODE
Derive the transfer function of the above system manually to verify the
generated transfer
MATLAB
function.
numc = [ 1 1] ; denc = [ 1
numg
2 ] ; = [ 1 ] ; deng = [ 500 0
[num1,
0] ; den1] = series (numg, deng, numc,
[num, den] = cloop(num1,
denc);
sys = tf(num,
den1);
den);
Ans:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
STEP RESPONSE
IMPULSE RESPONSE
BLOCK DIAGRAM
X 1 / 5000 S2 X
S+1 / S+2
MATLAB CODE
Derive the transfer function of the above system manually to verify the
generated transfer
MATLAB
function
numg = [ 1 1] ; deng = [ 1
numh
2 ] ; = [ 1 ] ; denh = [ 500 0
[num,
0] ; den] = feedback (numh, denh, numg, deng,
sys = tf(num,
-1);
den);
Ans:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
STEP RESPONSE
IMPULSE RESPONSE
What is the relationship between the real part of the roots, the time constant and
time
settling
?
Ans:
What is the relationship between the imaginary part of the roots and the frequency
oscillations of the step
of
response?
Ans:
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 05
OPERATIONS ON LTI MODELS
OBJECTIVE
Write the code for the section in the dashed lines and also find the value of the output
y
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Write the code for the section in the dashed lines and also find the value of the output
y
The following LTI model interconnection functions are useful for specifying closed-loop
open-loop
and
configurations:
● Feedback puts two LTI models with compatible dimensions in a
configuratio
feedback
n
● Series connects two LTI models in
series.
Write the code for the section in the dashed lines and also find the value of the output
y
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Write the code for the section in the dashed lines and also find the value of the output
y
X S+1 / S+2 X
S+1 / S+2
The syntax
sysd =
where Ts is the sampling period in
c2d(sysc,Ts);
sysc=d2c(sysd)
seconds
;
Example
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
STEP RESPONSE OF H1
STEP RESPONSE OF H2
P = 5 e-3.4S / S + 1
Num={5 ; -2};
Den={[11] ; [1 3]};
P=tf(num,den,’outputdelay’,[3.4 ;
2.7])
Next consider a multi-input, multi output
model
P(s)=[ 5 e-3.4S / S + 1 1 ]
[ -2 e-2.75 / s + 3 e-0.7s/s ]
num={5 , 1; -2 1};
den={[1 1] , 1; [1 3], [1
p=tf(num,den,’iodelay’,[3.4 0 ; 2.7
0]};
0.7]);
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
OUTPUT
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 06
STABILITY
OBJECTIVE
X K S2– S + 1 /
S2– 2S + 1
Ans:
Now determine the closed-loop transfer function using Matlab and verify
the
transfer function you derived in the previous step. Write Matlab commands
calculate the transfer function when
to
K=1.
Ans:
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Find the roots of the characteristic equation for K=1, 2 and 5 and check if the system
stable for these values of the controller
is
gain.
K =1
K=2
K=5
STEP RESPONSE
Sketch the step response of the system for K=1, 2 and 5 in the following space. Label
response
each
properly.
FOR K = 1
FOR K = 2
FOR K = 3
FOR K = 5
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
TRANSFER FUNCTION
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 07
STATE SPACE ANALYSIS
OBJECTIVE
Transfer function.(Mason’s
form)
Signal flow
diagram.
Equation in Matrix
form.
Roots of
equation.
Step response.
Ans:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
ROOTS OF EQUATION
STEP RESPONSE
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Ans:
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
ROOTS OF EQUATION
STEP RESPONSE
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 08
SIMULINK BASICS
OBJECTIVE
To learn about
To observing behavior of different system in
Simulink.
simulink.
PROCEDURE
The simple model consists of three blocks: Step, transfer function, and scope. The step is
asource block from which a step input signal originates. This signal is transferred
the line in the direction indicated by the arrow to the transfer function linear block.
through
transfer function modifies the input signal gives a new signal on the line to the scope.
The
scope is a sink block used to display a signal much like an
The
oscilloscope.
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
BLOCK DIAGRAM
PLOT
RESULT
BLOCK DIAGRAM
PLOT
RESULT
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
PLOT
RESULT
PLOT
RESULT
PLOT
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
RESULT
PLOT
RESULT
C
V
SIMULINK MODEL
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Sketch the
waveform.
SCOPE 1
SCOPE 2
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 09
STATE VARIABLE MODELS
OBJECTIVE
Write matlab command to determine the closed loop transfer function using the
and denominator polynomials.
numerator
5s 2 + 4s 12
G ( s)
s 3 + 11s 2 8s + 15
Ans:
Where the matrices A, B, C and D are the matrices that describe the system. The vectors
and U are the state and input vectors respectively. The vector Y is called output
X
The first equation is called state
vector.
equation.
Transfer function to state space conversion can accomplished using the
function
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
tf2ss
Write matlab command to determine the closed loop transfer function using the
and denominator polynomials.
numerator
s 2 + 10s 9
G ( s)
s 3 + 14s 2 7 s + 15
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Ans:
[A B C D] = tf2ss (NUM,DEN)
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 10
STEADY STATE AND PERFORMANCE ANALYSIS
OBJECTIVE
G(S)=10s+20/s^2+10
The response of this system to a ramp (triangular) input can be observerd using
function as
lsim
follows
MATLAB COMMAND
Numg=[10 20];
Deng=[1 10 0];
Sysg=tf(numg,deng)
;Sys=feedback(sysg,1)
;T=[0:0.1:8.2]’
;V1=[0:0.1:2];v2=[2:-0.1:-2];v3=[-
U=[v1;v2;v3];
2:0.1:0]’;
[y,T]=lsim(sys,u,t)
;plot(T,y,t,u,’..’)
,xlabel(‘Time(sec)’),Ylabel(‘Amplitude’),gri
d
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Find steady state error for ramp input mathematically, using the relation ess=A/Kv
Kv=lim s__0[sG(s)] and ‘A’ is the magnitude of step
Where
input.
Ans:
DC GAIN
The steady state of the system, or simply the dc gain of the system, is determine
evaluating the transfer function of the system at zero frequency I-e the value of s in
by
transfer function must be zero. For example, if a closed loop system is characterized by
the
transfer
the
function.
K n
G(s) = 2
s + 2=+n s n 2
G(s) = 2 = = K
s + 2=+n s n 2 n 2
s=0
Thus ,K is the dc-gain of the
system.
In MATLAB the dc gain of the system can be obtained by using the
dcgain(sys),where ‘sys’ is the transfer function of the
function
system.
Consider the system below, plot the actual output of the open loop system due to a
input
step
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Now construct a unity feedback system as the plant. Plot the actual output of the
loop system due to a step input.
closed-
MATLAB COMMANDS
numg = [2
deng = [1 4 -5 0];
5];
sys=tf(numg,deng)
;t=[0:0.1:8.2]'
;v1=[0:0.1:2]'; v2=[2:-.1:-2]'; v3=[-
u=[v1;v2;v3]
2:.1:0]';
;[y,T]=lsim(sys,u,t)
;figure(1
)plot(T,y,t,u,'--'),xlabel('Time(sec)'),ylabel('Amplitude'),gri
dfigure(2
)
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
step(sys
)
PLOT
Now a construct a unity feedback system shown below ,the error function is determines
the equation and can directly be found from
by
MATLAB.
e(t) = r(t) – y(t)
MATLAB COMMAND
numg=[2 3]
deng=[1 3 6]
sysg=tf(numg,deng
)%Generate unity feedback
syst=feedback(sysg,1
system
)%Dtermine output and time
[out,t]=step(syst)
vectors
;%Determine error
ref=ones(1,length(t))
function
;err=ref-
plot(t,err
out';
)grid on
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
OUTPUT
Both Zeros and poles may affect the system response, but the dominant poles are the one
have significant amount of impact on system
who
response.
For the following transfer
function
G(s)=62.5(s+2.5)/(s^2+6s+25)
(s+6.25)
Write MATLAB commands to find poles and
zeros.
Ans:
Plot poles and zeros in s-plane. What is the command that will be
used?
Ans:
Again find step response and values of % Overshoot and settling time for
approximated system.(you can use step(sys1,sys2) for comparison of
the
responses)
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 11
TRANSIENT RESPONSE & GAIN EFFECT
OBJECTIVE
STEP RESPONSE
steady
steady state
state=
error=
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Obtain the step response of this close loop unity feedback system and also determind
overshoot and steady state
the
error.
G(s)=100/s(s+15
)
Ans:
STEP RESPONSE
percentage
steady state
overshoot=
error=
CLOSED LOOP TRANSFER FUNCTION
For k=1
clear
k=1
all
a=1
num=[10*k]
den=[1 20 k]
y=tf(num,den
s) ys=feedback(y,1
)step(sys
)title('step responce for
k=1')
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
STEP RESPONSE
For k=10;
clear
clc
all
k=10
a=1
num=[10*k]
den=[1 20 k]
y=tf(num,den
)sys=feedback(y,1
)step(sys
)title('step responce for k=10')STEP
RESPONSE
For k=100;
clear
clc
all
k=100
a=1
num=[10*k]
den=[1 20 k]
y=tf(num,den
)sys=feedback(y,1
)step(sys
)title('step responce for
k=100')
STEP RESPONSE
K Steady
Overshoot
state error Setting Time
1 (sec)
10
100
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
OBSERVATION
As the value of K is increases Overshoot percentage is also increasing and setting time
decreasing and steady state error is
is
same
UNITY FEEDBACK SYSTEM
When k=2,a=1 find the steady state value of y(t) and also find Ts at
2%.
Code:
STEP RESPONSE
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
clear
k=2
all
k0=2
k1=20
a=1
num=[10]
den=[1 10]
y1=tf(num,den
)num1=[k0 k1]
den1=[1 0]
y2=tf(num1,den1
)y=y1*y2
sys=feedback(y,1
)step(sys
)title(‘Proportional Integral
Controller’)
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
STEP RESPONSE
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 12
TIME DOMAIN INTERPRETATION OF PD, PI, PID
CONTROLLER
OBJECTIVE
To observe the effect of different controllers on Rise time, overshoot, settling time
steady state
and
error.
PROCEDURE
Note that these correlations are not Exactly accurate, because Kp,Ki,Kd are related to
other. Changing one of these variables can change the effect of the other two. For
each
reason, the table should only be used, as a reference when you are determining the
this
for ki,Kp and Kd by trial &
values
error.
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
Many PID controllers are designed by the trial & error selection of the variables kp.Ki
kd. There are some rules of thumb that you can consult to determine good values to
and
from; see your controls book for some explanations of these
start
Suppose we have a second-order plant transfer
recommendations.
function;
_____1_______
s^2+10s+20
The Dc gain of the plant transfer function is 1/20, so 0.05 is the final value of the
for a unit step input. This corresponds to a steady –state error of 0.95, quite large
output
Furthermore, the rise time is about one second, and the settling time is about 1.5
indeed.
Most likely, the response will not be adequate. Therefore, we need to add some
seconds.
control.
PROPORTIONAL CONTROL
From the chart above we see that kp will help us to reduce the steady-state error. Let’s
add a proportional controller into the
first
system.
Num=1;
Den=[1 10 20];
Kp=10;
[numCL,denCL]=cloop(kp*num,den,-
t=0:0.01:2
1);
;step(numCL,denCL,t)
OUTPUT
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
It should also be noted that it is not a good idea to use proportional control to reduce
steady-state
the error, because you will never be able to eliminate the error completely.
fact will become evident
This
Now, the rise time has been reduced and the steady-state error is smaller, if we use
below.
Kp, the rise time and steady-state error will become even smaller Change the
greater
This time we see that the rise time is now about 0.1 second and the steady-state error
Kp=500.
much smaller. But the overshoot has gotten very
is
large.
PD CONTROL
The rise time is now probably satisfactory (rise time is about 0.1 second).Now let’s add
aderivative controller to the system to see if the overshoot can be reduced. Add
variable, Kd, to them-file, set it equal to 10 and return them-
another
file:
Kp=500;
Kd=10;
Numc=[Kd Kp];
[numCL,denCL]=cloop(conv(num,den),den)
;step(numCL,denCL,t)
OUTPUT
The overshoot is much less then before. it is now only twenty percent instead of
forty-five percent. we can now try improve that even more. Try increasing Kd to 100,
almost
will see the overshoot eliminated
you
We now have a system with a fast rise time and ni overshoot. Unfortunately, there is
completely.
about a 5 percent steady-state error. It would seem that a PD controller is not
still
for this system. Let’s try a PI controller
satisfactory
instead.
PI CONTROL
As we have seen, proportional control will reduce the steady-state error, but at the cost
larger overshoot. Furthermore, proportional gain will never completely eliminate
of
steady-state error .For that we need to try integral control. Let’s implement a PI
the
and start with a small
controller
ki.
Kp=500;
Ki=1;
Kd=0;
Numc[Kd Kp Ki];
Denc=[1 0];
[numCL,denCL]=cloop(conv(num,numc),conv(den,denc))
;step(numCL,denCL)
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
OUTPUT
Try Ki=10,
Kp=500;
Ki=10;
Kd=0;
Numc[Kd Kp Ki];
Denc=[1 0];
[numCL,denCL]=cloop(conv(num,numc),conv(den,denc))
;step(numCL,denCL)
axis([0 100 0
1.5])
OUTPUT
PID CONTROL
From the two controllers above, we see that if we want a fast response, small overshot,
no steady-state error, neither a PI nor a PD controller will suffice. Let’s implement
and
controllers and design a PID controller to see if combining the two controllers will
both
the desired response. Recalling that, our PD controller gave us a pretty good
yield
except for a little steady-state
response
error.
Kp=500;
Ki=1;
Kd=100;
Numc=[Kd Kp Ki];
Denc[1 0];
[numCL,denCL]=cloop(conv(num,numc),conv(den,denc))
:step(numCL,denCL)
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
OUTPUT
The settling time is much shorter,but still small enough. Increase ki to 500 and change the
command to
step
step(numCL,denCL,t):
SUMMARY
To design a PID controller, the general rule is to add proportional control to get the
rise time, add derivative control to get desire overshoot, and then add integral control
desired
needed).To eliminate the steady-state
(if
error.
COMMENTS
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
EXPERIMENT NO – 13
OBJECTIVE
SECTION – 1
Show the position of poles and zeros of the open-loop transfer function in the s-
plane.
Ans:
OUTPUT
CONTROL SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
SECTION - 2
In the system shown above, using integral controller K/s and determined the open loop
close loop TF?
and
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
OUTPUT
SECTION - 3
In the system shown above, use a proportional integral (PI) controller K(1+1/s)
determine the open-loop and closed-loop transfer
and
functions
For integral open-loop
proportional
num=[1
den=[1 5 6 0];
1];
sys=tf(num,den
)
For close-loop proportional
integral
num=[1
den=[1 5 6 0];
1];
sys=tf(num,den
)y=feedback(sys,1
)
Plot the root-locus using MATLAB command rlocus and sketch the root-
locus.
Ans: num=[1 1];
den=[1 5 6 0];
sys=tf(num,den
)y=feedback(sys,1
)rlocus(sys
)
OUTPUT
CONTROL
SYSTEMS
FEDERAL URDU UNIVERSITY
ELECTRICAL
OFENGINEERING
ARTS, SCIENCE, AND TECHNOLOGY
ISLAMABAD
What is range of
K?
Ans:
SECTION - 4
The root locus of (open-loop) TF, H(s) is s plot of the location (locus) of all
closed loop poles with proportional gain k and unity feedback;
possible
CONTROL
SYSTEMS