Você está na página 1de 119

Basic PLC

Basic PLC

Description
This chapter introduces the basic hardware and software components of a Programmable Controller (PLC). It details the architecture and basic instruction set common to all PLCs. Basic programming techniques and logic designs are covered. This unit describes the operating features of the PLC, the advantages of the PLC over hard-wired control systems, practical applications, troubleshooting and maintenance of PLCs.

Basic PLC

Objectives
At the end of this chapter we should be able to: Describe the major components of a common PLC. Interpret PLC specifications. Apply troubleshooting techniques. Convert conventional relay logic to a PLC language. Operate and program a PLC for a given application.

Basic PLC

Contents
History of Programmable Controllers Relay Ladder Logic Central Processing Unit Input/output System Programming and Peripheral Devices Programming Concepts Applications Troubleshooting and Maintenance

Basic PLC

INTRODUCTION TO PLCS
Advantages of PLCs 1. Less wiring. 2. Wiring between devices and relay contacts are done in the PLC program. 3. Easier and faster to make changes. 4. Trouble shooting aids make programming easier and reduce downtime. 5. Reliable components make these likely to operate for years before failure.

Basic PLC

PLC Origin

- Developed to replace relays in the late 1960s - Costs dropped and became popular by 1980s - Now used in many industrial designs

Basic PLC

Historical Background

The Hydramatic Division of the General Motors Corporation specified the design criteria for the first programmable controller in 1968. Their primary goal was to eliminate the high costs associated with inflexible, relay-controlled systems.

The controller had to be designed in modular form, so that subassemblies could be removed easily for replacement or repair.
The control system needed the capability to pass data collection to a central system. The system had to be reusable.

The method used to program the controller had to be simple, so that it could be easily understood by plant personnel.
7

Basic PLC

Programmable Controller Development


1968 1969 Programmable concept developed Hardware CPU controller, with logic instructions, 1 K of memory and 128 I/O points Use of several (multi) processors within a PLC - timers and counters; arithmetic operations; 12 K of memory and 1024 I/O points Remote input/output systems introduced Microprocessors - based PLC introduced

1974

1976 1977

Basic PLC

Programmable Controller Development


1980 Intelligent I/O modules developed Enhanced communications facilities Enhanced software features (e.g. documentation) Use of personal microcomputers as programming aids Low - cost small PLCs introduced Networking of all levels of PLC, computer and machine using SCADA software.

1983 1985 on

Basic PLC

Comparison between PC and PLC


The main difference from other computers is that PLCs are armored for severe conditions (dust, moisture, heat, cold, etc) and have the facility for extensive input/output (I/O) arrangements. Advantages over PC : 1. Cost effective for controlling complex systems. 2. Flexible and can be reapplied to control other systems quickly and easily. 3. Computational abilities allow more sophisticated control. 4. Trouble shooting aids make programming easier and reduce downtime. 5. Reliable components make these likely to operate for years before failure. Disadvantages over PC : 1. Too much work required in connecting wires. 2. Difficulty with changes or replacements. 10 3. Difficulty in finding errors; requiring skillful work force.

Basic PLC

Programmable Logic Controllers


( Definition according to NEMA standard ICS3-1978)

A digitally operating electronic apparatus which uses a programming memory for the internal storage of instructions for implementing specific functions such as logic, sequencing, timing, counting and arithmetic to control through digital or analog modules, various types of machines or process.

11

Basic PLC

Programmable Logic Controller: Definition


Definition: small computers, dedicated to automation tasks in an industrial environment" cabled relay control (hence 'logic'), analog (pneumatic, hydraulic) governors real-time (embedded) computer with extensive input/output Measure, Control, Protect Instrumentation flow meter, temperature, position,. but also actors (pump, ) Control programmable logic controllers with digital peripherals & field bus Visualization HMI* in PLCs (when it exists) is limited to service help and control of operator displays
*Human Machine Interface

Formerly:
Today: Function: Distinguish

Basic PLC

Simple PLC
binary inputs
network

binary outputs

analog inputs / outputs

Basic PLC

PLC in a cabinet
CPU1

PLC in a cabinet CPU2


serial connections

redundant field bus connection

inputs/outputs

Basic PLC

example: turbine control (in the test lab)

Basic PLC

PLC: functions
PLC = PMC: Protection, Measurement and Control

Measure Control (Command and Regulation) Protection

Event Logging

Communication
Human interface

Basic PLC

PLC: Characteristics
large number of peripherals: 20..100 I/O per CPU, high density of wiring, easy assembly. binary and analog Input/output with standard levels operate under harsh conditions, require robust construction, protection against dirt, water and mechanical threats, electro-magnetic noise, vibration, extreme temperature range (-30C..85C), sometimes directly located in the field. programming: either very primitive with hand-held terminals on the target machine itself, or with a lap-top able to down-load programs. network connection allows programming on workstations and connection to SCADA field bus connection for remote I/Os primitive Human-Machine-Interface for maintenance, either through LCD-display or connection of a laptop over serial lines (RS232) or wireless. economical - 1000.- .. 15'000.- for a full crate. the value is in the application software (licenses 20'000 ..50'000)

Basic PLC

PLC: Location in the control architecture


Engineer Operator station station
Control Bus (e.g. Ethernet)
large PLCs
Control Station with Field Bus
COM1 COM 2

Enterprise Network

Supervisor Station

gateway

COM1

COM1

COM 2

PLC

CPU

CPU

I/O

I/O

I/O

I/O

I/O

I/O

I/O

I/O

Field Bus
COM COM I/O COM COM

I/O

PLC

CPU I/O

gateway
Field Bus

direct I/O

Field Stations FB gateway Field Devices small PLC data concentrators, not programmable, Sensor Bus (e.g. ASI) but configurable

COM

CPU

CPU

CPU

I/O

I/O

I/O

I/O

I/O

I/O

Basic PLC

Why 24V / 48 V supply ?


After the plant lost electric power, operators could read instruments only by plugging in temporary batteries [IEEE Spectrum Nov 2011 about Fukushima]

Basic PLC

Leading Brands Of PLC


AMERICAN 1. 2. 3. 4. 5. 6. 7. EUROPEAN 1. 2. 3. 4. Allen Bradley Gould Modicon Texas Instruments General Electric Westinghouse Cutter Hammer Square D Siemens Klockner & Mouller Festo Telemechanique
20

Basic PLC

Leading Brands Of PLC


JAPANESE 1. 2. 3. 4. Toshiba Omron Fanuc Mitsubishi

21

Basic PLC

Areas of Application
Manufacturing / Machining Food / Beverage Metals Power Mining Petrochemical / Chemical

22

Basic PLC

PLC Size
- it covers units with up to 128 I/Os and memories up to 2 Kbytes. - these PLCs are capable of providing simple to advance levels or machine controls. 2. MEDIUM - have up to 2048 I/Os and memories up to 32 Kbytes. 3. LARGE - the most sophisticated units of the PLC family. They have up to 8192 I/Os and memories up to 750 Kbytes. - can control individual production processes or entire plant. 1. SMALL
23

Basic PLC

Types of PLC

(1)

Compact Monolithic construction Monoprocessor Fieldbus connection


Fixed casing Fixed number of I/O (most of them binary) No process computer capabilities (no MMC) Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7

(2)

Modular PLC Modular construction (backplane) One- or multiprocessor system Fieldbus and LAN connection
3U or 6U rack, sometimes DIN-rail Large variety of input/output boards Connection to serial bus Small MMC function possible

Typical products: SIMATIC S5-115, Hitachi H-Serie, ABB AC110

(3)

Soft-PLC Windows NT or CE-based automation products Direct use of CPU or co-processors

Basic PLC

Compact PLC

Monolithic (one-piece) construction Fixed casing Fixed number of I/O (most of them binary) No process computer capabilities (no MMC) Can be extended and networked by an extension (field) bus Sometimes LAN connection (Ethernet, Arcnet) Monoprocessor costs: 2000 Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7

Basic PLC

Modular PLC
RS232

tailored to the needs of an application housed in a 19" (42 cm) rack (height 6U ( = 233 mm) or 3U (=100mm) high processing power (several CPU) large choice of I/O boards concentration of a large number of I/O interface boards to field busses requires marshalling of signals primitive or no HMI cost effective if the rack can be filled
CPU CPU Analog I/O Binary I/O
courtesy ABB

development environment

LAN backplane parallel bus fieldbus Power Supply

fieldbus

supply 115-230V~ , 24V= or 48V= (redundant) cost ~ 10000 for a filled crate

Basic PLC

Small modular PLC

mounted on DIN-rail, 24V supply cheaper (5000) not water-proof, no ventilator extensible by a parallel bus (flat cable or rail)

Basic PLC

Soft-PLC (PC as PLC)


23 4 3 3 2 12 2

PC as engineering workstation PC as human interface (Visual Basic, Intellution, Wonderware) PC as real-time processor (Soft-PLC) PC assisted by a Co-Processor (ISA- or PC104 board) PC as field bus gateway to a distributed I/O system

I/O modules

Basic PLC

PLC evolution
Binary World relay controls, Relay control pneumatic sequencer
A B C

Analog World Pneumatic and electromechanical controllers


I1

P1 P2

combinatorial

sequential

Regulation, controllers

discrete processes

continuous processes

Programmable Logic Controllers

Basic PLC

Continuous Plant

Example: traction motors, ovens, pressure vessel,... The state of continuous plants is described by continuous (analog) state variables like temperature, voltage, speed, etc. There exist a fixed relationship between input and output , described by a continuous model in form of a transfer function F. This transfer function can be expressed by a set of differential equations. If equations are linear, the transfer function may expressed as Laplace or Z-transform.
y x F(s) = (1+Ts) (1+T1s + T2 s2) y time

Continuous plants are normally reversible and monotone. This is the condition to allow their regulation. The time constant of the control system must be at least one order of magnitude smaller than the smallest time constant of the plant.

the principal task of the control system for a continuous plant is its regulation.

Basic PLC

Discrete Plant
init b a 1 7 6 5 2 c + d 3 e e c +d 4

Examples: Elevators, traffic signaling, warehouses, etc.

The plant is described by variables which take well-defined, non-overlapping values. The transition from one state to another is abrupt, it is caused by an external event. Discrete plants are normally reversible, but not monotone, i.e. negating the event which caused a transition will not revert the plant to the previous state.

Example: an elevator doesn't return to the previous floor when the button is released. Discrete plants are described e.g. by finite state machines or Petri nets. the main task of a control system with discrete plants is its sequential control.

Basic PLC

Example of Discrete state system: Tank Used to Mix Two Liquids


MOTOR

A
FS

FLOAT SWITCH

SOLENOIDS

SOLENOID

C
TIMER

1 -MINUTE

32

Basic PLC

Tank Used to Mix Two Liquids


A tank is used to mix two liquids. The control circuit operates as follows: 1. When the start button is pressed, solenoids A and B energize. This permits the two liquids to begin filling the tank.

2. When the tank is filled, the float switch trips. This deenergizes solenoids A and B and starts the motor used to mix the liquids together. 3. The motor is permitted to run for one minute. After one minute has elapsed, the motor turns off and solenoid C energizes to drain the tank.
33

Basic PLC

Tank Used to Mix Two Liquids


4. When the tank is empty, the float switch de-energizes solenoid C. 5. A stop button can be used to stop the process at any point. 6. If the motor becomes overloaded, the action of the entire circuit will stop. 7. Once the circuit has been energized it will continue to operate until it is manually stopped.

34

Basic PLC

Block Diagram of PLC


POWER SUPPLY

From SENSORS Pushbuttons, contacts, limit switches, etc.

I M N O P D U U T L E

PROCESSOR CPU ALU Memory

O U T P U T

M O D U L E

PROGRAMMING DEVICE

To OUTPUT Solenoids, contactors, alarms etc.

35

Basic PLC

Major Components of a Common PLC


POWER SUPPLY Provides the voltage needed to run the primary PLC components

36

Basic PLC

Major Components of a Common PLC


I/O MODULES
Provides signal conversion and isolation between the internal logic level signals inside the PLC and the fields high level signal. Performs the following functions: 1. Termination: Provides terminals for connection to field devices 2. Isolation: Provides isolation between the high power field devices and low power controller generally by making use of optical couplers. 3. Signal Conditioning: Performs signal conversion like A to D or D to A. 4. Indication: Makes use of low power LEDs to indicate the absence (low state) or presence (high state) of the field devices.
37

Basic PLC

Major Components of a Common PLC


PROCESSOR Provides intelligence to command and govern the activities of the entire PLC systems. Consists of : 1. CPU 2. ALU 3. Memory: RAM, ROM and Files ( Program and Data) PROGRAMMING DEVICE External device used to enter the desired program that will determine the sequence of operation and control of process equipment or driven machine. Different types of programming devices used with PLC are: 1. Hand held terminals 2. Dedicated terminals 3. Microcomputer (PC) 38

Basic PLC

Programming Device
Also known as:

Industrial Terminal ( Allen Bradley )


Program Development Terminal ( General Electric )

Programming Panel ( Gould Modicon )


Programmer ( Square D )

Program Loader ( Idec-Izumi )


Programming Console ( Keyence / Omron )
39

Basic PLC

Programming Device
1. Hand held unit with LED / LCD display : It is a small self contained unit in which the ladder diagram is displayed one rung at a time in a special liquid crystal display. The user can enter a program, perform diagnostic tests, run the program through the programmable controller and perform editing of the installed program. The installed program is stored in a temporary memory that will be lost without ac power or battery back up. The program can be permanently burned into a ROM for final installation.

40

Basic PLC

2. Dedicated terminals: These are used with only one type and make
of PLC and is used when programming has to be done in mass for the same type of the controller. 3. Microcomputer (PC) : It is able to display many rungs of the ladder Diagram. The advantage of PC is that it can be used for programming Different makes of PLC by running their respective loaded software and when not on the network can be used for other applications such as design or accounting.

41

Basic PLC

I/O Module
The I/O interface section of a PLC connects it to external field devices. The main purpose of the I/O interface is to condition the various signals received from or sent to the external input and output devices. Input modules converts signals from discrete or analog input devices to logic levels acceptable to PLCs processor. Output modules converts signal from the processor to levels capable of driving the connected discrete or analog output devices.

42

Basic PLC

Classification of I/O Module


1) Serial I/O 2) Parallel I/O 3) Discrete I/O : AC , DC Discrete I/O 4) Analog I/O : Analog Input (0-5 V,0-10 V,1-5 V,4-20 mA) Analog Output (4-20 mA, 0-10 V) 5) Special purpose I/O : ASCII communication module, Stepper motor module, Thermocouple module, Bar code module, Vision system module, PID Controller module.
43

Basic PLC

Discrete Input Module

Most common input interface used with PLCs.

DISCRETE DC INPUT MODULE


USE TO DROP THE VOLTAGE TO LOGIC LEVEL IS NEEDED TO: Prevent voltage transients from damaging the processor. Helps reduce the effects of electrical noise

FROM INPUT DEVICE

Current Limiting Resistor

OPTOISOLATOR

Signal Conditioning Buffer, Filter, hysteresis Circuits

TO PROCESSOR

44

Basic PLC

DISCRETE AC INPUT MODULE


IS NEEDED TO: Prevent voltage transients from damaging the processor. Helps reduce the effects of electrical noise

CONVERTS THE AC INPUT TO DC AND DROPS THE VOLTAGE TO LOGIC LEVEL

FROM INPUT DEVICE

Rectifier, Resistor Network

OPTOISOLATOR

Signal Conditioning Buffer, Filter, hysteresis Circuits

TO PROCESSOR

45

Basic PLC

46

Basic PLC

47

Basic PLC

48

Basic PLC

DISCRETE OUTPUT MODULE


They are most widely used and simply act as switches to control output field devices. DISCRETE DC OUTPUT MODULE

49

Basic PLC

DISCRETE AC OUTPUT MODULE


IS NEEDED TO: Prevent voltage transients from damaging the processor. Helps reduce the effects of electrical noise

FROM PROCESSOR

TTL Circuits

OPTOISOLATOR

Amplifier RELAY TRIAC XSISTOR

TO OUTPUT DEVICE

50

Basic PLC

Operation flow of an Output Module

51

Basic PLC

Analog Input Module


It is used to interface a PLC to analog input signals. The module converts analog input signals to 16-bit binary values for storage in processors input image table. It accepts signals 0 to 10 V DC,-10 V to +10 V DC, 1 to 5 V DC, 4 to 20 mA, 0 to 20 mA, -20 to +20 mA.

52

Basic PLC

Analog Output Module


It accepts a 16 bit output status word which they convert into an analog value through digital to analog converter.
Typical analog signals 0 to 10 V DC,-10 V to +10 V DC, 1 to 5 V DC, 4 to 20 mA, 0 to 20 mA, -20 to +20 mA. Analog output modules are selected to send out either a varying current or voltage signal. For Ex: If the speed of the DC motor is to be varied over a range of say 1000-3000 rpm, the voltage of an output module of range 0 1 V DC will represent a specific speed over the range.

53

Basic PLC

54

Basic PLC

General PLC architecture


RS 232 Ethernet ethernet controller extension bus parallel bus
buffers

CPU

Real-Time Clock

ROM

flash EPROM

serial port controller

field bus controller

analogdigital converters
signal conditioning

digitalanalog converters
power amplifiers

Digital Output

Digital Input
signal conditioning

external I/Os

relays

direct Inputs and Outputs


field bus

Basic PLC

The signal chain within a PLC


y(i) y(i)

time

time

time

analog filtering variable & (e.g. 4..20mA) scaling binary variable (e.g. 0..24V)

sampling

analogdigital converter
1

011011001111

digitalanalog converter

analog amplifier variable e.g. -10V..10V transistor or relay

processing

filtering

sampling
0001111

binary variable

counter

non-volatile memory

time

Basic PLC

Example: Signal chain in a protection device


Input transformer Anti aliasing filter Sample and hold A/D conversion Digital Protection Output filter algorithm driver

U/I


f = 200 kHz f = 1 MHz

A/D

CPU

Trip
reaction < 10 ms

f = 300 -1200 Hz
f = 100 kHz

Basic PLC

I/O Circuits
DIFFERENT TYPES OF I/O CIRCUITS

1. Pilot Duty Outputs Outputs of this type typically are used to drive high-current electromagnetic loads such as solenoids, relays, valves, and motor starters.
These loads are highly inductive and exhibit a large inrush current.

Pilot duty outputs should be capable of withstanding an inrush current of 10 times the rated load for a short period of time without failure.
58

Basic PLC

I/O Circuits
2. General - Purpose Outputs These are usually low- voltage and low-current and are used to drive indicating lights and other non-inductive loads. Noise suppression may or may not be included on this types of modules.

3. Discrete Inputs Circuits of this type are used to sense the status of limit switches, push buttons, and other discrete sensors. Noise suppression is of great importance in preventing false indication of inputs turning on or off because of noise.

59

Basic PLC

I/O Circuits
4. Analog I/O

Circuits of this type sense or drive analog signals.


Analog inputs come from devices, such as thermocouples, strain gages, or pressure sensors, that provide a signal voltage or current that is derived from the process variable. Standard Analog Input signals: 4-20mA; 0-10V Analog outputs can be used to drive devices such as voltmeters, X-Y recorders, servomotor drives, and valves through the use of transducers. Standard Analog Output signals: 4-20mA; 0-5V; 0-10V

60

Basic PLC

I/O Circuits
5. Special - Purpose I/O
Circuits of this type are used to interface PLCs to very specific types of circuits such as servomotors, stepping motors PID (proportional plus integral plus derivative) loops, highspeed pulse counting, resolver and decoder inputs, multiplexed displays, and keyboards.

This module allows for limited access to timer and counter presets and other PLC variables without requiring a program loader.

61

Basic PLC

OUTPUTS INPUTS
CONTACTOR LAMP PUSHBUTTONS

MOTOR

PLC

62

Basic PLC

Allen-Bradley 1746-1A16 L1 L2 I= Input I:2


P. B SWITCH

Module/ Element slot # in rack

Module Terminal #/ Bit Address I:2.0/0

LADDER PROGRAM INPUT MODULE WIRING DIAGRAM

63

Basic PLC

CONTACTOR

L2

L1

N.O

MOTOR C

L2 L1 FIELD WIRING

SOLENOID VALVES LAMP BUZZER

OUTPUT MODULE WIRING

L1

O:4

L2

CONTACTOR

0
64

LADDER PROGRAM

Basic PLC

Discrete Input

A discrete input also referred as digital input is an input that is either ON or OFF are connected to the PLC digital input. In the ON condition it is referred to as logic 1 or a logic high and in the OFF condition maybe referred to as logic o or logic low.
Normally Open Pushbutton Normally Closed Pushbutton Normally Open switch Normally Closed switch Normally Open contact Normally closed contact
65

Basic PLC

IN

OFF Logic 0

PLC Input Module


24 V dc

IN

OFF Logic 1

PLC Input Module


24 V dc

66

Basic PLC

Analog Input
An analog input is an input signal that has a continuous signal. Typical inputs may vary from 0 to 20mA, 4 to 20mA or 0 to10V. Below, a level transmitter monitors the level of liquid in the tank. Depending on the level Tx, the signal to the PLC can either increase or decrease as the level increases or decreases.
Level Transmitter
IN

Tank

PLC Analog Input Module

67

Basic PLC

Digital Output
A discrete output is either in an ON or OFF condition. Solenoids, contactors coils, lamps are example of devices connected to the Discrete or digital outputs. Below, the lamp can be turned ON or OFF by the PLC output it is connected to.
OUT

PLC

Lamp
Digital Output Module

68

Basic PLC

Analog Output
An analog output is an output signal that has a continuous signal. Typical outputs may vary from 0 to 20mA, 4 to 20mA or 0 to10V.
Electric to pneumatic transducer
OUT

PLC
Analog Output Module

0 to 10V

Supply air

Pneumatic control valve

69

Basic PLC

Processor
The processor module contains the PLCs microprocessor, its supporting circuitry, and its memory system. The main function of the microprocessor is to analyze data coming from field sensors through input modules, make decisions based on the users defined control program and return signal back through output modules to the field devices. Field sensors: switches, flow, level, pressure, temp. transmitters, etc. Field output devices: motors, valves, solenoids, lamps, or audible devices. The memory system in the processor module has two parts: a system memory and an application memory.
70

Basic PLC

Memory Map Organization


System memory includes an area called the EXECUTIVE, composed of permanently-stored programs that direct all system activities, such as execution of the users control program, communication with peripheral devices, and other system activities. The system memory also contains the routines that implement the PLCs instruction set, which is composed of specific control functions such as logic, sequencing, timing, counting, and arithmetic. System memory is generally built from read-only memory devices.

SYSTEM

APPLICATION Data Table User Program


The application memory is divided into the data table area and user program area. The data table stores any data associated with the users control program, such as system input and output status data, and any stored constants, variables, or preset values. The data table is where data is monitored, manipulated, and changed for control purposes. The user program area is where the programmed instructions entered by the user are stored as an application control program.

71

Basic PLC

Memory Designs
VOLATILE. A volatile memory is one that loses its stored information when power is removed. Even momentary losses of power will erase any information stored or programmed on a volatile memory chip. Common Type of Volatile Memory

RAM. Random Access Memory(Read/Write) Read/write indicates that the information stored in the memory can be retrieved or read, while write indicates that the user can program or write information into the memory.
72

Basic PLC

Memory Designs
The words random access refer to the ability of any location (address) in the memory to be accessed or used. Ram memory is used for both the user memory (ladder diagrams) and storage memory in many PLCs. RAM memory must have battery backup to retain or protect the stored program.

73

Basic PLC

Memory Designs
Several Types of RAM Memory: 1.MOS 2.HMOS 3.CMOS The CMOS-RAM (Complimentary Metal Oxide Semiconductor) is probably one of the most popular. CMOSRAM is popular because it has a very low current drain when not being accessed (15microamps.), and the information stored in memory can be retained by as little as 2Vdc.

74

Basic PLC

Memory Designs
NON-VOLATILE Has the ability to retain stored information when power is removed, accidentally or intentionally. These memories do not require battery back-up. Common Type of Non-Volatile Memory ROM, Read Only Memory Read only indicates that the information stored in memory can be read only and cannot be changed. Information in ROM is placed there by the manufacturer for the internal use and operation of the PLC.

75

Basic PLC

Memory Designs
Other Types of Non-Volatile Memory PROM, Programmable Read Only Memory Allows initial and/or additional information to be written into the chip. PROM may be written into only once after being received from the PLC manufacturer; programming is accomplish by pulses of current. The current melts the fusible links in the device, preventing it from being reprogrammed. This type of memory is used to prevent unauthorized program changes.
76

Basic PLC

Memory Designs
EPROM, Erasable Programmable Read Only Memory Ideally suited when program storage is to be semipermanent or additional security is needed to prevent unauthorized program changes. The EPROM chip has a quartz window over a silicon material that contains the electronic integrated circuits. This window normally is covered by an opaque material, but when the opaque material is removed and the circuitry exposed to ultra violet light, the memory content can be erased. The EPROM chip is also referred to as UVPROM.
77

Basic PLC

Memory Designs
EEPROM, Electrically Erasable Programmable Read Only Memory

Also referred to as E2PROM, is a chip that can be programmed using a standard programming device and can be erased by the proper signal being applied to the erase pin. EEPROM is used primarily as a non-volatile backup for the normal RAM memory. If the program in RAM is lost or erased, a copy of the program stored on an EEPROM chip can be down loaded into the RAM.

78

Basic PLC

PLC Operation
Basic Function of a Typical PLC

Read all field input devices via the input interfaces, execute the user program stored in application memory, then, based on whatever control scheme has been programmed by the user, turn the field output devices on or off, or perform whatever control is necessary for the process application.
This process of sequentially reading the inputs, executing the program in memory, and updating the outputs is known as scanning.
79

Basic PLC

While the PLC is running, the scanning process includes the following four phases, which are repeated continuously as individual cycles of operation:
PHASE 1

Read Inputs Scan


PHASE 2

Program Execution
PHASE 3

Diagnostics/ Comm
PHASE 4

Output Scan
80

Basic PLC

PHASE 1 Input Status scan

A PLC scan cycle begins with the CPU reading the status of its inputs.
PHASE 2 Logic Solve/Program Execution The application program is executed using the status of the inputs. PHASE 3 Logic Solve/Program Execution Once the program is executed, the CPU performs diagnostics and communication tasks.
81

Basic PLC

PHASE 4 - Output Status Scan An output status scan is then performed, whereby the stored output values are sent to actuators and other field output devices. The cycle ends by updating the outputs.

82

Basic PLC

As soon as Phase 4 are completed, the entire cycle begins again with Phase 1 input scan. The time it takes to implement a scan cycle is called SCAN TIME. The scan time composed of the program scan time, which is the time required for solving the control program, and the I/O update time, or time required to read inputs and update outputs. The program scan time generally depends on the amount of memory taken by the control program, type of instructions used in the program and the clock frequency of the processor. The time to make a single scan can vary from 1 ms to 100 ms.
83

Basic PLC

PLC Communications
Common Uses of PLC Communications Ports
Changing resident PLC programs - uploading/downloading from a supervisory controller (Laptop or desktop computer).

Forcing I/O points and memory elements from a remote terminal.

Linking a PLC into a control hierarchy containing several sizes of PLC and computer.

Monitoring data and alarms, etc. via printers Interface Units (OIUs).

or Operator

84

Basic PLC

PLC Communications
Serial Communications
PLC communications facilities normally provides serial transmission of information. Common Standards RS 232 Used in short-distance computer communications, with the majority of computer hardware and peripherals. Has a maximum effective distance of approx. 30 m at 9600 baud.

85

Basic PLC

PLC Communications
Local Area Network (LAN)

Local Area Network provides a physical link between all devices plus providing overall data exchange management or protocol, ensuring that each device can talk to other machines and understand data received from them.
LANs provide the common, high-speed data communications bus which interconnects any or all devices within the local area. LANs are commonly used in business applications to allow several users to share costly software packages and peripheral equipment such as printers and hard disk storage.
86

Basic PLC

PLC Communications
RS 422 / RS 485
Used for longer-distance links, often between several PCs in a distributed system. RS 485 can have a maximum distance of about 1000 meters.

87

Basic PLC

PLC Communications
Programmable Controllers and Networks
Dedicated Network System of Different Manufacturers
Manufacturer Allen-Bradley Gould Modicon General Electric Mitsubishi Square D Texas Instruments Network Data Highway Modbus GE Net Factory LAN Melsec-NET SY/NET TIWAY

88

Basic PLC

Specifications
Several factors are used for evaluating the quality and performance of programmable controllers when selecting a unit for a particular application. These are listed below. NUMBER OF I /O PORTS

This specifies the number of I/O devices that can be connected to the controller. There should be sufficient I/O ports to meet present requirements with enough spares to provide for moderate future expansion.

89

Basic PLC

Specifications
OUTPUT-PORT POWER RATINGS

Each output port should be capable of supplying sufficient voltage and current to drive the output peripheral connected to it. SCAN TIME
This is the speed at which the controller executes the relayladder logic program. This variable is usually specified as the scan time per 1000 logic nodes and typically ranges from 1 to 200 milliseconds.
90

Basic PLC

Specifications
MEMORY CAPACITY The amount of memory required for a particular application is related to the length of the program and the complexity of the control system. Simple applications having just a few relays do not require significant amount of memory. Program length tend to expand after the system have been used for a while. It is advantageous to a acquire a controller that has more memory than is presently needed.

91

Basic PLC

Selecting a PLC
Criteria Number of logical inputs and outputs. Memory Number of special I/O modules Scan Time Communications Software

Basic PLC

A Detailed Design Process


1. Understand the process 2. Hardware/software selection 3. Develop ladder logic 4. Determine scan times and memory requirements

Basic PLC

PLC Status Indicators


Power On Run Mode

Programming Mode
Fault

Basic PLC

Troubleshooting
1. Look at the process 2. PLC status lights HALT - something has stopped the CPU RUN - the PLC thinks it is OK (and probably is) ERROR - a physical problem has occurred with the PLC 3. Indicator lights on I/O cards and sensors 4. Consult the manuals, or use software if available. 5. Use programming terminal / laptop.

Basic PLC

List of items required when working with PLCs: 1. Programming Terminal - laptop or desktop PC. 2. PLC Software. PLC manufacturers have their own specific software and license key. 3. Communication cable for connection from Laptop to PLC. 4. Backup copy of the ladder program (on diskette, CDROM, hard disk, flash memory). If none, upload it from the PLC. 5. Documentation- (PLC manual, Software manual, drawings, ladder program printout, and Seq. of Operations manual.)

Basic PLC

Examples of PLC Programming Software: 1. Allen-Bradley Rockwell Software RSLogix500 2. Modicon - Modsoft 3. Omron - Syswin 4. GE-Fanuc Series 6 LogicMaster6 5. Square D- PowerLogic 6. Texas Instruments Simatic 6. Telemecanique Modicon TSX Micro

Basic PLC

The five types of PLC Programming languages


CALC1 CALC IN1 OUT MAN_ON IN2 T2 >=1 PUMP DO V START STEP T1 STEP A N D STEP B T3 PUMP N D CALC1 ACTION D1 ACTION D2 ACTION D3 ACTION D4 D1_READY D2_READY D3_READY D4_READY

Function Block Diagram (FBD) graphical languages Sequential Flow Chart (SFC)
AUTO DI

V
ACT

Ladder Diagram (LD)


AUTO ACT

CALC
IN1 OUT

textual languages Structured Text (ST)


VAR CONSTANT X : REAL := 53.8 ; Z : REAL; END_VAR VAR aFB, bFB : FB_type; END_VAR bFB(A:=1, B:=OK); Z := X - INT_TO_REAL (bFB.OUT1); IF Z>57.0 THEN aFB(A:=0, B:=ERR); ELSE aFB(A:=1, B:=Z is OK); END_IF

IN2
MAN_ON

Instruction List (IL)


A: LD %IX1 (* PUSH BUTTON *) ANDN %MX5 (* NOT INHIBITED *) ST %QX2 (* FAN ON *)

Basic PLC

PLC Ladder diagram


The most widely used language for PLC programming. Rules for writing PLC Ladder 1. The vertical lines called as rails represents the power lines. Where the left rail represents positive lead and the right rail represents negative lead. 2. The horizontal lines are called as rungs and are labeled in numerical order from left to right and top to bottom. 3. The ladder is read like a book from left to right and from top to bottom. 4. Whenever possible the components are labeled in numerical order from left to right and from top to bottom. 5. The components are shown in their normal condition which means they are de-energized. 6. Contacts will have the same letter and number designation as the device that controls them. These control devices include relay coils, timers or motor starters. 7. A normally open contact closes when the device that controls it is energized. A normally closed contact opens when the devices that controls it is energized.
99

Basic PLC

Addressing
Each instruction written on the ladder diagram has to be given a specific addresses. One such simple scheme for addressing is given in the following table.

100

Basic PLC

Types of PLC ladder instructions


1) Relay logic instructions, 2) Timer and counter, 3) Program control instructions, 4) Arithmetic instructions, 5) Data manipulation instructions, 6) Data transfer instructions, and 7) Advanced instructions such as sequencer, subroutine, shift etc.

Basic PLC

Logic states
ON : TRUE, contact closure, energize, etc. OFF: FALSE, contact open , de-energize, etc. Do not confuse the internal relay and program with the external switch and relay. Internal symbols are used for programming. External devices provide actual interface.

Basic PLC

Relay logic Instructions


Relay logic instructions consists of two parts, the coil (output condition instruction) and the contacts ( input condition instruction). Contacts: a. Normally open b. Normally closed c. Off-on transitional d. On-off transitional Coil: a. Energize Coil b. De-energize c. Latch -( )-(/)-(L)-| |-|/|-||-| |-

01

08
()

d. Unlatch

-(U)-

Basic PLC

AND and OR Logic


PB1 PB2 R1 R1 = PB1.AND.PB2

AND
PB3 PB4 R2 R2 = PB2.AND.~PB4

PB1

R1 R1 = PB1 .OR. PB2

OR
PB2

Basic PLC

Combined AND & OR


R1 = PB1 .OR. (PB2 .AND. PB3)
PB1 R1

PB2

PB3

Basic PLC

NOT Operation
A
Rung C

In the rung above, it can be seen that if input A is be true (1), then the output C is true (0) or when A is (0), output C is 1.

106

Basic PLC

Timers
These are output condition instructions which are used to provide specific time delay. They also have their associated normally open and normally closed contacts which are used to control the outputs in other rungs. At the time of programming the user needs to select time base value and enter preset value. When the accumulated value = preset value timer times out and the contacts change their status.

107

Basic PLC

Counters
These are also output condition instructions and are used to count the no. of events. They also have associated normally open and normally closed contacts used to control the devices in other rungs. They also reset instruction associated with them used to reset the count accumulated by the counter.

108

Basic PLC

Programming Examples
1. Develop a ladder diagram for the elevator system shown in the figure. The objective is to move the platform up and down. The global objective is to move the platform up when the UP button is pressed and to move it down when the down button is pressed. The following hardware is associated with the system. OUTPUT ELEMENTS: M1: Motor for up movement M2: Motor for up movement INPUT ELEMENTS: LS1: NC Limit switch to indicate UP position LS2: NC Limit switch to indicate DOWN position START: NO push button for START STOP : NO push button for STOP UP : NO push button for UP Command DOWN: NO push button for DOWN Command
109

Basic PLC

Solution : Here first we will have to develop narrative statements to describe sequence of events 1. When the START button is pushed the platform is driven to down position. 2. When the STOP button is pushed the platform is halted at whatever position it occupies at that time. 3. When UP button is pushed the platform if not in the downward motion is driven UP. 4. When the DOWN button is pushed the platform if not in the upward motion is driven DOWN.

110

Basic PLC

The ladder logic program for this system is as follows.

111

Basic PLC

2. For the oven shown in the figure all the inputs and outputs are two state variables and the relation of the states and the variables is indicated. Construct Boolean equations that implements the following events and then construct the ladder diagram from that. 1. The heater will be on when the switch is activated ,the door is closed and the temperature is below the limit. 2. The fans will be turned on when the heater is on or when the temperature is above the limit and the door is closed. 3. The light will be turned on if the light switch is on or whenever the door is opened.

112

Basic PLC

The Boolean equation for the above description is given as follows from which we can construct the ladder diagram.

113

Basic PLC

3. A Bidirectional movable arm is as shown below. Develop a ladder diagram to control it as per the conditions mentioned. Conditions: Both start and stop switches are push buttons. When the system is turned ON the motor should rotate continuously alternating between the counter clockwise and clockwise directions as the movable arm touches two limit switches RLS and LLS.

Solution: Lets use the following addressing scheme for the system Inputs: Start switch I:0/11 Stop switch I:0/12 LLS I:0/13 RLS I:0/14
Outputs: CCW Rotation O:0/2 CW Rotation O:0/3 Based on the above addressing scheme the ladder diagram is as constructed below.

114

Basic PLC

115

Basic PLC

4. When the system of the following figure is turned ON the motor is to produce alternate rotation CW and then CCW, cycling as the shaft extension contacts the two limit switches RLS and LLS. All the four switches have only normally closed positions. Prepare a PLC Ladder program with the following requirements: 1. When the ON button is pushed the system motor moves the arm to the right limit switch position and waits 30 seconds. 2. The system then cycles 75 times between right and left limit switches and stops. 3. The OFF button stops the system at any time or after the 75 cycles have been made resets the system.

116

Basic PLC

117

Basic PLC

5.Prepare the programmable ladder diagram for the control problem shown in the following figure. The global objective is to heat a liquid to a specified temperature and keep it there for 30 minutes. The hardware has the following characteristics: 1. START push button is NO, STOP is NC. 2. NO and NC are available for the limit switches.

The event sequence is 1. Fill the tank. 2. Heat and stir the liquid for 30 minutes. 3. Empty the tank 4. Repeat from step 1.

118

Basic PLC

119

Você também pode gostar