Professional Documents
Culture Documents
Laboratory Manual
By
1
CONTENTS
SL.NO. TITLE
15 P,Pi,Pid Controller
(Using Matlab Software)
2
1. CHARACTERISTICS OF SYNCHRO TRANSMITTER AND
RECEIVER PAIR
APPARATUS:
1. Synchro Transmitter and receive pair trainer kit.
2. Patch cords.
3. Digital Multimeter.
CIRCUIT DIAGRAM:
3
SYNCHRO TRANSMITTER AND RECEIVE PAIR
THEORY:
The classical synchro system consists of two units.
Synchro transmitter Tx.
Synchro receiver Tr.
Transmitter and receiver have almost the same constructional features. The
two units are connected as shown initially the winding S2 of the stator of
transmitter is positioned for maximum coupling with rotor winding. Suppose
its voltage is V. The coupling between S1 and S2 of the stator and primary
(rotor) winding is a cosine function. Therefore the effective voltages in these
windings are proportional to cos 60° or they are V/2 each. So long as the
rotors of the transmitter or receiver remain in this position. No current will
flow between winding because of voltage balance.
When rotor of Tx is moved to a new position the voltage balance is
disturbed. Assume that the rotor of Tx is moved through 30° . the stator
winding voltages will be changed to zero, 0.866V and 0.0866V respectively.
Thus these are a voltage imbalance between the windings cause’s currents to
4
flow through the close circuit producing torque that tends to rotate. T he
rotor of the receiver to a new position where the voltage balance is again
restored. This balance is recovered only if the receiver turns through the
same angle as the transmitter and also the direction of the rotation is the
same as that of Tx.
The Tx, Tr pair thus selves to transmit information regarding angular
position at one point to a reverse point.
PROCEDURE:
Study of synchro transmitter.
1. Connect the main supply to the system with the help of cable provided.
Do not connect any patch cords to terminals marked S1, S2, and S3.
2. Switch on mains supply for the unit.
3. Starting from zero position, note down the voltage between stator
winding terminals i.e. VS1 S2, VS2 S3, and VS3 S1 in a sequential
manner. Enter readings in a tabular form and plot a graph of angular
manner. Enter readings in tabular form and plot a graph of angular
position of rotor vs. stator voltages for all three phases.
4. Note that zero position of the stator, rotor coincides with VS3 S1 voltage
equal to zero voltage. Don’t disturb this condition.
6
B. STU3DY OF SYNCHROTRANSMITTER
ROTOR VOLTAGE [VR] = VOLTS
Angular position in Angular position in
Sr. No. degrees degrees
of Synchro transmitter of Synchro receiver
RESULT:
VIVA QUESTIONS:
1. What do you mean by Synchro?
2. What are the applications of Synchro Transmitter and Receiver
pair.
3. What is shape of rotor in Synchro Transmitter?
4. What is shape of rotor in Synchro Receiver?
5. What do you mean by Electrical Zero position?
7
2. CHARACTERISTICS OF MAGNETIC AMPLIFIERS
AIM: To control the output power and to plot the characteristics of series,
parallel self saturated Magnetic Amplifiers
APPARATUS:
1. Magnetic Amplifier Trainer Kit
2. Rheostats
3. Ammeters
4. Patch Cords
CIRCUIT DIAGRAM:
8
PROCEDURE:
Expected graph:
9
Parallel connection of magnetic amplifier:
CIRCUIT DIAGRAM:
PROCEDURE:
10
4. Connect 100 watt lamp load in the holder provided for this purpose.
Expected graph:
11
Self saturated magnetic amplifier:
CIRCUIT DIAGRAM:
PROCEDURE:
Expected graph:
13
Tabular column for Parallel connected Magnetic amplifier:
RESULT:
14
3. EFFECT OF FEEDBACK ON DC SERVO MOTOR
SPEED - TORQUE CHARACTERISTICS
AIM:
To study the DC Servo motor Speed - Torque Characteristics.
APPARATUS:
1. DC Servo Motor Kit.
2. Two spring weights.
3. Digital multimeter.
15
4. ARMATURE CONTROL: Varying armature voltage from 0 - 25 V.
PROCEDURE:
Expected graph:
OBSERVATIONS:
Table 1(a)
17
Case (i) set speed 1000 rpm and Gain 25% constant
Table1 (b)
Table 2(a)
S.NO Gain Run speed Error
1
2
3
4
5
Case ( 2 )
Set speed = 1000 rpm , P controller gain =25 %
I controller =25 % ( constant )
Table 1(c)
18
( C ) PD controller (switch off I controller )
Do not experiment for different loads synchrons load , 100 gms , 250
Do not experiment for different loads synchrons load , 100 gms , 250
RESULT:
19
4. CHARACTERISTICS OF AC SERVO MOTOR
AIM: To study the Speed – Back EMF characteristics and Speed – Torque
characteristics of AC Servomotor.
APPARATUS:
THEORY:
20
On one of the sides of the shaft, metallic wheel 6 partitions is mounted.
Metalic wheel running through an optocoupler, the opto coupler converts
number of revolutions in to train of pulses to measure speed of the motor.
TORQUE MEASUREMENT:
N = RPM
We can find the mechanical power developed at the motor shaft. Again we
must use the formula P = 2ΠNT/60
PROCEDURE:
21
4. Now switch ON the instrument and also switch ON the servo motor. The
AC servo motor will start rotating and the speed will be indicated by the RPM
meter.
5. With load switch in OFF position, vary the speed of the AC servo motor by
rotating P2 in clockwise and note down back emf (Eb) generated by DC
machine at TP1 terminals at different speeds, with DMM and enter in Table
No1.
6. Plot the graph back emf voltage v/s speed by using the above values. Take
speed in RPM on X- axis and back emf voltage in mV on Y-axis.
1. Initially keep load switch and servo motor switch in OFF position.
2. Before switch ON the instrument Keep load control potentiometer P1 &
speed control potentiometer P2 are in min position( anti-clockwise)
3. Now Switch ON the instrument and also switch ON the servo motor.
You can observe that A.C servomotor will start rotating and the speed
will be indicated by the RPM meter.
4. By using potentiometer P2 set control winding voltage at fixed Vc=45V.
Use digital multimedia to measure control winding voltage. Note down the
speed of the A.C servo motor in Table No. 2(a). Now keep P1 at minimum
position and switch ON the load switch to apply the load on A.C servo
motor. Note down the corresponding current from digital D.C ammeter.
And also note down the back emf voltage Eb from TP1 terminals by using
DMM. Enter these values in Table 2(a). Corresponding to the RPM value
already noted.
5. Repeat the step No.4 for different values by varying load control
potentiometer P1 in a slow fashion. Note down the corresponding values of
current Ia, back emf voltage Eb and speed N. And enter these values Table
No.2(a).
6. Now switch OFF the load switch and keep load control potentiometer
P1 in minimum position. Now you may set control winding voltage Vc= 50V.
22
Again repeat the process as indicated in Step No. 4 & 5. Enter these values
in Table No. 2(b).
7. Repeat the process as indicated in Step No. 4,5,6 for different values of
Vc =55V, 60V & 65V. And note down readings in Table No.2(c), 2(d)& 2(e).
8. Plot the graph speed v/s torque characteristics of various values
of control winding.
Expected graph:
23
Table No.2(a): Speed v/s Torque Characteristics
Control Winding Voltage Vc = 220(fixed)
RESULT:
24
5. STUDY CHARACTERISTICS OF– DC GENERATOR
APPARATUS:
25
PROCEDURE:
To obtain the torque –speed characteristics, the motor is supplied with a fixed
armature voltage and its speed is recorded for varying external loading. This
loading is affected by electrically loading the coupled Generator.
2. Set the Motor Switch to OFF . set RESET switch to RESET. Set LOAD
switch to “0” position
3. Connect Ea to the voltmeter and set Ea = 6 V.
4. Switch the MOTOR switch to ON. Measure armature voltage (Ea)
Motor current () and speed in rpm. Record the readings as per the Table-2.
5. Set the LOAD switch to 1, 2,3,4,5 and take readings as shown in Table 2.
6. Complete the table.2 with calculated values Motor voltage Ea=6v; Ra =7
9.Repeat above for Ea =8V .Ea =10V ,Ea =12V and record the average values of
motor parameters B&Kb.
The dynamics of the motor is studied with the help of its step response.
27
2.Set the Motor Switch to OFF . set RESET switch to RESET. Set LOAD
switch to “0” position
3.Connect Ea to the voltmeter and set Ea = 8V.
4.Switch ON the MOTOR and measure Eg, and speed in rpm . These are the
steady state generator voltage Eg and steady state motor speed N respectively.
5.Set Es to 63.2% of Eg measured above. This is the generator voltage at
which the counter will stop counting.
6. Switch OFF the motor, set RESET switch to READY.
7. Now switch the motor ON record the counter reading as time constant in
mille second.
8. Repeat the above with Ea = 10 V, Ea = 12 V and tabulate results.
9. Substitute the values of Km and Tm in equation 6.and write down motor
transfer function.
10. Using the average value of Tm, B, Kb and Ra. calculate the motor inertia
from equation 7.
Kb2
J = τm B+
Ra
Es = 0.632XEg
Kb2
Km = τm B+
Ra
28
OBSERVATIONS:
29
Expected graph:
RESULT:
30
6. TIME RESPONSE OF SECOND ORDER SYSTEM
AIM: To study the time response of a variety of simulated linear systems and
to correlate the studies with theoretical results.
APPARATUS:
1. Second order system kit
2. CRO
3. Connecting wires
4. Probes
Integrator:
1. Apply a 1V P-P square i/p of known frequency
2. Measure the P-P output voltage of triangular wave and also note its
phase.
3. Calculate gain constant K of integrator and write the transfer
function of this block
Time constant:
1. Apply a 100mv P-P square wave of known frequency (measured by
CRO).
For this experiment the frequency should be selected toward the
lower end to ensure that steady state is nearly reached.
2. Find on the trace time t = T at which the response reaches 63.2%.
This is the
Time constant.
3. Find on the trace the steady state value of the response the value of
K is given
By the ratio of P-P steady state output to the P-P input amplitude.
4. Write transfer function of the block.
5. The waveforms on the CRO may be traced on the tracing paper for
analysis error.
31
R(S)` C(S)
K K1/S
-1
Error!
R(S) C(S)
K K3/ST22+1
-1
32
Closed loop Response – Second order system:
1. Choose and wire a suitable second order system configuration from
fig.2.
2. Apply a 1V P-P
P square wave input and trace the output waveform on a
tracing paper for different values of K. obtain peak percent overshoot,
setting time, rise time and steady state errors from the tracing and
calculate S and wn.
Compare with theoretical results.
3. In case of type -1
1 system, obtain steady state error to ramp input.
The closed loop transfer function for different open loop functions are shown
below:
C (S ) K 1
(i) For G(S) = K/S,
R( S ) ( S K ) S ( K 1)
Which gives a step response with time constant decreasing as K increases.
K C (S ) K 1 /( K 1)
(ii) For G(S) = ;
S ( ST 1) R ( S ) ( ST K 1) ST /( K 1) 1
Which is a step response.
K C (S ) K K
(iii) For G(S) = ; 2 2
S ( ST 1) R( S ) ( S T S K ) S / S / T K / T
33
Tabilar Column:
S.No. Gain Tr Tp Ts % MP Wn Wd δ
(K)
Result :
MODEL GRAPH:
VIVA QUESTIONS :
34
7. TEMPERATURE CONTROLLER USING PID
APPARATUS:
1. Trainer kit
2. CRO
3. Connecting wires
PROCEDURE:
Proportional controller :
Zieglar and Nicholas suggest the value of Kp for p-controller as
Kp = 1/K X T1/T2
1. Starting with a cool oven, keep the switch to ‘wait’ position and connect
p output to the driver i/p keep R,D and outputs disconnected. Short
feedback terminals.
2. Set ‘P’ potentiometer to the above calculated value of Kp. keeping in
mind that the maximum gain is 10.
3. Plot the observations on a linear graph paper and observe the rise time,
steady state error and percent over shoot.
Expected graph:
Temp
In oC Ambient temperature
Time in minutes
Ambient temperature
Time in min
Zieglar and Nicholas suggests and values of KP,Kd,Ki for this controller as
Kp= 1.2 /K X T1/T2; T1= 1/K = 2 T2
Giving K1 = 1/2T2.
KD = TD = 0.5 T2
36
1. Starting with a cool oven, keep switch to ‘Wait’ position and connect
P,D and I outputs to the driver i/p keep ‘R’ output disconnected. Short
‘feedback’ terminals.
Expected graph:
(iii) Response with PI controller:
Ambient temperature
Time in min
Temp in 0C
Rise time
Ambient temp
T2 = 90%
38
8. EFFECT OF P, PI AND PID CONTROLLER ON
A SECOND ORDER SYSTEM
CIRCUIT DIAGRAM:
PROCEDURE:
Proportional [P] Controller
1. Make the connections as given in the circuit diagram. Keep I and D
controllers at OFF position.
39
2. Connect Second Order System in the loop and also connect Square
Wave input and keep the Damping factor of Second order system
constant and observe the wave form at Vf by varying P-Gain.
3. You can observe that as the P-Gain increases error decreases but
oscillations increases. If P gain is less, error is more but oscillations are
less.
Vs
4. We can observe that the error voltage =
1 G
40
P-CONTROLLER
Proportional(%) Integral(%) Derivative Peak Settling Rise
Overshoot Time Time
PI-CONTROLLER
PID-CONTROLLER
RESULT:
VIVA QUESTIONS:
1. What is the effect of PI controller on the system performance?
2. What is the effect of P controller on the system performance?
3. What is the effect of PID controller on the system performance?
4. What are the disadvantages of P controller?
5. Define damping ratio?
6. Define Zero?
7. Define pole?
8. How the system is classified depending upon the value of damping?
41
9. OP-AMP BASED INTERGRATOR AND DIFFERENTIATOR
Apparatus:
a) Integrator:
Circuit Diagram:
Rf = 10k ohm
C1
R1=2.5k ohm 0.1µf
1 2
ViN Vo
a) Integrator:
Program:
Output:
1.0V
0V
SEL>>
-1.0V
V(1)
1.0mA
0A
-1.0mA
I(C1)
4.0V
0V
-4.0V
0s 2ms 4ms 6ms 8ms 10ms 12ms 14ms 16ms 18ms 20ms
V(3)
Time
43
b) Differentiator:
Circuit Diagram:
Rf =1k ohm
R1=100ohm
1 4 2
C1=1µf
3
Vin
Vo
0
0
b) Differentiator:
Program:
44
b) Differentiator:
Output:
1.0V
0.5V
SEL>>
0V
V(1)
2.0mA
0A
-2.0mA
I(C1)
2.0V
0V
-2.0V
0s 2ms 4ms 6ms 8ms 10ms 12ms 14ms 16ms 18ms 20ms
V(3)
Time
45
10. STABILITY ANALYSIS (BODE PLOT, ROOT LOCUS,
NYQUIST) OF A LINEAR TIME INVARIANT SYSTEM
Bode Plot:
Program:
s = tf (n, d);
bode (s)
else
else
end
end
46
Transfer Function Input:
n = 25
d = [23 2 11]
Transfer function:
25
----------------
23S^2 + 2 s + 11
pm = 5.7341
wcg = Inf
wcp = 1.2489
gmdb = 15.1694
Bode Plot:
Transfer Function: = 25
(23s^2+2s+11)
47
Output Graph:
Bode Diagram
30
20
10
Magnitude (dB)
-10
-20
-30
-40
0
-45
Phase (deg)
-90
-135
-180
-1 0 1
10 10 10
Frequency (rad/sec)
Nyquist Plot:
Program:
n = input ('ENETER THE NUMERATOR OF THE TRANSFER FUNTION:')
s = tf (n, d);
nyquist (s)
48
gmdb = 20*log10 (pm)
else
else
end
end
n = 10
d = [1 4 7]
Transfer function:
10
-------------
S^2 + 4 s + 7
pm = 94.5252
wcg = Inf
wcp = 2.4922
gmdb = 39.5110
Nyquist Plot:
Transfer Function: = 10
(s^2+4s+7)
Output Graph:
Nyquist Diagram
1.5
0.5
Imaginary Axis
-0.5
-1
-1.5
-1 -0.5 0 0.5 1 1.5
Real Axis
50
Root Locus:
Program:
S= tf (n1, d1);
rlocus (s)
end
Transfer Function: = 25
(23s^2+2s+11)
Root Locus:
Transfer Function: = 25
(23s^2+2s+11)
51
Output Graph:
52
11. TRANSFORMATION OF DYMAMICAL SYSTEM INTO
STATE MODEL & VICE VERSA
Program:
n = input ('Enter the value 1 for transforming Transfer Function into State
Space variable and 2
for State Space variable into Transfer Function is Case: ')
switch n
case 1
num = input ('Enter the Numerator valve of the Transfer Fumtion: ')
den = input ('Enter the Denominator valve of the Transfer Funtion: ')
t = tf (num,den)
case 2
a = input ('System matrix a: ')
b = input ('Matrix b: ')
c = input ('Output Matrix c: ')
d = input ('Transition Matrix d: ')
tf (num,den)
otherwise
end
53
Output:
n=1
num = [1 2]
den = [2 3 4]
s+2
---------------
2 s^2 + 3 s + 4
a= -1.5000 -2.0000
1.0000 0
b= 1
0
c = 0.5000 1.0000
0 0
d= 0 0
0 0
54
Transfer Function Input:
Enter the value 1 for transforming Transfer Function into State Space
variable and 2 for State Space variable into Transfer Function is Case: 2
n=2
a= -1.5000 -2.0000
1.0000 0
Matrix b: [1; 0]
b= 1
0
c= 0.5000 1.0000
0 0
d = [0]
Transfer function:
0.5 s + 1
---------------
S^2 + 1.5 s + 2
55
12. LAG AND LEAD COMPENSATION -
MAGNITUDE AND PHASE PLOT
AIM: To obtain magnitude and phase plots of the given compensation
networks and verify the responses.
APPARATUS:
1. Lead-Lag Compensation Trainer Kit
2. Resistors
3. Capacitors
4. Patch Cords
CIRCUIT DIAGRAM:
Lag Compensator
56
PROCEDURE:
1. Switch ON the Mains supply to the unit. Observe the sine wave signal
by varying frequency and amplitude potentiometer.
2. Now make the networks connections depending on Lag – Lead or Lag –
Lead networks. Connect sine wave output to networks input.
3. Note down the peak detector input using digital voltmeter provided.
Now the frequency and note down the frequency, Phase angle difference
and output Vp for different frequencies and enter the readings in the
tabular column.
4. Now calculate the theoretical values of phase angle difference and gain.
Compare this with the measured values.
5. Plot the graph of Phase Angle Vs Frequency (Phase plot) and Gain Vs
Frequency (Magnitude plot).
6. Repeat the same for different frequencies.
57
TABULAR COLUMN: LAG-LEAD NETWORK
MODEL CALCULATIONS:
In case of lag compensation network
R2 cs 1 1 Ts 1 (S 1/ T )
G(S) = = =
( R1 R2 )cs 1 1 Ts ( S 1 / T )
R2c = T; R1 + R2 = >1
2T 2 1
G(jw) =
2 2T 2 1
- = Tan-1 wt – tan-1 wt
In case of lead compensation network
R2 ( R1cs 1)
G (S) =
R1 R2
R1R2cs 1
R1 R2
( ST 1) (S 1/ T )
= =
( ST 1) ( S 1 / T )
2T 2 1
G(jw) =
2 2T 2 1
G(jW) = tan-1 (wT) – tan-1 (wT)
58
CONNECTION DIAGRAM:
LAG COMPENSATION
LEAD COMPENSATION
59
LEAD – LAG COMPENSATION
RESULT:
VIVA QUESTIONS:
1. What is compensator?
2. What is the difference between Lead and Lag compensator?
3. Bode plot for Lag network?
4. Which compensator used to improve study state response of
system?
5. Which compensator used to improve transient response of system?
6. Which type of filter acts as a lead compensator?
7. Which compensator acts as a band pass filter?
8. Which compensator acts as a high pass filter?
60
13. LINEAR SYSTEM ANALYSIS (TIME DOMAIN ANALYSIS
USING MATLAB)
AIM: To write a program and simulate dynamical system of I/O model
Program:
OUTPUT:
num =
100
61
enter the denominator of transfer function:[1 5 100]
den =
1 5 100
Transfer function:
100
---------------
s^2 + 5 s + 100
nt =
0 0 100
dt =
1 5 100
wn =
10
z=
0.2500
tr =
2.8238
tp =
0.3245
ts =
62
1.6000
pos =
44.4344
1
v in volts
0.5
0
0 0.5 1 1.5 2 2.5
t in secs (sec)
63
14. LAG COMPENSATOR, LEAD COMPENSATOR
(Using MATLAB software)
LAG COMPENSATOR
AIM:
To design a Lag compensator.
APPARATUS:
MATLAB software.
PROGRAM:
%design a lag compensator%
k=input('enter the value of k to meet the steady state error equipments
k=0.1');
pos=input('enter the required % overshoot');
n=100*k;
d=poly([10 -36 -100]);
g=tf(n,d)
z=(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2));
pm=atan(2*z/(sqrt(-2*z^2+sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi)+10);
w=0.01:0.1:100;
[m,p]=bode(g,w);
ph=-180+pm;
for k=1:1:length(p)
if p(k)-ph<=0
m=m(k)
wf=w(k)
break
end
end
wn=wf/10;
w1=wn/m;
nc=[1 wn];
dc=[1 w1];
kc=w1/wn;
kc;
gc=tf(kc*nc,dc)
gcg=gc*g;
s=tf([1 0],1);
sgcg=s*gcg;
kv=dcgain(sgcg);
t=feedback(gcg,1)
subplot(2,2,1)
64
step(t)
title('closed loopresponse of lagcompensated system');
subplot(2,2,2)
bode(g)
title('bodeplot of uncompensated system:');
subplot(2,2,3)
bode(t)
title('bodeplot of compensated system:');
RESULT:
enter the value of k to meet the steady state error equipments k=0.11
enter the required % overshoot12
Transfer function:
100
------------------------------
s^3 + 126 s^2 + 2240 s - 36000
m=
0.0028
wf =
0.0100
Transfer function:
360 s + 0.36
------------
s + 0.36
Transfer function:
3.6e004 s + 36
------------------------------------------------
s^4 + 126.4 s^3 + 2285 s^2 + 806.4 s - 1.292e004
GRAPHS:
LEAD COMPENSATOR
AIM:
To design a Lead compensator.
APPARATUS:
MATLAB software.
PROGRAM:
%program to design lead compensator%
pos=input('enter the % over shoots:');
tp=input('enter peak time:');
kv=input('enter the value of kv:');
num=[100]
den=poly([0 -36 -100]);
g=tf(num,den);
s=tf([1 0],1);
sg=s*g;
sg=minreal(sg);
65
k=dcgain(kv/sg);
g=zpk(k*g);
z=(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2));
pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))+(180/pi)
wn=pi/(tp*sqrt(1-z^2));
wbw=wn*sqrt((1-2*z^2)+sqrt(4*z^4-4*z^2+2))
w=0.01:0.5:1000;
[m,p]=bode(g,w);
[gm,pm,wgc,wpc]=margin(g);
pmreq=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))+(180/pi);
pmreqc=pmreq+10;
pc=pmreqc-pm
beta=(1-sin(pc*pi/180))/(1+sin(pc*pi/180));
magpc=1/sqrt(beta);
for k=1:1:length(m)
if m(k)-(1/magpc)<0
wmax=w(k)
break
end
end
%calculate lead compensator zero,pole,gain%
zc=wmax*sqrt(beta);
pc=zc/beta;
kc=1/beta;
gc=tf(kc*[1 zc],[1 pc])
gc=zpk(gc)
sgc=s*gc;
kv=dcgain(gc);
t=feedback(gc,1)
subplot(2,2,1)
step(t)
title('lead compensated step response:');
subplot(2,2,2)
bode(g)
title('bode plot of uncompensated system:');
subplot(2,2,3)
bode(t)
title('bode plot of compensated system;');
RESULT:
enter the % over shoots:12
enter peak time:5
enter the value of kv:3
num =
100
pm =
58.2796
wbw =
66
0.9102
pc =
-15.2644
wmax =
2.5100
Transfer function:
0.5832 s + 1.917
----------------
s + 1.917
Zero/pole/gain:
0.58319 (s+3.287)
-----------------
(s+1.917)
Zero/pole/gain:
0.36836 (s+3.287)
-----------------
(s+2.421)
GRAPHS:
LAG-LEAD COMPENSATOR
AIM:
To design a Lag-Lead compensator.
APPARATUS:
MATLAB software.
PROGRAM:
%design of lag lead compensator%
pos=input('enter the %overshoot:');
tp=input('enter the time:');
kv=input('enter the value of kv:');
num=[1];
den=poly([0 -1 -4]);
g=tf(num,den)
s=tf([1 0],1);
sg=s*g;
sg=minreal(sg);
k=dcgain(kv/sg);
g=tf(k*num,den)
g=zpk(g);
z=(-log(pos/100))/sqrt(pi^2+log(pos/100)^2);
pmreq=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi)+5;
wn=pi/(tp*sqrt(1-z^2));
wbm=wn*sqrt((1-2*z^2)+sqrt(4*z^4-4*z^2+2));
wpm=.5+wbm
[m,p]=bode(g,wpm);
67
pmreq=pmreq-(180+p);
beta=(1-sin(pmreq*pi)/180/(1+sin(pmreq*pi)/180));
zclag=wpm/10;
pclag=zclag*beta;
kclag=beta;
glag=tf(kclag*[1 zclag],[1 pclag])
glag=zpk(glag);
zclead=wpm*sqrt(beta);
pclead=zclead/beta;
kclead=1/beta;
gclead=tf(kclead*[1 zclead],[1 pclead])
gclead=zpk(gclead);
gc=g*glag*gclead;
sgc=s*gc;
sgc=minreal(sgc);
t=feedback(gc,1)
subplot(2,2,1)
step(t)
title('lag-lead compensated step response');
subplot(2,2,2)
bode(g)
title('bode plot of uncompensated system');
subplot(2,2,3)
bode(t)
title('bodeplot of compensated system:');
RESULT:
69
15.P,PI,PID CONTROLLER
PID CONTROLLER.
AIM:
To design PID CONTROLLER.
APPARATUS:
MATLAB software.
PROGRAM:
clear all;
g = tf ([100], [1 13 32 20])
w=4
ess = 0.1
pmd = 45
kv = 1/ess;
k = 100;
a = 1;
b = 13;
c = 32;
d = 20;
[a1, f1] = bode(g,w);
pmu = 180+f1;
t1 = pmd-pmu;
tr = deg2rad(t1)
ki = (kv*d)/k
kd = (sin(tr)/(w*a1))+(ki/w^2)
kp = cos(tr)/a1
gc = tf([kd kp ki],[1 0])
go = series(g,gc)
[a0, f0] = bode(go,w);
pm0 = 180+f0
70
PI CONTROLLER
AIM:
To design PI CONTROLLER.
APPARATUS:
MATLAB software.
PROGRAM:
clear all;
g = tf ([100], [1 13 32 20])
w=4
ess = 0.1
pmd = 45
kv = 1/ess;
k = 100;
a = 1;
b = 13;
c = 32;
d = 20;
[a1, f1] = bode(g,w);
pmu = 180+f1;
t1 = pmd-pmu;
tr = deg2rad(t1)
ki = (kv*d)/k
kp = cos(tr)/a1
gc = tf([kd kp ki],[1 0])
go = series(g,gc)
[a0, f0] = bode(go,w);
pm0 = 180+f0
71
P CONTROLLER
AIM:
To design P CONTROLLER.
APPARATUS:
MATLAB software.
PROGRAM:
clear all;
g = tf ([100], [1 13 32 20])
w=4
ess = 0.1
pmd = 45
kv = 1/ess;
k = 100;
a = 1;
b = 13;
c = 32;
d = 20;
[a1, f1] = bode(g,w);
pmu = 180+f1;
t1 = pmd-pmu;
tr = deg2rad(t1)
kp = cos(tr)/a1
gc = tf([kd kp ki],[1 0])
go = series(g,gc)
[a0, f0] = bode(go,w);
pm0 = 180+f0
72
16.PROGRAMMABLE
PROGRAMMABLE LOGIC CONTROLLER
INTRODUCTION
This manual provides information for the use of the Nexgenie PLC. A PC with
installation of CoDeSys (Controlled Development Systems) is necessary to program
the Nexgenie PLC. Nexgenie PLC designed for use in industrial environment, which
uses a programmable memory for its internal operation of user oriented instructions
and for implementing specific functions such as logic, sequencing, timing, counting,
and arithmetic. This PLC controls digital or analog inputs and outputs in the various
types of machines or processes.
Installing Software:
For installing the
he CoDeSys software, which is useful to write the program and
to download it into PLC, you have to install the CoDeSys. As you are received a CD
insert it into CD-ROM,
ROM, it displays the folders that it contains.
73
Press `OK'.
Press `Next' until the setup is installing, don't make any changes.
74
After installation is ccompleted, press `Finish'.
75
1. Getting Started:
First of all to write a program in CoDeSys, you have to install the target. Target
means selecting your PLC type, to install the target select:
Start Programs Messung systems CoDeSys
V2.3 Install target.
Browse your PLC target folder and select your target file in that folder and press
install.
New Project:
Now open the CoDeSys software, close project that is displayed (if any) like
select: file menu close.
To create new project, select file New.
A dialog box of targget settings is displayed, select `Nexgen 22110 T1.0' and
press OK.
In the next dialog box don't make any changes and press OK. Name of the new
POU is PLC_PRG, it is default don't change it. Select type of POU as program,
select language of the POU as LD (Ladder diagram) and press OK.
76
A window is displayed contains empty rung,
You can insert input i.e. contacts, coils and function blocks whatever you want
in your program.
Next to that is set your PLC configuration in resources menu and select PLC
configuration Nexgen 2000 2-IO Base
Rack[SLOT].
Right click on the 0 Pt input+output module[SLOT].
Select replace element 16 Pt input module for one, and other as 16
Pt output module.
Downloading Project:
After completion of editing your program, you have to download the program
into PLC for executing it. For downloading the program, follow the below steps:
First, build your projoject by using `build' option in project menuu. If errors
are not there, you are ready to download the program. For this select: online
menu login.
Then you have a prompt for asking to download the program, then press yes.
Next prompt is for to flash the program, press yes. Now the
download is completed.
Next to see the output of your program put PLC in run mode by selecting `Run'
in online menu.
Now check your program through PLC.
To stop run mode, press stop in online menu.
To exit the execution mode, press logout in online menu.
2. Addresses:
Input is called as ‘CONTACT’ .It is normally open ) or normally closed )
respectively. It is addressed as %IX0.x. The Input address ranges from:
%IX0.0 to %IX0.7 for first 8 inputs.
%IX1.0 to % IX1.7 for next 8 inputs.
Output is called as ‘COIL’. It is normally open or normally closed respectively. It is
addressed as %QX0.x. The output address ranges from:
%QX0.0 to %QX0.7 for first 8 outputs.
%QX1.0 to %QX1.7 for next 8 outputs. Flags
Fl are
temporary storage bits. They are addressed as
%MX0.0 to %MX0.9
%MX1.0 to %MX1.9 and so on..
77
3. Function Blocks
Timers:
In some PLCs timers are represented by boxes in ladder diagram. When a timer receives
an enable input the timer starts. The preset time is compared to the current time. The output of
timer is at logic 0 as long as current time is less than preset time. The timer logic becomes 1 as
current time exceeds the preset time. Timers are mainly of two types:
78
Counter:
It is represented by `C'. Maximum number of counter coils, which can be used
in programming, is 8/16/32. Counter is also of two types
`Astable' and `Monostable'. Counter is used to measure number of pulses generated
by any external device or by PLC itself.
Clock Counter:
It is represented by `D' and the maximum number of clock counter coils, which
can be used in programming is 8/16/32. It is used to count clock pulses of high
frequency.
79
DC MOTOR SPEED CONTROL
Aim:
In this Interfacing we will be able to understand the Controlling of DC
Motor speed and how to write the logic ladder.
Wiring Diagram:
Procedure:
This circuit is designed for DC Motor Speed Control. When we Switch ON or give any
one of digital inputs the particular output gets activated according to the ladder logic written.
DC Motor circuit is connected to outputs of PLC accordingly. 02 is connected to
normally open contact of relay and output 00, 01 are connected to normally closed contact
through the resistors as shown in the above circuit. All outputs are given to 24VDC supply.
When the output of PLC is connected to normally open contact then the polarity of the Relay is
connected to outputs of PLC, then it changes from normally closed to normally opened the
polarity of DC Motor changes and Motor rotates in opposite direction, when the output 00, 02
are activated then the DC Motor rotates in forward direction. The Speed of DC Motor changes
as the resistance value changes.
1. Connect I1, I2, I3 inputs sockets of PLC to DC Motor I1, I2, I3 inputs
Sockets respectively.
2. Connect O0, O1, O3 outputs sockets of PLC to DC Motor O0, O1, O2 out
put sockets & +24v, GND of PLC to +24v,GND of DC motor respectively.
3. Now switch ON the PLC select DC Motor logic ladder diagram &
download it to PLC.
There are three Rungs (R0, R1, R2) in the ladder given below:
1. When we give digital input I1, then the DC Motor rotates in forward
direction with full speed.
2. When we give digital input I2, then the DC Motor rotates in forward
direction with low speed.
3. When we give digital inputs I3, then the DC Motor rotate in Reverse
direction with full speed.
TRAFFIC LIGHT CONTROL
Aim:
In this, we will be able to understand the functioning of Traffic Light
Control & how to write the program using timers to run the traffic light control.
Circuit Diagram:
24 VDC
Logic Ladder Diagram:
Procedure:
Given one intersection of major Cross Road on a main city road. In all you have
12 LED's assigned with following function associated with each colour.
1. Connect all PLC outputs (O0 to O12) to Traffic light control outputs (O0
to O12) & 24V, GND respectively.
2. Only one green signal should be ON at a time & at all other junctions
Red signal should be ON. Green signal should be ON for some time. After
green signal ON there should be yellow signal for some time.
I1 O2
( )
I2
Connections:
Connect the patch cords of PLC input sockets I1 & I2 to sequential control of motor input
sockets START(I/P1) & STOP(I/P2) and PLC output sockets O0, O1, O2 & O3 to sequential
control of motor output sockets O0, O1, O2 & O3.
+24V & GND to sequential control of motor + 24V & GND respectively.
ELEVATOR SIMULATOR
Aim: In this, we can understand the functioning of elevator simulator & how to
Write the logic ladder using gates.
Block Diagram:
Block Diagram: