Introduction to Matlab - Dr. Imtiaz Hussain

Download Report

Transcript Introduction to Matlab - Dr. Imtiaz Hussain

Control System Toolbox (Part-I)
[email protected]
1
Outline
• Introduction
• Transfer Function Models
– From Numerator & Denominator Coefficients
– From Zero-Pole-Gain
• Pole-Zero maps
• Simplification of Block Diagrams
– Series Blocks
– Parallel Blocks
– Feedback loops
Transfer Function Model Using Numerator & Denominator
Coefficients
G( s ) 
100
s 2  14s  10
This transfer function can be stored into the MATLAB
num = 100;
den = [1 14 10];
sys=tf(num,den)
To check your entry you can use the command printsys as
shown below:
printsys(num,den);
7/16/2015
Transfer Function Model Using Zeros, Poles and Gain
(ZPK model)
K ( s  z1 )
100( s  3)
G( s ) 

( s  1)( s  2 ) ( s  p1 )( s  p 2 )
This transfer function can be stored into the MATLAB
Zeros=-3;
Poles= [-1 -2];
K=100;
sys=zpk(Zeros,Poles,K)
To check your entry you can use the command printsys as
shown below:
printsys(num,den);
7/16/2015
Poles & Zeros
G( s ) 
s 2  3s  5
s 2  4 s  10
We can find poles with the help of following MATLAB
command.
poles = roots(den)
We can find Zeros with the help of following MATLAB
command
zeros = roots(num)
7/16/2015
contd…..
Poles & Zeros
We can plot the poles of the above transfer function marked by the
symbol ‘x’.
plot(poles,’x’)
To plot the poles and zeros of any transfer function there is a built in
function pzmap in the MATLAB
pzmap(num,den)
7/16/2015
Series Blocks
• Blocks in series can be simplified by using series command
S
9S + 17
9(S+3)
2S2 + 9s + 27
num1 = [1 0];
den1 = [9 17];
num2 = 9*[1 3];
den2 = [2 9 27];
[num12, den12] = series (num1,den1,num2,den2);
printsys(num12,den12);
7/16/2015
Contd… Series Blocks
• Blocks in series can also be simplified by using conv command
S
9S + 17
num1 = [1 0];
den1 = [9 17];
num2 = 9*[1 3];
den2 = [2 9 27];
num12 =conv(num1,num2);
den12 = conv(,den1,den2);
printsys(num12,den12);
7/16/2015
9(S+3)
2S2 + 9s + 27
Parallel Block
• Blocks in parallel can be simplified by using parallel command
num1 = [1 2];
den1 = [1 2 3];
num2 = [1 3];
den2 = [1 -4 1];
[num, den]=parallel(num1,den1,num2,den2);
printsys(num,den);
7/16/2015
Closed-Loop Transfer Function (Unity Feedback)
• Closed loop transfer function with unity feedback can be simplified
using cloop command.
R(S)
-
9
S+5
num = 9;
den = [1 5];
[numcl, dencl] = cloop(num, den,-1);
printsys(numcl,dencl)
7/16/2015
C(S)
Closed-loop transfer function
• If the feedback is not unity then we can use feedback command to
simplify the canonical form.
R(S)
-
1
S+1
num1 = 1;
2
den1 = [1 1];
S
num2 = 2;
den2 = [1 0];
[numcl,dencl] = feedback(num1,den1,num2,den2,-1);
printsys(numcl,dencl)
7/16/2015
C(S)
Exercise#1
• Simplify the following block diagram and determine the following
(Assume K=10).
– Closed loop transfer function (C/R)
– Poles
– Zeros
– Pole-zero-map
1
s2
1
s
Exercise#2
• Simplify the following block diagram and determine the following.
– Closed loop transfer function (C/R)
– Poles
– Zeros
1
– Pole-Zero-map
R
+
( s  1)2
+
-
-
7( s  1)
s( s  3)
10
1
( s  1)2
-+
C
You can Download this tutorial from
http://imtiazhussainkalwar.weebly.com/
END OF TUTORIAL
7/16/2015