Sei sulla pagina 1di 58

PLC

(Lecture # 21)

By Nazeer Ahmad Anjum


NazeerAnjum@uettaxila.edu.pk 300-5397864

Spring 2007 (Mechatronics)


Department of Mechanical Engineering. UET Taxila

PLC
Lecture No 21 Week
th 11

29-05-2007

PROGRAMMABLE LOGIC CONTROLLER



A digital Electronic Device Uses a programmable memory to store instructions & implement functions as to

Logic Sequencing Timing Counting & Arithmetic In order to control machines & Process I/P devices as switches & o/p devices as motors are connected to PLC. controller monitors the i/ps & o/ps according to the program stored in the PLC

Programmable Logic Controller


1. 2. 3. A control device that uses a programmable microprocessor and is typically programmed. PLCs are often categorized by the number of I/O ports they provide. PLCs are often RISC based and are designed for real-time and rugged industrial environments

Uses Programmable Logic Controller


PLCs have been gaining popularity on the factory floor and will probably remain predominant for some time to come. Most of this is because 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 reduce downtime. 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.

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 relay control 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

Features of PLC

1. 2. 3.

They are rugged and designed to withstand vibrations, Temperature, Humidity and Noise. The interfacing for i/p and o/p is inside the controller. They are easily programmed.

Programmable Logic Control (PLC)

Definition - Dedicated computer for rapid


processing of simple logic instructions in a defined time.

Purpose - Send and read signals that can


be used to control and monitor devices.

Process - One of scanning all the devices


(sensors, timers, etc.) in a cyclical time period.

PLC Control Approaches


Logic Control Method - This closed-loop method uses
conditions and events to signal completion of a given step, and then triggers the execution of some other event. This is an asynchronous method of process control, because it does not always proceed in a constant time period.

Sequencing Method - This open-loop method uses timers to


trigger the completion of one step and the beginning of the next. This is a synchronous control method.

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 low voltage value. The binary variables in DPC are associated with i/p signals to the controller & 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 in response to the i/p signals & as a function of time. These o/p signals turn on or off switches, motors, valves, solenoid and other binary actuator related to the process.

Discrete Process Control


Logic Control or Event Driven Changes Sequencing or Time Driven Changes

1. Executed by the controller in 1. response to some event.

2. The change can be to initiate an 2. operation or terminate an operation, start a motor or stop, open a valve or close 3. Has no memory. 3. 4. Does not consider any previous 4. values of i/p

Executed by the control system either at a specific point in time or after a certain time lapse has occurred Uses internal timing devices to determine when to initiate changes in o/p variables.

Memory element is present. Consider any previous values of i/p

Discrete Process Control


Logic Control Examples
1. A robot loads a work part into 1. the fixture, the part is sensed by the limit switch. Sensing the parts presence is the event that alter the system state. 2. Counting parts moving along a 2. conveyor past an optical sensor is an event driven system.

Sequencing Examples
Starting times & ending times for the shift & uniform break periods for all the workers. Heat treating operations carried out for certain length of time.

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

Three conditions and Solution


1. 2. The raw work part must be at the stopping point The forge press must have completed the process on the previous part 3. 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 in the 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.

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 Systems c. 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

PLC
CPU Input Flag System Input Module

Output
User Ladder Diagram

Output Module

Working memory registers

PLC
Lecture No 25 Week
th 13

16-06-2007

Boolean Logic Operators


AND INPUT Normally Closed

INPUT Normally Open

OUTPUT OR

TMR Timer CTR Counter

COMBINED AND & OR

Logic Control Elements


PLC's are typically programmed using Boolean logic, shown in figures by logical AND, OR, and NOT gates.

AND, OR , & NOT GATE


AND, OR, and NOT gates are then used to define two more logical elements - the NAND and NOR gates - also shown with their truth tables.

RELAYS
contact

A switch whose operation is activated by an electromagnet is called a "relay"


input

coil

Relay coil R1 Output contact R1

AN EXAMPLE OF RELAY LOGIC


For a process control, it is desired to have the process start (by turning on a motor) five seconds after a part touched a limit switch. The process is terminated automatically when the finished part touches a second limit switch. An emergency switch will stop the process any time when it is pushed.
PB1 LS1 LS2
L1 LS1 R1 PB1 LS2 R1

TIMER
R1 TIMER R2

Motor R2
PR=5

R1

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 until a voltage is applied to the input A. The second relay is normally open and will not allow current to flow until a voltage is applied to the input B. If current is flowing through the first two relays then current will flow through the coil in the third relay, and close the switch for output C. This circuit would normally be drawn in the ladder logic form. This can be read logically as C will be on if A is off and B is on.

A Simple Relay Controller

Problem:

Try to develop a relay based controller that will allow three switches in a room to control a single light.

Solution: There are two possible approaches to this


problem. The first assumes that any one of the switches on will 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 the light on or off, regardless of the states of the other switches. This method is more complex and involves thinking through all of the possible combinations of switch positions. You might recognize this problem as an exclusive or problem.

COUNTER
input Re giste r

Accumulator re se t conta ct output


Input Re se t Output Count

Digital counters, output in the form of a relay contact when a pre-assigned count value is reached.

1 2

Clock

TIMER

Accumulator re se t Re giste r

conta Contact ct output

Clock Reset Output Count 0 1 2 3 4 5

Time 5 seconds.

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

PLC ARCHITECTURE
Programmable controllers replace most of the relay panel wiring by software programming.
Progr am Loade r Printe r Proce ssor Casse tte Loade r EPROM Loade r Pe riphe rals M emory Powe r Supply I/O M odule s M achine s PC Switche s

Exte r nal De v ice s

A typical PLC

PLC COMPONENTS
1. Processor
Microprocessor based, may allow arithmetic operations, logic operators, computer interface, local area network, 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 Programmable Read Only Memory.

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 programmer operator console printer simulator EPROM loader graphics processor network communication interface

PLC SELECTION CRITERIA


1. What I/O is required, i. e. the number of I/O, capability of expansion for future needs. 2. What types of I/O are required, i. e. signal conditioning, onboard power supply for inputs, outputs, etc. 3. What size of memory is required? This is linked to the number of I/O & a complexity of program used. 4. What speed & power is required of CPU.

Logical Control
Control actions are taken by making decisions depending on the values associated with various inputs or variables and the control logic in the program If a decision can be made by answering yes or no to a given question, it is referred to as a decision by attributes
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 yes or no are referred to as decisions by variables
How long is the bar stock? What is the feed rate? What is the part temperature?

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 series connection represents a logical and and a parallel connection represents a logical or. Made up of inputs, outputs connected according to appropriate 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.

Ladder Logic Diagram


Except when special provisions are made, it is 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.

LADDER DIAGRAM
A ladder diagram is a means of graphically representing the logic required in a relay logic system.
Rail
start PB1 emergency stop PB2 R1

Rung

R1

R1 A

PLC WIRING DIAGRAM


A B
Input 01 02 20 01 PLC 02 20 Output 11 12 C

03
20 11

External switches

Stored program

CONTROL DEVICES
1) 2) Mechanical Control - cam, governor, etc., Pneumatic Control - compressed air, valves, etc.

3)
4)

Electromechanical Control - switches, relays, timers, counters, etc,


Electronics Control - similar to electromechanical control, except uses electronic switches.

5)

Computer Control

PLC Evolution
Binary World Relay control pneumatic sequencer
A B C P1 P2

Analog World

Pneumatic and electromechanical controllers


I1

combinatorial

sequential

Regulation, controllers

discrete processes

continuous processes

Programmable Logic Controllers

Continuous and Discrete Control (comparison)


"combinatorial" e.g. ladder logic
A Out = A B A B Out = (A + B) C NOT C B

"sequential"

ladder logic

I1

P1 P2

analog building blocks

Ladder Logic
make contact

origin: electrical circuit

01

02
relay coil

03

50
break contact

01 corresponding ladder diagram 50 03

02 50 rung

05 44

"coil" 50 is used to move other contact(s)

Ladder Logic
Binary combinations are expressed by series and parallel relay contact: ladder logic representation "CMOS" equivalent 01 50 02 50

Series

01

02

Coil 50 is active (current flows) when 01 is active and 02 is not. Parallel + 01 40 02 01 02 40

Coil 40 is active (current flows) when 01 is active or 02 is not.

PLC
Lecture No 26 Week
th 14

19-06-2007

Ladder logic example


Process will mix ingredients, first adding ingredient A until level reaches sensor 2, then adding ingredient B until level reaches sensor 1. The mix is then stirred for a period of time, and tank is emptied. Investigate the control logic required.

Ladder logic example


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

How would you write the ladder logic for this problem?

Solution

X1, X2 = sensors S1, S2, S3 = solenoids (relays) M = motor (relay) T1 = tank stir period T2 = drain period
X2

S3
S1

X1

X2
S2

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)

X1 M

M TMR T1 T1 S3

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)

S3
TMR T2

Programming a PLC

Ladder Logic for Tank

Address Low = 0000 High = 0001 Motor = 0500 Relay = 1000

Logic for Ladder Solution

How does it work?

PROGRAMMING EXAMPLE
Bar code re ader microswitch Part Stopper Conveyor

Robot

Machine

id MSI R1 C1 R2 R3 C2 R4 C3 C4

description microswitch output to bar code reader input from bar code reader output robot output robot input from robot output to stopper input from machine input from machine

state 1 1 1 1 1 1 1 1 1

explanation part arrive scan the part right part loading cycle unloading cycle robot busy stopper up machine busy task complete

SOLUTION
Input MS1 C1 C2 C3 C4 01 02 03 04 05 Pro grammable Controlle r PLC Outpu t 11 12 13 14 15 R1 R2 R3 R4

01

14

11

02

14

14

04

03

12

05

03

13

Rung 1. If part arrives and no part is stopped, trigger the 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 busy and the robot is not busy, load the part onto the machine. Rung 4. If the task is completed and the robot is not busy, unload the machine.

Light Switch Examples Test


Switch_1 X0 Light_1 Y0 Switch_1 X0 Switch_2 X1 Light_2 Y1

Switch_1 X0

Switch_2 X1

Switch_1 X0

Switch_3 X2

Switch_2 X1

Light_3 Y2

Switch_1 X0

Switch_3 X2

Switch_1 X0

Switch_3 X2

Switch_2 X1

Switch_1 X0

Switch_3 X2

END

Motor Control Examples Test


Stop X0 Start X1 Motor Y0 Motor Y0

Stop X0

Start X1

Motor Y0

Motor_FB X2

Intrlk_1 X3

Stop X0

Start X1

Intrlk_2 X4

Motor Y0

Motor_FB X2

Intrlk_3 X5

END

Potrebbero piacerti anche