0% found this document useful (0 votes)
40 views19 pages

Complete Solution Ee 593

The document outlines a series of experiments using MATLAB to familiarize users with matrix operations, transfer functions, impulse and ramp responses, and stability analysis of linear control systems. Each experiment includes objectives, program codes, and outputs such as graphs and calculated values. The experiments cover various topics including matrix summation, transfer function analysis, pole-zero mapping, and Bode and Nyquist plots for stability assessment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views19 pages

Complete Solution Ee 593

The document outlines a series of experiments using MATLAB to familiarize users with matrix operations, transfer functions, impulse and ramp responses, and stability analysis of linear control systems. Each experiment includes objectives, program codes, and outputs such as graphs and calculated values. The experiments cover various topics including matrix summation, transfer function analysis, pole-zero mapping, and Bode and Nyquist plots for stability assessment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

EXPERIMENT NO: 01

TITLE: Familiarization with MATLAB & basic operations of matrices.


Objective: - To familiar with basic commands of matrix operations in MATLAB.

1) Question 1:
Find out the sum of 2nd row elements for a given matrix?

Program code:
a=[1,2,3;4,5,6;7,8,9];
s=sum(a(2,:));
grid;

output:
s=15
2) Question 2:

  2  1
A  
1. Find out the inverse of the given matrix,  4 5  .

Program code:
a=[-2,-1;-4,5];
i=inv(a);

output:

i=

-0.3571 -0.0714

-0.2857 0.1429

1
EXPERIMENT NO: 02

TITLE: Determine the transfer function & find out step response of the given
systems.
Objective: To obtain the transfer function & step response for the given systems.
Problems:
1) Determine the transfer function & find out the step response of the given transfer
function’s( s ) =¿ ¿+5)/(3 s5 +4 s4 +5 s3+2 s2+1).

Program code:

num=[1 0 5];
den=[3 4 5 2 0 1];
g=tf(num,den);
step(g);
grid;

Output:
Graph 1

2) Determine the transfer function & find out the step response of the given transfer
function.
G(s) =RCS/1+RCS, where R=1µΩ, C=1µf.

2
Program :
r=1e-6;
c=1e-6;
num=[r*c 0];
den=[r*c 1];
g=tf(num,den);
step(g);
grid;

output:
graph 2

EXPERIMENT NO: 03

TITLE: Find & plot the Poles & Zeros from Transfer function and various connections
of Transfer functions.

Objective: To study the poles-zeros and different connections of a system transfer function
to understand the concept of stability of the system given below.

Problems:

3
01.

G( s ) =¿+5) / (3 s7+4 s6 +5 s5+2 s4 +3 s3 +¿6 s2+6s+1))

Program Code:
num=[1 0 5];
den=[3 4 5 2 3 6 6 1];
g=tf(num,den);
[z,p,k]=tf2zp(num,den);
pzmap(num,den);
grid;

Output Transfer function:

g=

s^2 + 5
-------------------------------------------------------
3 s^7 + 4 s^6 + 5 s^5 + 2 s^4 + 3 s^3 + 6 s^2 + 6 s + 1

Output Poles & Zeros:


z=

0.0000 + 2.2361i
0.0000 - 2.2361i
p=

0.7339 + 0.7639i
0.7339 - 0.7639i
-0.4992 + 1.1827i
-0.4992 - 1.1827i
-0.7991 + 0.4926i
-0.7991 - 0.4926i
-0.2046 + 0.0000i
k=

0.3333

Output Graph (Pole Zero Plot):

Graph 3

02(cascade or series)

4
2 5
(a) T.F= (b) T.F= 2
s +5 s + 3 s+ 10
Program:
num=[2];
den=[1 5];
g=tf(num,den);
num1=[5];
den1=[1 3 10];
g1=tf(num1,den1);
[num2,den2]=series(num,den,num1,den1);
printsys(num2,den2,'s');
grid;

Output:
num/den =
10
-----------------------
s^3 + 8 s^2 + 25 s + 50

03 (Parallel)

2 5
(a) T.F= s +5 (b) T.F= 2
s + 3 s+ 10

Program:
num=[2];
den=[1 5];
g=tf(num,den);
num1=[5];
den1=[1 3 10];
g1=tf(num1,den1);
[num2,den2]=parallel(num,den,num1,den1);
printsys(num2,den2,'s');
grid;

Output:
num/den =

2 s^2 + 11 s + 45
-----------------------
s^3 + 8 s^2 + 25 s + 50

04. (Positive and negative Feedback)

5
2 5
(a) T.F= (b) T.F= 2
s +5 s + 3 s+ 10

Program:
num=[2];
den=[1 5];
g=tf(num,den);
num1=[5];
den1=[1 3 10];
g1=tf(num1,den1);
g2=feedback(g,g1,+1);
g3=feedback(g,g1,-1);
grid;

Output:
g2 =

2 s^2 + 6 s + 20
-----------------------
s^3 + 8 s^2 + 25 s + 40

Continuous-time transfer function.

>> g3

g3 =

2 s^2 + 6 s + 20
-----------------------
s^3 + 8 s^2 + 25 s + 60

Continuous-time transfer function.

05. (Pole Zero to Transfer function)

Given poles are -3.2+j7.8,-3.2-j7.8,-4.1+j5.9,-4.1-j5.9,-8 and the zeroes are -0.8+j0.43,-0.8-


j0.43,-0.6 with a gain of 0.5

Program:

6
EXPERIMENT NO: 04
TITLE: Find out the Impulse response and ramp response of a system using
MATLAB command and simulation.
Objective: To obtain Impulse response and Ramp response of a system.
THEORY:

System Type

The system type is determined by the form of the loop (or open-loop) transfer function
GH(s). In general, the form of GH(s) can be written as -

N (s )
G(s) H(s)=
s n D (s)

Where N(s) and D(s) represent polynomials in s, and sn represents all powers of s that can be
factored from the denominator. The number n determines the system type. It is said that the
system is a “type n” system. As we will show in the following paragraphs, the value of n
determines the "type" of steady-state error the system will have for various inputs.

Problem 1 Obtain the Impulse response of the following system by MATLAB command.

s+ 2
G(s) = 3 2
s + 5 s + 8 s+ 12

7
Program:
num=[1 2];
den=[1 5 8 12];
g=tf(num,den);
impulse(g);
grid;

Output Response:
Graph 4

Problem 2

Obtain the Unit Ramp response of the following system by MATLAB command.

s+ 2
G(s) = 3 2
s + 5 s + 8 s+ 12

Program:
num=[1 2];
den=[1 5 8 12];
g=tf(num,den);
t=0:0.01:10;
r=t;
y=lsim(g,r,t);
plot(t,r,'r',t,y,'b');
grid;

Output Response:
Graph 5

EXPERIMENT NO: 05

TITLE: Determination of closed loop unit step, unit ramp & unit parabolic response for
the 1st order type 0, type 1 and type 2 system.

Objective: To obtain the closed loop response for the 1st order type 0, type 1 and type 2
system for different inputs like unit step, unit ramp & unit parabolic and observe whether the
response is bounded or unbounded.

Theory:

8
Problem: 01(for type 0)

Open loop transfer function of a type 0 system

c (s ) 1
=
r ( s ) 3 s+ 2
Program:
num=[1];
den=[3 2];
g=tf(num,den);
sys=feedback(g,1,-1);
t=0:0.01:10;
u=t./t;
y=step(sys,t);
r=t;
y1=lsim(sys,r,t);
p=(t.^2)/2;
y2=lsim(sys,p,t);
subplot(1,3,1),plot(t,u,t,y);
title('response for step i/p');
xlabel('time');
ylabel('magnitude');
grid;
subplot(1,3,2),plot(t,r,t,y1);
title('response for ramp i/p');
xlabel('time');
ylabel('magnitude');
grid;
subplot(1,3,3),plot(t,p,t,y2);
title('response for parabolic i/p');
xlabel('time');
ylabel('magnitude');
grid;

ouput response:
graph 6

Problem: 02(for type 1)

Open loop transfer function of a type 1 system

c (s ) 1
= s (3 s +2)
r (s )
Program:

num=[1];
den=[3 2 0];
g=tf(num,den);
sys=feedback(g,1,-1);
t=0:0.01:10;
u=t./t;
y=step(sys,t);

9
r=t;
y1=lsim(sys,r,t);
p=(t.^2)/2;
y2=lsim(sys,p,t);
subplot(1,3,1),plot(t,u,t,y);
title('response for step i/p');
xlabel('time');
ylabel('magnitude');
grid;
subplot(1,3,2),plot(t,r,t,y1);
title('response for ramp i/p');
xlabel('time');
ylabel('magnitude');
grid;
subplot(1,3,3),plot(t,p,t,y2);
title('response for parabolic i/p');
xlabel('time');
ylabel('magnitude');
grid;

Output response:
Graph7

Problem: 03(for type 2)

Open loop transfer function of a type 2 system

c (s ) 1
= 2
r ( s ) s (3 s +2)
Program:

num=[1];
den=[3 2 0 0];
g=tf(num,den);
sys=feedback(g,1,-1);
t=0:0.01:20;
u=t./t;
y=step(sys,t);
r=t;
y1=lsim(sys,r,t);
p=(t.^2)/2;
y2=lsim(sys,p,t);
subplot(1,3,1),plot(t,u,t,y);
title('response for step i/p');
xlabel('time');
ylabel('magnitude');
grid;
subplot(1,3,2),plot(t,r,t,y1);
title('response for ramp i/p');
xlabel('time');
ylabel('magnitude');
grid;
subplot(1,3,3),plot(t,p,t,y2);
title('response for parabolic i/p');

10
xlabel('time');
ylabel('magnitude');
grid;

Output response:
Graph8

EXPERIMENT NO: 06

TITLE: Pole Zero Mapping and Step response of second order system for different
damping ratio.

Objective: To obtain poles and zeros of a second order system and also find out the
system response for different damping ratio.

Theory:

Problem:
Obtain second order step response for different damping coefficient, (ξ=0.2, 0.4, 0.6, 1,
1.2).Here natural frequency of oscillationω n & Gain( k ) of the system is 1.

PROGRAM:
t=0:0.01:20;
wn=1;
zeta=0.2;
[num,den]=ord2(wn,zeta);
g=tf(num,den);
[y1,x,t]=step(num,den,t);
zeta=0.4;
[num,den]=ord2(wn,zeta);
g=tf(num,den);
[y2,x,t]=step(num,den,t);
zeta=0.6;
[num,den]=ord2(wn,zeta);
g=tf(num,den);
[y3,x,t]=step(num,den,t);
zeta=1;
[num,den]=ord2(wn,zeta);
g=tf(num,den);
[y4,x,t]=step(num,den,t);
zeta=1.2;
[num,den]=ord2(wn,zeta);
g=tf(num,den);
[y5,x,t]=step(num,den,t);
plot(t,y1,'k',t,y2,'b',t,y3,'r',t,y4,'g',t,y5,'y');
xlabel('time');
ylabel('output');
title('second order step response for different damping coefficient');
grid;

Output Response:
Graph 9

11
EXPERIMENT NO: 07

TITLE: Determination of stability analysis of linear control system by Root Locus.

Objective: To find out the stability of a system by Root Locus

Problem: 01

Root Locus Plot for the given system transfer function given below.

4
G(s) =
s (1+ 0.5 s ) (1+ 0.08 s)

Program:
num=[4];
den=[0.04 0.58 1 0];

12
g=tf(num,den);
rlocus(g);
grid;

Output Response:
Graph 10
Problem: 02
Root Locus Plot for the given system transfer function given below.
k
H(s) = 2
( s + 4 s +3)(s +4 )

Program
num=[1];
den=[1 8 19 12];
g=tf(num,den);
rlocus(g);
grid;

Output Response:
Graph11
Problem: 03
Root Locus Plot for the given system transfer function given below.

2
G(s) = 2
s + 3 s+ 2

Program:
num=[2];
den=[1 3 2];
g=tf(num,den);
rlocus(g);
grid;

Output Response:
Graph 12

EXPERIMENT NO: 08

TITLE: Determination of stability analysis of linear control system by Bode plot.

Objective: To find out the stability of a linear control system by Bode plot.
Theory:

13
The performance and characteristics of a system in frequency domain are measured in term
of frequency domain specifications. The requirements of a system to be designed are usually
specified in terms of these specifications. Bode computes the magnitude and phase of the
frequency response of LTI models. When invoked without left-side arguments, bode
produces a Bode plot on the screen. The magnitude is plotted in decibels (dB), and the phase
in degrees. The decibel calculation for magnitude is computed as 20log10 (|H (jw)|), where
H(jw) is the system's frequency response. Bode plots are used to analyze system properties
such as the gain margin, phase margin, DC gain, bandwidth, disturbance rejection, and
stability

Problem: 01

Find out the Bode plot and gain margin, phase margin, gain and phase cross over
frequency of the system given below:

2
G(s) = s 2+ 3 s+ 2
Program:
num=[2];
den=[1 3 2];
g=tf(num,den);
margin(g);
grid;

Output: graph 13
Gm=inf dB at inf rad/sec
Pm=-180deg at 0 rad/sec

Problem: 02

Find out the Bode plot and gain margin, phase margin, gain and phase cross over
frequency of the system given below:

4
G(s) = s (1+ 0.5 s ) (1+ 0.08 s)

Program:
num=[4];
den=[0.04 0.58 1 0];
g=tf(num,den);
margin(g);
grid;

Output:
graph 14
Gm= 11.2 dBat 5 rad/s
Pm=27.8 deg at 2.47 rad/s

14
EXPERIMENT NO: 09

TITLE: Determination of stability analysis of linear control system by Nyquist plot.

Objective: To find out the stability of a linear control system by Nyquist plot.
Theory: A nyquist plot is used in automatic control and signal processing for assessing the
stability of a system with feedback. It is represented by a graph in polar coordinates in which
the gain and phase of a frequency response are plotted. The plot of these phasor quantities
shows the phase as the angle and the magnitude as the distance from the origin. This plot
combines the two types of Bode plot — magnitude and phase — on a single graph with
frequencry as a parame ter along the curve.

Nyquist calculates the Nyquist frequency response of LTI models. When invoked without
left-hand arguments, nyquist produces a Nyquist plot on the screen. Nyquist plots are used to
analyze system properties including gain margin, phase margin, and stability.

The nyquist stability criterion , provides a simple test for stability of a closed-loop control
system by examining the open-loop system's Nyquist plot. Stability of the closed-loop control
system may be determined directly by computing the poles of the closed-loop transfer
function. The Nyquist Criteria can tell us things about the frequency characteristics of the
system. For instance, some systems with constant gain might be stable for low-frequency
inputs, but become unstable for high-frequency inputs. Also, the Nyquist Criteria can tell us
things about the phase of the input signals, the time-shift of the system, and other important
information.

Problem: 01
4
G(s) = s (1+ 0.5 s ) (1+ 0.08 s)
Program:
num=[4];
den=[0.04 0.58 1 0];
g=tf(num,den);
nyquist(g);
[gm,pm,wcp,wcg]=margin(g);
grid;

Output: see graph 15


gm =

3.6250
pm =

15
27.8257
wcp =5

wcg =

2.4696

Problem: 02
2
G(s) = s 2+ 3 s+ 2

Program:
num=[2];
den=[1 3 2];
g=tf(num,den);
nyquist(g);
[gm,pm,wcp,wcg]=margin(g);
grid;

Output: graph 16

gm = Inf

pm = -180

wcp = Inf

wcg = 0
Problem: 03

G(s) H(s) = 2 s 3/( s+1 ) (s+ 2)

Program code:
num=[2 0 0 0];
den=[1 3 2];
g=tf(num,den);
nyquist(g);
[gm,pm,wcp,wcg]=margin(g);
grid;

Output:graph 17

gm = 0.7500

16
pm =7.5156

wcp =1.4142

wcg = 1.2301

EXPERIMENT NO: 10

TITLE: To study the position control of DC motor.

Objective:
Theory: A common actuator in control systems is the DC motor. It directly provides rotary
motion and, coupled with wheels or drums and cables, can provide translational motion. The
electric equivalent circuit of the armature and the free-body diagram of the rotor are shown in
the following figure.

Fig. 10.1 Free body diagram of DC motor

We will assume the following values for the physical parameters:

 moment of inertia of the rotor 3.2284E-6 kg.m^2


 motor viscous friction constant 3.5077E-6 N.m.s
 electromotive force constant 0.0274 V/rad/sec
 motor torque constant 0.0274 N.m/Amp
 electric resistance 4 Ohm
 electric inductance 2.75E-6H

Program (Transfer Function):

17
Transfer Function:

0.0274
-------------------------------------------------------
8.878e-012 s^3 + 1.291e-005 s^2 + 0.0007648 s

The open-loop transfers function of the DC Motor:

 ( s) K  rad 
P s   
 
V ( s ) s Js  b Ls  R   K  V 
2 

The structure of the control system has the form shown in the figure below:

Fig. 10.2 Controller circuit

The transfers function for a PID controller:


K K s2  K P s  Ki
C s   K P  i  K d s  d
s s

Proportional Control:

First Using Proportional Controller

18
Program: (Step response for different values of Kp)

Output:

Program: (With disturbance)

Output:

Proportional plus Integral Control (PI):

Program: (Step response for different values of Ki)

Output:

Program: (With disturbance)

Output:

Proportional plus Integral plus Derivative Control (PID):


Program: (Step response for different values of Kd)

Output:

Program: (With disturbance)

Output:

19

You might also like