You are on page 1of 96

CONTROL SYSTEMS

Laboratory Manual
By

Mr. T.Ravi Babu M.Tech.


Assistant Professor, EEE

Department of Electrical and Electronics Engineering

MAHAVEER INSTITUTE OF SCIENCE & TECHNOLOGY


(Approved by AICTE, Affiliated to JNTU, Hyd)
Vyasapur, Bandlaguda, Post : Keshavgiri, Hyderbad - 500 0051

1
CONTENTS

SL.NO. TITLE

1. Characteristics Of Synchronous Transmitter & Receiver Pair

2. Characteristics Of Magnetic Amplifiers


3. Effect Of Feedback On Dc Servomotor
Speed – Torque Charactesistics
4. Characteristics Of Ac Servomotor
5. Study Of Dc Motor – Generator Characteristics

6. Time Response Of Second Order System


7. Temperature Controller Using Pid
8. Effect Of P, Pi, Pid Controller On A Second Order System

9. Pspice Simulation Of Op – Amp Based Integrator &


Differentiator
10. Stability Analysis ( Bode Plot, Root Locus, Nyquist Plot) Of
A Linear Time Invariant System

11. Transformation Of A Dynamical System To State Model &


Vice – Versa

12. Lag & Lead Compensation – Magnitude & Phase Plot

13. Linear System Analysis ( Time Domain Analysis Using


Matlab)

14 Lag Compensator, Lead Compensator


(Using Matlab Software)

15 P,Pi,Pid Controller
(Using Matlab Software)

16 Programmable Logic Controller

2
1. CHARACTERISTICS OF SYNCHRO TRANSMITTER AND
RECEIVER PAIR

AIM: To convert the angular of a shaft into an electrical signal in a


transmitter and determine the change in deflection of Synchro
Transmitter and receive 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.

Study of synchro transmitter & receiver pair.

1. Connect the mains supply with the help of cable provided.


2. Connect S1, S2 and S3 terminals of transmitter to S1, S2 and S3 of
synchro receiver by patch cords provided respectively.
3. Switch on Sw1 and Sw2 and also switch on the main supply.
4. Move the pointer i.e. rotor position of synchro transmitter Tx in steps of
300 and observe the new rotor position on receiver side which follows
its both the directions of rotations and their positions are in good
agreement.
5. Enter the input angular position and output angular position in the
tabular form and plot a graph.
5
PRECAUTIONS:
1. Handle the pointers for both the rotors in a gentle manner.
2. Do not attempt to pull out the pointers.
3. Do not short rotor on stator terminals.
OBSERVATIONS:
A. STUDY OF SYNCHROTRANSMITTER
ROTOR VOLTAGE [VR] = VOLTS
STATOR TERMINAL VOLTAGE
Sr. Rotor position in
(RMS)
No. degrees
VS3S1 VS1S2 VS2S3

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

Series connected magnetic amplifier:

CIRCUIT DIAGRAM:

8
PROCEDURE:

1. Keep the toggle switch in position ‘D’ on the front panel.


2. Keep control current setting knob at its extreme left position which
ensures zero control current at starting.
3. With help of the patch cards, connect following terminals on the front
panel of unit.
a) Connect Ac to A1.
b) Connect B1 to A2.
c) Connect B2 to L.
4. Now put 100 watt lamp load in the holder provided on the front panel.
5. Now once again check the switch position and wiring switch. (Switch on
D position).
6. Switch on the unit.
7. Now gradually increase control current by rotating control current
setting knob clockwise in steps and note down control current and
corresponding load current.

Expected graph:

9
Parallel connection of magnetic amplifier:

CIRCUIT DIAGRAM:

PROCEDURE:

1. Keep the toggle switch in position D on the front level.


2. Keep control current by setting knob at its extreme left position which
ensures zero control current at starting.
3. Write the unit as given below with patch cards.
a) Connect A1 to Ac.
b) Connect A1 to A2.
c) Connect B2 to L.
d) Connect B2 to B1.

10
4. Connect 100 watt lamp load in the holder provided for this purpose.

5. Switch on the unit.


6. Now gradually increase control current by rotating control current
setting knob clockwise in steps and note down control current and
corresponding load current.
7. Plot the graph of load current versus control current.

Expected graph:

11
Self saturated magnetic amplifier:

CIRCUIT DIAGRAM:

PROCEDURE:

1. Keep the toggle switch in position ‘E’ on the front panel.


2. Keep the control current setting knob at its extreme left position which
ensure zero control current at starting.
3. With the patch cards, connect the following terminals on the front
panel of the unit.
a) Connect Ac toC1.
b) Connect A3 to B3.
c) Connect B3 to L.
4. Connect 100 watt lamp load in the holder provided on the front panel.
5. Now once again check that the switch in position ‘E’ and the
connections.
12
6. Switch on the unit.

7. Now gradually increase control current by rotating control current


setting knob clockwise in steps and note down control current and
corresponding load current.
8. Plot the graph of load current versus control current.

Expected graph:

Tabular column for series connected Magnetic amplifier:

Ic (Control winding IL(Load winding


Sl No. current) DC in current) AC in
milliamps milliamps

13
Tabular column for Parallel connected Magnetic amplifier:

Ic (Control winding IL(Load winding


Sl No. current) DC in current) AC in
milliamps milliamps

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.

FRONT PANEL CONTROLS & FEATURES

1. SPRING BALANCE UNIT: Used to apply load on DC Servo motor. T1,T2


are spring balances used to measure Torque. By varying knob control
the load can be varied from min to max. (pulley radius 3.5 cm)
2. DC AMMETER: reads armature current (approx)
3. RPM METER: Reads DC motor speed from 0 to 2500 rpm approx.

15
4. ARMATURE CONTROL: Varying armature voltage from 0 - 25 V.

Keep armature control potentiometer at min. position before switching


on.
5. ARMATURE VOLTAGE: DC servo motor Armature DC Voltage (Va ) is
available on 15 amps terminals marked + & -
6. ARMATURE FUSE: Use always Armature fuse rating is 2 amps.
7. FIELD CONTROL: used for varying field voltage from 25 – 7 volts.
Keep field control potentiometer at min. position before switchingon.
8. FIELD VOLTAGE: DC servo motor Field DC Voltage (Vf ) is available on
15 amps terminals marked + & -.
9. FIELD FUSE: Use always Armature fuse rating is 1 amp.
10.FIELD ON: It indicates field voltage supply availability to the motor.
(Do not operate the instrument with out field supply)

PROCEDURE:

1. Study all the front panel controls carefully.


2. Before switch ON, keep armature control potentiometer and field
control potentiometer are at minimum position .So that armature
voltage applied to the armature from 0 volts and field voltage applied to
the field from zero volt onwards.
3. Now switch ON the instrument , observe FIELD on indication LED
glows .If field ON indication LED OFF then immediately switch OFF
the instrument .note that for all DC Motors field voltage to be given
initially before applying the armature voltage .Initially DC Ammeter
and RPM meter indicates zero readings.
4. Adjust spring balance so that there is minimum load to the DC servo
motor .adjust the knob in anti clock wise direction to apply load to the
DC servo motor and adjust the knob in the clock wise direction to
release the load .fix the knob at particular place to apply a fixed load on
the DC Servo motor.
5. Connect the digital multi meter across the armature voltage terminals
and field voltage terminals .
6. Adjust armature control potentiometer so that Va=10 volts and field
control potentiometer Vf=20 volts.
16
7. Note down T1, T2, armature current & speed and enter the results in
table 1.
8. Keeping Va=10 Volts (constant), Vf=20 Volts (constant),repeat steps
6&7.
9. Note down the readings in table 1(a),1(b),1(c) and 1 (d).
10. From table no.1 plot the speed –Torque Characteristics.
11. Repeat above steps for various values of field voltages (say Vf=15
V,10V) by varying field control potentiometer.

Expected graph:

OBSERVATIONS:

DC SERVO MOTOR SPEED TORQUE CHARACHTERISTICS


(a) P controller (switch off I & D controller)
Case (i) set speed 1000 rpm and Gain 0 constant

Table 1(a)

S.NO Gain Run speed Error


1
2
3
4
5

17
Case (i) set speed 1000 rpm and Gain 25% constant

Table1 (b)

S.NO Load Run speed Error


1
2
3
4
5
6

(a) PI controller (switch off D controller)


Case (i) set speed 1000 rpm and Gain 0 constant

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)

S.NO Load Run speed Error


1
2
3
4
5
6

Do not experiment for different times of I controller

18
( C ) PD controller (switch off I controller )

Case -1 Set speed = 1000 rpm , Load = No load

S.NO Gain Run speed Error


1
2
3
4
5

Do not experiment for different loads synchrons load , 100 gms , 250

Case -2 Set speed =1000 rpm


P controller gain =25 % constant
D controller gain =25 % constant

S.NO Load Run speed Error


1
2
3
4
5
6

Do not experiment for different loads synchrons load , 100 gms , 250

Case -1 Set speed =1000 rpm


P controller gain =25 % constant
I controller gain =25 % constant
D controller gain =25 % constant

S.NO Load Run speed Error


1
2
3
4
5
6

With P+I+ controller the overall offset is almost eliminated

RESULT:

19
4. CHARACTERISTICS OF AC SERVO MOTOR

AIM: To study the Speed – Back EMF characteristics and Speed – Torque
characteristics of AC Servomotor.

APPARATUS:

1.Ac Servo Motor Trainer Kit.


2.Necessary wires for connecting
3.Digital Multi Meter

FRONT PANEL CONTROLS:

THEORY:

SPEED VARIATION AND SPEED MEASUREMENT:

The reference winding of the motor is excited from a fixed voltage of


100V .The control winding voltage is obtained through an R-C combination.
The voltage available to control winding is varied by the control of resistance
potentiometer P2.The capacitance is used to generate a phase shift .By
varying the magnitude of the control voltage; it is possible to vary the speed of
the AC .Servo Motor. The secondary of the transformer provided the reference
winding the control winding voltage.

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:

In order to measure torque ,produced by the AC.Servomotor, we must have


some arrangement to produce a variable load on the AC.Servo motor .The
AC.Servo motor is mechanically coupled to a small PMDC Motor on the
remaining side of the extended shaft .A variable DC.current is required to be
passed on through the DC.motor . the polarity of the current is such as to
produce an opposite torque as result of its interaction with the field of the
permanent magnet.
It can be proved that the electrical power developed by the AC Servo
motor is given by the product of back emf generated by the DC machine and
current we are forcing through armature by means of a variable resistance
and the constant voltage source. By varying the resistance, the current is
changing and the opposite torque is also changing .We have to use the
following formula to find the torque in gm-cm.

P x 1.019 x 104 x 60 gm-cm


T= 2Π x N
Where Eb = back emf
Ia = Armature current
P = E bx I a

N = RPM
We can find the mechanical power developed at the motor shaft. Again we
must use the formula P = 2ΠNT/60

PROCEDURE:

1. Speed-Back emf Characteristics of AC servo motor:

1. Study all the front panel controls carefully.


2. Initially keep load switch and servo motor switch in OFF position.
3. Keep P1 and P2 at minimum (anti clockwise).

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.

2.Speed V/s Torque Characteristics of A.C Servo Motor:

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)

S.No Current Ia Speed Back emf Power P=Eb Torque


mA N rpm Voltage Eb x Ia mW T=Px1.019x104x60
V 2∏ x N
gm-cm
1.
2.
3.
4.
5.
6.

Table No.2(b): Speed v/s Torque Characteristics


Control Winding Voltage Vc = 240V(fixed)
S.No Current Ia Speed Back emf Power Torque
mA N rpm Voltage Eb P=Eb x Ia T=Px1.019x104x60
V mW 2∏ x N
gm-cm
1.
2.
3.
4.
5.

RESULT:

24
5. STUDY CHARACTERISTICS OF– DC GENERATOR

AIM: To study the DC Motor - DC Generator Characteristics, torque-speed


characteristics and step response.

APPARATUS:

1. DC Motor – Generator trainer kit


2. Digital multimeter
3. Connecting wires

FRONT PANEL DIAGRAM:

25
PROCEDURE:

1.DC MOTOR – DC GENERATOR CHARACTERISTICS


At no load (
load step at 0 ) the motor is supplied with varying armature voltages ,
Ea=4,6,….24V. For each Ea, the motor current Ia, Speed N, and Generator
voltage Eg are recorded. Straight line approximation of the Ea Vs speed and
Eg Vs speed yield the motor and generator gain constants KM(rpm/volt)and
KG(volts/rpm)

1. Connect the patch cards as shown in diagram


2. Set the Motor Switch to ON. Set RESET switch to RESET. Set LOAD switch
to “0” position
3. Vary Ea (the voltage can be observed by using DC Voltmeter )in small steps
and take readings as under (table no.1)

4.EG (Generator Voltage )can also be observed at DC Voltmeter and Ia can


observed at DC Ammeter.
5.Obtain the slopes and compute KM (Motor gain constant)and KG(Generator
gain constant ),by using formulas mentioned below:

KM = N/Ea rpm / volt = N / 30Ea = rad per sec/ volt


{ie. = 2N/60 =N/30 }
KG = Eg / N = volt / rpm = 30Eg / N = volt/ rad per sec.

6.Now plot N (SPEED) Vs Ea (armature voltage)and Eg (Generator voltage) Vs N


(Speed)

2. TORQUE SPEED CHARACTERISTICS

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.

1. Connect the patch cards as shown in diagram


26
2.

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

7.Plot Torque Vs Speed curves on a Graph paper (approximated straight line


plots)
8.Compute B (Viscous friction co-efficient) from the slope of Torque Speed
curve and average Kb(back emf constant ) from the table.

B = TM/ Newton-m rad per sec

Kb=Eb/ volt/ rad per sec.

9.Repeat above for Ea =8V .Ea =10V ,Ea =12V and record the average values of
motor parameters B&Kb.

Average Kb =20.66X10-3 volts


Rad/sec

[from the slope of the curve ] Fig 3,


coefficient of viscous friction, B = 79.92X10-6 Newton - m
rad/sec.
3. STEP RESPONSE:

The dynamics of the motor is studied with the help of its step response.

1.Connect the patch cards as shown in diagram 1

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

Motor transfer function = G(s) = ω(s) =Km


E(s) Sτ+1

28
OBSERVATIONS:

Table No – 1 ( Armatur voltage control method)

s.n Current(I) VOLTS(V) SPEED(N) Eb=v-IaRa W=2ΠN/60


1
2
3
4

Table No - 2 (For Field control method)

s.n IL Kg1 Kg2 Speed(N) T=(f1-f2)χ9.81xr


1
2
3
4

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

Closed loop Response – First order system:


1. Two forms of first order closed loop system as shown in fig 1(a) and 1(b)
are possible. Make proper connections for configuration chosen.
2. Apply a 1V P-P square input and trace the output waveform on a
tracing paper for K=0.5,1.0,1.5,…………….calculate the time constant
in each case and compare with theoretical results.
3. Also calculate the steady state error.
4. Note that in case of I-order type – I system. Experiments must be
conducted at the lowest frequency to allow enough time for the step
response to reach near steady state. For still better results an external
oscillator may be used.

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:

Step response of second order under damped system

VIVA QUESTIONS :

1. What is meant by linear system?


2. What is the purpose of feedback?
3. What is the difference between open loop system and closed loop
system?
4. What is meant by gain?

34
7. TEMPERATURE CONTROLLER USING PID

AIM : To study the performance of various types of controllers used to control


the temperature of an oven.

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.

Proportional – integral controller


Zieglar and Nicholas suggested the value of Kp and K1 for p-I
controller as
Kp= 0.9/K X T1/T2; T1= 1/K = 3.3 T2
Giving K1 = 1/3.3T2.
1. Starting with a cool oven, keep switch to ‘WAIT’ position. Connect and
I outputs to Driver i/p and disconnect R and D outputs. Short ‘feed
back’ terminals.
2. Set p and I potentiometers to the above values of Kp and Ki resp,
keeping in mind that the maximum value of Kp is 20 and that K1 is
0.024.
3. Select and set the desired temperature say 600C.
4. Keep switch to ‘RUN’ position and record temperature readings as
before.
35
5. Plot the response on a graph and observe the steady state error and %
over shoot.

Expected graph:

(i) Open loop response of oven

(i) Open loop response of oven

Steady State error

Temp
In oC Ambient temperature

Time in minutes

(ii) Response with p-controller

Temp in oC Steady state error

Ambient temperature

Time in min

Proportional –Integral –Derivative Controller:

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.

2. Set P,I and D potentiometers according to the above calculated values


of KP,Ki and Kd. Keeping in mind that the maximum values for these
are 20, 0.024 and 23.5 respectively.
3. Select and set the desired temperature, say 600C.
4. Switch to ‘RUN’ position and record temperature time readings as
before.
5. Plot the response on a linear graph and observe the rise time, steady
state error and percent over shoot.
6. Compare the results of the various controller options.

Expected graph:
(iii) Response with PI controller:

Temp in 0C Study state temp

Ambient temperature

Time in min

(iv) Response with PID controller:

Study state temperature

Temp in 0C
Rise time
Ambient temp

T2 = 90%

T1=10% Time in minutes


37
OBSERVATIONS:

P with feedback kp = P without feedback kp =

Time (min) Temperature Time (min) Temperature

P with feedback ki = P without feedback ki =

Time (min) Temperature Time (min) Temperature

RESULT: Temperature controller using P,PI,PID controller is studied


practically

38
8. EFFECT OF P, PI AND PID CONTROLLER ON
A SECOND ORDER SYSTEM

AIM: To study the performance characteristics of an analog PID controller


using simulated systems.
APPARATUS:
1. PID controller kit
2. CRO

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

5. Check with the Theoretical value and the practical result.

Proportional – Integral [PI] Controller


1. Make the connections as given in the circuit diagram - Keep D
Controller at OFF position.
2. Connect Square wave input to Second Order System for different
Values of P and I gain by keeping the damping factor constant by
adjusting R value provided on the front panel by varying both P gain
and I gain.
3. Enter the results in the tabular column.
4. You can observe that study state error is zero with PI controller.

Proportional + Integral + Derivative [PID] Controller


1. Make the connections as given in the circuit diagram.
2. Connect square wave input to the Second order system and adjust
damping factor by adjusting R.
3. Observe the wave form at Input and VF. Observe the change in
overshoots by increasing the D gain.

40
P-CONTROLLER
Proportional(%) Integral(%) Derivative Peak Settling Rise
Overshoot Time Time

PI-CONTROLLER

Proportional(%) Integral(%) Derivative Peak Settling Rise


Overshoot Time Time

PID-CONTROLLER

Proportional(%) Integral(%) Derivative Peak Settling Rise


Overshoot Time Time

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

Aim: To perform PSICE Simulation for op-amp based on Integrator and


Differentiator.

Apparatus:

PSPICE Software 9.1 student version

a) Integrator:

Circuit Diagram:
Rf = 10k ohm

C1
R1=2.5k ohm 0.1µf
1 2

ViN Vo

a) Integrator:
Program:

VIN 1 0 PULSE (-1V 1V 1MS 1NS 1NS 1MS 2MS)


R1 1 2 2.5KOHM
C1 2 3 0.1UF
RF 2 3 10KOHM
XA1 2 0 3 0 OPAMP-DC
.SUBCKT OPAMP-DC 1 2 3 4
RIN 1 2 2MEGOHM
R0 5 3 75OHM
EA 5 4 2 1 2E+5
.ENDS OPAMP-DC
.TRAN 10US 20000US
.PLOT TRAN V(3) V(1)
42
.PROBE
.END
a) Integrator:

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:

VIN 1 0 PULSE(0 1 0MS 1MS 1MS 1NS 2MS)


R1 1 2 100OHM
RF 2 4 1KOHM
C1 2 4 1UF
XA1 3 0 4 0 OPAMP-DC
.SUBCKT OPAMP-DC 1 2 3 4
R1 1 2 2MEGOHM
R0 5 3 75OHM
EA 5 4 2 1 2E+5
.ENDS OPAMP-DC
.TRAN 10US 20000US
.PROBE
.END

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

Aim: To perform a suitable experiment on the stability of a system by


using Bode plot, Root locus and Nyquist plot.

Apparatus: MATLAB Software

Bode Plot:

Program:

n = input ('ENETER THE NUMERATOR OF THE TRANSFER FUNTION:')

d = input ('ENTER THE DENOMINATOR OF THE TRANSFER FUNTION:')

s = tf (n, d);

bode (s)

[gm, pm, wcg, wcp] = margin(s)

gmdb = 20*log10 (pm)

if ((pm>0) & (gmdb>0))

disp ('THE SYSTEM IS STABLE')

else

if ((pm==0) & (gmdb==0))

disp ('THE SYSTEM IS MARGINALLY STABLE')

else

disp ('THE SYSTEM IS UNSTABLE')

end

end
46
Transfer Function Input:

ENTER THE NUMERATOR OF THE TRANSFER FUNTION: 25

n = 25

ENTER THE DENOMINATOR OF THE TRANSFER FUNTION: [23 2 11]

d = [23 2 11]

Transfer function:

25
----------------
23S^2 + 2 s + 11

Transfer Function Output:


gm = Inf

pm = 5.7341

wcg = Inf

wcp = 1.2489

gmdb = 15.1694

THE SYSTEM IS STABLE

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:')

d = input ('ENTER THE DENOMINATOR OF THE TRANSFER FUNTION:')

s = tf (n, d);

nyquist (s)

[gm, pm, wcg, wcp] = margin(s)

48
gmdb = 20*log10 (pm)

if ((pm>0) & (gmdb>0))

disp ('THE SYSTEM IS STABLE')

else

if ((pm==0) & (gmdb==0))

disp ('THE SYSTEM IS MARGINALLY STABLE')

else

disp ('THE SYSTEM IS UNSTABLE')

end

end

Transfer Function Input:


ENTER THE NUMERATOR OF THE TRANSFER FUNTION: 10

n = 10

ENTER THE DENOMINATOR OF THE TRANSFER FUNTION: [1 4 7]

d = [1 4 7]

Transfer function:

10
-------------
S^2 + 4 s + 7

Transfer Function Output:


49
gm = Inf

pm = 94.5252

wcg = Inf

wcp = 2.4922

gmdb = 39.5110

THE SYSTEM IS STABLE

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:

n1= input (‘Enter the Numerator of the transfer function’);

d1= input (‘Enter the Denominator of the transfer function’);

S= tf (n1, d1);

rlocus (s)

end

Transfer Function Input:


Enter the numerator of the transfer function [25 0]

Enter the denominator of the transfer function [23 2 11]

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

AIM: To perform a suitable experiment on the transformation of


dynamical system into state variable model & Vic versa.

APPARATUS: MATLAB Software

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: ')

disp ('Transfer Function is: ')

t = tf (num,den)

[a,b,c,d] = tf2ss (num,den)

case 2
a = input ('System matrix a: ')
b = input ('Matrix b: ')
c = input ('Output Matrix c: ')
d = input ('Transition Matrix d: ')

[num,den] = ss2tf (a,b,c,d)

tf (num,den)

otherwise

disp ('Invalid Choice')

end

53
Output:

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: 1

n=1

Enter the Numerator valve of the Transfer Function: [1 2]

num = [1 2]

Enter the Denominator valve of the Transfer Function: [2 3 4]

den = [2 3 4]

Transfer Function is:

s+2
---------------
2 s^2 + 3 s + 4

Transfer Function Output:

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

System matrix a: [-1.5000 -2.0000; 1.0000 0]

a= -1.5000 -2.0000
1.0000 0

Matrix b: [1; 0]

b= 1
0

Output Matrix c: [0.5000 1.0000; 0 0]

c= 0.5000 1.0000
0 0

Transition Matrix d: [0]

d = [0]

Transfer Function Output:


num = [0 0.5000 1.0000]

den = [1.0000 1.5000 2.0000]

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

Lead - 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.

TABULAR COLUMN: LEAD NETWORK

S.N FREQUENCY V O/P A B GAIN PHASE


DIFFERENCE
1
2
3
4
5

TABULAR COLUMN: LAG NETWORK

S.N FREQUENCY V O/P A B GAIN PHASE


DIFFERENCE
1
2
3
4
5

57
TABULAR COLUMN: LAG-LEAD NETWORK

S.N FREQUENCY V O/P A B GAIN PHASE


DIFFERENCE
1
2
3
4
5

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 )
= =
( ST  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

APPARATUS: MATLAB Software

Program:

num=input('enter the numerator of transfer function:')


den=input('enter the denominator of transfer function:')
s=tf(num,den)
step(s)
title('the response of second order system is:')
Xlabel('t in secs')
Ylabel('v in volts')
[nt,dt]=tfdata(s,'v')
wn=sqrt(dt(3))
z=dt(2)/(2*wn)
disp('the rise time is:')
tr=pi-(atan^-1(sqrt(1-z^2)/z)/(wn*sqrt(1-z^2)))
disp('the peak time is:')
tp=pi/(wn*sqrt(1-z^2))
disp('the settling time is:')
ts=4/(z*wn)
disp('the peak over shoot is:')
pos=exp((-z*pi)/sqrt(1-z^2))*100
end

OUTPUT:

enter the numerator of transfer function:100

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

the rise time is:

tr =

2.8238

the peak time is:

tp =

0.3245

the settling time is:

ts =
62
1.6000

the peak over shoot is:

pos =

44.4344

the response of second order system is:


1.5

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:

enter the %overshoot:12


enter the time:5
enter the value of kv:3
Transfer function:
1
-----------------
s^3 + 5 s^2 + 4 s
Transfer function:
12
-----------------
s^3 + 5 s^2 + 4 s
wpm =
1.4102
Transfer function:
1.006 s + 0.1418
----------------
68
s + 0.1418
Transfer function:
0.9945 s + 1.406
----------------
s + 1.406
Zero/pole/gain:
12 (s+1.414) (s+0.141)
-----------------------------------------------------
(s+1.413) (s+4.691) (s+0.141) (s^2 + 0.3025s + 2.56)
GRAPHS:

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.

open `codesysv2.3.7.3'3' `Installable CoDeSys V2.3'


`setup.exe' an
and follow the steps that are displayed

73
Press `OK'.

Press `Next' until the setup is installing, don't make any changes.

74
After installation is ccompleted, press `Finish'.

To open the software:


Start Programs Messung systems CoDeSys V2.3
CoDeSys V2.3

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:

On Delay Timer (TON):


When TON receives an enable (logic 1) at its input (IN), a predetermined
amount of time (preset time `PT') passes before the timer bit turns on. A ladder
diagram with TON is shown below

When switch I1 is closed logic 1 is loaded in to the timer T63.


The preset time (PT) value has been set to 10S. As the 10sec pass the T63 contact will
become NC C from NO and output O1 is set. At same time in same ladder T63 NC
contact will become NO and output O2 is disabled. If the switch I1 is opened and
again closed before 10sec the timer will reset to 0.

Off-Delay Timer (TOF):


The off delay timer is used to delay an output off for a fixed period of time
after the input is turned off. When the enabling bit turns on the timer bit turns on
immediately and the value is set to 0. When input turns off, the timer counts until the
preset time has elapsed before the timer
timer bit turns off. A box diagram of delay timer is
shown below

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:

2 pole 24 v 500 fi Relay


Logic Ladder 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.

Here one traffic junction is given


LED colour : Red Yellow
Green Function :
Stop Wait
Go

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.

[Type text] Page 24


LOGIC DIAGRAM OF GATES
Ladder diagram for OR gate:

I1 O2
( )
I2

Ladder diagram for NAND gate:

Ladder diagram for NOR gate:

[Type text] Page 25


Ladder diagram interpretation of NOT gate:

Ladder diagram interpretation of XNOR gate:

Ladder diagram interpretation of XOR gat

[Type text] Page 26


SEQUENTIAL CONTROL OF MOTOR
Aim:
Sequential control of motor is useful to run 4 motors one by one with
Selectable time delay. This program is basically timer based program.

[Type text] Page 27


Logic Ladder Diagram:

[Type text] Page 28


Procedure:
When I1 is high `M1' rotates with selectable time delay, when motor `M1' rotating all
other (M2, M3, M4) must be in OFF condition. When next motor
`M2' rotates with selectable time delay, all other motors (M1, M3, M4) are OFF. When next
motor `M3' rotates with selectable time delay, all other motors (M1, M2, M4) are OFF.
When next motor `M4' rotates with selectable time delay, all other motors (M1, M2, M3) are
OFF. When I2 is high rotating will be OFF.

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:

[Type text] Page 29


Elevator Simulator Logic Ladder Diagram:

[Type text] Page 30


[Type text] Page 31
Procedure:
Connect PLC input socket I0 – I9 & I15 to elevator simulator input sockets I0 to I9 &
I15 using patch cords, outputs O0,O1,O2 to elevator simulator outputs O0, O1,O2 and +24V,
GND also.
1. I0 input should be in ON position which means door switch is ON or Elevator on
condition.
2. When limit switch I2 (1st floor) is high, we are giving call from out side I4(GND) or
call from inside I7 (GND) down LED `DN' indication should be glow, when lift reaches
calling state led down indication should be off.
3. When limit Switch I2 (1st floor) is high, we are giving call from out side I6 (2nd floor) or
call from inside I9 (2nd floor) `UP' LED indication should be glow. When lift reaches
calling state led up indication should be off, when we are giving call from outside I5 or call from
inside I8 nothing will glow (up or down LED indications).
The limit switches indicates the position of lift in building. Call from outside & call from
inside are used to call the lift. LED `UP' represent elevator is moving in up direction, LED
`DN' represent elevator moving in down direction. Master reset is used to reset the `UP' &
`DN' LED.

[Type text] Page 32


STAR DELTA

Aim: In this interfacing we able to understand the functioning of Star to Delta


Conversion & Logic ladder diagram.

Block Diagram:

[Type text] Page 33


Control System & Simulation Lab

MIST, DEPT OF EEE Page 34

You might also like