0% found this document useful (0 votes)
29 views64 pages

Mechatronics Automation CH 5

The document discusses programmable logic controllers (PLCs) and PLC programming. It covers topics like relay logic ladder diagrams, basic PLC instructions including load, output and logic functions, typical PLC input/output addressing, and how ladder programming in PLCs is analogous to electric circuits with relays. The chapter outlines how PLCs are used for sequential control systems and sensor technology for sequence control applications. It also provides examples of ladder logic programs.

Uploaded by

Zeyad Ayman
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)
29 views64 pages

Mechatronics Automation CH 5

The document discusses programmable logic controllers (PLCs) and PLC programming. It covers topics like relay logic ladder diagrams, basic PLC instructions including load, output and logic functions, typical PLC input/output addressing, and how ladder programming in PLCs is analogous to electric circuits with relays. The chapter outlines how PLCs are used for sequential control systems and sensor technology for sequence control applications. It also provides examples of ladder logic programs.

Uploaded by

Zeyad Ayman
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/ 64

Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 1


Chapter (5) PLC Programming

 Course Syllabus
 Pneumatics actuators, gripper technology, control valves and pneumatic circuit
representation.
 Sequential Control Systems.
o Programmable Logic Controllers (PLC). Sequential control system representation,
logic analysis and PLC programming. Relay logic ladder diagram, Timers,
Counters, shift registers.
 Sensor technology for sequence control, optical, capacitive, inductive and
magnetic.
o Computer simulation of a programmable pneumatic positioning system.

 Chapter Outlines
Programmable Logic Controllers (PLC). Sequential control system representation,
logic analysis and PLC programming. Relay logic ladder diagram, Timers, Counters,
shift registers.

Mechatronic Automation Dr. Aly Gaballa 2


Chapter (5) PLC Programming Relay logic ladder diagram

 Relay ladder logic, the standard


programming language, is based on electromagnetic relay control.
 A relay: showing normally closed (NC) and normally open (NO) contacts.

Mechatronic Automation Dr. Aly Gaballa 3


Chapter (5) PLC Programming Relay logic ladder diagram

 Logic functions from relays.

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

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

Mechatronic Automation Dr. Aly Gaballa 4


Chapter (5) PLC Programming Relay logic ladder diagram

 A relay logic ladder diagram

Mechatronic Automation Dr. Aly Gaballa 5


Chapter (5) PLC Programming Relay logic ladder diagram

Example
In a certain bank, each of three bank officers has a unique key to the vault. The bank rules
require that two out of the three officers be present when the vault is opened. Draw the
ladder diagram for a relay logic circuit that will unlatch the door and turn on the light when
two of the three keys are inserted.

Mechatronic Automation Dr. Aly Gaballa 6


Chapter (5) PLC Programming

 The three most common types of languages encountered in programmable controller


systems are as follows

1. Ladder diagram (LAD)


2. Statement list (STL)
3. Function block diagram (FBD)
 The ladder diagram (LAD) is the most common programmable controller
language
 Basic ladder diagram instructions

Mechatronic Automation Dr. Aly Gaballa 7


Chapter (5) PLC Programming

 The three most common types of languages encountered in programmable controller


systems are as follows

Mechatronic Automation Dr. Aly Gaballa 8


Chapter (5) PLC Programming

 Symbols
o Contacts
 Normally Open Contacts (NO)

 Normally Closed Contacts (NC)

o Coils

Mechatronic Automation Dr. Aly Gaballa 9


Chapter (5) PLC Programming

 Symbols

o Boxes
 Timers
 Counters
 Math Operations

Mechatronic Automation Dr. Aly Gaballa 10


Chapter (5) PLC Programming

 Symbols

Mechatronic Automation Dr. Aly Gaballa 11


Chapter (5) PLC Programming

 Symbols

Mechatronic Automation Dr. Aly Gaballa 12


Chapter (5) PLC Programming

 The ladder diagram consists of two vertical lines representing the power rails.
 Circuits (rung) are connected as horizontal lines

Mechatronic Automation Dr. Aly Gaballa 13


Chapter (5) PLC Programming

 Ladder diagram language is the most commonly used PLC language and is designed
to mimic hardwired relay logic.

Hardwired relay control


circuit

Equivalent ladder diagram


program

Mechatronic Automation Dr. Aly Gaballa 14


Chapter (5) PLC Programming

 Typical Input / Output addresses

Mechatronic Automation Dr. Aly Gaballa 15


Chapter (5) PLC Programming

 Typical Input / Output addresses


Siemens Allen Bradley
XXX.X
X:XXX/XX

I= input Bite I=input Module


Q=output number O=output number

Rack Terminal
Byte number number
number
Example I:012/03

Example:
Example: The Allen-Bradley PLC-5
I0.1 is an input at bit 1 in byte 0
has I: 012/03 to indicate an
Q2.0 is an output at bit 0 in byte 2
input in rack 01 at module 2
and terminal 03
Mechatronic Automation Dr. Aly Gaballa 16
Chapter (5) PLC Programming

 Basic Instructions
LOAD (LD)
LD → normally open contact

Mechatronic Automation Dr. Aly Gaballa 17


Chapter (5) PLC Programming

 Basic Instructions
LDI LOAD Inverse
LDI → Normally Closed Contact

Mechatronic Automation Dr. Aly Gaballa 18


Chapter (5) PLC Programming

 Basic Instructions
o OUT Relay

I Input
Q Output
M Memory
T Timer
C counter
Mechatronic Automation Dr. Aly Gaballa 19
Chapter (5) PLC Programming

 Relay-Type Instructions
Normally Open Instruction

Logic flow for normally open contact instruction

Mechatronic Automation Dr. Aly Gaballa 20


Chapter (5) PLC Programming

 Relay-Type Instructions
Normally Closed Instruction

Logic flow for normally closed instruction

Mechatronic Automation Dr. Aly Gaballa 21


Chapter (5) PLC Programming

 Output Coil Instruction

the output instruction O:0/01 is energized or TRUE if either input A or input B is TRUE
or if both inputs are TRUE.

Mechatronic Automation Dr. Aly Gaballa 22


Chapter (5) PLC Programming

 Ladder programming
The form of programming commonly use with PLC is ladder programming. Each
program task is specified as though a rung of a ladder. Thus a rung could specify
that the state of switches A and B be examined and if both A and B are closed then a
solenoid, the output is energized.

(a), (b) Alternative ways of drawing an electric circuit,


(c) comparable rung in a ladder program.

Mechatronic Automation Dr. Aly Gaballa 23


Chapter (5) PLC Programming

 Ladder program
Figure below shows a basic standard symbols that are used and rung, Inputs must
always precede outputs and there must be at least one output on each line Each
rung must start with an input or series of inputs and end with an output

Mechatronic Automation Dr. Aly Gaballa 24


Chapter (5) PLC Programming

 Switch controlling a solenoid.

The output from the PLC is to energize a solenoid when a normally open start
switch connected to the input is activated by being closed

Mechatronic Automation Dr. Aly Gaballa 25


Chapter (5) PLC Programming

 Logic functions
o The logic Functions can be obtained by combinations of switches
o AND

A B O/P
0 0 0
0 1 0
1 0 0
1 1 1
o OR

A B O/P
0 0 0
0 1 1
1 0 1
1 1 1
Mechatronic Automation Dr. Aly Gaballa 26
Chapter (5) PLC Programming

 Logic functions
o The logic Functions can be obtained by combinations of switches
o NOR

A B O/P
0 0 1
0 1 0
1 0 0
1 1 0
o NAND

A B O/P
0 0 1
0 1 1
1 0 1
1 1 0
Mechatronic Automation Dr. Aly Gaballa 27
Chapter (5) PLC Programming

 Logic functions

o XOR

A B O/P
0 0 0
0 1 1
1 0 1
1 1 0

Mechatronic Automation Dr. Aly Gaballa 28


Chapter (5) PLC Programming

 Switches controlling a solenoid.


o The basic logic functions can be used to obtained more complicated combinations of
switches.
o Consider a situation where a normally open switch A must be activated and either of two
other, normally open switches B and C must be activated for a coil to be energized.

A B C O
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Mechatronic Automation Dr. Aly Gaballa 29


Chapter (5) PLC Programming

 Switches controlling a solenoid.

Shop door system

Mechatronic Automation Dr. Aly Gaballa 30


Chapter (5) PLC Programming

 Instruction lists
o Each horizontal rung on the ladder represents a line in the program and the entire
ladder gives the complete program in the ladder language.
o Using a graphic interface, a programmer can build his program, then translate these
symbols into machine language that can be stored in the PLC memory.
o Alternatively, the ladder program can be translated into an instruction list and entered
into the programming panel or computer.
o Instruction lists consist of a series of instruction with each instruction being on a
separate line.
o An instruction consists of an operator followed by one or more operand

LD A (*load input A*)

Mechatronic Automation Dr. Aly Gaballa 31


Chapter (5) PLC Programming

 Instruction lists

Mechatronic Automation Dr. Aly Gaballa 32


Chapter (5) PLC Programming

 Instruction lists and logic functions

Mechatronic Automation Dr. Aly Gaballa 33


Chapter (5) PLC Programming

 Instruction lists and branching

Mechatronic Automation Dr. Aly Gaballa 34


Chapter (5) PLC Programming

 Example: PLC Control of AC Motor

PLC Control: ( Phase Motor in OFF position)


Mechatronic Automation Dr. Aly Gaballa 35
Chapter (5) PLC Programming

 Example: PLC Control of AC Motor

PLC Control: (Phase Motor in START position)

PLC Control: (Phase Motor in RUNNING position)


Mechatronic Automation Dr. Aly Gaballa 36
Chapter (5) PLC Programming

 Example: PLC Control of AC Motor


Stop pushbutton

PLC Control: (Phase Motor in switch OFF position)

Mechatronic Automation Dr. Aly Gaballa 37


Chapter (5) PLC Programming

 Example: PLC Control of AC Motor

Stop pushbutton

Mechatronic Automation Dr. Aly Gaballa 38


Chapter (5) PLC Programming

 Example: PLC Control of AC Motor

Start pushbutton

Mechatronic Automation Dr. Aly Gaballa 39


Chapter (5) PLC Programming

 Data in memory, showing the relationship between memory position and the I/O
terminals.

Mechatronic Automation Dr. Aly Gaballa 40


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 41


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 42


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 43


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 44


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 45


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 46


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 47


Chapter (5) PLC Programming

Mechatronic Automation Dr. Aly Gaballa 48


Chapter (5) PLC Programming

 Boolean Logic Design

Mechatronic Automation Dr. Aly Gaballa 49


Chapter (5) PLC Programming

 Boolean Logic Design

Mechatronic Automation Dr. Aly Gaballa 50


Chapter (5) PLC Programming

 Boolean Logic Design

Mechatronic Automation Dr. Aly Gaballa 51


Chapter (5) PLC Programming

 Boolean Logic Design

Mechatronic Automation Dr. Aly Gaballa 52


Chapter (5) PLC Programming

 Boolean Logic Design

Mechatronic Automation Dr. Aly Gaballa 53


Chapter (5) PLC Programming

 Logic Design

o Process Description:

A heating oven with two bays can heat one ingot in each bay. When the heater is on it
provides enough heat for two ingots. But, if only one ingot is present the oven may
become too hot, so a fan is used to cool the oven when it passes a set temperature.

o Control Description:

If the temperature is too high and there is an ingot in only one bay then turn on fan.

o Define Inputs and Outputs:

Mechatronic Automation Dr. Aly Gaballa 54


Chapter (5) PLC Programming

 Logic Design

Mechatronic Automation Dr. Aly Gaballa 55


Chapter (5) PLC Programming

 Digital circuits Design.

Mechatronic Automation Dr. Aly Gaballa 56


Chapter (5) PLC Programming

 Digital circuits Design.

Mechatronic Automation Dr. Aly Gaballa 57


Chapter (5) PLC Programming

 The Simplified Form of the Example

Mechatronic Automation Dr. Aly Gaballa 58


Chapter (5) PLC Programming

 Complex Gate Forms

 Multiplexers

Mechatronic Automation Dr. Aly Gaballa 59


Chapter (5) PLC Programming

 Design Cases
o Problem: Develop a program that will cause output D to go true when switch A and
switch B are closed or when switch C is closed.

o Problem: Develop a program that will cause output D to be on when push button A is
on, or either B or C are on.

Mechatronic Automation Dr. Aly Gaballa 60


Chapter (5) PLC Programming

 Car Safety System


o Problem: Develop Ladder Logic for a car door/seat belt safety system. When the car
door is open, and the seatbelt is not done up, the ignition power must not be applied. If
all is safe then the key will start the engine.

 Motor Forward/Reverse
o Problem: Design a motor controller that has a forward and a reverse button. The motor
forward and reverse outputs will only be on when one of the buttons is pushed.

Mechatronic Automation Dr. Aly Gaballa 61


Chapter (5) PLC Programming

 A Burglar Alarm
o Consider the design of a burglar alarm for a house. When activated an alarm and lights
will be activated to encourage the unwanted guest to leave. This alarm be activated if an
unauthorized intruder is detected by window sensor and a motion detector. The window
sensor is effectively a loop of wire that is a piece of thin metal foil that encircles the
window. If the window is broken, the foil breaks breaking the conductor. This behaves
like a normally closed switch. The motion sensor is designed so that when a person is
detected the output will go on. As with any alarm an activate/deactivate switch is also
needed. The basic operation of the alarm system, and the inputs and outputs of the
controller are itemized

Mechatronic Automation Dr. Aly Gaballa 62


Chapter (5) PLC Programming

 A Burglar Alarm

Mechatronic Automation Dr. Aly Gaballa 63


Chapter (5) PLC Programming

 A Burglar Alarm

Mechatronic Automation Dr. Aly Gaballa 64

You might also like