experiment no.1- introduction to matlab and simulink software tools

2
Control Engineering Laboratory (AEEC345) Exp.1 Introduction to MATLAB and SIMULINK Instructor’s Signature......................................... Experiment No.1: Introduction to MATLAB and SIMULINK Software Tools Objectives To familiarise with the use of MATLAB for determining the transfer function, poles and zeros and transient reponse of control systems. To familiarise with the use of Simulink Toolbox in obtaining the transient reponse of Control Systems. Procedure A. Transfer function implementation of Control Systems using MATLAB. 1. Consider the following Transfer function of a control System 12 s 4 s 3 s 2 s 3 s ) s ( G 2 3 2 + + = 2. In the MATLAB command window enter the following commands and observe the output: Num=[1 3 2]; Den=[1 3 4 12]; Sys=tf(num,den); 3. Repeat step 2 to enter in MATALB the following Transfer function: 15 s 2 s 3 s 5 s 2 s 8 s 4 s 2 s 4 s 5 ) s ( G 2 3 4 5 2 3 4 + + + + = 4. Consider the closed loop system shown in Fig.1.1 R + - 10 1 s 2 5 + + + + s 4 C Fig.1.1 5. To determine the closed loop transfer function of the above system, open a new m- file and enter the following in MATLAB: nsys1=[10]; dsys1=[1]; sys1=tf(nsys1,dsys1) nsys2=[5]; dsys2=[2 1]; sys2=tf(nsys2,dsys2) sys3=series(sys1,sys2) nsys4=[4]; dsys4=[1 0]; sys4=tf(nsys4,dsys4); sys=feedback(sys3,sys4)

Upload: kalin-gordanovich

Post on 08-Apr-2015

146 views

Category:

Documents


6 download

TRANSCRIPT

Control Engineering Laboratory (AEEC345) Exp.1 Introduction to MATLAB and SIMULINK

Instructor’s Signature.........................................

Experiment No.1: Introduction to MATLAB and SIMULINK Software Tools Objectives • To familiarise with the use of MATLAB for determining the transfer function, poles and

zeros and transient reponse of control systems. • To familiarise with the use of Simulink Toolbox in obtaining the transient reponse of

Control Systems. Procedure

A. Transfer function implementation of Control Systems using MATLAB.

1. Consider the following Transfer function of a control System

12s4s3s

2s3s)s(G

23

2

+++++=

2. In the MATLAB command window enter the following commands and observe the output: Num=[1 3 2]; Den=[1 3 4 12]; Sys=tf(num,den); 3. Repeat step 2 to enter in MATALB the following Transfer function:

15s2s3s5s2s

8s4s2s4s5)s(G

2345

234

+++++++++=

4. Consider the closed loop system shown in Fig.1.1

R+

-10

1s25++++

s4

C

Fig.1.1

5. To determine the closed loop transfer function of the above system, open a new m-file and enter the following in MATLAB: nsys1=[10]; dsys1=[1]; sys1=tf(nsys1,dsys1) nsys2=[5]; dsys2=[2 1]; sys2=tf(nsys2,dsys2) sys3=series(sys1,sys2) nsys4=[4]; dsys4=[1 0]; sys4=tf(nsys4,dsys4); sys=feedback(sys3,sys4)

AEEC345 Exp.1 Introduction to MATLAB and SIMULINK

6. Write a MATLAB program to obtain the closed loop transfer function of the system shown in Fig.1.2.

R+

- 3s23++++

C

1s4++++

Fig.1.2

B. Poles and zeros determination using MATLAB 1. Open a New m-file from the File Menu and enter the following transfer function

.

1s2s

10s)s(G

2 +++=

2. Enter the following commands to obtain the zeros and poles of the above transfer

function: p=pole(sys) z=zero(sys)

3. Obtain the poles and zeros of the following transfer function:

1s3s3s

1s6)s(G

23

2

++++=

P1= P2= z1= Z2= Z3=

C. Transient response analysis using Simulink

1. Run the SIMNULINK toolbox by entering the command simulink in the MATLAB

Command window. 2. Draw the 1st order control system shown in Fig.1.1.

5

2s+1

T ransfe r FcnStep Scope Fig.1.1

Hint: Use the Continuous, Sinks and Sources libraries to obtain the transfer function, step input and scope blocks.

3. Simulate the system via the simulation menu and obtain the unit step response of the system.

4. Obtain the transient reponse of the feedback control system shown in Fig.1.2, using Simulink toolbox

Theory: Mathematical model of Systems in “Modern Control Systems” by R.C. Dorf and R.H. Bishop, 9th Ed., Prentice Hall, (2001).

Prepared by Dr C.Themistos (July 2004)