plc training powerpoint

35
PLCs and Ladder Logic An Introduction By Thomas Smith 3/20/14 Basic PLC 1

Upload: thomas-smith

Post on 29-Dec-2015

114 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Plc Training Powerpoint

1

PLCs and Ladder Logic

An IntroductionBy Thomas Smith

3/20/14 Basic PLC

Page 2: Plc Training Powerpoint

2

• This is a basic introduction on how to create an automation program for a ControlLogix or CompactLogix processor using the RSLogix 5000 programming environment from Rockwell Automation.

• Also this is to teach the fundamentals and basics of PLC’s in general.

• This presentation explains how to write the automation program including the ladder logic for a garage door opener. I chose a door opener because it’s quite simple, and it’s something that everyone is familiar with.

3/20/14 Basic PLC

Page 3: Plc Training Powerpoint

3

What will be covered

• PLC history• Ladder logic basics• From electrical drawing to ladder logic• Creating a new project• Adding I/O cards• Program structure / Building a program• Create fault logic

3/20/14 Basic PLC

Page 4: Plc Training Powerpoint

4History of a PLC

Historical Background

• The Hydramatic Division of the General Motors Corporation specified the design criteria for the first programmable controller in 1968

• What was their primary goal?

• To eliminate the high costs associated with inflexible, relay-controlled systems.

3/20/14 Basic PLC

Page 5: Plc Training Powerpoint

5

• 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.

3/20/14 Basic PLC

Page 6: Plc Training Powerpoint

6

Major Components of a Common PLC

3/20/14 Basic PLC

PROCESSOR

POWERSUPPLY

I MN O P D U UT L E

O M U OT DP UU LT E

PROGRAMMING DEVICE

From SENSORS

Pushbuttons,contacts,

limit switches,etc.

ToOUTPUT

Solenoids, contactors,

alarmsetc.

Page 7: Plc Training Powerpoint

7

3/20/14 Basic PLC

PLC OperationBasic 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.

Page 8: Plc Training Powerpoint

Basic PLC 8

3/20/14

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

PHASE 2Program

Execution

PHASE 3Diagnostics/

Communication

PHASE 4Update Outputs

PHASE 1Read Inputs

Page 9: Plc Training Powerpoint

9

• Ladder logic is the main programming method used for PLCs. Ladder logic has been developed to mimic relay logic. By selecting ladder logic as the main programming method, the amount of retraining needed for engineers and trades people was greatly reduced.

• Modern control systems still include relays, but these are rarely used for logic. A relay is a simple device that uses a magnetic field to control a switch.

2/20/14 Basic PLC

Page 10: Plc Training Powerpoint

103/20/14 Basic PLC

A PLC Illustrated With Relays

Page 11: Plc Training Powerpoint

11

Discrete InputA discrete input also referred as digital input is an input that is either ON or OFF and is connected to the PLC’s digital input. In the ON condition it is referred to as logic 1 or a logic high and in the OFF condition it is referred to as logic o or logic low.

3/20/14 Basic PLC

Normally Open Pushbutton

Normally Closed Pushbutton

Normally Open switch

Normally Closed switch

Normally Open contact

Normally closed contact

Page 12: Plc Training Powerpoint

12

Analog Input• An analog input is an input signal that has a continuous signal.

Typical inputs are eather 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.

3/20/14 Basic PLC

INPUT

PLCAnalogInputModule

Tank

Level Transmitter

Page 13: Plc Training Powerpoint

13

3/20/14 Basic PLC

PROGRAMMING INPUTS

Normally Open(NO)

Normally Closed(NC)

Power flows through these contacts when they are closed. The normally open (NO) is true when the input or output status bit controlling the contact is 1 or on. The normally closed (NC) is true when the input or output status bit controlling the contact is 0 or off.

Page 14: Plc Training Powerpoint

14

3/20/14 Basic PLC

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.

Digital Output

OUT

PLC

Digital OutputModule

Lamp

Page 15: Plc Training Powerpoint

15

3/20/14 Basic PLC

An analog output is an output signal that has a continuous signal. Typical outputs are 4 to 20mA or 0 to10V.

Analog Output

OUT

PLC

AnalogOutputModule

EP

Pneumatic control valve

Supply air

Electric to pneumatic transducer

0 to 10V

Page 16: Plc Training Powerpoint

16

3/20/14 Basic PLC

Outputs or Coils

Coils represent relays that are energized when power flows to them. When a coil is energized it causes a corresponding output to turn on by changing the state of the status bit controlling the output to a logic 1. That same output status bit maybe used to control normally open or normally closed contact anywhere in the program.

Page 17: Plc Training Powerpoint

17

3/20/14 Basic PLC

Each rung or network on a ladder program representsa logic operation. In the rung above, both inputs A and Bmust be true (1) in order for the output C to be true (1).

RungA B C

Page 18: Plc Training Powerpoint

183/20/14 Basic PLC

A Relay logic Seal-in Circuit

Page 19: Plc Training Powerpoint

193/20/14 Basic PLC

A Simple Relay Logic Diagram

Page 20: Plc Training Powerpoint

203/20/14 Basic PLC

Page 21: Plc Training Powerpoint

213/20/14 Basic PLC

Output Connections

Page 22: Plc Training Powerpoint

3/20/14 Basic PLC

L1 L2

P. B SWITCH

INPUT MODULE

WIRING DIAGRAM

Allen BradleyLADDER PROGRAM

I:2

0

I= Input

Moduleslot # in rack

ModuleTerminal #

Address I:2.0/0

Last digitIs the Bit #

Page 23: Plc Training Powerpoint

3/20/14 Basic PLC

N.O

C

L2 L1

L1 L2

OUTPUT MODULEWIRING

CONTACTOR

O:4

0CONTACTOR

LADDER PROGRAM

L1 L2

MOTOR

• SOLENOID

• VALVES• LAMP• BUZZER

O:4.0/0

Page 24: Plc Training Powerpoint

24Allen-Bradley Abbreviations

• Circuit elements– “I” Input contact closures– “Q” Output contact closures (drives coil)– “T” Timer device– “C” Counter device– “M” Auxillary relay (or internal relay bits)– “H” Time of day– “A” Analog input– “D” Display on screen– “R”,”S” Expansion devices

3/20/14 Basic PLC

Page 25: Plc Training Powerpoint

25

3/20/14 Basic PLC

Boxes

Boxes represent various instructions or functions that areExecuted when power flows to the box. Some of these Functions are timers, counters and math operations.

Other instructions

Page 26: Plc Training Powerpoint

26

• I have a 700 page PDF file with all the RSLogix 5000 special function blocks. I am not going to go through them all. I am going to touch base on just a couple. This PDF can also be found on the Rockwell Automation website.

http://www.rockwellautomation.com/literature/

3/20/14 Basic PLC

Page 27: Plc Training Powerpoint

27Timers and Counters

• The special instructions I am going to discuss are timers and counters.

• Timers and counters control operations based on time or the number of events.

• The time base for all timers is 1 ms.

• Counters count the number of events.

3/20/14 Basic PLC

Page 28: Plc Training Powerpoint

28

If you want to Use this instruction

Time how long a timer is enabled TON (delay on timer)

Time how long a timer is disabled TOF (delay off timer)

Accumulate time RTO (Retentive Timer On)

Time how long a timer is enabled with built-in reset in a function block

TONR (Timer On Delay with Reset)

Time how long a timer is disabled with built-in reset in a function block

TOFR (Timer Off Delay with Reset)

Accumulate time with built-in reset in function block

RTOR (Retentive Timer On with reset)

Count up CTU (count up counter)

Count down CTD (count down counter)

Count up and count down in function block

CTUD (count up/down counter)

Reset a timer or counter RES (reset)

3/20/14 Basic PLC

Page 29: Plc Training Powerpoint

29Timer On Delay

• The Timer On Delay or TON• The TON instruction is a non-retentive timer

that accumulates time when the instruction is enabled (rung-condition-in is true).

• Timer – Tag or name• Preset – how long to delay (accumulated time)• Accum -- Total milliseconds the timer has

counted Initial value is typically 0

3/20/14 Basic PLC

Page 30: Plc Training Powerpoint

30Timer On Delay3/20/14 Basic PLC

EN – indicates that the TON bit is enabled• DN – the done bit is set when the ACCUM is

bigger then the PRESET value• The TON instruction accumulates time until the

following occurs:

• The TON instruction is disabled

• The ACCUM ≥ PRESET• The time base is always 1 ms. For example, for

a two-second timer, enter 2000 for the PRESET value.

Page 31: Plc Training Powerpoint

31Timer Off Delay

• The Timer Off Delay or TOF• The TOF instruction is a non-retentive timer

that accumulates time when the instruction is disabled (rung-condition-in is false).

• Timer – Tag or name• Preset – how long to delay (accumulated time)• Accum -- Total milliseconds the timer has

counted Initial value is typically 0

3/20/14 Basic PLC

Page 32: Plc Training Powerpoint

32Timer Off Delay

EN – indicates that the TOF bit is enabled• DN – the done bit is set when the ACCUM is

bigger then the PRESET value• The TOF instruction accumulates time until the

following occurs:

• The TOF instruction is enabled

• The ACCUM ≥ PRESET• The time base is always 1 ms. For example, for

a two-second timer, enter 2000 for the PRESET value.

3/20/14 Basic PLC

Page 33: Plc Training Powerpoint

33Count Up

• The Count Up or CTU• The CTU instruction counts upward.

• Counter – Tag or name• Preset – how high to count• Accum – The number of times the counter has

counted Initial value is typically 0

3/20/14 Basic PLC

Page 34: Plc Training Powerpoint

34Count Up

• CU indicates the CTU instruction is enabled• DN indicates the done bit is set and the

ACCUM is greater than or equal to the PRESET

• When enabled and the CU bit is set, the CTU instruction increments the counter by one.

• And when disabled, the CU bit is cleared, the CTU instruction retains its ACCUM value.

• The accumulated value continues incrementing, even after the DN bit is set. To clear the accumulated value, use a RES instruction that references this counter.

4/24/05 BAE 3023

Page 35: Plc Training Powerpoint

35Count Down

• The Count Down or CTD• Same as the count up counter but it counts

down from a preset value

4/24/05 BAE 3023