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

Basics PLC

Embed Size (px)

DESCRIPTION

PLC's Basics

Citation preview

Page 1: Basics PLC

Basics of PLC Programming

EE 100 – Intro to EEFall 2004Dr. Stephen Williams, P.E.

Page 2: Basics PLC

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 PLC

VocabularyProgrammable Logic Controllers

Definite-purpose computers design to control industrial processes and machines

DrivesSolid-state devices designed to control

motorsSensors

Transducers used to obtain information

Page 4: Basics PLC

First Programmable ControllerGeneral Motors Corporation

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

Modular Digital Controller

Page 5: Basics PLC

Information Flow

Page 6: Basics PLC

Genesis of AutomationOperation sheets

May date back to the 1830sListing of:

All machining operationsThe machine tools employedTools, jigs, fixtures, and gauges

Organization and flow of work

Page 7: Basics PLC

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

Scientific managementHenry Ford

Page 8: Basics PLC

Purpose of Automation Increase productivity Standardize

components or processes

Free workers from repetitive, and sometime dangerous, tasks

Page 9: Basics PLC

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 PLC

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 PLC

Forces Driving AutomationLower costsFaster productionBetter quality controlHow have they remained relevant

today?

Page 12: Basics PLC

Engineering Resources Why do you need all

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

Page 13: Basics PLC

Breakthroughs and PlateausWhere have we seen breakthroughs,

and then plateaus of technology?MicroprocessorsGraphical User InterfacesPower ElectronicsSoftware Systems

Page 14: Basics PLC

Brief Review of TechnologyTraditional (ancient?) devices

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

Where are we going?

Page 15: Basics PLC

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

Hard to design and constructDifficult to maintain

Page 16: Basics PLC

Traditional DevicesRelaysContactorsMotor StartersManually operated switchesMechanically operated switchesElectrically operated switches

Page 17: Basics PLC

CR1

CR1-1

RelaysOriginal control elementsNow used as auxiliary devices

The PLC is not designed to switch high currents or voltages

Page 18: Basics PLC

ContactorsUsed for heavy-duty switchingProvides isolation from high voltages

and large currentsUsefully for large inductive currents,

such as motor starting

Page 19: Basics PLC

Motor StartersContactors + Overload RelayOverload relays were usually heaters

and bimetal stripsThe bimetal strip separates when heated

Next steps: PLCs and motor startersElectronic overloads Intelligent starters

Page 20: Basics PLC

Manually Operated SwitchesPushbuttons

Normally openNormally closedBreak-then-makeMake-then-break

Selector switchesMaintained or spring return

Page 21: Basics PLC

Mechanically Operated SwitchesLimit SwitchesTemperature SwitchesPressure SwitchesLevel Switches

Page 22: Basics PLC

Electrically Operated SwitchesPhotoelectric SwitchesProximity Switches

Page 23: Basics PLC

What's ahead?Solid state devices to replace motor

startersDistributed smart sensorsMicro- and nanomachinesAdaptive controlSmart maintenance

Page 24: Basics PLC

SummaryA very brief history of industrial

automationOverview of some of the older

technologiesSome thoughts on the future

Page 25: Basics PLC

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 PLC

Small Logic Controllers

Page 27: Basics PLC

Input and Output Input Modules

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

Output ModulesConvert PLC signal to “real world” output

24 V, 120 V, Analog, etc.

Limiting valuesPLC power supply

Page 28: Basics PLC

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 PLC

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 PLC

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 PLC

“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 PLC

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 PLC

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

24 V 120 VTTL 4 – 20 mA

Page 34: Basics PLC

Special I/O ModulesAnalogHigh speed counterThumb-wheelTTLEncoderPIDServo

Page 35: Basics PLC

Memory OrganizationNot the same on all manufactures

Allen Bradley uses two main typesMemory Maps

Data tableUser program Internal registers

Memory allocation could be fixed or variable

Page 36: Basics PLC

SLC Program File Structure

Subroutines3-255

Main Program2

Reserved1

System Functions0

UseProgram File Number

Page 37: Basics PLC

RSLogix 500 Screen Define controller

attributes Model Memory Communication

Program files Main program Subprograms

Page 38: Basics PLC

SLC Data File Structure

Bit Table3

Status Table2

Input Image Table1

Output Image Table0

UseData File Number

Page 39: Basics PLC

SLC Data File Structure

Integer Table7

Control Table6

Counter Table5

Timer Table4

UseData File Number

Page 40: Basics PLC

SLC Data File Structure

Any combination of Bit, Timer, Counter, Control, or Integer Tables

10-255

Network Table9

Reserved (Floating Point Value Table)

8

UseData File Number

Page 41: Basics PLC

RSLogix 500 Screen Access to

input and output tables

Access to timer and control control files

Page 42: Basics PLC

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 PLC

Multiword ElementsTimers, counters, and control elementsThree words used

Control word to store statusPreset word to store desired valueAccumulated word to store present valueControl file store a length and position

value (on functions other than counters and timers)

Page 44: Basics PLC

Counter Element Example

1240C5:0.ACCAccumulated Word

5000C5:0.PREPreset Word

C5:0/DNC5:0Control Word

ExampleAddressName

Page 45: Basics PLC

RSLogix 500 Screen Counter C5:0

Page 46: Basics PLC

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 PLC

Programming EnvironmentsLanguages available

Ladder logicBoolean Function chart

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

Page 48: Basics PLC

TransducersConverts energy from one form to

another Input transducers

Real world into the PLCOutput transducers

PLC to real world

Page 49: Basics PLC

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 PLC

Proximity SensorsDetect the presence of a object (target)

without physically touching the objectSolid-state devicesCompletely encapsulatedUsed when:

Detecting small objectsRapid response is required

Page 51: Basics PLC

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 PLC

Manually Operated SwitchesPushbuttons

Normally openNormally closedBreak-then-makeMake-then-break

Selector switchesMaintained or spring return

Page 53: Basics PLC

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 PLC

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 programMove a new value into C5:0.PRE

Page 55: Basics PLC

Control Bits

UAUNOVDNCDCU

101112131415

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

Page 56: Basics PLC

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 PLC

Cascading Example

Page 58: Basics PLC

Down CountersThe SLC 5/02 does not have a true

down counterThe 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 PLC

Down Counter Example

Page 60: Basics PLC

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 PLC

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 tableT4 is a file

Page 62: Basics PLC

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 PLC

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

device. In lab, the LED Display

Page 64: Basics PLC

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

register. In lab, the thumb-wheel inputs

Page 65: Basics PLC

Comparisons Greater than, less than, equals,

etc. When true, output is true

Page 66: Basics PLC

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!