0% found this document useful (0 votes)
212 views63 pages

Industrial Automation Lab Manual

Uploaded by

akkgptcktm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
212 views63 pages

Industrial Automation Lab Manual

Uploaded by

akkgptcktm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

INDUSTRIAL AUTOMATION LAB

SUBJECT CODE : 6038

Prepared for
Department of Electrical & Electronics Engineering
by:

Dileep. P (Workshop Instructor)


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

INSTRUCTIONS TO STUDENTS

1. Only enter the lab wearing proper uniform, shoes, and ID card
2. Use the tools, training kits, computers and equipments safely to avoid
injuring yourself and damaging the equipments.
3. Never run inside the lab.
4. Do your work with very attentive mind and carefulness.
5. Students must bring the rough record every day, with the experiment or
work of that day written and diagrams and table drawn.
6.
on next day.

OLOGICAL INSTITUTE Page 2


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

COURSE TITLE : INDUSTRIAL AUTOMATION LAB


COURSE CODE : 6038
COURSE CATEGORY :A
PERIODS/WEEK :5
PERIODS/SEMESTER : 75
CREDITS :3

Course Outcome:

Sl. Sub On completion of this course the student will be able

1 To comprehend with various microcontrollers.

2 To comprehend microcontrollers programming.

3 To interface the microcontroller with external devices.

4 To comprehend with PLC.

5 To interface the PLC with control circuits.

LIST OF PRACTICALS

1. To write assembly language programmes, execute and verify the result for the following;
i. Various arithmetic operations.
ii. Various data transfer operations.
iii. Finding the maximum value in an array.
iv. Arrange an array in ascending order / descending order.
v. BCD to Hex conversion.
2. To write an assembly language programme to Interface LEDs through port 1 including time
delay.
3. To write an assembly language programme and control a stepper motor.
4. To write an assembly language programme and control a DC motor.
5. To wire up hardware, write and implement ladder programmes for the following controls.
i. Lamp control for various situations.
a. Staircase control, hospital etc.
b. Traffic light control.
ii. Induction motor controls as in direct on Line (DOL) starter, Star-delta starter.
iii. Conveyor motor controls.
iv. Lift controls
v. Water level control using level sensors.

OLOGICAL INSTITUTE Page 3


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

SL. NO. TOPICS PAGE NO.


8051 MICROCONTROLLER
1 STUDY OF 8051 MICROCONTROLLER 6
2 8 BIT MULTIPLICATIONS 9
3 SQUARE OF A NUMBER 11
4 DIVISION OF 8 BIT NUMBER 13
5 8 BIT ADDITION 15
6 8 BIT SUBTRACTION 17
7 BLOCK TRANSFER 19
8 LARGEST VALUE IN AN ARRAY 21
9 LED INTERFACING 23
10 STEPPER MOTOR CONTROL 25
PROGRAMMABLE LOGIC CONTROLLER
11 LOGIC GATES 29
12 STAIRCASE LAMP CONTROL 31
13 GODOWN LAMP CONTROL 33
14 MASTER CONTROL OF LAMPS 35
15 HOSPITAL LAMP CONTROL 38
16 DOL STARTER 41
17 STAR DELTA STARTER 44
18 FORWARD REVERSE MOTOR CONTROL 47
19 LIFT CONTROL 51
20 WATER LEVEL CONTROLLER 56
APPENDIX
OPCODES OF 8051 MICROCONTROLLER 60
STEPS FOR PROGRAMMING IN CONNECTED
63
COMPONENTS WORKBENCH
CONFIGURATION OF THE DEVICE CONNECTED TO
63
CONNECTED COMPONENTS WORKBENCH

OLOGICAL INSTITUTE Page 4


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

8051 MICROCONTROLLER

OLOGICAL INSTITUTE Page 5


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 1
Date :

STUDY OF 8051 MICROCONTROLLER

AIM: To study 8051 microcontroller architecture, pin details, programming model and features.

Features of 8051 microcontroller

a. ALU 8 bit
b. RAM 128 byte
c. ROM - 4k
d. I/O port 4 no. x 8 bit = 32 bits
e. Instruction set 111
f. Timers - 2 no. x 16 bit
g. Program memory 64k
h. Data memory 64k
i. Clock 12MHZ
j. Serial port 1 no.
k. Interrupt source 5 no.
l. On-chip oscillator and clock circuit
m. Boolean processor
n. Full duplex UART (sending and receiving at a time)

PIN DETAILS

40 Pin DIP

OLOGICAL INSTITUTE Page 6


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

ARCHITECTURE OF 8051

OLOGICAL INSTITUTE Page 7


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROGRAMMING MODEL

RESULT

Studied 8051 microcontroller architecture, pin details, programming model and features.

OLOGICAL INSTITUTE Page 8


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 2
Date :

8 BIT MULTIPLICATIONS

AIM: Write an assembly language program to find the product of two numbers stored in the
external memory location [4100]H and [4101]H. Store the result in the external
memory location [4102]H (LSB) and [4103]H (MSB). Write the assembly listing. Enter
the program (or hex code) in 8051 microcontroller kit and execute the program and
show the result.

PROBLEM ANALYSIS

In order to perform multiplication in 8051 the two numbers should be stored in A and B
registers. Then multiplication can be performed using MUL instruction. After multiplication
the 16 bit product will be in A(LS Byte) and B (MS byte).

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4200H Starting address
MOV DPTR,#4100 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4100)
Copy the data from
MOV B,A
accumulator to B register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4101)
MUL AB Multiply A and B
INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A external memory
location(4102)
Copy the data from B to
MOV A,B
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4103)
HALT SJMP HALT Stop execution
END

OLOGICAL INSTITUTE Page 9


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2. For writing the pro .
3. Now ORG will be displayed on the screen. Now give the starting address of the
.
4. Now enter the instructions in assembly language one by one
twice after each instruction.
5. .
6. Now for executing the program type
.
7. be displayed.
8. .
9. ress of external memory location where
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Multiplication of two 8 bit numbers is done and the result is stored in the external memory
locations.

Input Output
st nd
1 no. 2 no. MS Byte LS Byte
Memory
[4100] [4101] [4103] [4102]
address

Data

OLOGICAL INSTITUTE Page 10


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 3
Date :

SQUARE OF A NUMBER

AIM: Write an assembly language program to find the square of the number stored in the
external memory location [4200]H. Store the result in the external memory location
[4201]H (LSB) and [4202]H (MSB). Write the assembly listing. Enter the program (or
hex code) in 8051 microcontroller kit and execute the program and show the result.

PROBLEM ANALYSIS

Square of a number can be obtained by multiplication. To get square the same number should
be stored in Reg A & Reg B. The MUL instruction can be used for getting square. After
multiplication the 16 bit product will be in A(LS Byte) and B (MS byte).

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4300H Starting address
MOV DPTR,#4200 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4200)
Copy the data from
MOV B,A
accumulator to B register
MUL AB Multiply A and B
INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A external memory
location(4201)
Copy the data from B to
MOV A,B
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4202)
HALT SJMP HALT Stop execution
END

OLOGICAL INSTITUTE Page 11


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2.
3. reen. Now give the starting address of the

4.
twice after each instruction.
5.
6. Now for executing the progr

7.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Input Output
Hex no. MS Byte LS Byte
Memory
[4100] [4202] [4201]
address

Data

OLOGICAL INSTITUTE Page 12


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 4
Date :

DIVISION OF 8 BIT NUMBER

AIM: Write an assembly language program to divide the numbers stored in the external
memory location [4300]H and [4301]H. Store the QUOTIENT in the external memory
location [4302]H and REMAINDER in [4303]H. Write the assembler listing. Enter the
program (or hex code) in 8051 microcontroller kit and execute the program and show
the result.

PROBLEM ANALYSIS

In order to perform division in 8051, the dividend should be stored in A register and the
divisor should be stored in B register. Then the content of A can be divided by content of B
using the instruction DIV AB. After division the quotient will be in Reg A and the remainder
will be in Reg B.

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4400H Starting address
MOV DPTR,#4300 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4300)
MOV B,A Copy the data from
accumulator to B register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4301)
DIV AB Divide A by B
INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A external memory
location(4302)
Copy the data from B to
MOV A,B
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4303)
HALT SJMP HALT Stop execution
END

OLOGICAL INSTITUTE Page 13


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2.
3.
program a
4.
twice after each instruction.
5.
6.

7.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Division of two 8 bit numbers is done and the result is stored in the external memory
locations.

Input Output
Divisor Dividend Quotient Remainder
Memory
[4300] [4301] [4302] [4303]
address

Data

OLOGICAL INSTITUTE Page 14


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 5
Date :

8 BIT ADDITION

AIM: Write an assembly language program to add two 8 bit numbers stored in the external
memory location [4400]H and [4401]H. Store the result in the external memory
location [4402]H (LSB) and [4403]H (MSB). Write the assembly listing. Enter the
program (or hex code) in 8051 microcontroller kit and execute the program and show
the result.

PROBLEM ANALYSIS

In order to perform addition in 8051 one of the data should be in Accumulator (A) and other
data should be in SFR(direct address) or in internal RAM location or an immediate number.
Addition can be performed by ADD instruction. After addition sum is available in
accumulator.
The sum of two 8 bit data can be either 8 bits (sum only) or 9 bit (8 bit sum and 1 bit carry).
Hence to accommodate carry register R7 is used in this program.

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4500H Starting address
CLR C Resetting carry flag.
MOV DPTR,#4400 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4400)
Copy the data from
MOV R0,A
accumulator to R0 register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4401)
Get the immediate data 00H
MOV R7,#00H
to register R7.
Add the content in R0 with
ADD A,R0
accumulator.
JNC AHEAD Jump if no carry to AHEAD
INC R7 Increment register R7.
AHEAD: INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A
external memory

OLOGICAL INSTITUTE Page 15


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

location(4402)
Copy the data from R7 to
MOV A,R7
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4403)
HALT: SJMP HALT Stop execution
END

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2. For writing the
3.

4.
twice after each instruction.
5.
6.

7.
8.
9. <address of external memory location where
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Addition of two 8 bit numbers is done and the result is stored in the external memory
locations.

Input Output
st nd
1 no. 2 no. MS Byte LS Byte
Memory
[4400] [4401] [4403] [4402]
address

Data

OLOGICAL INSTITUTE Page 16


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 6
Date :

8 BIT SUBTRACTION

AIM: Write an assembly language program to subtract two 8 bit numbers stored in the
external memory location [4500]H and [4501]H(number stored in 4501H number
stored in 4500H ). save the difference in external memory location [4502]H if the
number is positive write data 00 in [4503] H to indicate positive sign. If the number is
negative write data 01 in [4503]h to indicate negative sign.

PROBLEM ANALYSIS

In order to perform subtraction in 8051 one of the data should be in Accumulator (A) and
other data should be in SFR(direct address) or in internal RAM location or an immediate
number. Subtraction can be performed by SUBB instruction. After subtraction difference is
available in accumulator.

The difference of two 8 bit data can be either 8 bits (difference only) or 9 bit (8 bit difference
and 1 bit borrow). Hence to accommodate borrow register R7 is used in this program.

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4600H Starting address
CLR C Resetting carry flag.
MOV DPTR,#4500 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4500)
Copy the data from
MOV R0,A
accumulator to R0 register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4501)
Get the immediate data 00H
MOV R7,#00H
to register R7.
Add the content in R0 with
SUBB A,R0
accumulator.
JNC AHEAD Jump if no carry to AHEAD
INC R7 Increment register R7.
CPL A Compliment the accumulator
INC A Increment accumulator
AHEAD: INC DPTR Increment DPTR

OLOGICAL INSTITUTE Page 17


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Transfer the data from A to


MOVX @DPTR,A external memory
location(4502)
Copy the data from R7 to
MOV A,R7
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4503)
HALT: SJMP HALT Stop execution
END

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2.
3.

4. Now enter the instructions in assembly langu


twice after each instruction.
5.
6.

7.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Subtraction of two 8 bit numbers is done and the result is stored in the external memory
locations.
Input Output
1st no. 2nd no. MS Byte LS Byte
Memory
[4500] [4501] [4503] [4502]
address

Data

OLOGICAL INSTITUTE Page 18


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 7
Date :

BLOCK TRANSFER

AIM: Write an assembly language program to transfer a block of da ) available in


external memory location 4501 H-450A H to 4601H- 460A H.

PROBLEM ANALYSIS

In order to transfer a block of data from one external memory location to other, initializes the
counter R6 and get the number in accumulator and save in register R0. Each time we check
whether R6 equal to zero and save the in result location

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4700H Starting address
MOV DPTR,#4501 Initializing DPTR
MOV R0,#50 Move 50H to R0
Initialize the counter with
MOV R6,0AH
number of data
BACK1: MOVX A,@DPTR Bring data to accumulator
Move the data from
MOV @R0,A
accumulator to register R0
INC DPTR Increment DPTR
INC R0 Increment R0
Decrement counter, if not
DJNZ R6,BACK 1
zero, go to BACK1
Initialize the counter with
MOV R6,0AH
number of data
MOV R0,#50 Move 50H to R0
MOV DPTR,#4601 Initializing DPTR
Move data from register R0
BACK2: MOV A,@R0
to accumulator
Transfer the data from A to
MOVX @DPTR,A
external memory location
INC DPTR Increment DPTR
INC R0 Increment R0
Decrement counter, if not
DJNZ R6,BACK 2
zero, go to BACK2
HALT: SJMP HALT Stop execution
END

OLOGICAL INSTITUTE Page 19


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2.
3.

4. Now enter the instructions in assembly language one by one an


twice after each instruction.
5.
6.

7.
8.
9. Now
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Input Output
Memory address Data Memory address Data
[4501]H [4601]H
[4502]H [4602]H
[4503]H [4603]H
[4504]H [4604]H
[4505]H [4605]H
[4506]H [4606]H
[4507]H [4607]H
[4508]H [4608]H
[4509]H [4609]H
[450A]H [460A]H

OLOGICAL INSTITUTE Page 20


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 8
Date :

LARGEST VALUE IN AN ARRAY

AIM: Write an assembly language program to find the l


available from [4701]H to [470A]H and store the result in [4600]H. Write the
assembler listing and execute the program.

PROBLEM ANALYSIS

In order to find the largest data from the set of que. Each
time we compare one data with other and save largest one in one of the memory locations

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4800H Starting address
MOV DPTR,#4701 Initializing DPTR
Initialize the counter with
MOV R6,#0AH
number of data
MOVX A,@DPTR Bring data to accumulator
Move the data from
MOV R4,A
accumulator to register R4
Decrement counter by
DEC R6 one(because 1st number is
already taken)
AGAIN: INC DPTR Increment DPTR
MOVX A,@DPTR Bring data to accumulator
Move the data from
MOV R2,A
accumulator to register R2
CLR C Clear Carry bit
Subtract data in R4 from data
SUBB A,R4
in Accumulator.
Check for carry, if carry bit is
set, jump to an instruction
JC AHEAD
which contains label as
AHEAD
Move the data from R2 to
MOV A,R2
register accumulator

Move the data from


MOV R4,A
accumulator to register R4

OLOGICAL INSTITUTE Page 21


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Decrement count and go to


AGAIN if count is not zero,
AHEAD: DJNZ R6,AGAIN
otherwise go to next
instruction
Initialize data pointer with
MOV DPTR,#4600
destination address.
Move largest number to
MOV A,R4
Accumulator
Store the largest data in
MOVX @DPTR,A
external memory
HALT: SJMP HALT Stop execution
END

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2.
3.

4. Now enter the instructions i


twice after each instruction.
5.
6.

7. layed.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.

RESULT

OUTPUT
INPUT (Largest
data)
Memory
4701 4702 4703 4704 4705 4706 4707 4708 4709 470A 4600
address

Data

OLOGICAL INSTITUTE Page 22


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 9
Date :

LED INTERFACING

AIM: Write
the pattern given in the external memory location [4600] H. The LED should be turn
ON and OFF alternatively 10 times.

PROBLEM ANALYSIS

LED logic one has to be applied to its anode and logic zero to the cathode. Here L
connected in common anode configuration (which means logic one is already present in the
anode). Hence on receiving logic zero the corresponding led will be turned ON and by
receiving a logic one the corresponding led will be turned OFF .

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4700H Starting address
MOV R7,#0A Initialize the counter
MOV DPTR,#4600 Initialize data pointer
MOVX A,@DPTR Bring data to accumulator
Move the data from
REPEAT: MOV P1,A accumulator to register
P1(port one)
ACALL DELAY Call delay subroutine.
CPL A Compliment Accumulator
Decrement counter if not
DJNZ R7,REPEAT
equal to zero go to REPEAT
Move logic one to port one to
MOV P1,#FF
turn
HALT: SJMP HALT Stop execution.
Move the content FF to
DELAY: MOV R0,#FF
register R0
Move the content FF to
BACK2: MOV R1,#FF
register R1
Move the content 0A to
BACK1: MOV R2,#0A
register R2

Decrement register R2 if not


HERE: DJNZ R2,HERE
equal to zero go to HERE

OLOGICAL INSTITUTE Page 23


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Decrement register R1 if not


DJNZ R1,BACK1
equal to zero go to BACK1

Decrement register R0 if not


DJNZ R0,BACK2
equal to zero go to BACK2
RET Return from subroutine

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2.
3.

4. Now enter the instructions in assembly language one by one


twice after each instruction.
5.
6.

7.
8.
9. N
result is stored>
10. Now data stored in that location will be displayed.

RESULT

Input
Memory address OUTPUT
[4600]H
FF

0F

DATA F0

AA

55

OLOGICAL INSTITUTE Page 24


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 10
Date :

STEPPER MOTOR CONTROL

AIM: Write an assembly language program to rotate a stepper motor by a particular angle
defined by a number stored in the external memory location [4400] H. The rotation
angle should be able to change by changing the number stored in [4400] H.

PROBLEM ANALYSIS

Stepper motors operate differently from normal DC motors, which simply spin when voltage
is applied to their terminals. Stepper motors, on the other hand, effectively have multiple
"toothed" electromagnets arranged around a central metal gear. To make the motor shaft turn,
first one electromagnet is given power, which makes the gear's teeth magnetically attracted to
the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet,
they are slightly offset from the next electromagnet. So when the next electromagnet is turned
on and the first is turned off, the gear rotates slightly to align with the next one, and from
there the process is repeated. Each of those slight rotations is called a "step." In that way, the
motor can be turned a precise angle. There are two basic arrangements for the
electromagnetic coils: bipolar and unipolar.

There are four coils in the stepper motor namely ABCD. These coils are activated by giving a
value 1 to the corresponding pin in the port P1 of the microcontroller. The coils are
deactivated by giving a value 0 to the corresponding pin in the port P1 of the microcontroller.
When two adjacent coils are activated the rotor rotates and stops at a position in between
those coils. Port P1 is accessed through port P9 of the training kit. P9 is connected to P12
port in the kit which is dedicated for stepper motor. The values to be given to port P1 for each
position is given in table below. A counter is set using a value in register R3. Four steps are
counted for one decrement in R3 value. Thus we can set number of steps required and thus
angle of rotation by the value we store in R3.

PORT P1 HEX PORT P1 COIL STATUS ROTOR


VALUE MSB LSB A B C D POSITION

39 H 0011 1001 1 0 0 1

35 H 0011 0101 0 1 0 1

36 H 0011 0110 0 1 1 0

3A H 0011 1010 1 0 1 0

OLOGICAL INSTITUTE Page 25


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

ASSEMBLY LANGUAGE PROGRAM AND ASSEMBLER LISTING

HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4100H Starting address
4100 MOV DPTR,#4400 Initialize data pointer
4103 MOVX A,@DPTR Bring data to accumulator
Move the data from
4104 MOV R3,A accumulator to register R3 for
a counter
Move value to port one to
4105 START MOV P1,#39H
turn rotor to first step
4108 ACALL DELAY Call delay subroutine.
Move value to port one to
410A MOV P1,#35H
turn rotor to second step
410D ACALL DELAY Call delay subroutine.
Move value to port one to
410F MOV P1,#36H
turn rotor to third step
4112 ACALL DELAY Call delay subroutine.
Move value to port one to
4114 MOV P1,#3AH
turn rotor to fourth step
4117 ACALL DELAY Call delay subroutine.
Decrement counter by one for
4119 DEC R3
counting 4 steps
Move the new value of
411A MOV A,R3
counter to the accumulator.
Stop further execution if
411B END JZ END
counter value becomes zero
Continue rotation if counter
411D SJMP START
value is not zero
Move the content 0A to
411F DELAY: MOV R1,#0AH register R1 for a counter
value to create a delay
Move the content FF to
register R2 for a counter
4121 BACK2 MOV R2,#FFH
value within a counter to
create a delay
Continue decreasing R2
4123 BACK1 DJNZ R2, BACK1
counter until it becomes zero
Decrease R1 counter and
4125 DJNZ R1, BACK2 jump back to R2 counter if
R1 counter is not zero
Stop the delay subroutine and
4127 RET return back to the main
program

OLOGICAL INSTITUTE Page 26


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Connect keyboard and turn ON the trainer kit.


2. Calculate the number of steps required for particular angle of rotation.
3. Calculate the value to be stored in R3 register for defining the rotation angle
4.
5.

6. Now enter the instructions in assembly language one by one and pre
twice after each instruction.
7.
8. Connect port P9 and P12 headers of the kit using 10 core connecting cable.
9.

10.
11.
12. Measure the angle of rotation of the stepper motor.

RESULT

Number of steps required Input value for angle


Output angle of rotation (degrees)
(in multiples of 4) [4400]H

OLOGICAL INSTITUTE Page 27


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROGRAMMABLE LOGIC
CONTROLLER

OLOGICAL INSTITUTE Page 28


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 11
Date :

LOGIC GATES

AIM: To prepare a ladder program for realization of logic gates and verify the truth tables
using PLC trainer kit

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.2 Logic input A
DI.3 Logic input B
DO.0 Logic output Q

AND Gate: The AND gate output will be high state only when all the inputs are in high
DI.2 and DI.3 are the two digital inputs.
DO.0 is the AND gate digital output.

TRUTH TABLE LADDER PROGRAM

A B
0 0 0
0 1 0
1 0 0
1 1 1

OR Gate: Its output will become high if any of the input is in high state.
represents the OR Gate. DI.2 and DI.3 are the two digital inputs. DO.0 is the OR gate
digital output.

TRUTH TABLE LADDER PROGRAM

A B A+B
0 0 0
0 1 1
1 0 1
1 1 1

OLOGICAL INSTITUTE Page 29


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

XOR Gate: Its output will be high if and only if one input is in high state.
represents the XOR Gate. DI.2 and DI.3 are the two digital inputs. DO.0 is the XOR gate
digital output.
TRUTH TABLE LADDER PROGRAM

A B A xor B
0 0 0
0 1 1
1 0 1
1 1 0

CONNECTION DIAGRAM

PROCEDURE
1. Switch on the PC.
2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT
Prepared a ladder program for logic gates and verified the truth tables using PLC trainer kit.

OLOGICAL INSTITUTE Page 30


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 12
Date :

STAIRCASE LAMP CONTROL

AIM: To prepare a ladder program for staircase lamp control and verify the truth table using
PLC trainer kit

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Lamp 230V,60W

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DO.0 Logic output for lamp L1

In staircase lamp control we are using two toggle switches DI.2 and DI.3 to control the
lamp. Output lamp control is through DO.0. The output is ON only when the input
switches are having opposite conditions.

STATUS TABLE

S1 S2 L1
0 0 0
0 1 1
1 0 1
1 1 0

LADDER PROGRAM

OLOGICAL INSTITUTE Page 31


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for staircase lamp control and verified the truth tables using
PLC trainer kit.

OLOGICAL INSTITUTE Page 32


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 13
Date :

GODOWN LAMP CONTROL

AIM: To prepare a ladder program for godown lamp control and verify the truth table using
PLC trainer kit

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Lamp 230V,60W

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DI.4 Logic input for switch S3
DO.0 Logic output for lamp L1
DO.1 Logic output for lamp L2
DO.2 Logic output for lamp L3

In godown lamp control we are using three toggle switches S1 , S2, S3 to control three
lamps L1, L2, L3. The input switches are connected to the digital inputs DI.2, DI.3 and
DI.4 of the PLC and the lamps are connected to the relays which are connected to digital
outputs DO.0, DO.1 and DO.2 of the PLC. L1 is ON when S1 only is ON. L1 turns off
and L2 turns on when S2 is also turned ON. Then L2 turns off and L3 turns ON when S3
is also turned ON. Rung 1 is for controlling L1, Rung 2 is for controlling L2 and Rung 3
is for controlling L3.

STATUS TABLE

S1 S2 S3 L1 L2 L3
0 0 0 0 0 0
1 0 0 1 0 0
1 1 0 0 1 0
1 1 1 0 0 1

OLOGICAL INSTITUTE Page 33


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

LADDER PROGRAM

CONNECTION DIAGRAM

PROCEDURE
1. Switch on the PC.
2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.
RESULT
Prepared a ladder program for godown lamp control and verified the truth tables using
PLC trainer kit.

OLOGICAL INSTITUTE Page 34


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 14
Date :

MASTER CONTROL OF LAMPS

AIM: To prepare a ladder program for master control of lamps and verify the truth table using
PLC trainer kit

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Lamp 230V,60W

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DI.4 Logic input for switch S3
DI.5 Logic input for switch S4
DO.0 Logic output for lamp L1
DO.1 Logic output for lamp L2
DO.2 Logic output for lamp L3

In master control of lamps we are using four toggle switches S1, S2, S3, and S4 to
control three lamps L1, L2 and L3. S4 is the master switch. The input switches are
connected to the digital inputs DI.2, DI.3, DI.4 and DI.5 of the PLC and the lamps are
connected to the relays which are connected to digital outputs DO.0, DO.1 and DO.2 of
the PLC. L1 is ON when S1 only is ON. L2 is ON when S2 only is ON. L3 is ON when
S3 only is ON. But L1, L2 and L3 turns ON when S4 is turned ON irrespective of the
condition of other switches S1, S2 and S3. Rung 1 is for controlling L1, Rung 2 is for
controlling L2 and Rung 3 is for controlling L3.

STATUS TABLE

S1 S2 S3 S4 L1 L2 L3
0 0 0 0 0 0 0
1 0 0 0 1 0 0
0 1 0 0 0 1 0
0 0 1 0 0 0 1
0 0 0 1 1 1 1

OLOGICAL INSTITUTE Page 35


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

LADDER PROGRAM

OLOGICAL INSTITUTE Page 36


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for master control of lamps and verified the truth tables using
PLC trainer kit.

OLOGICAL INSTITUTE Page 37


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 15
Date :

HOSPITAL LAMP CONTROL

AIM: To prepare a ladder program for hospital lamp control and verify the truth table using
PLC trainer kit

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Lamp 230V,60W

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DO.0 Logic output for relay D0
DO.1 Logic output for relay D1
DO.2 Logic output for relay D2
DO.3 Logic output for relay D3

In hospital lamp control we are using two toggle switches S1 and S2 to control two
lamps L1 and L2. The input switches are connected to the digital inputs DI.2 and DI.3 of
the PLC. The lamps should be connected for a series and parallel connection. Therefore
lamps could not be directly controlled by two digital outputs only. To achieve both series
and parallel connections four control relays has to be used. These four relays are
controlled by the digital outputs DO.0, DO.1, DO.2 and DO.3. The conditions of the
status table are achieved by controlling the four digital outputs based on the ladder logic
program made referring the truth table prepared.

When S1 and S2 is OFF all four relays are OFF. When both lamps have to be bright
relays D0, D1, D2 has to be closed. When only one lamp has to be bright only D1 has to
be closed. When both lamps has to be dim D0, D3 has to be closed and D1 and D2 has to
be open. D1, D2 and D3 should never be closed together to avoid short circuit.

Rung 1 is for controlling D0, Rung 2 is for controlling D1, Rung 3 is for controlling D2,
and Rung 3 is for controlling D3.

OLOGICAL INSTITUTE Page 38


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

STATUS TABLE TRUTH TABLE

S1 S2 L1 L2 S1 S2 D0 D1 D2 D3
0 0 OFF OFF 0 0 0 0 0 0
0 1 BRIGHT BRIGHT 0 1 1 1 1 0
1 1 BRIGHT OFF 1 1 0 1 0 0
1 0 DIM DIM 1 0 1 0 0 1

CONNECTION DIAGRAM

OLOGICAL INSTITUTE Page 39


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

LADDER PROGRAM

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for hospital lamp control and verified the truth tables using
PLC trainer kit.

OLOGICAL INSTITUTE Page 40


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 16
Date :

DOL STARTER

AIM: To prepare a ladder program for DOL starting of a three phase motor and verify the
program using PLC trainer kit.

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Three phase contactor, 415 V, 5HP ( Coil voltage 230 V ) (1 No.)
Three phase motor, 440 V, 5HP (1 No.)

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.0 START Push botton
DI.1 STOP Push botton
DI.2 OLR switch
DO.0 STARTER COIL

In DOL starter the three phase supply to the motor winding connections are given
through the main contacts of a three phase contactor. The contactor is turned ON by
energizing its electromagnetic coil. The coil is energised through relay module in PLC
connected to DO.0 output. The output DO.0 is turned ON when START push button is
pressed which sends the input signal to input DI.0. When turned ON, the STARTER
holds in ON condition due to the holding circuit in the ladder program. The output DO.0
is turned OFF when STOP push button is pressed which sends the input signal to input
DI.1. A toggle switch named OLR switch in the trainer kit is used to emulate overload
condition. When this switch is turned on it sends a signal to DI.2 which will turn OFF the
output DO.0 and thus starter coil is de-energised and motor is turned OFF.

OLOGICAL INSTITUTE Page 41


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

OLOGICAL INSTITUTE Page 42


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

LADDER PROGRAM

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for DOL starting of a three phase motor and verified the
program using PLC trainer kit by running the motor.

OLOGICAL INSTITUTE Page 43


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 17
Date :

STAR DELTA STARTER

AIM: To prepare a ladder program for STAR DELTA starting of a three phase motor and
verify the program using PLC trainer kit.

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Three phase contactor, 415 V, 5HP ( Coil voltage 230 V ) ( 3 Nos.)
Three phase motor, 440 V, 5HP (1 No.)

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.0 START Push botton
DI.1 STOP Push botton
DI.2 OLR switch
DO.0 MAIN CONTACTOR COIL
DO.1 STAR CONTACTOR COIL
DO.2 DELTA CONTACTOR COIL

In STAR DELTA starter the three phase supply to the motor winding connections are
given first in STAR connection and then in DELTA connection.
RUNG 1 - The MAIN contactor is turned ON when the output DO.0 is turned ON by the
input START button (DI.0). The holding circuit in the program holds the main
contactor in ON position. STOP switch will turn off the MAIN contactor.
RUNG 2 - The STAR contactor is turned ON when the output DO.1 is turned ON after
the MAIN contactor NO switch closes. NC switches in name of the TIMER
and DELTA contactor is also in this rung to turn OFF the STAR Contactor.
RUNG 3 - An On time delay timer T1 is started when MAIN contactor NO switch closes.
After the set time 10sec is over, the local variable TIMER 1 turns ON and it
turns OFF the STAR contactor by opening its NC switch in Rung 2.
RUNG 4 - TIMER 1 turns ON another timer TIMER 2 to delay the turning ON of
DELTA contactor by 500ms.
RUNG 5 - The NO switch of Main contactor is already closed. When the set time of
TIMER 2 is over the NO switch of local variable TIMER 2 in Rung 5 closes to
turn ON the DELTA Contactor output DO.2. The NC switch of STAR
prevents DELTA and STAR contactors from being turned ON together.

OLOGICAL INSTITUTE Page 44


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

OLOGICAL INSTITUTE Page 45


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

LADDER PROGRAM

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for STAR DELTA starting of a three phase motor and verified
the program using PLC trainer kit by running the motor.

OLOGICAL INSTITUTE Page 46


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 18

Date :

FORWARD REVERSE MOTOR CONTROL

AIM: To prepare a ladder program for running a three phase motor in forward direction for 10
sec then stop for 10 sec and then in reverse direction for 10 sec and stop for another 10
sec alternately until stop push button is pressed and verify the program using PLC
trainer kit.

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Forward Reverse Motor control training board, 415 V, 5HP ( Coil voltage 230 V )
Three phase motor, 440 V, 5HP

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.0 START Push botton
DI.1 Manual STOP Push botton
DO.0 FORWARD Contactor Coil
DO.1 REVERSE Contactor Coil

For reversing a motor rotation direction we have to change the phase sequence of the
connection by interchanging any two phases. This alteration of connection is achieved by
using two contactors. In one contactor named FORWARD CONTACTOR the motor is
connected in RYB phase sequence and in another contactor named REVERSE
CONTACTOR the motor is connected in RBY sequence.
RUNG 1 - When START pushbutton DI.0 is pressed it switches ON the local output
MAIN which holds in ON state for the rest of the time. MAIN turns ON all
the connections in other rungs.
RUNG 2 - When MAIN turns ON it turns ON the FORWARD output switch DO.0 and
the FORWARD CONTACTOR turns ON running the motor in forward
direction.
RUNG 3 - When MAIN turns ON the FWD STOP local output is tuned ON after a 10 sec
delay due to TON Timer T1. When FWD STOP turns ON the FORWARD
output in Rung 2 is turned OFF due to the opening of NC switch in the name
of FWD STOP. Thus FORWARD CONTACTOR turns OFF and the motor
stops running.

OLOGICAL INSTITUTE Page 47


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

RUNG 4 - When MAIN turns ON it turns ON the REVERSE output switch DO.1 after a
20 sec delay due to TON Timer T2, and the REVERSE CONTACTOR turns
ON running the motor in reverse direction.
RUNG 5 - When MAIN turns ON the REV STOP local output is tuned ON after a 30 sec
delay due to TON Timer T3. When REV STOP turns ON the REVERSE
output in Rung 4 is turned OFF due to the opening of NC switch in the name
of REV STOP. Thus REVERSE CONTACTOR turns OFF and the motor
stops running.
RUNG 6 - When REV STOP is turned ON a local output RESTART is turned on after a
40 sec delay due to TON Timer T4. Thus the FWD STOP and REV STOP
outputs are turned OFF due to the NC contact in the name of RESTART in
Rung 3 and Rung 5. When FWD STOP is turned OFF the FORWARD
output in Rung 2 is turned ON again, thus repeating the cycle.

LADDER PROGRAM

OLOGICAL INSTITUTE Page 48


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

OLOGICAL INSTITUTE Page 49


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for running a three phase motor in forward direction for 10 sec
then stop for 10 sec and then in reverse direction for 10 sec and stop for another 10 sec
alternately until stop push button is pressed and verified the program using PLC trainer kit
by running the motor.

OLOGICAL INSTITUTE Page 50


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 19
Date :

LIFT CONTROL

AIM: To prepare a ladder program for controlling the miniature working model of a Lift and
verify the program using PLC trainer kit.

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Miniature working model of Lift

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.0 START PB
DI.1 STOP PB
DI.2 Ground floor PB
DI.3 First floor PB
DI.4 Second floor PB
DI.5 Ground floor sensor
DI.6 First floor sensor
DI.7 Second floor sensor
DO.0 Motor Down
DO.1 Motor Up

In Lift control model there are three levels, Ground floor, First floor and Second floor.
Each floor has their corresponding push buttons sensors. The push button when pressed
sends signal to the PLC for bringing the lift to the corresponding floor and the sensor
sends the signal to PLC giving information about where the lift is. Lift model has two
motor running controls, UP and DOWN. When the PLC sends signal to UP terminal the
motor runs in a direction to move the lift upwards and when the PLC sends signal to
DOWN terminal the motor runs in opposite direction to move the lift downwards.
RUNG 1 - The control module is started by START push button (DI.0). A latching branch
is provided to hold on the start condition and an NC contact for STOP push
button is also given. START LATCH NO contact is given in all other rungs to
control them.
RUNG 2 - When GROUND FLOOR PUSH BUTTON is pressed a local output
GROUND PB LATCH is turned ON to hold on the GROUND FLOOR PUSH
BUTTON. The latch is turned OFF when GROUND FLOOR SENSOR is
turned ON.

OLOGICAL INSTITUTE Page 51


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

RUNG 3 - When FIRST FLOOR PUSH BUTTON is pressed a local output FIRST PB
LATCH is turned ON to hold on the FIRST FLOOR PUSH BUTTON. The
latch is turned OFF when FIRST FLOOR SENSOR is turned ON.
RUNG 4 - When SECOND FLOOR PUSH BUTTON is pressed a local output SECOND
PB LATCH is turned ON to hold on the SECOND FLOOR PUSH BUTTON.
The latch is turned OFF when SECOND FLOOR SENSOR is turned ON.
RUNG 5 - When GROUND PB LATCH is turned ON it turns ON a local output TO
GROUND if either FIRST FLOOR SENSOR or SECOND FLOOR SENSOR
is ON. A branch for holding on the TO GROUND output is also given. This
rung is intended to turn ON the Down rotation of motor if lift is at first or
second floor and stop at ground floor.
RUNG 6 - When FIRST PB LATCH is turned ON it turns ON a local output DOWN TO
FIRST if SECOND FLOOR SENSOR is ON. A branch for holding on the
DOWN TO FIRST output is also given. This rung is intended to turn ON the
Down rotation of motor if lift is at second floor and stop at first floor.
RUNG 7 - An output is given for the Down rotation of the motor by activation of output
DO.0 MOTOR DOWN if either DOWN TO FIRST or TO GROUND outputs
are ON. This brings the lift to First floor if it is in Second floor or to Ground
floor if it is in First or second floor.
RUNG 8 - When SECOND PB LATCH is turned ON it turns ON a local output TO
SECOND if either GROUND FLOOR SENSOR or FIRST FLOOR SENSOR
is ON. A branch for holding on the TO SECOND output is also given. This
rung is intended to turn ON the Up rotation of motor if lift is at ground or first
floor and stop at second floor.
RUNG 9 - When FIRST PB LATCH is turned ON it turns ON a local output UP TO
FIRST if GROUND FLOOR SENSOR is ON. A branch for holding on the UP
TO FIRST output is also given. This rung is intended to turn ON the Up
rotation of motor if lift is at ground floor and stop at first floor.
RUNG 10 - An output is given for the Up rotation of the motor by activation of output
DO.1 MOTOR UP if either UP TO FIRST or TO SECOND outputs are ON.
This brings the lift to First floor if it is in Ground floor or to Second floor if it
is in First or Ground floor.

OLOGICAL INSTITUTE Page 52


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

OLOGICAL INSTITUTE Page 53


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

LADDER PROGRAM

OLOGICAL INSTITUTE Page 54


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for controlling the miniature working model of a Lift and
verified the program using PLC trainer kit.

OLOGICAL INSTITUTE Page 55


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Experiment No: 20
Date :

WATER LEVEL CONTROLLER

AIM: To prepare a ladder program for the operation of water level controller to automatically
fill the tank if it is empty and drain the water if the tank is full and verify the program
using PLC trainer kit.

EQUIPMENTS REQUIRED

PC with ladder programming software (Connected Components Workbench)


Micro 810 Allen Bradley PLC trainer kit.
Water level control trainer board.

THEORY

INPUTS/OUTPUT DENOTATIONS

Input/output Use
DI.0 HIGH LEVEL SENSOR
DI.1 LOW LEVEL SENSOR
DO.0 PUMP
DO.1 DRAIN VALVE

In the water level controller training board there is a water tank with two sensors, high
level and low level. It also have a mini pump working at 12 V DC and a solenoid drain
valve working at 230 V AC.

RUNG 1 The output DO.0 for the PUMP is turned ON if both LOW LEVEL SENSOR
and HIGH LEVEL SENSOR are OFF. Once the pump starts, the tank is filled
and the LOW LEVEL SENSOR will turn OFF while the tank is filling. Then a
parallel branch of NO contact will prevent the PUMP from turning OFF.
RUNG 2 Once the tank is filled both HIGH LEVEL SENSOR and LOW LEVEL
SENSOR are in ON condition. Then the output DO.1 for the DRAIN VALVE
turns ON and the water is drained from the tank. Then the HIGH LEVEL
SENSOR turns OFF, but the DRAIN VALVE will be still ON due to the
parallel branch of NO contact across HIGH LEVEL SENSOR.

OLOGICAL INSTITUTE Page 56


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

CONNECTION DIAGRAM

OLOGICAL INSTITUTE Page 57


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

LADDER PROGRAM

PROCEDURE

1. Switch on the PC.


2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.

RESULT

Prepared a ladder program for the operation of water level controller to automatically fill
the tank if it is empty and drain the water if the tank is full and verified the program using
PLC trainer kit.

OLOGICAL INSTITUTE Page 58


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

APPENDIX

OLOGICAL INSTITUTE Page 59


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

OPCODES OF 8051 MICROCONTROLLER


Hex Code Bytes Mnemonic Operands Hex Code Bytes Mnemonic Operands
0 1 NOP 34 2 ADDC A, #immed
1 2 AJMP addr11 35 2 ADDC A, direct
2 3 LJMP addr16 36 1 ADDC A, @R0
3 1 RR A 37 1 ADDC A, @R1
4 1 INC A 38 1 ADDC A, R0
5 2 INC direct 39 1 ADDC A, R1
6 1 INC @R0 3A 1 ADDC A, R2
7 1 INC @R1 3B 1 ADDC A, R3
8 1 INC R0 3C 1 ADDC A, R4
9 1 INC R1 3D 1 ADDC A, R5
0A 1 INC R2 3E 1 ADDC A, R6
0B 1 INC R3 3F 1 ADDC A, R7
0C 1 INC R4 40 2 JC offset
0D 1 INC R5 41 2 AJMP addr11
0E 1 INC R6 42 2 ORL direct, A
0F 1 INC R7 43 3 ORL direct, #immed
10 3 JBC bit, offset 44 2 ORL A, #immed
11 2 ACALL addr11 45 2 ORL A, direct
12 3 LCALL addr16 46 1 ORL A, @R0
13 1 RRC A 47 1 ORL A, @R1
14 1 DEC A 48 1 ORL A, R0
15 2 DEC direct 49 1 ORL A, R1
16 1 DEC @R0 4A 1 ORL A, R2
17 1 DEC @R1 4B 1 ORL A, R3
18 1 DEC R0 4C 1 ORL A, R4
19 1 DEC R1 4D 1 ORL A, R5
1A 1 DEC R2 4E 1 ORL A, R6
1B 1 DEC R3 4F 1 ORL A, R7
1C 1 DEC R4 50 2 JNC offset
1D 1 DEC R5 51 2 ACALL addr11
1E 1 DEC R6 52 2 ANL direct, A
1F 1 DEC R7 53 3 ANL direct, #immed
20 3 JB bit, offset 54 2 ANL A, #immed
21 2 AJMP addr11 55 2 ANL A, direct
22 1 RET 56 1 ANL A, @R0
23 1 RL A 57 1 ANL A, @R1
24 2 ADD A, #immed 58 1 ANL A, R0
25 2 ADD A, direct 59 1 ANL A, R1
26 1 ADD A, @R0 5A 1 ANL A, R2
27 1 ADD A, @R1 5B 1 ANL A, R3
28 1 ADD A, R0 5C 1 ANL A, R4
29 1 ADD A, R1 5D 1 ANL A, R5
2A 1 ADD A, R2 5E 1 ANL A, R6
2B 1 ADD A, R3 5F 1 ANL A, R7
2C 1 ADD A, R4 60 2 JZ offset
2D 1 ADD A, R5 61 2 AJMP addr11
2E 1 ADD A, R6 62 2 XRL direct, A
2F 1 ADD A, R7 63 3 XRL direct, #immed
30 3 JNB bit, offset 64 2 XRL A, #immed
31 2 ACALL addr11 65 2 XRL A, direct
32 1 RETI 66 1 XRL A, @R0
33 1 RLC A 67 1 XRL A, @R1

OLOGICAL INSTITUTE Page 60


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Hex Code Bytes Mnemonic Operands Hex Code Bytes Mnemonic Operands
68 1 XRL A, R0 9B 1 SUBB A, R3
69 1 XRL A, R1 9C 1 SUBB A, R4
6A 1 XRL A, R2 9D 1 SUBB A, R5
6B 1 XRL A, R3 9E 1 SUBB A, R6
6C 1 XRL A, R4 9F 1 SUBB A, R7
6D 1 XRL A, R5 A0 2 ORL C, /bit
6E 1 XRL A, R6 A1 2 AJMP addr11
6F 1 XRL A, R7 A2 2 MOV C, bit
70 2 JNZ offset A3 1 INC DPTR
71 2 ACALL addr11 A4 1 MUL AB
72 2 ORL C, bit A5 reserved
73 1 JMP @A+DPTR A6 2 MOV @R0, direct
74 2 MOV A, #immed A7 2 MOV @R1, direct
75 3 MOV direct, #immed A8 2 MOV R0, direct
76 2 MOV @R0, #immed A9 2 MOV R1, direct
77 2 MOV @R1, #immed AA 2 MOV R2, direct
78 2 MOV R0, #immed AB 2 MOV R3, direct
79 2 MOV R1, #immed AC 2 MOV R4, direct
7A 2 MOV R2, #immed AD 2 MOV R5, direct
7B 2 MOV R3, #immed AE 2 MOV R6, direct
7C 2 MOV R4, #immed AF 2 MOV R7, direct
7D 2 MOV R5, #immed B0 2 ANL C, /bit
7E 2 MOV R6, #immed B1 2 ACALL addr11
7F 2 MOV R7, #immed B2 2 CPL bit
80 2 SJMP offset B3 1 CPL C
81 2 AJMP addr11 B4 3 CJNE A, #immed, offset
82 2 ANL C, bit B5 3 CJNE A, direct, offset
@R0, #immed,
83 1 MOVC A, @A+PC B6 3 CJNE
offset
@R1, #immed,
84 1 DIV AB B7 3 CJNE
offset
85 3 MOV direct, direct B8 3 CJNE R0, #immed, offset
86 2 MOV direct, @R0 B9 3 CJNE R1, #immed, offset
87 2 MOV direct, @R1 BA 3 CJNE R2, #immed, offset
88 2 MOV direct, R0 BB 3 CJNE R3, #immed, offset
89 2 MOV direct, R1 BC 3 CJNE R4, #immed, offset
8A 2 MOV direct, R2 BD 3 CJNE R5, #immed, offset
8B 2 MOV direct, R3 BE 3 CJNE R6, #immed, offset
8C 2 MOV direct, R4 BF 3 CJNE R7, #immed, offset
8D 2 MOV direct, R5 C0 2 PUSH direct
8E 2 MOV direct, R6 C1 2 AJMP addr11
8F 2 MOV direct, R7 C2 2 CLR bit
90 3 MOV DPTR, #immed C3 1 CLR C
91 2 ACALL addr11 C4 1 SWAP A
92 2 MOV bit, C C5 2 XCH A, direct
93 1 MOVC A, @A+DPTR C6 1 XCH A, @R0
94 2 SUBB A, #immed C7 1 XCH A, @R1
95 2 SUBB A, direct C8 1 XCH A, R0
96 1 SUBB A, @R0 C9 1 XCH A, R1
97 1 SUBB A, @R1 CA 1 XCH A, R2
98 1 SUBB A, R0 CB 1 XCH A, R3
99 1 SUBB A, R1 CC 1 XCH A, R4
9A 1 SUBB A, R2 CD 1 XCH A, R5

OLOGICAL INSTITUTE Page 61


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

Hex Code Bytes Mnemonic Operands Hex Code Bytes Mnemonic Operands
CE 1 XCH A, R6 E7 1 MOV A, @R1
CF 1 XCH A, R7 E8 1 MOV A, R0
D0 2 POP direct E9 1 MOV A, R1
D1 2 ACALL addr11 EA 1 MOV A, R2
D2 2 SETB bit EB 1 MOV A, R3
D3 1 SETB C EC 1 MOV A, R4
D4 1 DA A ED 1 MOV A, R5
D5 3 DJNZ direct, offset EE 1 MOV A, R6
D6 1 XCHD A, @R0 EF 1 MOV A, R7
D7 1 XCHD A, @R1 F0 1 MOVX @DPTR, A
D8 2 DJNZ R0, offset F1 2 ACALL addr11
D9 2 DJNZ R1, offset F2 1 MOVX @R0, A
DA 2 DJNZ R2, offset F3 1 MOVX @R1, A
DB 2 DJNZ R3, offset F4 1 CPL A
DC 2 DJNZ R4, offset F5 2 MOV direct, A
DD 2 DJNZ R5, offset F6 1 MOV @R0, A
DE 2 DJNZ R6, offset F7 1 MOV @R1, A
DF 2 DJNZ R7, offset F8 1 MOV R0, A
E0 1 MOVX A, @DPTR F9 1 MOV R1, A
E1 2 AJMP addr11 FA 1 MOV R2, A
E2 1 MOVX A, @R0 FB 1 MOV R3, A
E3 1 MOVX A, @R1 FC 1 MOV R4, A
E4 1 CLR A FD 1 MOV R5, A
E5 2 MOV A, direct FE 1 MOV R6, A
E6 1 MOV A, @R0 FF 1 MOV R7, A

OLOGICAL INSTITUTE Page 62


INDUSTRIAL AUTOMATION LAB DEPT OF ELECTRICAL ENGG

STEPS FOR PROGRAMMING IN THE CONNECTED COMPONENTS


WORKBENCH SOFTWARE
1. Open Connected components Workbench from start menu or desktop icon.
(The Project window will open up)
2. Click New (A box will open up asking the project name and destination folder)
3. Type in the project name and select a destination folder and click Create.
4. Now a window will open up to select the microcontroller in the PLC Training kit.
5. Select M
6.
New LD : Ladder diagram.
7. Now double click on Prog1 tab to open the Ladder diagram window.
8. Open the Tool box window by clicking on the Tool box tab on the right side of
window.
9. In tool box we will get all the instructions to be added in the ladder diagram.
10. Drag and drop the required instructions to prepare the ladder diagram.
11. Double click the instructions to assign I/O Micro 810 variables and give alias names.
This will connect the instruction of ladder diagram to the Inputs and Output ports of
PLC.
12. After completing the ladder diagram connect the PLC kit to the Computer using the
given USB cable.
13. Click Build and see the output tab if there is any error.
14. After successfully building the program click on Disconnected.
15. A window will open up to select the device to which the software is to be connected.
16. Select
17. A box will open up asking to download the project into the hardware.
18. Click on Download.
19. Wait until downloading process is completed and a box opens up asking to change the
controller to remote run mode. Click Yes.
20. Now we can operate the PLC training kit.

CONFIGURATION OF THE DEVICE CONNECTED TO


CONNECTED COMPONENTS WORKBENCH
1. Go to the Device manager of the computer and note down the COM PORT number
to which the Silicon lab USB to UART bridge driver of the PLC is connected.
2. Now open the Connected Components Workbench software and open the project to
be downloaded.
3. C
4. Then a window opens up to select the device.
5. Select RS 232 DF1 device and Add
6. Click on the AB DF1, DF1 device in the list below and click configure.
7. A new window opens up.
8. Change the COM PORT number to the number noted in step 1.
9. Click Auto configure. Configuration will be completed successfully

OLOGICAL INSTITUTE Page 63

You might also like