You are on page 1of 10

COMSATS University Islamabad

Abbottabad Campus

Name : IJAZ UL HAQ

Reg No : FA19-EPE-008

Teacher : Mam Rabiya Bahadur

Date : 13-06-2022

COMSATS University Islamabad

Abbottabad Campus
Lab 09: Stability analysis for the systems under different
performance conditions:
Objective: In this lab students will learn about stability of system, they will be able to determine
the stability of system either by examining pole’s location or output response of the system.
Software: Matlab
Stability: Stability is the most important system specification. If a system is unstable, transient
response and steadystate errors are moot points. An unstable system cannot be designed for a
specific transient response or steady-state error requirement. What, then, is stability? There are
many definitions for stability, depending upon the kind of system or the point of view. In this
section, we limit ourselves to linear, time-invariant systems. Stability of system on the basis of time
response is given below.

Stable: A linear, time-invariant system is stable if the natural response approaches zero as time
approaches infinity.

Marginally Stable: Linear, time-invariant system is marginally stable if the natural response
neither decays nor grows but remains constant or oscillates as time approaches infinity.

Unstable: A linear, time-invariant system is unstable if the natural response grows without bound
as time approaches infinity.

Now definition of stability on the basis of poles of system

Stable: Stable systems have closed-loop transfer functions with poles only in the left half-plane.
Marginally Stable: Marginally stable systems have closed-loop transfer functions with only
imaginary axis poles of multiplicity 1 and poles in the left half-plane.

Unstable: Unstable systems have closed-loop transfer functions with at least one pole in the right
half plane and/or poles of multiplicity greater than 1 on the imaginary axis.

Task 1:
Find out that following systems are either Stable/Unstable, with help of step response and pole’s
location.

a) G(s) = 1/ 𝑠+1

b) G(s) = 1 /𝑠−2

Code:
close all;clc;clear all
s=tf('s');
G1=1/(s+1);
G2=1/(s-2);
[p1 s1]=pzmap(G1);
[p2 s2]=pzmap(G2);
fprintf('task1');
disp('pole location');
if(p1<0);
x=sprintf('stable',p1);
disp(x);
else
x=sprintf('unstable',p1);
disp(x);
end
if(p2<0);
x=sprintf('stable',p2);
disp(x);
else
x=sprintf('unstable',p2);
disp(x);
end
figure;
subplot(2,1,1);
step(G1);
xlabel('time sec');
ylabel('g1(t)')
grid on
subplot(2,1,2);
step(G2);
xlabel('time sec');
ylabel('g2(t)')
grid on
figure
subplot(2,1,1);
pzmap(G1);
subplot(2,1,2)
pzmap(G2)

Step Response
1
g1(t)

0.5

0
0 1 2 3 4 5 6 7 8 9
time sec (seconds)

25
x 10 Step Response
6

4
g2(t)

0
0 5 10 15 20 25 30
time sec (seconds)
Step Response
g1(t) 1

0.5

0
0 1 2 3 4 5 6 7 8 9
time sec (seconds)

25
x 10 Step Response
6

4
g2(t)

0
0 5 10 15 20 25 30
time sec (seconds)

Systems↓ / Parameters→ Pole Location Stable /Unstable


a) -1 stable
b) 2 unstable
Task 2:
Find out that following systems are Stable/Unstable/Marginally stable, with help of step response
and pole location.

a) G(s) = 3 / (𝑠2+2𝑠+3)

b) G(s) = 6 /(𝑠2−2𝑠−3)

Code:
close all;clc;clear all
s=tf('s');
G1=3/(s^2+2*s+3);
G2=6/(s^2-2*s-3);
[p1 s1]=pzmap(G1);
[p2 s2]=pzmap(G2);
fprintf('task1');
disp('pole location');
if(real(p1(1))<0 && real(p1(2))<0);
x=char(177);
p1_1_r=real(p1(1));
p1_1_i=real(p1(1));
fprintf('stable',p1_1_r,x,p1_1_i);
disp(x);
else
x=char(177);
p2_1_r=real(p2(1));
p2_1_i=real(p2(1));
fprintf('unstable',p2_1_r,x,p2_1_i);
end
if(real(p2(1))<0 && real(p2(2))<0);
p2_1_r=real(p2(1));
p2_1_i=real(p2(2));
fprintf('stable',p2_1_r,x,p2_1_i);
else
p2_1_r=real(p2(1));
p2_1_i=real(p2(2));
fprintf('unstable',p2_1_r,x,p2_1_i);
disp(x);
end
figure;
subplot(2,1,1);
step(G1);
xlabel('time sec');
ylabel('g1(t)')
grid on
subplot(2,1,2);
step(G2);
xlabel('time sec');
ylabel('g2(t)')
grid on
figure
subplot(2,1,1);
pzmap(G1);
subplot(2,1,2)
pzmap(G2)
Step Response
1.5

1
g1(t)

0.5

0
0 1 2 3 4 5 6 7
time sec (seconds)

25
x 10 Step Response
6

4
g2(t)

0
0 2 4 6 8 10 12 14 16 18 20
time sec (seconds)

Pole-Zero Map
2
Imaginary Axis (seconds-1)

-1

-2
-1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0
-1
Real Axis (seconds )

Pole-Zero Map
1
Imaginary Axis (seconds-1)

0.5

-0.5

-1
-1 -0.5 0 0.5 1 1.5 2 2.5 3
-1
Real Axis (seconds )

Systems↓ / Response → Pole Location Stable/Marginally Stable


/Unstable
a) -1+1.4,-1-1.4 stable
b) 3,-1.4 unstable

Task 3:
Now implement the following systems in unit negative feedback form and find out that closed loop
systems are Stable/Unstable/Marginally stable, with help of step response.

a) G(s) = 3/ (𝑠3+3𝑠2+2𝑠)

b) G(s) = 6/ (𝑠3+3𝑠2+2𝑠)

c) G(s) = 7/ (𝑠3+3𝑠2+2𝑠)

Code:
clc
clc
clear all
close all
s=tf('s');
G1=3/(s^3+3*s^2+2*s);
a=feedback(G1,-1);
subplot(311)
step(a)
G2=6/(s^3+3*s^2+2*s);
b=feedback(G2,-1)
subplot(312)
step(b)
G3=7/(s^3+3*s^2+2*s);
c=feedback(G3,-1)
subplot(313)
step(c)

figure
subplot(311)
pzmap(G1)
subplot(312)
pzmap(G2)
subplot(313)
pzmap(G3)
26 Step Response
x 10
2

Amplitude
1

0
0 10 20 30 40 50 60 70 80 90
Time (seconds)
25
x 10 Step Response
10
Amplitude

0
0 10 20 30 40 50 60
Time (seconds)
28
x 10 Step Response
2
Amplitude

0
0 10 20 30 40 50 60
Time (seconds)
Axis (seconds-1)

Pole-Zero Map
1

0
Axis (seconds-1Imaginary

-1
-2 -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0
-1
Real Axis (seconds )
)

Pole-Zero Map
1

0
Imaginary Axis (seconds-1Imaginary

-1
-2 -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0
Real Axis (seconds -1)
)

Pole-Zero Map
1

-1
-2 -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0
-1
Real Axis (seconds )

Systems↓ / Response → Stable/Marginally Stable


/Unstable
a) Unstable
b) Unstable
c) Unstable

Task 4:
For the system given in figure 1, find equivalent transfer function,

Figure 1: Closed Loop System

G(s) = K/s(s + 2)2 , H(s) = 1;


Find the value of gain, K, on paper that will make the system stable, marginally stable and unstable,
then

a) Draw the step response of the system for gain of K-1, where K is value calculated for marginally
stable response

b) Draw the step response of the system for gain of K that yields marginally stable response.

Code:
clc
clear all
close all
s=tf('s');
G1=16/(s^3+4*s^2+4*s+16);
step(G1)
figure
pzmap(G1)
Case Value of K
Stable
Marginally Stable

Task 5:
Implement the transfer function of DC motor from task 3 of lab 6 in unit negative feedback form.
Now study the effect of proportional, integral and derivative components by adding them one by
one in cascade form with forward path with transfer function of DC motor. Also use the analog PID
module of the control system trainer to get the difference in the real time and simulation
performance.

G(s) = θL(s)/Ea(s).
Figure 2: Closed Loop System

You might also like