controls lab manual

37
Second order system CODE zeta=input('input the value of zeta ='); t=input('input the vlaue of time constant chosen='); wn=1/(zeta*t) num=[wn*wn] den=[1 2*zeta*wn wn*wn] sys=tf(num,den); figure(2); pzmap(sys) f=input('press any key for the step response'); step(sys)

Upload: raghavendra-m-bhat

Post on 30-Jan-2016

214 views

Category:

Documents


0 download

DESCRIPTION

helps in matlab simulations of various systems

TRANSCRIPT

Page 1: controls lab manual

Second order system

CODE zeta=input('input the value of zeta ='); t=input('input the vlaue of time constant chosen='); wn=1/(zeta*t) num=[wn*wn] den=[1 2*zeta*wn wn*wn] sys=tf(num,den); figure(2); pzmap(sys) f=input('press any key for the step response'); step(sys)  

Page 2: controls lab manual

Procedure

Open matlab, open the editor and type the above code.

Save the code and run it. Go to the command window and and

enter the value of zeta and t. The pole zero plot is shown. Enter any key to get the step response

Page 3: controls lab manual

input the value of zeta =2 input the vlaue of time constant chosen=5

wn =

0.1000

num =

0.0100

den =

1.0000 0.4000 0.0100

Page 4: controls lab manual

Transfer function = .001 s^2+0.4s+.001

Page 5: controls lab manual

Pole zero plot

Page 6: controls lab manual

Step response

Page 7: controls lab manual

secondor input the value of zeta =0.1 input the vlaue of time constant chosen=5

wn =

2

num =

4

den =

1.0000 0.4000 4.0000

Page 8: controls lab manual

Pole zero

Page 9: controls lab manual

Step response

Page 10: controls lab manual

input the value of zeta =1 input the vlaue of time constant chosen=5

wn =

0.2000

num =

0.0400

den =

1.0000 0.4000 0.0400

Page 11: controls lab manual

Pole zero

Page 12: controls lab manual

Step response

Page 13: controls lab manual

Lead network Code phi_deg=input('input the given value of phi in degrees=') phi_rad=pi*phi_deg/180 wm=input('input the given value of frequency in radians per second=') alpha=(1-sin(phi_rad))/(1+sin(phi_rad)) T=1/(sqrt(alpha)*wm) f1=1/(2*pi*T) fm=wm/(2*pi); f2i=(pi*T*alpha)/2 C=0.11e-06 R1=T/C R2=alpha*R1/(1-alpha) numg=[1 1/T] deng=[1 1/(alpha*T)] sys=tf(numg,deng) figure(2); pzmap(sys) f=input('Press any key to observe the plot') bode(sys)

Page 14: controls lab manual

Procedure

input the given value of phi in degrees=54.9

phi_deg =

54.9000

phi_rad =

0.9582

input the given value of frequency in radians per second=2010

wm =

2010

Page 15: controls lab manual

alpha =

0.1000

T =

0.0016

f1 =

101.1715

f2i =

2.4715e-04

Page 16: controls lab manual

C =

1.1000e-07

R1 =

1.4301e+04

R2 =

1.5894e+03

numg =

1.0000 635.6795

Page 17: controls lab manual

deng =

1.0e+03 *

0.0010 6.3556

sys = s + 635.7 --------- s + 6356 Continuous-time transfer function.

Press any key to observe the plot

Page 18: controls lab manual

Pole zero

Page 19: controls lab manual

Bode plot

Page 20: controls lab manual

Lag network

phi_deg=input('input the given value of phi in degrees=')

phi_rad=pi*phi_deg/180 wm=input('input the given value of

frequency in radians per second =') beta=(1-sin(phi_rad))/(1+sin(phi_rad)) T=1/(sqrt(beta)*wm) f1=1/(2*pi*beta*T) fm=wm/(2*pi); f2=1/(2*pi*T)

Page 21: controls lab manual

C=1.0e-06 R2=T/C R1=(beta-1)/R2 numg=[1 1/T] deng=[beta*T 1] sys=tf(numg,deng) figure(2); pzmap(sys) f=input('Press any key to observe the plot') figure(3); bode(sys)

Page 22: controls lab manual

Procedure

input the given value of phi in degrees=-54.8

phi_deg =

-54.8000

phi_rad =

-0.9564

input the given value of frequency in radians per second =198.8

wm =

Page 23: controls lab manual

198.8000

beta =

9.9376

T =

0.0016

f1 =

10.0368

Page 24: controls lab manual

f2 =

99.7419

C =

1.0000e-06

R2 =

1.5957e+03

R1 =

0.0056

Page 25: controls lab manual

numg =

1.0000 626.6970

deng =

0.0159 1.0000

sys = s + 626.7

Page 26: controls lab manual

------------- 0.01586 s + 1 Continuous-time transfer function.

Press any key to observe the plot

f =

[]

>>

Page 27: controls lab manual

Bode plot

Page 28: controls lab manual

Pole zero

Page 29: controls lab manual

num=[1] den=conv(conv([1 0],[.2 1]),[.05 1]) sys=tf(num,den) figure(1); bode(sys) [mag,phase,w]=bode(sys) margin(sys) f=input('press any key to uose the rltool') figure(2); rltool(sys)

Page 30: controls lab manual

num =

1

den =

0.0100 0.2500 1.0000 0

sys = 1 ----------------------- 0.01 s^3 + 0.25 s^2 + s Continuous-time transfer function.

Page 31: controls lab manual

procedure

The transfer function is shown. Press any key to get the bode plot The magnitude and phase value of w is

shown. Press any key to get the root locus of the

transfer function.

Page 32: controls lab manual
Page 33: controls lab manual
Page 34: controls lab manual
Page 35: controls lab manual
Page 36: controls lab manual
Page 37: controls lab manual