basics of plc programming ee 100 – intro to ee fall 2004 dr. stephen williams, p.e

66
Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E.

Upload: carmella-cross

Post on 31-Dec-2015

226 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Basics of PLC Programming

EE 100 – Intro to EE

Fall 2004

Dr. Stephen Williams, P.E.

Page 2: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Overview How did we get where we are today?How does a project at GM in 1968

relate to the work of Henry Leland in the late 1800s?

Ford

DriveSensor

GMAutos

Bus

ABSLCPLC

Page 3: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

VocabularyProgrammable Logic Controllers

Definite-purpose computers design to control industrial processes and machines

Drives Solid-state devices designed to control

motorsSensors

Transducers used to obtain information

Page 4: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

First Programmable ControllerGeneral Motors Corporation

Hydromatic DivisionReplaced relay-controlled systemPDP-8 minicomputers?MODICON 084

Modular Digital Controller

Page 5: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Information Flow

Page 6: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Genesis of AutomationOperation sheets

May date back to the 1830sListing of:

All machining operations The machine tools employed Tools, jigs, fixtures, and gauges

Organization and flow of work

Page 7: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Industrial RevolutionHigh-volume production Interchangeable partsTransportation system Inexpensive energy (coal)Frederick W. Taylor

Scientific managementHenry Ford

Page 8: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Purpose of Automation Increase productivity Standardize

components or processes

Free workers from repetitive, and sometime dangerous, tasks

Page 9: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Early Automation Applications 1869 – Refineries in

Pennsylvania automatically covert crude oil to kerosene

1937 – Pictured is the loading and unloading of stators via an overhead conveyor for dipping in continuous process oven

Page 10: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

The Case Against Automation Las Vegas Sun, August 2, 1961

Jimmy Hoffa saw a new industrial revolution forming with automation being a threat to his giant union more menacing than the Justice Department, Attorney General Bobby Kennedy and the president himself.

He felt he could cope with the Senate committees, the FBI, and all the new legislation being written, which he thinks is aimed at unionism. It is with automation that all his talents, energy and ability must be directed.

Page 11: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Forces Driving AutomationLower costsFaster productionBetter quality controlHow have they remained relevant

today?

Page 12: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Engineering Resources Why do you need all

of these engineers running around to make all of this stuff work?

Page 13: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Breakthroughs and PlateausWhere have we seen breakthroughs,

and then plateaus of technology? Microprocessors Graphical User Interfaces Power Electronics Software Systems

Page 14: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Brief Review of TechnologyTraditional (ancient?) devices

Still used in many plants If it ain’t broke …

Where are we going?

Page 15: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Traditional Relay LogicUsed since …Control via a series of relay contactsOn and off inputsRace conditions on the outputsVery expensive

Hard to design and construct Difficult to maintain

Page 16: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Traditional DevicesRelaysContactorsMotor StartersManually operated switchesMechanically operated switchesElectrically operated switches

Page 17: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

CR1

CR1-1

RelaysOriginal control elementsNow used as auxiliary devices

The PLC is not designed to switch high currents or voltages

Page 18: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

ContactorsUsed for heavy-duty switchingProvides isolation from high voltages

and large currentsUsefully for large inductive currents,

such as motor starting

Page 19: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Motor StartersContactors + Overload RelayOverload relays were usually heaters

and bimetal strips The bimetal strip separates when heated

Next steps: PLCs and motor starters Electronic overloads Intelligent starters

Page 20: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Manually Operated SwitchesPushbuttons

Normally open Normally closed Break-then-make Make-then-break

Selector switches Maintained or spring return

Page 21: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Mechanically Operated SwitchesLimit SwitchesTemperature SwitchesPressure SwitchesLevel Switches

Page 22: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Electrically Operated SwitchesPhotoelectric SwitchesProximity Switches

Page 23: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

What's ahead?Solid state devices to replace motor

startersDistributed smart sensorsMicro- and nanomachinesAdaptive controlSmart maintenance

Page 24: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SummaryA very brief history of industrial

automationOverview of some of the older

technologiesSome thoughts on the future

Page 25: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

PLC Systems CPU

Processor Memory

One Module Power Supply

Part of the chassis or a separate module

Programming/ Monitoring Device

I/0 Modules

Page 26: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Small Logic Controllers

Page 27: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Input and Output Input Modules

Convert “real world” signal to PLC input 24 V, 120 V, Analog, etc.

Output Modules Convert PLC signal to “real world” output

24 V, 120 V, Analog, etc.

Limiting values PLC power supply

Page 28: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

ConfigurationsFixed I/O

Limited expandabilityRack

Many modules, with the possibility of chaining many racks together

SLC 500 is a fixed I/O deviceSLC 5/02 uses a rack configuration

Page 29: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Chassis Versus Rack One “Rack” is 128

inputs/outputs A chassis is the outer

shell of the PLC Chassis ≠ Rack SLC 5/02’s in S-340

have a ten-slot chassis Slots are numbered from

0 to 9

Page 30: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SLC Image TablesHex numberingAddressing

I1:2.0/01 I is for the file type 1 is the file number 2 is the element number .0 is the sub-element number (>16) /01 is the bit number

Page 31: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

“Real World” Address I1:3.0/01

I is the module type 1 is redundant 3 is the slot number .0 is for terminals above 15 /01 is the terminal number

Page 32: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Remote Racks I/O racks located close to the equipment

being monitored Simplifies wiring Communication modules

Similar to LAN Fiber Optic Coaxial cable

Page 33: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Discrete I/O ModulesEither “on” or “off”Bit orientedVarious ratings

24 V 120 V TTL 4 – 20 mA

Page 34: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Special I/O ModulesAnalogHigh speed counterThumb-wheelTTLEncoderPIDServo

Page 35: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Memory OrganizationNot the same on all manufactures

Allen Bradley uses two main typesMemory Maps

Data table User program Internal registers

Memory allocation could be fixed or variable

Page 36: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SLC Program File Structure

Program File Number

Use

0 System Functions

1 Reserved

2 Main Program

3-255 Subroutines

Page 37: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

RSLogix 500 Screen Define controller

attributes Model Memory Communication

Program files Main program Subprograms

Page 38: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SLC Data File Structure

Data File Number

Use

0 Output Image Table

1 Input Image Table

2 Status Table

3 Bit Table

Page 39: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SLC Data File Structure

Data File Number

Use

4 Timer Table

5 Counter Table

6 Control Table

7 Integer Table

Page 40: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SLC Data File Structure

Data File Number

Use

8 Reserved

(Floating Point Value Table)

9 Network Table

10-255 Any combination of Bit, Timer, Counter, Control, or Integer Tables

Page 41: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

RSLogix 500 Screen Access to

input and output tables

Access to timer and control control files

Page 42: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Address FormatWhat type of device or moduleWhere is it located physically or in

memory For example, T4:0/DN is the done bit for

timer 0 in file 4 I:2.0 is an input module in slot 2Word versus bit addresses

I:3.0 is a word, I:3.0/04 is a bit

Page 43: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Multiword ElementsTimers, counters, and control elementsThree words used

Control word to store status Preset word to store desired value Accumulated word to store present value Control file store a length and position

value (on functions other than counters and timers)

Page 44: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Counter Element Example

Name Address Example

Control Word C5:0 C5:0/DN

Preset Word C5:0.PRE 5000

Accumulated Word

C5:0.ACC 1240

Page 45: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

RSLogix 500 Screen Counter C5:0

Page 46: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Program Scan Each cycle through

the program and I/O process is called a scan

Scan times vary with the length of the program and the speed of the processor

Page 47: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Programming EnvironmentsLanguages available

Ladder logic Boolean Function chart

Ladder logic is the most commonFunction chart is the futureC, BASIC, etc., are also possible

Page 48: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

TransducersConverts energy from one form to

another Input transducers

Real world into the PLCOutput transducers

PLC to real world

Page 49: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

SensorsSensors are transducers used to

measure or detectConvert mechanical, magnetic, thermal,

or optical variations into electrical quantities

Sensor input is the basis for most of the decisions made in a large system

Page 50: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Proximity SensorsDetect the presence of a object (target)

without physically touching the objectSolid-state devicesCompletely encapsulatedUsed when:

Detecting small objects Rapid response is required

Page 51: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Inductive Proximity SensorsSenses a metallic objectA change in the magnetic field occurs

when a metallic object enters into rangeThis type of sensor can “see” through

cardboard boxes and other enclosuresCurrent-sourcing or current-sinking

output

Page 52: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Manually Operated SwitchesPushbuttons

Normally open Normally closed Break-then-make Make-then-break

Selector switches Maintained or spring return

Page 53: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Counter InstructionsCount Up or DownSimilar to timers, but without an internal

sourceTwo methods used: block and coil

SLC 5/02s use the coil formatPREset and ACCumlated valuesRESet similar to RTO

Page 54: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

How Counters Work Increment or decrement on a false to

true input transitionThey are retentive

The accumulated value remains when the rung goes false

PREset can be changed by the program Move a new value into C5:0.PRE

Page 55: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Control Bits

15 14 13 12 11 10

CU CD DN OV UN UA

CU = Count UpCD = Count DownDN = DoneOV = Overflow, UN = Underflow

Page 56: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Integer LimitsPREset and ACCumulator values must

be integers Integers on the SLC 5/02 range from

32,767 to -32,768Cascade counters to go beyond these

limits

Page 57: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Cascading Example

Page 58: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Down CountersThe SLC 5/02 does not have a true

down counter The counter does not start at a value and

become true when the ACCumulator is zero

The SLC 5/02 CTD works with another counter with the same address

Page 59: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Down Counter Example

Page 60: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Types of Data InstructionsMath Functions

Add, subtract, multiply, etc.Data Conversion and Comparison

Integer to BCD, Less than, Equal, etc.Logical Operations

Page 61: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Bits, Words, and FilesA bit is the smallest unit of information

T4:0/DN is a bitA “word” is another name for a register

T4:0.PRE is a wordA “file” is a block of words, also known

as a table T4 is a file

Page 62: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Data Transfer – Move The move instruction takes a

value from a register, or a constant value, and places it in another register

Page 63: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

BCD Move Into a Register Moves an integer value into a BCD

device. In lab, the LED Display

Page 64: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

BCD Move From a Register Moves an BCD value into an integer

register. In lab, the thumb-wheel inputs

Page 65: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Comparisons Greater than, less than, equals,

etc. When true, output is true

Page 66: Basics of PLC Programming EE 100 – Intro to EE Fall 2004 Dr. Stephen Williams, P.E

Today’s Task Use what you have

learned to “break the code”

Each bench has a PLC program

The first bench to turn on all five lamps wins!