Basics PLC

Preview:

DESCRIPTION

PLC's Basics

Citation preview

Basics of PLC Programming

EE 100 – Intro to EEFall 2004Dr. 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

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

First Programmable ControllerGeneral Motors Corporation

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

Modular Digital Controller

Information Flow

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

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

Scientific managementHenry Ford

Purpose of Automation Increase productivity Standardize

components or processes

Free workers from repetitive, and sometime dangerous, tasks

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

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.

Forces Driving AutomationLower costsFaster productionBetter quality controlHow have they remained relevant

today?

Engineering Resources Why do you need all

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

Breakthroughs and PlateausWhere have we seen breakthroughs,

and then plateaus of technology?MicroprocessorsGraphical User InterfacesPower ElectronicsSoftware Systems

Brief Review of TechnologyTraditional (ancient?) devices

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

Where are we going?

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

Traditional DevicesRelaysContactorsMotor StartersManually operated switchesMechanically operated switchesElectrically operated switches

CR1

CR1-1

RelaysOriginal control elementsNow used as auxiliary devices

The PLC is not designed to switch high currents or voltages

ContactorsUsed for heavy-duty switchingProvides isolation from high voltages

and large currentsUsefully for large inductive currents,

such as motor starting

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

Manually Operated SwitchesPushbuttons

Normally openNormally closedBreak-then-makeMake-then-break

Selector switchesMaintained or spring return

Mechanically Operated SwitchesLimit SwitchesTemperature SwitchesPressure SwitchesLevel Switches

Electrically Operated SwitchesPhotoelectric SwitchesProximity Switches

What's ahead?Solid state devices to replace motor

startersDistributed smart sensorsMicro- and nanomachinesAdaptive controlSmart maintenance

SummaryA very brief history of industrial

automationOverview of some of the older

technologiesSome thoughts on the future

PLC Systems CPU

Processor Memory

One Module Power Supply

Part of the chassis or a separate module

Programming/ Monitoring Device

I/0 Modules

Small Logic Controllers

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

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

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

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

“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

Remote Racks I/O racks located close to the equipment

being monitored Simplifies wiring Communication modules

Similar to LAN Fiber Optic Coaxial cable

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

24 V 120 VTTL 4 – 20 mA

Special I/O ModulesAnalogHigh speed counterThumb-wheelTTLEncoderPIDServo

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

SLC Program File Structure

Subroutines3-255

Main Program2

Reserved1

System Functions0

UseProgram File Number

RSLogix 500 Screen Define controller

attributes Model Memory Communication

Program files Main program Subprograms

SLC Data File Structure

Bit Table3

Status Table2

Input Image Table1

Output Image Table0

UseData File Number

SLC Data File Structure

Integer Table7

Control Table6

Counter Table5

Timer Table4

UseData File Number

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

RSLogix 500 Screen Access to

input and output tables

Access to timer and control control files

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

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)

Counter Element Example

1240C5:0.ACCAccumulated Word

5000C5:0.PREPreset Word

C5:0/DNC5:0Control Word

ExampleAddressName

RSLogix 500 Screen Counter C5:0

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

Programming EnvironmentsLanguages available

Ladder logicBoolean Function chart

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

TransducersConverts energy from one form to

another Input transducers

Real world into the PLCOutput transducers

PLC to real world

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

Proximity SensorsDetect the presence of a object (target)

without physically touching the objectSolid-state devicesCompletely encapsulatedUsed when:

Detecting small objectsRapid response is required

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

Manually Operated SwitchesPushbuttons

Normally openNormally closedBreak-then-makeMake-then-break

Selector switchesMaintained or spring return

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

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

Control Bits

UAUNOVDNCDCU

101112131415

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

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

Cascading Example

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

Down Counter Example

Types of Data InstructionsMath Functions

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

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

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

Data Transfer – Move The move instruction takes a

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

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

device. In lab, the LED Display

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

register. In lab, the thumb-wheel inputs

Comparisons Greater than, less than, equals,

etc. When true, output is true

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!

Recommended