lect_11_21_plc
TRANSCRIPT
-
7/29/2019 Lect_11_21_PLC
1/58
-
7/29/2019 Lect_11_21_PLC
2/58
By
Nazeer Ahmad Anjum
300-5397864
Spring 2007
(Mechatronics)
Department of Mechanical Engineering.
UET Taxila
PLC (Lecture # 21)
mailto:[email protected]:[email protected] -
7/29/2019 Lect_11_21_PLC
3/58
PLCLecture No 21
Week 11th
29-05-2007
-
7/29/2019 Lect_11_21_PLC
4/58
PROGRAMMABLE LOGIC CONTROLLER
A digital Electronic Device
Uses a programmable memory to store instructions & toimplement functions as
Logic
Sequencing
Timing Counting &
Arithmetic
In order to control machines & Process
I/P devices as switches & o/p devices as motors areconnected to PLC.
controller monitors the i/ps & o/ps according to the programstored in the PLC
-
7/29/2019 Lect_11_21_PLC
5/58
Programmable Logic Controller
1. A control device that uses a programmable
microprocessor and is typically programmed.
2. PLCs are often categorized by the number of I/O
ports they provide.3. PLCs are often RISC based and are designed for
real-time and rugged industrial environments
-
7/29/2019 Lect_11_21_PLC
6/58
Controller
PLCs have been gaining popularity on the factory floor and will
probably remain predominant for some time to come. Most of this isbecause of the advantages they offer.
Cost effective for controlling complex systems. Flexible and can be reapplied to control other systems
quickly and easily.
Computational abilities allow more sophisticated control.
Trouble shooting aids make programming easier and reducedowntime.
Reliable components make these likely to operate for years
before failure. Easy to modify a control system without rewiring the
connections to i/p & o/p devices.
Much faster than relay-operated systems.
-
7/29/2019 Lect_11_21_PLC
7/58
Uses Programmable Logic Controller
Widely used for the implementation of logic control functions.
Easy to use
Reliability of PLC is greater
Maintenance is easier
PLCs take less floor space than do relay control panels.
Can perform a greater variety of control functions than relaycontrol
Virtual real-time control becomes feasible
Used for implementing automatic control of manufacturing
systems Logical information is rapidly and repeatedly processed and
immediately responded to with appropriate actions
A series of logical decisions have to be made and a variety of
actions taken on the basis of input that is obtained from appropriate
sensors
-
7/29/2019 Lect_11_21_PLC
8/58
Features of PLC
1. They are rugged and designed to withstand vibrations,Temperature, Humidityand Noise.2. The interfacing for i/p and o/p is inside the controller.3. They are easily programmed.
-
7/29/2019 Lect_11_21_PLC
9/58
Programmable Logic Control (PLC)
Definition - Dedicated computer for rapidprocessing of simple logic instructions in a
defined time.
Purpose - Send and read signals that canbe used to control and monitor devices.
Process- One of scanning all the devices(sensors, timers, etc.) in a cyclical time
period.
-
7/29/2019 Lect_11_21_PLC
10/58
PLC Control Approaches
Logic Control Method -Thisclosed-loop method usesconditions and events to signal completion of a given step, andthen triggers the execution of some other event. This is anasynchronous method of process control, because it does notalways proceed in a constant time period.
Sequencing Method -This open-loop method uses timers totrigger the completion of one step and the beginning of the next.This is a synchronous control method.
-
7/29/2019 Lect_11_21_PLC
11/58
Discrete Process Control
Discrete process control systems deals with parameters and variables
that change at discrete moments in time.Parameters and variables are also discrete in binary form.They can have either of two possible values, 1 or 0, values mean on/off,True/False, Object present or not present, high voltage value or lowvoltage value.
The binary variables in DPC are associated with i/p signals to thecontroller & o/p signals from the controller.
I/p signals are generated by binary sensors, such as limits switches,Timer, Relay or photo-detector sensors that are interfaced to the process.
O/p signals are generated by the controller to operate the process inresponse to the i/p signals & as a function of time.These o/p signals turn on or off switches, motors, valves, solenoid andother binary actuator related to the process.
-
7/29/2019 Lect_11_21_PLC
12/58
Discrete Process Control
1. Executed by the controller in
response to some event.
2. The change can be to initiate an
operation or terminate an
operation, start a motor or stop,
open a valve or close
3. Has no memory.
4. Does not consider any previous
values of i/p
1. Executed by the control
system either at a specific
point in time or after a certaintime lapse has occurred
2. Uses internal timing devicesto determine when to initiatechanges in o/p variables.
3. Memory element is present.
4. Consider any previous values
of i/p
Logic Control or
Event Driven Changes
Sequencing or
Time Driven Changes
-
7/29/2019 Lect_11_21_PLC
13/58
Discrete Process Control
1. A robot loads a work part into
the fixture, the part is sensed bythe limit switch. Sensing theparts presence is the event thatalter the system state.
2. Counting parts moving along a
conveyor past an optical sensoris an event driven system.
1. Starting times & ending times
for the shift & uniform breakperiods for all the workers.
2. Heat treating operationscarried out for certain lengthof time.
Logic Control
Examples
Sequencing
Examples
A robot is programmed to pickup a raw work part from a known stopping point
along a conveyor & place it into a forging press. In this three conditions must be
satisfied
-
7/29/2019 Lect_11_21_PLC
14/58
1. The raw work part must be at the stopping point
2. The forge press must have completed the process on the
previous part3. The previous part must be removed from the die
The first condition can be indicated by means of a simple limit
switch that sense the presence of the part at the conveyor,
stop & transmits an On signal to the robot controller. The 2nd condition can be indicated by the forge press, which
sends an On signal after it has completed the previous cycle.
The 3rd condition might be determined by the photo-detector
located so as to sense the presence or absence of the part inthe forging die.
When the finished part is removed from the die, an ON signal is
transmitted by the photocell. All three of these ON signals
must be received by the ROBOT controller to initiate the next
work cycle.
Three conditions and Solution
-
7/29/2019 Lect_11_21_PLC
15/58
Uses of Discrete Process Control
1. Widely used in discrete manufacturing as well as process
industries.2. In discrete manufacturing it is used to control the operation
of:
a. Conveyors
b. Automated Storage Systemsc. Automated Transfer Lines
d. Automated Assembly Systems
3. In process industries, discrete control is associated more
with :a. Batch processing than with continuous processes
b. Possible flow from one container to another during the
cycle.
c. Finally packaging
-
7/29/2019 Lect_11_21_PLC
16/58
PLC
CPU
System
User LadderDiagram
Workingmemoryregisters
Input
Flag
Output
InputModule
OutputModule
-
7/29/2019 Lect_11_21_PLC
17/58
-
7/29/2019 Lect_11_21_PLC
18/58
PLCLecture No 25
Week 13th
16-06-2007
-
7/29/2019 Lect_11_21_PLC
19/58
Boolean Logic Operators
INPUT
Normally Open
OUTPUT
AND
OR
COMBINED AND & OR
INPUT
Normally Closed
TMR
CTR
Timer
Counter
-
7/29/2019 Lect_11_21_PLC
20/58
Logic Control ElementsPLC's are typically programmed using Boolean logic, shown in
figures by logical AND, OR, and NOT gates.
-
7/29/2019 Lect_11_21_PLC
21/58
AND, OR , & NOT GATEAND, OR, and NOT gates are then used to define two more
logical elements - the NAND and NOR gates - also shown with
their truth tables.
-
7/29/2019 Lect_11_21_PLC
22/58
RELAYS
contact
coil
input
Relay coil
R1
R1Output contact
A switch whose operation isactivated by an electromagnet iscalled a "relay"
-
7/29/2019 Lect_11_21_PLC
23/58
AN EXAMPLE OF RELAY LOGIC
For a process control, it is desired to have the process start (by turning ona motor) five seconds after a part touched a limit switch. The process isterminated automatically when the finished part touches a second limitswitch. An emergency switch will stop the process any time when it is
pushed.
L1
LS1PB1 LS2 R1
R1
R1TIMER
R2
PR=5
LS1
PB1
LS2
R1
TIMER
5MotorR2
-
7/29/2019 Lect_11_21_PLC
24/58
Example of a relay in a simple control
In this system the first relay on the left is used as
normally closed, and will allow current to flow untila voltage is applied to the input A. The second relayis normally open and will not allow current to flowuntil a voltage is applied to the input B. If current is
flowing through the first two relays then currentwill flow through the coil in the third relay, andclose the switch for output C. This circuit wouldnormally be drawn in the ladder logic form. This
can be read logically as C will be on ifA is off andB is on.
-
7/29/2019 Lect_11_21_PLC
25/58
A Simple Relay Controller
-
7/29/2019 Lect_11_21_PLC
26/58
Try to develop a relay based controller that
will allow three switches in a room to controla single light.
Problem:
-
7/29/2019 Lect_11_21_PLC
27/58
Solution: There are two possible approaches to thisproblem. The first assumes that any one of the switches onwill turn on the light, but all three switches must be off for
the light to be off.
The second solution assumes that each switch can turn
-
7/29/2019 Lect_11_21_PLC
28/58
The second solution assumes that each switch can turnthe light on or off, regardless of the states of the otherswitches. This method is more complex and involvesthinking through all of the possible combinations of
switch positions. You might recognize this problem asan exclusive or problem.
-
7/29/2019 Lect_11_21_PLC
29/58
COUNTER
Digital counters,
output in the form of arelay contact when apre-assigned count
value is reached.
Register
Accumulator
contact
input
reset
outpu
Input
Reset
Output
Count 0 1 2 3 4 5 0 1
-
7/29/2019 Lect_11_21_PLC
30/58
TIMERClock
Accumulator
contact
reset
outpu
Register
Contact
Time 5 seconds.
Clock
Reset
Output
Count 1 2 3 40 5
-
7/29/2019 Lect_11_21_PLC
31/58
Counters and Timers
Counters can be used in manufacturing to
measure quantities such as production stock,inventory, and packaging
Timers are used specifically to count clock
pulses Timers and counters greatly expand the
versatility of a PLC and allow the handling of
some variable-type questions Virtually all PLCs on the market today include
countering and timing capability
-
7/29/2019 Lect_11_21_PLC
32/58
PLC ARCHITECTURE
Programmable controllers replace most of the
relay panel wiring by software programming.
ProcessorI/OModules
M emoryPowerSupply
ProgramLoader
Printer
CassetteLoader
EPROMLoader
Switches
Machines
Peripherals External Device
PC
A typical PLC
-
7/29/2019 Lect_11_21_PLC
33/58
PLC COMPONENTS
1. Processor Microprocessor based, may allow arithmeticoperations, logic operators, computer interface, local areanetwork, functions, etc.
2. Memory Measured in words.
ROM (Read Only Memory),
RAM (Random Access Memory),
PROM (Programmable Read Only Memory),
EEPROM (Electric Erasable Programmable ROM),
EPROM (Erasable Programmable Read Only Memory),
EAPROM (Electronically Alterable ProgrammableRead Only Memory.
PLC COMPONENTS
-
7/29/2019 Lect_11_21_PLC
34/58
PLC COMPONENTS
3.I/O Modular plug-in periphery
AC voltage input and output,DC voltage input and output,
Low level analog input,
High level analog input and output,
Special purpose modules, e.g., high speed timers,
Stepping motor controllers, etc.
4. Power supply AC power
5. Peripheral hand-held programmer (HHP)
CRT programmeroperator consoleprintersimulatorEPROM loadergraphics processor
network communication interface
PLC SELECTION CRITERIA
-
7/29/2019 Lect_11_21_PLC
35/58
PLC SELECTION CRITERIA
1. What I/O is required, i. e. the number of I/O, capability ofexpansion for future needs.
2. What types of I/O are required, i. e. signal conditioning, on-board power supply for inputs, outputs, etc.
3. What size of memory is required? This is linked to thenumber of I/O & a complexity of program used.
4. What speed & power is required of CPU.
-
7/29/2019 Lect_11_21_PLC
36/58
Logical Control
Control actions are taken by making decisions
depending on the values associated with variousinputs or variables and the control logic in the
program
If a decision can be made by answering yesornoto
a given question, it is referred to as a decision byattributes Is a part loaded in the machine?
Is the tool path unobstructed?
Is the AGV carrying a part?
Decisions that cannot be made by answering yesor
noare referred to as decisions by variables How long is the bar stock?
What is the feed rate?
What is the art tem erature?
-
7/29/2019 Lect_11_21_PLC
37/58
Ladder Logic Diagram
Well established in industry in relation to the traditional
electromechanical logic devices. Makes use of representations similar to electrical circuits in
which a ser ies connect ionrepresents a logical and and
a parallel connect ionrepresents a logical or.
Made up of inputs, outputs connected according toappropriate logic.
Each rung in the ladder represents a set of logical
relationships between the inputs that leads to a particular
output. The output from one rung of the ladder could be used as an
input in another rung of the same ladder.
-
7/29/2019 Lect_11_21_PLC
38/58
Ladder Logic Diagram
Except when special provisions are made, itis considered that all rungs in a given ladder
logic diagram are executed simultaneously,
so the order of the rungs on the ladder in
general does not matter.
-
7/29/2019 Lect_11_21_PLC
39/58
LADDER DIAGRAM
A ladder diagram is a means of graphicallyrepresenting the logic required in a relay logic system.
A
R1
PB1 PB2
R1
R1
start emergency stop
Rail
Rung
-
7/29/2019 Lect_11_21_PLC
40/58
PLC WIRING DIAGRAM
Externalswitches
Stored program
01 02 20
20
20 11
01
02
03
11
12
C
PLCInput OutputA
B
CO O C S
-
7/29/2019 Lect_11_21_PLC
41/58
CONTROL DEVICES
1) Mechanical Con trol - cam, governor,
etc.,
2) Pneumatic Con trol - compressed air,valves, etc.
3) Electromechan ical Con trol - switches,relays, timers, counters, etc,
4) Electronics Control - similar toelectromechanical control, except useselectronic switches.
5) Compu ter Contro l
PLC E l ti
-
7/29/2019 Lect_11_21_PLC
42/58
PLC Evolution
Programmable Logic Controllers
A
B
P2
P1
I1
Analog WorldBinary World
C
continuous processes
Regulation, controllers
discrete processes
combinatorial sequential
Pneumatic and electromechanicalcontrollersRelay controlpneumatic sequencer
Continuous and Discrete Control (comparison)
-
7/29/2019 Lect_11_21_PLC
43/58
Continuous and Discrete Control (comparison)
A B
Out = A B
B
NOT CA
Out = (A + B) C
"sequential""combinatorial"
ladderlogic
e.g. ladder logic
P2
P1
I1
analog
building
blocks
Ladder Logic
-
7/29/2019 Lect_11_21_PLC
44/58
Ladder Logic
01 02
50
0102
03 50
03
relay coil
break contact
make contact
correspondingladder diagram
origin:
electrical
circuit
50 05
44
rung
"coil" 50 is used to move
other contact(s)
L dd L i
-
7/29/2019 Lect_11_21_PLC
45/58
Ladder Logic
Binary combinations are expressed by series and parallel relay contact:
+ 01 02
50
Coil 50 is active (current flows) when 01 is active and 02 is not.
01
0250
Series
+ 01
40
02
Coil 40 is active (current flows) when 01 is active or 02 is not.
Parallel
ladder logic representation "CMOS" equivalent
01
02 40
-
7/29/2019 Lect_11_21_PLC
46/58
PLCLecture No 26
Week 14th
19-06-2007 Ladder logic example
-
7/29/2019 Lect_11_21_PLC
47/58
Ladder logic example
Process will mix ingredients, first adding ingredient A until
level reaches sensor 2, then adding ingredient B until levelreaches sensor 1. The mix is then stirred for a period of time,
and tank is emptied. Investigate the control logic required.
Ladder logic example
-
7/29/2019 Lect_11_21_PLC
48/58
Ladder logic example
How would you w r ite the ladder log ic for th is problem?
IF sensor 2 is not tripped
THEN energize solenoid 1(Ingr A)
IF sensor 2 is tripped AND
sensor 1 is not tripped THEN
energize solenoid 2 (ingr B)
IF sensor 1 is tripped THENenable timer (10 Sec)
IF sensor 1 is tripped AND
the timer is not done timing
THEN energize motor
IF the timer is done timingTHEN energize solenoid 3
(drain)
Solution X1, X2 = sensors
-
7/29/2019 Lect_11_21_PLC
49/58
Solution
TMR
T1
S3
S1
TMR
T2
S3
T1
X2 S3
S2
X1 X2
M
M
X1
S1, S2, S3 = solenoids (relays)
M = motor (relay)
T1 = tank stir period
T2 = drain period
IF sensor 2 is not tripped THEN energize solenoid 1
(Ingr A)
IF sensor 2 is tripped AND sensor is not tripped THEN
energize solenoid 2 (ingr B)
IF sensor 1 is tripped THEN enable timer (10 Sec)
IF sensor 1 is tripped AND the timer is not done timing
THEN energize motor
IF the timer is done timing THEN energize solenoid 3
(drain)
Programming a PLC
-
7/29/2019 Lect_11_21_PLC
50/58
Programming a PLC
Ladder Logic for Tank
-
7/29/2019 Lect_11_21_PLC
51/58
Ladder Logic for Tank
Address
Low = 0000
High = 0001
Motor = 0500
Relay = 1000
Logic for Ladder Solution
-
7/29/2019 Lect_11_21_PLC
52/58
Logic for Ladder Solution
A B C
D E F
H d it k?
-
7/29/2019 Lect_11_21_PLC
53/58
How does it work?
PROGRAMMING EXAMPLE
-
7/29/2019 Lect_11_21_PLC
54/58
PROGRAMMING EXAMPLE
id description state explanation
MSI microswitch 1 part arrive
R1 output to bar code reader 1 scan the part
C1 input from bar code reader 1 right partR2 output robot 1 loading cycle
R3 output robot 1 unloading cycle
C2 input from robot 1 robot busy
R4 output to stopper 1 stopper up
C3 input from machine 1 machine busyC4 input from machine 1 task complete
Part
microswitch
Bar code reader
Stopper
Conveyor
Machine
Robot
SOLUTION
-
7/29/2019 Lect_11_21_PLC
55/58
SOLUTION
Rung 1. If part arrives andno part is stopped, triggerthe bar code reader.
Rung 2. If it is a right part,activate the stopper.
Rung 3. If the stopper is up,the machine is not busyand the robot is not busy,load the part onto themachine.
Rung 4. If the task iscompleted and the robot
is not busy, unload themachine.
01
02
03
04
05
11
12
13
14
15
InputOutput
ProgrammableControllerPLC
MS1
C1
C2
C3
C4
R1
R2
R3
R4
01 14 11
02
14 04 03
14
12
1305 03
-
7/29/2019 Lect_11_21_PLC
56/58
Light Switch Examples Test
-
7/29/2019 Lect_11_21_PLC
57/58
Light Switch Examples TestSwitch_1
X0
Switch_2
X1
Switch_1
X0
Switch_1
X0
Switch_1
X0
Switch_1
X0
Switch_1
X0
Switch_1
X0
Switch_3
X2
Switch_2
X1
Switch_2
X1
Switch_2
X1
Switch_3
X2
Switch_3
X2
Switch_3
X2
Light_1
Y0
Light_2
Y1
Light_3
Y2
END
Motor Control Examples Test
-
7/29/2019 Lect_11_21_PLC
58/58
Motor Control Examples TestStop
X0
Start
X1
Motor_FBX2
Start
X1
Stop
X0
Intrlk_2
X4
Motor_FB
X2
Intrlk_3X5
Motor
Y0
Motor
Y0
Motor
Y0
END
Start
X1
Motor
Y0
Stop
X0
Intrlk_1
X3