CS Lab Mannual
-
Upload
srinureddy2014 -
Category
Documents
-
view
251 -
download
0
Transcript of CS Lab Mannual
-
8/18/2019 CS Lab Mannual
1/122
C
1
&
-
8/18/2019 CS Lab Mannual
2/122
C
2
( )
20112012
:
:
:
-
8/18/2019 CS Lab Mannual
3/122
C
3
LIST OF EXPERIMENTS
1 .AE C E AD E
2. E AD E AE C
3. CAACEC C4.E EE EE C CC
5.AE DE AE C
6.AE DE E AD E
7.E AD E AE DE
8.E EE A AE C
9.E EE A AE C
10.A EE A AE C
11. E EE A AE DE
12.E EE A AE DE
13.A EE A AE DE
14.AE C A DC EEA15.AE C A DC
16.E EE ECD DE
17. C A AE C
18. BDE A AE C
19. D CE
20.A CEA
21. EAD CEA
22. A EAD CEA
23. DEEA AE C DC
24. EEC C EED AD CE DC , EE AAE
CE E
25. BA BA EED C DC
26. EED C DC D CE A AC EEDBAC
27. EEEA DEEA EEC EE EED C A DC
AD BA E AE C E E ABE
28. AE C
29. AC AABE EED DE 3 AE DC 0.25 7.5 , 0.33
10.
30. E C ACA
-
8/18/2019 CS Lab Mannual
4/122
C
4
1 .TRANSFER FUNCTION FROM ZEROS AND POLES
AIM:
To obtain a transfer function from given poles and zeroes using matlab
PROCEDURE:
• Write matlab program in the matlab editor document.
• Then save and run the program.
• Give the required input.
• The syntax “zp2tf(z,p,k)” and “tf(num,den)” solves the given input poles and zeros andgives the transfer function.
• zp2tf forms transfer function polynomials from the zeros, poles, and gains of a system in
factored form.
Now find the output theoretically for the given transfer function and compare it with the output
obtained practically
MATLAB PROGRAM:
z=input(‘enter zeroes’)
p=input(‘enter poles’)
k=input(‘enter gain’)
[num,den]=zp2tf(z,p,k)
tf(num,den)
EXAMPLE:
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
-
8/18/2019 CS Lab Mannual
5/122
C
5
PRACTICAL CALCULATIONS:
Enter zeros num =
Z = den =Enter poles
P =
Enter gain Transfer function=
K=
RESULT:
Theoretical value =
Practical value =
Hence theoretical value = practical value
Therefore,the transfer function is obtained from the given poles and zeroes.
Viva Questions:
1. what is meant by transfer function?
2. what is s-domain. What is the significance of real axis and imaginary axis in s-domain?
3. what happen to the transfer function at zero of the transfer function?
4. what happens to the transfer function at ‘pole’ of the transfer function?
-
8/18/2019 CS Lab Mannual
6/122
C
6
2. ZEROS AND POLES FROM TRANSFER FUNCTION
AIM:
To obtain zeros and poles from a given transfer function using MATLAB.
PROCEDURE:
Type the program in the MATLAB editor that is in M-file. Save and run the program.
Give the required inputs in the command window of MATLAB in matrix format. tf2zp converts the transfer function filter parameters to pole-zero-gain form. [z,p,k] = tf2zp(b,a) finds the matrix of zeros z, the vector of poles p, and the associated
vector of gains k from the transfer function parameters b and a:
The numerator polynomials are represented as columns of the matrix b. The denominator polynomial is represented in the vector a.
Note down the output of the program that is zeros, poles and gain obtained in MATLAB. The zeros, poles and gain are also obtained theoretically. B .
MATLAB PROGRAM:
num = input(‘enter the numerator of the transfer function’)
den = input(‘enter the denominator of the transfer function’)
[z,p,k] = tf2zp(num,den)
PRACTICAL RESULT:
enter the numerator of the transfer function num =
enter the denominator of the transfer function den =
z = p =
-
8/18/2019 CS Lab Mannual
7/122
C
7
RESULT:
1.The zeros, poles and gain are found from the transfer function theoretically
and by using MATLAB.
2. Theoretically, Zeros are
Poles are
Gain
Practically, Zeros are
Poles are
Gain is
3. The zeros, poles and gain are found to be equal both theoretically and practically.
Viva Questions:
1. what is the significance of ‘s’ in the transfer function.
2. if s=σ+jω, what do σ and ω signify.
3. what do you meant by time-domain?
4. what do you mean by frequency-domain.
-
8/18/2019 CS Lab Mannual
8/122
C
8
3. CHARACTERISTICS OF SYNCHROS
AIM:
To study the characteristics of synchros.
APPARATUS:
Synchro transmitter and receiver set.
CIRCUIT DIAGRAM
PROCEDURE:
STUDY OF SYNCHRO TRANSMITTER
1. Switch on the supply to the synchro transmitter.2. Note the line voltages of stator terminals by using the multimeter for different angular
positions of rotor of transmitter.
3. Tabulate the line voltages Vs1s2,Vs2s3,Vs3s1 across different angular positions of rotor.
4. Plot the graph of line voltages Vs angular position.
STUDY OF SYNCHRO TRANSMITTER AND RECEIVER PAIR
1. Connect stator terminals of transmitter s1,s2,s3 to that of rotor terminals s1,s2,s3 .
2. Switch on rotor exitation switches sw1 and sw2 .3. Rotate the transmitter rotor in steps of 30 degreesand note the corresponding angular
position of rotor of receiver in tabular form.
4. Plot the graph of angular position of transmitter Vs receiver.
-
8/18/2019 CS Lab Mannual
9/122
C
9
OBSERVATION TABLE:
STUDY OF SYNCHRO TRANSMITTER:
S.No. Angular
Positions
Vs1s2 Vs2s3 Vs3s1
1 0
2 30
3 60
4 90
5 120
6 150
7 180
8 210
9 240
10 270
11 300
12 330
CHARACTERISTICS OF SYNCHRO TRANSMITTER
80
60
40
20
0
20
40
60
80
0 50 100 150 200 250 300 350
-
8/18/2019 CS Lab Mannual
10/122
C
10
STUDY OF SYNCHRO TRANSMITTER AND RECEIVER PAIR:
S.No. Angular position of transmitter Angular position of receiver
1 0 0
2 30 28
3 60 60
4 90 90
5 120 118
6 150 149
7 180 178
8 210 206
9 240 240
10 270 268
11 300 299
12 330 330
0
100
200
300
400
0 50 100 150 200 250 300 350
RESULT:
1. Characteristics of synchro transmitter were plotted.
2. Characteristics of synchro transmitter and receiver pair were plotted.
Viva Questions:
1. What are the applications of ‘synchro’.
2. Explain working principle of synchro.
-
8/18/2019 CS Lab Mannual
11/122
C
11
4.TIME RESPONSE OF SERIES RLC CIRCUITS
Aim:- To obtain the time response of series RLC circuit using Breadboard
APPARATUS:-
Semiconductor trainer module containing:
BreadboardResistor(330ohms)
Inductor
Capacitor(0.01uf)
Connecting wires
PROCEDURE:- CIRCUIT DIAGRAM:-
1.
Connect the circuit as shown in figure2. Apply a sinusoidal voltage of 5v p-p
3. Input 5v p-p is applied to series RLC circuit4. Connect output terminals across capacitor
5. Connect output to channelA of CRO and
observe the waveforms
6. Findout time p-p risetime, falltime.
THEORETICAL CALCULATIONS:-
PRACTICAL:-
R=330ohms V=5volts
Tr=0.3Usec L=0.1mh
Tp=0.5Usec C=0.01uf
Ts=0.8Usec
RESULT:-
Hence the series RLC circuit risetime,Falltime total time obtained.
Viva Questions:
1. what do you meant by damping?
2. what is resonance?
3. what are ‘time domain specifications’? elaborate.
-
8/18/2019 CS Lab Mannual
12/122
C
12
5.STATE MODEL FROM TRANSFER FUNCTION
AIM:
To obtain the state model from the given transfer function.
MATLAB PROGRAM:
num=input(‘enter the numerator of the transfer function’)
den=input(‘enter the denominator of the transfer function’)
ss(tf(num,den))
EXAMPLE:
Obtain the state model from the transfer function given below:
PROCEDURE:
Type the program in the MATLAB editor that is in M-file. Save and run the program. Give the required inputs in the command window of MATLAB in matrix format. The command ss(tf(num,den)) converts the given transfer function into a state model. Note down the output obtained in MATLAB. The state model is also obtained theoretically.
Both the state models are compared.
PRACTICAL RESULT:
enter numerator of transfer function[ ]
num =
enter denominator of transfer function[ ]
den =
a =
-
8/18/2019 CS Lab Mannual
13/122
C
13
b =
RESULT:
1. The state model is obtained from the given transfer function both theoretically and
practically by using MATLAB.
Practically, the state model is
A = B =
C = ;D =
2. Both the state models are verified.
Viva questions:
1. What is a state model?
-
8/18/2019 CS Lab Mannual
14/122
C
14
6.STATE MODEL FROM ZEROS AND POLES
AIM:
To obtain a state model from given poles and zeros using MATLAB.
PROCEDURE:
Open the MATLAB window and open a new MATLAB editor. Write the MATLAB program in the MATLAB editor. Save and run the MATLAB program. Enter the given poles, zeros and gain as input in matrix format. The syntax “[A,B,C,D]=zp2ss(z,p,k)” solves zeroes, poles and gain given in the
matrix format as input and gives the output in the form of a state model. This syntax transforms the given zeros, poles and gain into a state model. Note down the output state model obtained practically by using the syntax
“[A,B,C,D]=zp2ss(z,p,k)” . Now find the state model theoretically for the given poles, zeros and gain. Compare the theoretically obtained state model from the given poles, zeros and
gain with the one obtained practically. Write the result based on the comparison
between thoretical and practical result.
MATLAB PROGRAM:
z=input('enter zeros')
p=input('enter poles')
k=input('enter gain')
[A,B,C,D]=zp2ss(z,p,k)
EXAMPLE:
zeros are: poles are: gain=
THEORETICAL CALCULATIONS:
Given,zeros =
Given, poles=
X(s)=
-
8/18/2019 CS Lab Mannual
15/122
C
15
X(t)=
Let ;
=
Y(s)=
Y(t)=
Therefore,
A =
B =
C=
D =
PRACTICAL RESULT:
enter zeros
z =
enter poles
p =
enter gain
k =
A =
B =C =
D =
Result:
State model for the given poles, zeros and gain is obtained both theoretically and practically. Itis found that both the theoretical result and practical result are different. The result obtained are
as follows.
Theoretical Result:
Practical Result:
-
8/18/2019 CS Lab Mannual
16/122
C
16
7.ZEROS AND POLES FROM STATE MODEL
AIM:
To obtain poles and zeros from a given state model using MATLAB
MATLAB PROGRAM:
A=input('enter matrix A')
B=input('enter matrix B')
C=input('enter matrix C')
D=input('enter matrix D')
[z,p,k]=ss2zp(A,B,C,D)
EXAMPLE:
A= B= C= D=
PROCEDURE:
Open the MATLAB window and open a new MATLAB editor. Write the MATLAB program in the MATLAB editor. Save and run the MATLAB program. The state model is given as input and entered in matrix format. The syntax “[z,p,k]=ss2zp(A,B,C,D)” solves the given state model entered in
matrix format as input and gives the output in the form of poles, zeros and gain. This syntax transforms the given state model into poles, zeros and gain. Note down the output zeros, poles and gain obtained practically by using the
syntax “[z,p,k]=ss2zp(A,B,C,D)”. Now find the poles, zeros and gain theoretically for the given state model Compare the theoretically obtained poles, zeros and gain from the given state
model with the one obtained practically. Write the result based on the comparison
between theoretical and practical result.
RESULT:
Zeros, poles and gain for the given state model is obtained both theoretically and practically. It isfound that both the theoretical result and practical result are equal. The result obtained are as
follows.
Practical Result:
Theoretical Result:
-
8/18/2019 CS Lab Mannual
17/122
C
17
8.STEP RESPONSE OF A TRANSFER FUNCTION
AIM:
To obtain the step response of a transfer function of the given system using MATLAB.
MATLAB PROGRAM:
num = input(‘enter the numerator of the transfer function’)
den = input(‘enter the denominator of the transfer function’)
step(num,den)
EXAMPLE:
Obtain the step response of the transfer function given below:
PROCEDURE:
Type the program in MATLAB editor that is in M-file. Save and run the program.
Give the required inputs in the command window of MATLAB in matrix format. step calculates the unit step response of a linear system. Zero initial state is assumed in state-space case.
When invoked with no output arguments, this function plots the step response on the
screen. step (sys) plots the response of an arbitrary LTI system.
This model can be continuous or discrete, and SISO or MIMO. The step response of multi-input systems is the collection of step responses for each input
channel. The duration of simulation is determined automatically based on the system poles and
zeroes. Note down the response of the transfer function obtained in MATLAB. The response of the transfer function is also obtained theoretically.
Both the responses are compared.
-
8/18/2019 CS Lab Mannual
18/122
C
18
TABULAR FORM
0.005
0
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0.04
0.045
0 2 4 6 8 10 12
T C(T)
0
1
2
3
4
5
6
-
8/18/2019 CS Lab Mannual
19/122
C
19
RESULT: The step response of a transfer function for a given system isobtained boththeoretically and by using Matlab.
Viva Questions:
1. what is meant by step response of a control system?
2. how to test a control system to obtain step response?
-
8/18/2019 CS Lab Mannual
20/122
C
20
-
8/18/2019 CS Lab Mannual
21/122
C
21
9.IMPULSE RESPONSE OF A TRANSFER FUNCTION
AIM:
To obtain the impulse response of a transfer function of the given system using MATLAB.
MATLAB PROGRAM:
num = input(‘enter the numerator of the transfer function’)
den = input(‘enter the denominator of the transfer function’)
impulse(num,den)
EXAMPLE:
Obtain the impulse response of the transfer function given below:
T(S)=
PROCEDURE:
Type the program in the MATLAB editor that is in M-file. Save and run the program. Give the required inputs in the command window of MATLAB in matrix format. impulse calculates the impulse response of a linear system. The impulse response is the response to the Dirac input, δ (t) for continuous time systems
and to a unit pulse at for discrete time systems.
Zero initial state is assumed in the state space case. When invoked without left hand arguments, this function plots the impulse response on
the screen. impulse(sys) plots the impulse response of an arbitrary LTI model sys.
This model can be continuous or discrete, SISO or MIMO. The impulse response of multi-input systems is the collection of impulse responses for
each input channel.
The duration of simulation is determined automatically to display the transient behaviour
of the response. Note down the response of the given transfer function obtained in MATLAB.
The response of the transfer function is also obtained theoretically.
Both the responses are compared.
T C(t)
0
1
2
3
-
8/18/2019 CS Lab Mannual
22/122
C
22
TABULAR FORM:
THEORETICAL RESULT:
4
5
-
8/18/2019 CS Lab Mannual
23/122
C
23
RESULT:
The impulse response of a transfer function for a given system is obtained both theoretically and
by using MATLAB.
Viva Questions:
1. What do you meant by impulse response of a control system?
-
8/18/2019 CS Lab Mannual
24/122
C
24
-
8/18/2019 CS Lab Mannual
25/122
C
25
10.RAMP RESPONSE OF A TRANSFER FUNCTION
AIM:
To obtain the ramp response of a transfer function of the given system using MATLAB.
MATLAB PROGRAM:
num = input(‘enter the numerator of the transfer function’)
den = input(‘enter the denominator of the transfer function’)
sim(num,den,u,t)
EXAMPLE:
Obtain the ramp response of the transfer function given below:
PROCEDURE:
Type the program in the MATLAB editor that is in M-file. Save and run the program. Give the required inputs in the command window of MATLAB in matrix format.
lsim simulates the (time) response of continuous or discrete linear systems to arbitraryinputs. When invoked without left-hand arguments, lsim plots the response on the screen.
lsim(sys,u,t) produces a plot of the time response of the LTI model sys to the input time
history t,u. The vector t specifies the time samples for the simulation and consists of regularly spaced
time samples.
t = 0:dt:Tfinal
The matrix u must have as many rows as time samples (length(t)) and as many columns
as system inputs.
Each row u(i,:) specifies the input value(s) at the time sample t(i). Note down the response of the transfer function obtained in MATLAB.
The response of the transfer function is also obtained theoretically.
Both the responses are compared.
-
8/18/2019 CS Lab Mannual
26/122
C
26
RESULT:
0
0.005
0.01
0.015
0.02
0.025
0.03
0 0.1 0.2 0.3 0.4 0.5 0.6
PRACTICAL RESULT:
RESULT: The ramp response of a transfer function for a given system is
obtained both theoretically and by using Matlab.
Viva Questions:
1. what do you meant by ramp response?
-
8/18/2019 CS Lab Mannual
27/122
C
27
-
8/18/2019 CS Lab Mannual
28/122
C
28
11. STEP RESPONSE OF A STATE MODEL
AIM:
To find the step response of a state model for a given system using MATLAB.
MATLAB PROGRAM:
A=input(‘enter matrix A’)
B=input(‘enter matrix B’)
C=input(‘enter matrix C’)
D=input(‘enter matrix D’)
Step(A,B,C,D)
EXAMPLE:
Obtain the step response of the state model for the given system.
T.F.=
PROCEDURE:
1. Step calculates the unit step response of a linear system. Zero initial state is assumed in
the state-space case.
2. When invoked with no output arguments, this function plots the step response on thescreen.
3. Step(sys) plots the step response of an arbitrary LTI model sys. This model can becontinuous or discrete, and SISO or MIMO.
4. The duration of simulation is determined automatically based on the system poles and
zeros.5. You can specify either a final time t = Tfinal (in seconds), or a vector of evenly spaced
time samples of the form
t = 0:dt:Tfinal
6.
For discrete systems, the spacing dt should match the sample period. For continuoussystems, dt becomes the sample time of the discretized simulation model (see"Algorithm"), so make sure to choose dt small enough to capture transient phenomena.
7. To plot the step responses of several LTI models sys1,..., sysN on a single figure, use
step(sys1,sys2,...,sysN)
-
8/18/2019 CS Lab Mannual
29/122
C
29
step(sys1,sys2,...,sysN,t)
8. All systems must have the same number of inputs and outputs but may otherwise be amix of continuous- and discrete-time systems.
9. This syntax is useful to compare the step responses of multiple systems
PRACTICAL RESULT:
PRACTICAL RESULT:
-
8/18/2019 CS Lab Mannual
30/122
C
30
RESULT:
Thus obtained the step response of the state model using MATLAB and verified theoretically
and practically.
Viva Questions:
1. Define step signal?
-
8/18/2019 CS Lab Mannual
31/122
C
31
-
8/18/2019 CS Lab Mannual
32/122
C
32
12.IMPULSE REPONSE OF A STATE MODEL
AIM:
To obtain the impulse response of a state model for a given system.
MATLAB PROGRAM:
A=input('enter matrix A')B=input('enter matrix B')
C=input('enter matrix C')
D=input('enter matrix D')impulse(A,B,C,D)
PROCEDURE:
1. Impulse calculates the unit impulse response of a linear system.
2. Zero initial state is assumed in the state-space case. When invoked without left-handarguments, this function plots the impulse response on the screen.
3. Impulse(sys) plots the impulse response of an arbitrary LTI model sys. This model can be
continuous or discrete, and SISO or MIMO.4. The duration of simulation is determined automatically to display the transient behavior
of the response.
5. Impulse(sys,t) sets the simulation horizon explicitly. You can specify either a final time t= Tfinal (in seconds), or a vector of evenly spaced time samples of the formt = 0:dt:Tfinal
6. For discrete systems, the spacing dt should match the sample period. For continuous
systems, dt becomes the sample time of the discretized simulation model (see"Algorithm"), so make sure to choose dt small enough to capture transient phenomena.
7. To plot the impulse responses of several LTI models sys1,..., sysN on a single figure, use
impulse(sys1,sys2,...,sysN)
impulse(sys1,sys2,...,sysN,t)
EXAMPLE:
Transfer function.=
-
8/18/2019 CS Lab Mannual
33/122
C
33
0.02
0
0.02
0.04
0 0.5 1 1.5 2 2.5
PRACTICAL GRAPH:
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9-0.01
-0.005
0
0.005
0.01
0.015
0.02
0.025
0.03
RESULT:
The impulse response of a state model for a given system is obtained both theoritically and
practically and verified graphically.
Viva questions:
1. Define impulse signal.
-
8/18/2019 CS Lab Mannual
34/122
C
34
-
8/18/2019 CS Lab Mannual
35/122
C
35
13.RAMP RESPONSE OF A STATE MODEL
AIM:
To obtain ramp response of a state model for a given system.
MATLAB PROGRAM:
t=0:0.01:10;u=t
A=input('enter matrix A')
B=input('enter matrix B')C=input('enter matrix C')
D=input('enter matrix D')
lsim(A,B,C,D,u,t)
PROCEDURE:1. lsim simulates the (time) response of continuous or discrete linear systems to arbitrary
inputs.2. When invoked without left-hand arguments, lsim plots the response on the screen.
3. lsim(sys,u,t) produces a plot of the time response of the LTI model sys to the input time
history t,u.
4. The vector t specifies the time samples for the simulation and consists of regularly spacedtime samples. t = 0:dt:Tfinal
5. The matrix u must have as many rows as time samples (length(t)) and as many columns
as system inputs. Each row u(i,:) specifies the input value(s) at the time sample t(i) .6. The LTI model sys can be continuous or discrete, SISO or MIMO. In discrete time, u
must be sampled at the same rate as the system (t is then redundant and can be omitted or
set to the empty matrix).7. In continuous time, the time sampling dt=t1-t2 is used to discretize the continuous model.
8. If dt is too large (undersampling), lsim issues a warning suggesting that you use a more
appropriate sample time, but will use the specified sample time.9. lsim(sys,u,t,x0) further specifies an initial condition x0 for the system states. This syntax
applies only to state-space models.
EXAMPLE:
Transfer function.=
-
8/18/2019 CS Lab Mannual
36/122
C
36
0.02
0
0.02
0.04
0.06
0.08
0 0.2 0.4 0.6
PRACTICAL GRAPH
0 1 2 3 4 5 6 7 8 9 100
1
2
3
4
5
6
7
8
9
10
:
RESULT:
The ramp response of a state model for a given system is obtained both theoritically and
practically and verified graphically.
-
8/18/2019 CS Lab Mannual
37/122
C
37
14.TRANSFER FUNCTION OF A DC GENERATOR
AIM:
To find the transfer function of a DC Generator.
APPARATUS :
Prime Mover
Ammeters (0-2A and 0-20A)
Voltmeters (0-300V)
NAME PLATE DETAILS :
Generator Motor
Power 2.2KW 2.2KW
Armature voltage 220V 220V
Armature current 10A 11.6A
Field voltage 220V 220V
Field current .64A .6A
Speed 1500rpm 1500rpm
Wound Shunt Shunt
PROCEDURE:
Make the connections as per circuit diagram. Keep variable AC in minimum position by
gradually increasing the output . Start the motor and bring the speed upto rated rpm i.e.
1500 rpm. To find ,magnetization characteristics If vs Vg has to be found. Vsc the straight line in
position to find K g = .
Find resistance R f found using the circuit. Measure the voltage across Z while current I is
also noted. To find If of the generator first the Is is denoted by V-I. Then Xf and Lf can be found.
Then the transfer function can be obtained from relation T.F =
OBSERVATIONS:
s.no Eg (V) If (A)
1 14
2 30
-
8/18/2019 CS Lab Mannual
38/122
C
38
GRAPH SHOWING O.C.C OF A DC GENERATOR
RESULT:
The transfer function of a dc generator is hence determined. It is found to be
3 60
90
5 120
6 150
7 180
8 200
9 210
10 220
-
8/18/2019 CS Lab Mannual
39/122
C
39
-
8/18/2019 CS Lab Mannual
40/122
C
40
15.TRANSFER FUNCTION OF A DC MOTOR
AIM:
• To determine the transfer function of a DC Motor.
• Interaction between mechanical and electrical quantities of a motor.
• Measuring time response of a DC motor and comparing with time response obtainedthrough transfer function.
PROCEDURE: Switch ON S1 and S2 and keep S3 OFF. Start the motor and gradually rise the speed upto the rated value i.e. 1500 rpm. Switch OFF S1 and press stop watch simultaneously . Note down the time taken by motor
speed to fall to 900 rpm. i.e. △ N = 600rpm. Stop the motor
Switch ON S1 and S2 and keep S3 OFF. Start the motor again and raise the speed up to 1500 rpm.
Switch off S2 and press stop watch. Note △T corresponding to △ N = 600rpm.
Stop the motor. Switch ON S1 and S2 and keep S3 OFF. Start the motor again and raise the speed up to 1500 rpm.
Note down Vs and Is. Switch OFF S2 and ON S3 and press stop watch simultaneously. Note the values until the speed falls to 900 rpm.
At 900 rpm also note the values of Va and Ia.
-
8/18/2019 CS Lab Mannual
41/122
C
41
OBSERVATIONS :
Case 1 : When S1 , S2 are ON and S3 is OFF
△
N1 = 600rpm△
T1 = secCase 2: When S1 is OFF , S2 are ON and S3 is OFF
△ N2 = 600rpm △T2 = sec
Case 3: When S1 is ON, S2 are OFF and S3 is ON.
△ N3 = 600rpm △T3 = sec.
Speed (rpm) Time (sec)
1500
1455
897
347
139
60
35
17
THEORETICAL CALCULATIONS:
Wmech + Wiron = J.N. watts =
Wmech = J.N. watts =
-
8/18/2019 CS Lab Mannual
42/122
C
42
Wcu = V.I + I2R a = J.N.
V1 = V, V2 = V. I1 = A , I2 = A
Hence, Vavg = V ; Iavg = A.
J.(271.43) = 87.33. Hence, J = 0.32
Rate of change of speed =
Retardation Power = =
63 % of 1500 rpm = rpm
Time taken to reach 900 rpm is time constant T = .
Hence B = =
Kt = Kb = = ( where w = . )
Transfer Function = =
RESULT:
Hence the transfer function of a dc motor is found using Retardation Process. The
transfer function is found to be
-
8/18/2019 CS Lab Mannual
43/122
C
43
-
8/18/2019 CS Lab Mannual
44/122
C
44
16.TIME RESPONSE OF SECOND ORDER
AIM:
To obtain the time response of a given second order system with its damping frequency.
MATLAB PROGRAM:
wn=input('enter value of undamped natural frequency')
z=input('enter value of damping ratio')
n=[wn*wn]
p=sqrt(1-z^2)
wd=wn*ph=[p/z]
k=atan(h)
m=pi-k;
tr=[m/wd]
tp=[pi/wd]
q=z*wn
ts=[h/q]
r=z*pi
f=[r/p]
mp=exp(-f)
num=[0 0 n]
den=[1 2*z*wn n]
s=tf(num,den)
hold on
step(s)
impulse(s)
-
8/18/2019 CS Lab Mannual
45/122
C
45
hold off
PROCEDURE:1.Time response of the system is being found when we give the values of natural undamped
frequency and damping ratio.
2.When we give these values first rise time ,peak time,peak overshoot,transfer function are being
calculated.
3.Then “ step(s)” And “impulse(s)” generates time response of the system.
5.The hold function determines whether new graphics object are added to the graph or replaces
objects in the graph.
6.hold on retains the current plot and certain axes properties so that subsequent graphing
command add to the existing graph.
7.hold off resets axes properties to their defaults before drawing new plots.hold off is the default.
PRACTICAL GRAPH:
-
8/18/2019 CS Lab Mannual
46/122
C
46
GRAPH:
RESULT:
The time response of a second order system for step and impulse inputs is found both
theoretically and practically by using MATLAB and both are found to be equal
VIVA Questions:
1. what is time response?
2. the closed transfer function of a second order system is given by (200)/(s²+20s+200).
Determine the damping ratio and natural frequency of oscillation.
3. what will be the nature of response of a second order system with different types of
damping?
-
8/18/2019 CS Lab Mannual
47/122
C
47
-
8/18/2019 CS Lab Mannual
48/122
C
48
17.ROOT LOCUS FROM A TRANSFER FUNCTION
AIM:
To plot the root locus for a given transfer function of the system using MATLAB.
MATLAB PROGRAM:
num=input(‘enter the numerator of the transfer function’)
den=input(‘enter the denominator of the transfer function’)
h=tf(num,den)
rlocus(h)
PROCEDURE:
• Write matlab program in the matlab specified documents.
• Then save the program to run it.
• The input is to be mentioned.
• The syntax “h=tf(num,den)” gives the transfer function and is represented as h.
• The syntax “rlocus(h)” plots the rootlocus of the transfer function h.
• Generally the syntax is of the form
rlocus(sys)
rlocus(sys,k)
rlocus(sys1, sys2, ….)
[r,k] = rlocus(sys)
r = rlocus(sys,k)
• rlocus(sys) calculates and plots the root locus of the open loop SISO model sys.
• Now we have to solve it theoretically.
• Now we have to compare the practical and theoretical ouputs to verify each other
correctly.
EXAMPLE:
Transfer function =
PRACTICAL:
enter the numerator of the transfer function num=
enter the denominator of the transfer function den=
-
8/18/2019 CS Lab Mannual
49/122
C
49
Transfer function :
RESULT:
The root locus of the given transfer function is obtained both theoretically and practically using
MATLAB.
V IVA Questions:
1. What is root locus?
2. What is the necessary condition for stability?
3. How the roots of characteristic equation related to stability?
-
8/18/2019 CS Lab Mannual
50/122
C
50
-
8/18/2019 CS Lab Mannual
51/122
C
51
18. BODE PLOT FROM A TRANSFER FUNCTION
AIM:
To obtain bode plot for a given transfer function of the system using matlab.
MATLAB PROGRAM:
num=input('enter the numerator of the transfer function')
den=input('enter the denominator of the transfer function')
h=tf(num,den)
[gm pm wcp wcg]=margin(h)
bode(h)
PROCEDURE:
Write the matlab program in the matlab editor. Then save and run the program.
Give the required inputs. The syntax "bode(h)" solves the given input transfer function and gives the bode plot, where num,den are the numerator and denominator of the transfer function. Now plot the bode plot theoretically for the given transfer function and compare it with the
plot obtained practically.
EXAMPLE:
Transfer function=
PRACTICAL CALCULATIONS:
enter the numerator of the transfer function
num =
enter the denominator of the transfer function
den =
Transfer function:
gm = pm = wcp = wcg =
-
8/18/2019 CS Lab Mannual
52/122
C
52
RESULT: Bode plot is obtained for the given transfer function of the system usingmatlab and verified with theoretically and practically obtained plots.
Viva Questions:
1. What is bode plot?
2. what are the advantages of bode plot?
3. what is frequency response?
-
8/18/2019 CS Lab Mannual
53/122
C
53
-
8/18/2019 CS Lab Mannual
54/122
C
54
19. PID CONTROLLER
AIM:
To control the closed loop system using PID controller.
MATLAB PROGRAM:
num=input('enter the numerator of the transfer function')den=input('enter the denominator of the transfer function')
h=tf(num,den)
[gm pm wcp wcg]=margin(h)km=10*(gm/20)
wm=wcp
kp=0.6*kmki=(kp*wm)/pi
kd=(kp*ki)/(4*wm)
h1=tf([1,0],[1])g=(kp+(kd*h1)+(ki/h1))*h
bode(g)
PROCEDURE:
1) Note down the given transfer function.
2) Sketch the bode plot for the given transfer function by Factor the transfer function into pole-zero form.
3) Find the frequency response from the Transfer function.
4) Use logarithms to separate the frequency response into a sum of decibel terms5) Use w=0 to find the starting magnitude.
6) The locations of every pole and every zero are called break points. At a zero breakpoint,
the7) Slope of the line increases by 20dB/Decade. At a pole, the slope of the line decreases by
8) 20dB/Decade.
9) At a zero breakpoint, the value of the actual graph differs from the value of the staright-line graph by 3dB. A zero is +3dB over the straight line, and a pole is -3dB below the
straight line.
10) Sketch the actual bode plot as a smooth-curve that follows the straight lines of the
previous point, and travels through the breakpoints
11) If A is positive, start your graph (with zero slopes) at 0 degrees. If A is negative, start
your graph with zero slope at 180 degrees (or -180 degrees, they are the same thing).
12) For every zero, slope the line up at 45 degrees per decade when w= (1 decade before
the Break frequency). Multiple zeros means the slope is steeper
13) For every pole, slope the line down at 45 degrees per decade when w = (1 decade
before the break frequency). Multiple poles means the slope is steeper.
14) Find out the gain margin, phase margin, wcp and wcg
-
8/18/2019 CS Lab Mannual
55/122
C
55
15) From those calculate km,wm,kp,ki,kd16) Already transfer function h1 is given. Now find out the transfer function g and sketch
bode plot for g by repeating steps from 2 -13.
THEORITICAL CALCULATIONS:
Given Transfer function =
A =
W A
0.01
0.1
1
5
7
10
100
Phase plot:
Ø = -90 - ( - ( - ( - (w
W Ø
0.01
0.1
1
5
7
10
100
For the above transfer function
Gain margin =
Phase margin =
-
8/18/2019 CS Lab Mannual
56/122
C
56
Wcp =
Wcg =
Now
Km = 10 x
=
Wm = wcp =
Kp = 0.6 x km =
Ki = (kp x km)/pi
=
Kd = (kp x ki)/(4 x wm)
=
Transfer function h1 = s
g = [kp + (kd x h1) + (ki/h1)] x h
=
Bode plot for transfer function g:
Magnitude Plot:
A=
W A
0.01
0.1
1
5
7
10
50
100200
500
1000
Phase Plot:
-
8/18/2019 CS Lab Mannual
57/122
C
57
Ø =
W Ø
0.010.1
1
5
7
10
50
100
200
500
1000
PRACTICAL CALULATIONS:
enter the numerator of the transfer function[ ]
num =
enter the denominator of the transfer function[ ]
den =
Transfer function:
gm =
pm =
wcp =
wcg =
km =
wm =
kp =
ki =
-
8/18/2019 CS Lab Mannual
58/122
C
58
kd =
Transfer function:
s
Transfer function:
-200
-150
-100
-50
0
50
100
M a g n i t u d e ( d B )
10
-2
10
-1
10
0
10
1
10
2
10
3-360
-270
-180
-90
0
P h a s e ( d e g )
Bode Diagram
Frequency (rad/sec)
RESULT:
The closed loop system of a given transfer function is controlled using matlab and is verified
theoretically.
VIVAB QUESTIONS:
1. what is PID controller?
2. sketch the ramp response of PID controller.
-
8/18/2019 CS Lab Mannual
59/122
C
59
-
8/18/2019 CS Lab Mannual
60/122
C
60
20.LAG COMPENSATOR
AIM: To design a lag compensator for a closed loop system
MATLAB PROGRAM:
num= input (‘enter the numerator’)
den= input (‘enter the denominator’)
h= tf (num, den)
kv= input (‘enter kv’)
phm= input (‘enter phase margin’)
h1= tf ([1 0], [1])
m= dcgain (h1*h)
g= k*h
[mag, phase, w]= bode (g)
e= input (‘enter margin of safety’)
bode (g)
theta= phm+e;
bm= theta-180;
wcm= input (‘enter wcm corresponding to bm’)
a= input (‘enter gain corresponding to wcm’)
beta= 10^(a/20)
w2= wcm/4
tou= 1/w2
w1= 1/(beta*tou)
g1= (h1+w2)/(h1+w1)
g2= g1*g
[gm1 pm1 wcg1 wcp1]= margin(g2)
bode (g2)
-
8/18/2019 CS Lab Mannual
61/122
C
61
hold
bode (g)
if ( (wcg1
-
8/18/2019 CS Lab Mannual
62/122
C
62
-150
-100
-50
0
50
100
M a g n i t u
d e ( d B )
10
-2
10
-1
10
0
10
1
10
2-270
-225
-180
-135
-90
P h a s e ( d e g )
Bode Diagram
Frequency (rad/sec)
RESULT: Hence, the lag compensation of the system is obtained and is verified theoretically
-
8/18/2019 CS Lab Mannual
63/122
C
63
-
8/18/2019 CS Lab Mannual
64/122
C
64
21. LEAD COMPENSATOR
AIM: To design a lead compensator for a closed loop system
MATLAB PROGRAM:
z
bm=theta-180;
wcm=input('enter wcm corresponding to bm')
w1=wcm*sqrt(alpha)
w2=wcm/sqrt(alpha)
g1=tf([1/w1 1],[1/w2 1])
g2=g1*g[mag3, phase3, w3]=bode(g2)
bode(g2)
hold bode(g)
PROCEDURE:
• Write the program in matlab editor and save it
• Enter the values of numerator and denominator of the uncompensated system given whenasked during execution
• Also enter the values of kv, phase margin and margin of safety
• bode (g) returns the bode plot of gain adjusted but uncompensated system
• bode (g2) returns the bode plot of compensated sytem
EXAMPLE:
is designed to compensate for the system so that the static velocity error constant
is 20 sec-1 and phase margin is 50 and gain margin is atleast 10 db
THEORITICAL CALCULATIONS:
Given that
-
8/18/2019 CS Lab Mannual
65/122
C
65
We have
The magnitude and phase plots for open loop transfer function for uncompensated system can be
given as
Mag (db)46 0.01 -90.2
26 0.1 -92.86
5 1 -116.56
-28.12 10 -168.69
-68 100 -178.85
Any lead compensator will be of the form
The compensated system will have the open loop transfer function as
Given that kv= 20 sec-1
Therefore
Value of
This gain is achieved at a critical frequency
Therefore the critical frequencies for the lead compensator are
Whose values are equal to 4.41 rad/sec and 18.4 rad/sec
Thus the lead compensator is
Where
Therefore the transfer function of compensated system is given by
-
8/18/2019 CS Lab Mannual
66/122
C
66
Therefore the open loop transfer function of the compensated system is
Practical graph:
-150
-100
-50
0
50
M a g n i t u d e ( d B )
10-1
100
101
102
103
-180
-135
-90
-45
P h a s e ( d e g )
Bode Diagram
Frequency (rad/sec)
RESULT:
Hence the lead compensation for a given system is obtained and is compared theoretically
-
8/18/2019 CS Lab Mannual
67/122
C
67
-
8/18/2019 CS Lab Mannual
68/122
C
68
22. LAG- LEAD COMPENSATOR
AIM:
To design lag-lead compensator using closed loop system.
MATLAB PROGRAAM:
num=input('enter the numerator')den=input('enter the denominator')
h=tf(num,den)
kv=input('enter velocity error') phm=input('enter the phase margin')
h1=tf([1 0],[1])
m=dcgain(h1*h)
k=kv/mg=k*h
[mag phase w]=bode(g)[gm pm wcg wcp]=margin(g)e=input('enter margin of safety')
bode(g)
theta=phm+e; bm=theta-180;
wcm=('enter wcm corresponding to bm')
a=input('enter gain corresponding to wcm') beta=10^(a/20)
w21g=wcm/4
tou=1/w21g
w11g=1/(beta*tou)g1=(h1+w21g)/(h1+w11g)
theta1d=theta1d*(pi/180);
alpha=(1-sin(theta1d)/(1+sin(theta1d)))a=-20*log10(1/sqrt(alpha))
wcm1d=input('enter the value of wcmld corresponding to gain a1')
w11d=wcm1d*sqrt(alpha)w21d=wcm1d/sqrt(alpha)
g3=tf([1/w11d1],[1/w21d 1])
g4=g3*g1*g[mag3 phase3 w3]=bode(g2)
bode(g)
hold bode(g4)
-
8/18/2019 CS Lab Mannual
69/122
C
69
PROCEDURE:
• Numerator of the given transfer function is assigned to num
• Denominator of the transfer function is assigned to den
• The value of the static velocity constant is assigned to the kv
• Margin of the safty is assigned to e
• Plot is obtained by in-build function bode()
• Wcm values assigned to wcm which is obtained from above bode plot
• The gain corresponding to wcm is assigned to a
• If wcg1>wcg orr wcp1>wcp, the network is compensated otherwise it is not
compensated.
THEORITICAL CALCULATIONS:
Transfer function=
=
For complex w,
Gain =-40db
MAGNITUDE PLOT:
Factor Corner frequency Log magnitude in db=-20log(factor)
W=1/Jω None 0
W=1/(1+Jω) 1 -20
W=1/(1+2Jω) 2 -60
-
8/18/2019 CS Lab Mannual
70/122
C
70
PHASE PLOT:
Φ=-90-
W(rad/sec) Φ
0.1 0
0.2 -98.57
1 -107.02
2 -161.56
10 -198.43
20 -261.43
20log5=139.8
New phase margin required is=-40+3=-37
Frequency corresponding to -37 is 1.4=wcg
RESULT:Hence given network is lag-lead compensated.
VIVA QUESTIONS:
1. What is phase margin?
-
8/18/2019 CS Lab Mannual
71/122
C
71
-
8/18/2019 CS Lab Mannual
72/122
C
72
23. DETERMINATION OF TRANSFER FUNCTION OF DC MOTOR
USING LABVIEW
AIM: To control the speed of the dc motor and find the transfer function of the complete speed
control system using bode plot.
THEORY:
A Bode Plot is a graph of the system’s frequency response. By frequency response we mean the
response of a system to sinusoidal input. Any linear system will give a sinusoidal output to a
sinusoidal input . The frequency of the output will be the same as that of the input. We observethe output by varying the frequency of the input. At low frquencie the magnitude of the output
will be same as that of input. But at higher frequencies the magnitude will normally fall and also
the output will lag from the input. These two aspects are brought about very well by Bode plot Itis usually a combination of a Bode magnitude plot (usually expressed as dB of gain) and a Bode
phase plot.
This is a simple and accurate method for graphing gain and phase-shift plots. A Bode phase plotis a graph of phase versus frequency, also plotted on a log-frequency axis, usually used in
conjunction with the magnitude plot, to evaluate how much a signal will be phase-shifted. Themagnitude and phase Bode plots can seldom be changed independently of each other changing
the amplitude response of the system will most likely change the phase characteristics and vice
versa.
Bode plots are a very useful way to represent the gain and phase of a system as a function of
frequency. This is referred to as the frequency domain behavior of a system.
LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a platform
and development environment for a visual programming language from National Instruments.
The graphical language is named "G". LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms including Microsoft
Windows, various flavors of UNIX, Linux, and Mac OS X.
The programming language used in LabVIEW, also referred to as G, is a dataflow programming
language. Execution is determined by the structure of a graphical block diagram (the LV-sourcecode) on which the programmer connects different function-nodes by drawing wires. These
wires propagate variables and any node can execute as soon as all its input data become
available. Since this might be the case for multiple nodes simultaneously, G is inherently capable
of parallel execution. Multi-processing and multi-threading hardware is automatically exploited by the built-in scheduler, which multiplexes multiple OS threads over the nodes ready for
execution.
LabVIEW ties the creation of user interfaces (called front panels) into the development cycle.
LabVIEW programs/subroutines are called virtual instruments (VIs). Each VI has threecomponents: a block diagram, a front panel, and a connector panel. The last is used to represent
the VI in the block diagrams of other, calling VIs. Controls and indicators on the front panel
allow an operator to input data into or extract data from a running virtual instrument. However,
http://en.wikipedia.org/wiki/Visual_programming_languagehttp://en.wikipedia.org/wiki/National_Instrumentshttp://en.wikipedia.org/wiki/National_Instrumentshttp://en.wikipedia.org/wiki/Data_acquisitionhttp://en.wikipedia.org/wiki/Data_acquisitionhttp://en.wikipedia.org/wiki/Instrument_controlhttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Unixhttp://en.wikipedia.org/wiki/Unixhttp://en.wikipedia.org/wiki/Linuxhttp://en.wikipedia.org/wiki/Linuxhttp://en.wikipedia.org/wiki/Mac_OS_Xhttp://en.wikipedia.org/wiki/Mac_OS_Xhttp://en.wikipedia.org/wiki/Dataflow_programminghttp://en.wikipedia.org/wiki/Multi-processinghttp://en.wikipedia.org/wiki/Multi-threadinghttp://en.wikipedia.org/wiki/Multi-threadinghttp://en.wikipedia.org/wiki/Multiplexinghttp://en.wikipedia.org/wiki/Operating_Systemhttp://en.wikipedia.org/wiki/Operating_Systemhttp://en.wikipedia.org/wiki/Multiplexinghttp://en.wikipedia.org/wiki/Multi-threadinghttp://en.wikipedia.org/wiki/Multi-processinghttp://en.wikipedia.org/wiki/Dataflow_programminghttp://en.wikipedia.org/wiki/Mac_OS_Xhttp://en.wikipedia.org/wiki/Linuxhttp://en.wikipedia.org/wiki/Unixhttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Instrument_controlhttp://en.wikipedia.org/wiki/Data_acquisitionhttp://en.wikipedia.org/wiki/National_Instrumentshttp://en.wikipedia.org/wiki/Visual_programming_language
-
8/18/2019 CS Lab Mannual
73/122
C
73
the front panel can also serve as a programmatic interface. Thus a virtual instrument can either be run as a program, with the front panel serving as a user interface, or, when dropped as a node
onto the block diagram, the front panel defines the inputs and outputs for the given node through
the connector pane. This implies each VI can be easily tested before being embedded as a
subroutine into a larger program.
LABVIEW PROGRAM:
-
8/18/2019 CS Lab Mannual
74/122
C
74
PROCEDURE: The hardware connections are made. The LABVIEW program for speed control of DC motor is written using LABVIEW
software. The hardware and software are interfaced using DAQ. Then the motor is made to run at different frequencies by clicking the start button in the
labview program. The values of actual and set speed are obtained and graphs for Time vs amplitude for
both input and output speed at different frequencies are drawn in the Excel sheet. The magnitude and phase plots are drawn using these values. Then the Bode plot is obtained.
Finally the transfer function of the DC motor is obtained.
OUTPUT:
Bode plot for the speed control system:
Magnitude plot
-
8/18/2019 CS Lab Mannual
75/122
C
75
Phase plot
Transfer function of the speed control system is:
86.76 x 10^9
___________________________
s(s+1000)(s+400)(s+20)(s+10)
RESULT:
Hence the transfer function of the complete speed control system is obtained.
-
8/18/2019 CS Lab Mannual
76/122
C
76
-
8/18/2019 CS Lab Mannual
77/122
C
77
24. HYSTERETIC CONTROL OF SPEED AND CURRENT OF DC
MOTOR, OUTPUT TO KEEP ARMATURE CURRENT WITHIN LIMITS
USING LabVIEW
Aim: To control speed and armature current of a dc motor with in two specific limits
using LabVIEW.
Theory:
Hysteretic current control is a method of controlling a power electronic converter so that an
output current is generated which follows a reference current waveform. A Hysteretic current
controller is implemented with a closed loop control. The difference between the desired current,
and the current being injected is used to control the switching of the thyristor circuit. When thecurrent crosses an upper limit namely upper hysteretic limit, a pulse is produced to decrease the
current. On the other hand when the current crosses the lower hysteretic limit, a pulse is
produced to increase the current. The minimum and maximum values of the current signal are[i.min] and [i.max]. The range of the current signal, [i.max]-[i.min], directly controls the amount
of ripple in the output current and is called the hysteretic current. Thus the armature current is
forced to stay within the hysteretic current determined by the upper and lower hysteretic limits.A sensor (proximity sensor) is used to detect the speed pulses of the motor in order to maintainspeed within the limits.
In the speed control of a DC shunt motor, the desired operating state may be a particular speed. If
it is different, an error signal, correspond to the difference between the reference and the actualspeeds, is fed to a voltage controller to change the motor speed so as to reduce the error signal.
When the motor is operating at the desired speed the error signal will be zero and the motor will
maintain that speed. For controlling armature current within the limits the procedure is same.Programming is done using advanced version of LabVIEW software wherein the entire operation
can be clearly produced and this is done in a computer which is interfaced with the DAQ USB-
6009 (advanced version of DAQ) using an USB driver. Once the interfacing is done and the program is sent to DAQ, the speed of the dc motor can be controlled with desired speed and also
the armature current will stay with in the limits.
-
8/18/2019 CS Lab Mannual
78/122
C
78
Block Diagram:
LabVIEW Program:
-
8/18/2019 CS Lab Mannual
79/122
C
79
Procedure:
A proximity sensor is connected to the shaft of DC motor. From the sensor the signals are
given to the input DAQ. A waveform generator is connected to the input DAQ to observe the pulses. From the data pin of input DAQ the pulses are split into two. One sent to frequency pin
of tone measurement. That is used for speed control and another one is used for current controlwith in limits. The output of tone measurement is rps but we need rpm so the frequency signal is
multiplied with 60.
The rpm is compared with some set high value by using comparison greater than or equalto and the output is given to selector. The selector takes true condition if rpm is greater than or
equal to the set high value and passes numeric constant 0 else it passes the same signal. Theoutput of selector gives the actual speed signal. This is done for noise elimination.
The reference voltage should be set by using numeric constant and a closed while loop is
used. A slider is used to adjust the set speed. The slider output is connected to a multiplier
whose another input is a number constant 1.1 and the output gives the upper limit of speed. The slider output is also connected to another multiplier whose second input is a number
constant 0.9 and the output gives the lower limit of speed. A comparison greater than or equal to is taken whose inputs are actual speed and upper
limit of speed and output is connected to a selector. It compares where the actual speed is greaterthan or equal to the upper limit of speed. If it is greater than or equal to the selector takes the truecondition and the numeric constant representing –dv is selected else it selects 0 and the same
signal is passed. A comparison lesser than or equal to is taken whose inputs are actual speed and lowerlimit of speed and output is connected to a selector. It compares where the actual speed is less
than or equal to the lower limit of speed. If it is less than or equal to the selector takes the true
condition and the numeric constant representing dv is selected else it selects 0 and the samesignal is passed.
The outputs of both the selectors are given as inputs to an adder. The output of this adder
is given as input to another adder whose second input is reference voltage.
The current is compared with some set high value by using comparison greater than orequal to and the output is given to selector. This is the upper limit .The selector takes true
condition if current is greater than or equal to the set high value and passes numeric constant 0
else it passes the same signal. The output of selector gives the actual current signal. The current is compared with some set value by using comparison lesser than or equal to
and the output is given to selector. This is the lower limit. The selector takes true condition if
-
8/18/2019 CS Lab Mannual
80/122
C
80
current is lesser than or equal to the set value and passes numeric constant 0 else it passes thesame signal.
The output of these two selectors given as input to the adder .the output of this adder to
given as input to another adder whose second input is reference voltage. The output of this adder and output of speed signal adder to given as input to the other
adder. The output of this given to the output DAQ.
After completing connections in LabVIEW program is connect to DAQ using connector. Now
initialize input and output DAQ’s of LabVIEW and run the program.
Result:
Hence, the speed control and armature current controls of a DC shunt motor within two specified
limits is obtained by using LabVIEW.
-
8/18/2019 CS Lab Mannual
81/122
C
81
-
8/18/2019 CS Lab Mannual
82/122
C
82
25. BANG BANG SPEED CONTROL OF DC MOTOR
AIM:To control the speed of dc motor within the desired limits using LabVIEW.
THEORY:
This experiment explains about BANG BANG speed control of dc motor using LabVIEW to keepspeed within limit. Here, a power electronic converter is controlled such that an output voltage is
generated which follows a reference voltage waveform .The difference between the desired voltage and
the voltage being injected is used to control the armature voltage using a thyristor converter. When thespeed reaches the lower limit, reference is changed to increase the voltage and hence speed. When the
speed crosses an upper limit, reference is reduced to decrease the speed.
As an extension to this project, the speed is controlled within the specified upper and lower limits
.This type of controlling the speed between the limits is known as bang bang speed control.
BLOCK DIAGRAM:
CIRCUIT DIAGRAM:
-
8/18/2019 CS Lab Mannual
83/122
C
83
PROCEDURE:
• A proximity sensor is connected to the shaft of DC motor. From the
sensor the signals are given to the input DAQ.
-
8/18/2019 CS Lab Mannual
84/122
C
84
• A waveform generator is connected to the input DAQ to observe the pulses.
• From the data pin of input DAQ the pulses are sent to frequency pin oftone measurement.
• The output of tone measurement is rps but we need rpm so the frequencysignal is multiplied with 60.
• The rpm is compared with some set high value by using comparison greaterthan or equal to and the output is given to selector. The selector takes true
condition if rpm is greater than or equal to the set high value and passes
numeric constant 0 else it passes the same signal through dynamic data array.The output of selector gives the actual speed signal. T his comparison helps in
noise elimination.
• The reference voltage should be set by using numeric constant and a closed
while loop is used.• A slider is used to adjust the set speed. The slider output is connected to a
multiplier whose another input is a number constant 1.1 and the output gives
the upper limit of speed.
• The slider output is also connected to another multiplier whose second input is
a number constant 0.9 and the output gives the lower limit of speed.
• A comparison greater than or equal to is taken whose inputs are actual speedand upper limit of speed and output is connected to a selector. It compares
where the actual speed is greater than or equal to the upper limit of speed. If it
is greater than or equal to the selector takes the true condition and the numericconstant representing –dv is selected else it selects 0 and the same signal is
passed.
• A comparison lesser than or equal to is taken whose inputs are actual speed and
lower limit of speed and output is connected to a selector. It compares wherethe actual speed is less than or equal to the lower limit of speed. If it is less
than or equal to the selector takes the true condition and the numeric constant
representing dv is selected else it selects 0 and the same signal is passed.
• The outputs of both the selectors are given as inputs to an adder . The output ofthis adder is given as input to another adder whose second input is reference
voltage. The output of this adder is connected to shift register of while loop andalso output DAQ.
• Stop button is connected as condition to the selector through loop conditionwhose inputs are numeric constant 0 and other is the output of the final adder.
This helps us to stop the motor at 0 instead of some other value.The output of
-
8/18/2019 CS Lab Mannual
85/122
C
85
this selector is connected to data pin of output DAQ through dynamic dataarray.
• The output of final adder and a constant 5 are given to a greater than or equalto comparator whose output is given as condition to selector.This selector takes
constant 5 when the condition is true and the output of adder when condition is
false. The output of this selector is given to data signal of output DAQ. Thishelps us to control the value of DAQ less than or equal to 5.
RESULTS AND CONCLUSION
In machine laboratory, coarse and fine are used to control the speed of dc motor.There should be a person continuously observing whether the speed is lying between
the limits or not. This results in wastage of time and is also laborious. Instead, in this
project, the speed of dc motor was controlled within the desired limits automatically
using LabVIEW software.
-
8/18/2019 CS Lab Mannual
86/122
C
86
-
8/18/2019 CS Lab Mannual
87/122
C
87
26. SPEED CONTROL OF DC MOTOR USING PID CONTROLLER WITH
A TACHO FEEDBACK
AIM: Speed control of DC motor using PID controller with a Tacho feedback.
Software Used: LabVIEW
Components Required:
DC Motor
Thyristor Drive
1:1 DC to DC converter
Data Acquisition(DAQ)
Tacho Sensor
5 volts DC Supply
PROCEDURE:
• The three phase AC supply is given to a thyristor drive to which DC motor is
connected.
• The speed of the DC motor is sensed by a tachosensor which gives the squarewave signal whose frequency is proportional to the speed. This square
wavevoltage signal is given as DAQ input. The ‘tone measurement block in thelabVIEW software finds the frequency which is then multiplied by 60 to get
RPM.The error in speed is fed to PID block whose output is sent as output signal
of DAQ card.
• The obtained output voltage signal is given to thyristor drive as reference usingdc/dc isolator. Isolator used is a 1:1 DC-DC converter which is placed to avoid
faults.
• Again this controller output is given to DC motor. Hence, it is a closed loopoperation and finally speed of the DC motor is controlled using PID controller
using LabVIEW software.
LABVIEW PROGRAM:
The DAQ input signal is converted into frequency signal using tone measurement which
is in R.P.S. It is multiplied by 60 to get speed in R.P.M. A selector is use to select the originalvalue if the speed is lesser than 1000(some higher value) and selects zero if it is greater than
1000. This is done to eliminate the noise. This obtained value and some reference sinusoidal
signal are merged and is given to a lvm writer which records the input an output values. Now, theerror is calculated which is the difference between the obtained value and the reference
-
8/18/2019 CS Lab Mannual
88/122
C
88
sinusoidal signal and is modulated to get the positive error. This error is individually multipliedwith kp(Proportional constant), ki(integral constant) and kd(Differential constant) and are
proportionated, integrated and differentiated. The obtained proportional, Integral and differential
values are summated which gives the differential voltage voltage (dv). Another selector is usedwhich selects the positive value of dv if the actual speed is less than the reference sinusoidal
signal and selects the negative dv if it is greater than reference sinusoidal signal. The obtained
value is added with some initial voltage (say 0.5v) and is given to shift register and DAQ output.Shift register replaces the initial voltage with th obtained voltage and hence it is closed loop
operation.
Hence, speed of the DC motor is controlled using PID controller in a LabVIEW software.
PID CONTROLLER:
where
Pout, Iout,
and Dout
are thecontributions to the output from the PID controller from each of the three terms, as
defined below.
Proportional term:
The proportional term (sometimes called gain) makes a change to the output that is
proportional to the current error value. The proportional response can be adjusted by multiplyingthe error by a constant K p, called the proportional gain.
The proportional term is given by:
where
Pout: Proportional term of output
-
8/18/2019 CS Lab Mannual
89/122
C
89
K p: Proportional gain, a tuning parametere: Error = SP − PV
t: Time or instantaneous time (the present).
Integral term:
The contribution from the integral term (sometimes called reset) is proportional to both
the magnitude of the error and the duration of the error. Summing the instantaneous error over
time (integrating the error) gives the accumulated offset that should have been corrected previously. The accumulated error is then multiplied by the integral gain and added to the
controller output. The magnitude of the contribution of the integral term to the overall control
action is determined by the integral gain, K i.The integral term is given by:
where
Iout: Integral term of outputK i: Integral gain, a tuning parameter
e: Error = SP − PV
t: Time or instantaneous time (the present)
τ: a dummy integration variable
Derivative term:
The rate of change of the process error is calculated by determining the slope of the errorover time (i.e., its first derivative with respect to time) and multiplying this rate of change by the
derivative gain K d. The magnitude of the contribution of the derivative term (sometimes called
rate) to the overall control action is termed the derivative gain, K d.
The derivative term is given by:
where
Dout: Derivative term of output
K d: Derivative gain, a tuning parametere: Error = SP − PV
t: Time or instantaneous time (the present)
-
8/18/2019 CS Lab Mannual
90/122
C
90
LabVIEW BLOCK DIAGRAM:
This is the block diagram of a PID controller. The DAQ input signal is converted intofrequency signal using tone measurement which is in R.P.S. It is multiplied by 60 to get speed inR.P.M. A Selector is use to select the original value if the speed is lesser than 1000(some higher
value) and selects zero if it is greater than 1000. This is done to eliminate the noise. This
obtained value and some reference sinusoidal signal are merged and is given to a lvm writerwhich records the input an output values. Now, the error is calculated which is the difference
between the obtained value and the reference sinusoidal signal and is modulated to get the
positive error. This error is individually multiplied with kp(Proportional constant), ki(integralconstant) and kd(Differential constant) and are proportionated, integrated and differentiated. The
obtained proportional, Integral and differential values are summated which gives the differential
voltage voltage (dv). Another selector is used which selects the positive value of dv if the actual
speed is less than the reference sinusoidal signal and selects the negative dv if it is greater thanreference sinusoidal signal. The obtained value is added with some initial voltage (say 0.5v) and
is given to shift register and DAQ output. Shift register replaces the initial voltage with th
obtained voltage and hence it is closed loop operation.
Hence, speed of the DC motor is controlled using PID controller in a labview software.
-
8/18/2019 CS Lab Mannual
91/122
C
91
MS-Excel:
It is used to record the speed of the motor with corresponding times. Input speed versus time
graphs and output speed versus time graphs are drawn and checked if both the graphs are similar.
WAVEFORMS:
INPUT WAVEFORMS
OUTPUT WAVEFORMS
-
8/18/2019 CS Lab Mannual
92/122
C
92
INPUT AND
OUTPUT WAVEFORMS
Series2 – Input
Series4 - output
RESULT:
Speed of the DC motor was controlled using a PID controller and respective input and output
waveforms were drawn.
-
8/18/2019 CS Lab Mannual
93/122
C
93
-
8/18/2019 CS Lab Mannual
94/122
C
94
27. EXPERMENTAL DETERMINATION OF FREQUENCY RESPONSE
OF SPEED CONTROL OF A DC MOTOR AND TO OBTAIN THE
TRANSFER FUNCTION OF THE SYSTEM USING LABVIEW
AIM: To determine the frequency response (Bode Plot) of speed control of a DC Motor and to
obtain the transfer function of the system using LABVIEW software.
THEORY:
SPEED CONTROL OF DC MOTOR:
Speed control of DC motor can be precisely done using three methods. It is required to obtain the
speed characteristics of a DC shunt motor as a function of armature voltage, field current and
external resistance in the armature circuit. The whole process of speed control is automated by
using LABVIEW
Instability of a DC Motor can be observed in three ways :
1. The Motor speed abruptly becomes zero.2. The speed of motor keeps oscillating between the minimum and maximum value
continuously and uncontrollably.3. The speed of Motor abruptly increases to maximum value and keeps running at maximum
speed continuously and uncontrollably.
DEFINITION OF FREQUENCY RESPONSE:
When a sinusoid signal is applied to the system the amplitude of the output obtained will not be
same as that of the amplitude of input signal and there is a phase difference between the input
and output signal.As the frequency of input is increased out put amplitude reduces and phase
shift occurs. This type of response is known as frequency response.The magnitude and phase relationship between sinusoidal input and the steady state output is
termed as frequency response
BODE PLOT:
It is a logarithmic plot which consists of two graphs, one giving the logarithm of | G(jw) | and the
other phase angle of G(jw) both plotted against frequency in logarithmic scale. These plots are
called Bode plots in honour of H.W.Bode who did the basic work in this area.
The standard procedure is to plot 20log| G(jw) |and phase angle ¢(w) versus log w i.e., frequency
on a logarithmic scale .in this representation ,the unit of magnitude 20 log| G(jw) | is decibel,
abbreviated as db.
LABVIEW PROGRAM TO CONTROL MOTOR SPEED
The proximity sensor senses the speed of the DC motor and generates the square wave form.Its
frequency is found by a function block called ‘tone measurement’ and multiplied by 60 to get
RPM.
-
8/18/2019 CS Lab Mannual
95/122
C
95
To eliminate the noise and to get pure signal from the proximity sensor, the signal is comparedwith the maximum speed (here 1200rpm) and if the value of the actual speed is greater than the
maximum speed then the value of zero is assigned The signal thus obtained is then compared
with the desired speed at which the DC motor is required to rotate. Here the actual speed of theDC motor is compared with the reference speed, if the value of actual speed is greater than the
reference speed then the constant (here dv) at various instance is being subtracted from the
voltage corresponding to actual speed until it attains the reference speed by while loop. Similarlyin case if the actual speed is less than the reference speed then a constant ‘dv’ is added to the
voltage corresponding to actual speed until it attains the reference speed.
Here the reference speed is given as the input at various frequencies by using ‘simulate signal’.
The DAQ (USB 6008/6009) which we are using can hold the voltage values up to 5volts. In caseif the voltage corresponding to different speeds exceeds 5volts separate block diagram has been
constructed in order to restrict output to 5V.
The reference speed and the corresponding voltage, actual speed at corresponding voltage is
then fed to “write to frequency” block where the input and output graphs at particular speed is
drawn from the graph. The gain of the system is obtained by dividing the output by input and the phase difference between the input and output at different frequencies is obtained. Thus the
magnitude and phase plot (Bode plot) vs frequencies is obtained from the Bode plot the transfer
function of the system is obtained. From the transfer function the system stability is verified.The
programming for speed control of DC Motor is done as shown below
Blockdiagram:
-
8/18/2019 CS Lab Mannual
96/122
C
96
Front panel
THEORITICAL CALCULATIONS:
-
8/18/2019 CS Lab Mannual
97/122
C
97
Input graph for frequency of 0.1 HZ
Output graph for frequency of 0.1 HZ
From the graph obtaining by taking input sinusoidal signals of frequency 0.1 HZ, the output
waveform will be also an sinusoidal signals with the same frequency but with different amplitude
and different phase difference.
Here for the frequency of 0.1 HZ ,the gain magnitude can be obtained as follows:
Magnitude Gain is defined as ratio of peak to peak amplitude of output waveform to peak to peak amplitude of input waveform.
Here input p-p amplitude is
590-210=380
Output p-p amplitude is
599.9-193=407
Hence gain magnitude is
407/380=1.0723
Phase difference between the two signals is four (4) sec (from the graph)
But 10 sec = 360 degrees
4 sec = 144 degrees
-
8/18/2019 CS Lab Mannual
98/122
C
98
Similarly for the different frequencies the gain magnitude and phase difference is calculated :
Corner Frequency Magnitude Phase
0.001 HZ 1.1058 36
0.01HZ 1.0960 108
0.1HZ 1.0723 144
0.125 HZ 1.043 216
0.25HZ 0.998 540
PRACTICAL WAVEFORM:
THE OBTAINED BODE PLOT ARE:
-
8/18/2019 CS Lab Mannual
99/122
C
99
0.94
0.96
0.98
1
1.02
1.04
1.06
1.08
1.1
1.12
0.001 0.01 0.1 0.125 0.25
Magnitude plot
0
100
200
300
400
500
600
0.001 0.01 0.1 0.125 0.25
Phase plot
From the bode plot the transfer function can be obtained
-
8/18/2019 CS Lab Mannual
100/122
C
100
The obtained transfer function from the bode plot is:
G(S) = 318.4*1000
(S+1000)(S+100)(S+10)(S+8)(S+4)
Thus from the transfer function all the poles lie on the left hand side of s-plane .The system is
stable.
RESULT OBTAINED:
The speed control of DC Motor is achieved through LABVIEW at a desired speed.
The Bode plot of the system is obtained.
The transfer function is obtained from the Bode Plot.
System stability of the obtained transfer function is obtained and verified.
-
8/18/2019 CS Lab Mannual
101/122
C
101
-
8/18/2019 CS Lab Mannual
102/122
C
102
28.NYQUIST PLOT FROM TRANSFER FUNCTION
AIM:
To plot Nyquist plot for a given transfer function of the system.
THEORY:
A nyquist plot is used in automatic control and signal processing for assessing the stability of asystem 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 ofBode plot — magnitude and phase — on a single graph with frequencry as a parameter 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 becomeunstable 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.
The Nyquist ContourThe nyquist contour, the contour that makes the entire nyquist criterion work, must encircle the
entire right half of the complex s plane. Remember that if a pole to the closed-loop transfer
function (or equivalently a zero of the characteristic equation) lies in the right-half of the s plane,the system is an unstable system.To satisfy this requirement, the nyquist contour takes the shape
of an infinite semi-circle that encircles the entire right-half of the s plane.
Nyquist CriteriaLet us first introduce the most important equation when dealing with the Nyquist criterion:
Where:
N is the number of encirclements of the (-1, 0) point.
Z is the number of zeros of the characteristic equation.
P is the number of poles of the characteristic equation.With this equation stated, we can now state the Nyquist Stability Criterion:
Nyquist Stability Criterion
A feedback control system is stable, if and only if the contour in the F(s) plane does notencircle the (-1, 0) point when P is 0.
A feedback control system is stable, if and only if the contour in the F(s) plane encirclesthe (-1, 0) point a number of times equal to the number of poles of F(s) enclosed by Γ.
-
8/18/2019 CS Lab Mannual
103/122
C
103
In other words, if P is zero then N must equal zero. Otherwise, N must equal P. Essentially, weare saying that Z must always equal zero, because Z is the number of zeros of the characteristic
equation (and therefore the number of poles of the closed-loop transfer function) that are in the
right-half of the s plane.
MATLAB PROGRAM:
num=input(‘enter the numerator of the transfer function’)
den=input(‘enter the denominator of the transfer function’)
h=tf(num,den)
nyquist(h)
[gm pm wcp wcg]=margin(h)
if(wcp>wcg)
disp(‘system is stable’)
else
disp(‘system is unstable’)
end
PROCEDURE:
• Write matlab program in the matlab editor document.
• Then save and run the program.
• Give the required input.
• The syntax “tf(num,den)” solves the given transfer function and gives poles and zeros ofthe function.
• “nyquist(sys)”, nyquist calculates the Nyquist frequency response of LTI models. Wheninvoked 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. “nyquist(sys)” plots the Nyquist response of an arbitrary LTI model sys.
This model can be continuous or discrete, and SISO or MIMO. In the MIMO case,
nyquist produces an array of Nyquist plots, each plot showing the response of one
particular I/O channel. The frequency points are chosen automatically based on thesystem poles and zeros.
• “[Gm,Pm,Wcg,Wcp] = margin(sys)”, margin calculates the minimum gain margin, phasemargin, and associated crossover frequencies of SISO open-loop models. The gain and
phase margins indicate the relative stability of the control system when the loop is closed.
RESULT:
-
8/18/2019 CS Lab Mannual
104/122
C
104
Nyquist plot is plotted from given transfer function and it is found to be unstable.
VIVA QUESTIONS:
1. What is nyquist plot?
-
8/18/2019 CS Lab Mannual
105/122
C
105
-
8/18/2019 CS Lab Mannual
106/122
C
106
29.
-
8/18/2019 CS Lab Mannual
107/122
C
107
-
8/18/2019 CS Lab Mannual
108/122
C
108
-
8/18/2019 CS Lab Mannual
109/122
C
109
-
8/18/2019 CS Lab Mannual
110/122
C
110
-
8/18/2019 CS Lab Mannual
111/122
C
111
-
8/18/2019 CS Lab Mannual
112/122
C
112
-
8/18/2019 CS Lab Mannual
113/122
C
113
-
8/18/2019 CS Lab Mannual
114/122
C
114
-
8/18/2019 CS Lab Mannual
115/122
C
115
-
8/18/2019 CS Lab Mannual
116/122
C
116
-
8/18/2019 CS Lab Mannual
117/122
C
117
30. :
:
ED DE:
BD ADDE E.
A .
A DE:
.
DE:
.
.
.
1. B , . B ,
.
-
8/18/2019 CS Lab Mannual
118/122
C
118
2. B , .
, .
3.
. ,
. , A
. , .
-
8/18/2019 CS Lab Mannual
119/122
C
119
4. , 1 5, 2
5; 3 5.A
(1, 2, 3) .
5. . A
10 .
3 , .
-
8/18/2019 CS Lab Mannual
120/122
C
120
6. , 5
5. 5 &
10. 10
.
-
8/18/2019 CS Lab Mannual
121/122
C
121
7. 1 5; 1
2 5; 2 3 5;
3 4 5. 4
1 ; .
8. AC A:
9. 1:
. 1 2 3 4
.
.
10. 2:
. 1 2 3 4
.
-
8/18/2019 CS Lab Mannual
122/122
C
.
11. 3:
. 1 2 3 4
.
.
12. 4:
. 1 2 3 4
.
.