programmable controller basics introduction

45
Dennis Wylie Senior Systems Application Engineer Programmable Controller Basics Introduction

Upload: auryon

Post on 09-Jan-2016

40 views

Category:

Documents


0 download

DESCRIPTION

Dennis Wylie Senior Systems Application Engineer. Programmable Controller Basics Introduction. So what is a P rogrammable L ogic C ontroller?. CR. A solid state device that controls output devices based on input signals and a user developed program. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Programmable Controller Basics Introduction

Dennis WylieSenior Systems Application Engineer

Programmable Controller Basics

Introduction

Page 2: Programmable Controller Basics Introduction

2

Programmable Controller

Inputs Outputs

CR

So what is a Programmable Logic Controller?

• A solid state device that controls output devices based on input signals and a user developed program.

• Originally developed to directly replace relays used for discrete control.

Page 3: Programmable Controller Basics Introduction

3

What are typical Input devices for PLC’s?

Type of Device• Pushbuttons

• Selector Switches

• Limit Switches

• Level Switches

• Photoelectric Sensors

• Proximity Sensors

• Motor Starter Contacts

• Relay Contacts

• Thumbwheel Switches

• Temperature Sensors

Device Ratings

• 120/240 VAC

• 24 VDC – Sourcing

– Sinking

• 24 VAC

• 4-20mA

• 0-10VDC

Page 4: Programmable Controller Basics Introduction

4

What are typical output devices for PLC’s?

Type of Device• Valves• Motor Starters• Solenoids• Control Relays• Alarms• Lights• Fans• Horns• Heaters

Device Ratings• Relays

– 240 VAC– 85-120 VAC/VDC– 24 VAC/VDC

• Triac– 120/230 VAC

• Transistor MOSFET– 24 VDC

• 4-20mA• 0-10VDC

Page 5: Programmable Controller Basics Introduction

5

General PLC Concept

• PLC performs relay equivalent functions

• PLC performs ON/OFF control• Ladder diagram program

representation• Designed for industrial

environment• Designed for ease of use and

maintenance

• Easy to program• Easy to maintain• Quick to install• Adaptable to change

Great low cost alternative to

multiple individual relays, timers

and counters as well as dedicated

single board controllers.

Page 6: Programmable Controller Basics Introduction

6

CR

IsolationBarrier

IsolationBarrier

MEMORY

program data

HighVoltage

HighVoltage

Low Voltage

AC Power Supply85-264 VAC,

50/60Hz

Output

Circuits

ExternalDC Power Supplyor

RS-232

Communications

Input

Circuits

CentralProcessor

(CPU)

What's really inside a PLC?

Page 7: Programmable Controller Basics Introduction

7

PLC’s Come in a Variety of Sizes...• Pico

– Typically less than 20 I/O

• Micro– Typically less than 32 I/O

• Small– Typically less than 128 I/O

• Medium– Typically less than 1024 I/O

• Large– Typically greater than 1024 I/O

Page 8: Programmable Controller Basics Introduction

8

Today's Applications require high Level Control Capability

• Arithmetic (Addition, Subtraction, Multiplication, Division, etc)

• Data Comparison (Equal, Greater Than or Equal, Less Than or Equal)

• Word Manipulation (Copy, Move, etc)

• Sequencing• Data Manipulation• Proportional, Integral, Derivative (PID) Control

Page 9: Programmable Controller Basics Introduction

9

So where could you use a PLC?

• Conveyor control• Printed circuit board handling equipment• SCADA(Supervisory Control And Data Acquisition)

– remote pump/lift station (water/wastewater)– Flow monitoring for leak detection (oil&gas)

• Strapping machinery / trash compactors• Palletizers• Compressor control• Replace hard-wired relay panels or SBCs• Many, many more

Page 10: Programmable Controller Basics Introduction

10

What to consider when applying a PLC• Inputs/Outputs

– Type, • AC, DC, Analog, Thermocouple

sourcing, sinking, etc.

– Number of Inputs/Outputs including embedded, local expansion, and networked I/O

• 10, 16, 20, 32, 138, 156, >256

• Memory– Size

• 1k, 6k, 8k 12k, 14k,

• Functions required– PID– PTO/PWM (Pulse Train Output/Pulse Width Modulated)– Data Logging– Messaging between PLC’s– Math Calculations

• Communications Networks• DeviceNet, Ethernet• DF1 Full Duplex, DF1 Half Duplex, DF1

Radio Modem, DH485, ModBus Master / Slave

Page 11: Programmable Controller Basics Introduction

Programmable Controller Basics

PLC Program Files

Page 12: Programmable Controller Basics Introduction

12

Memory Organization

MicroLogixMEMORY

PROGRAMFILES 0

12

34

56 - 15

System

ReservedM

ain P

rog

ramE

rror F

ileH

SC

File

ST

I File

Su

bro

utin

eF

iles

DATAFILES 0

12

34

56

7

Ou

tpu

t File

Inp

ut F

ileS

tatus F

ileB

it File

Tim

er File

Co

un

ter File

Co

ntro

l File

Integ

er Files

Page 13: Programmable Controller Basics Introduction

13

PROGRAM FILES

PROGRAMFILES

0

1

2

34

5

6 - 15

Sys

temR

eservedM

ain P

rog

ramE

rror F

ileH

SC

File

ST

I File

Su

bro

utin

eF

iles

MicroLogixMEMORY

There are several different program files inside of a PLC.

Lets talk about the main one we will use today.

Page 14: Programmable Controller Basics Introduction

14

File #2 = Main Program

Dedicated & Open file• Main Ladder Program

– Most important file– Typically is where the “main” user program resides– Must have some program logic– Where jump to subroutines originate

Page 15: Programmable Controller Basics Introduction

Programmable Controller Basics

PLC data types

Page 16: Programmable Controller Basics Introduction

16

Data definitions and data types

PLC Data Types• Bit

– B3 file of PLC

• Integer (signed) -32768 to 32767– N7 file of PLC

• Floating Point– F8 file of PLC

• ASCII– String data “My Text String”

Remember :

Bits 1 or 0

Words(16 bits) 2 bytes

Page 17: Programmable Controller Basics Introduction

Programmable Controller Basics

Addressing the PLC instructions to real devices

Page 18: Programmable Controller Basics Introduction

18

O0:0/0

File Type

File Number

Output NumberWhere the Output

Was connected to the PLC0

Outputs

11 0

0 0 0 0 0 0 0 0 0 0 0 0Word 0

15 0

Word 0

I1:0/0File Type

File Number

Input NumberWhere the Input

Was connected to the PLC

1Inputs

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

File #0

File #1

Addressing Inputs and Outputs

Page 19: Programmable Controller Basics Introduction

19

B/16

OR

B3:1/0

0000 0000 0000 000015 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Word 0:

Word 1: 0000 0000 0000 000015 14 13 12 11 10 9 8 7 6 5 4 3 2 1 031 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

File #3 = Bit File

Bits in a PLC can be used to turn on a real device, or bits can be used as “storage”. They may just indicate when a condition exists within your program that you want to use in another part of your logic.

For example, if the fact that a push button is pressed is important to the logic of your program, but additional conditions also need to be present for an real output to turn on, you may wish to store the state of the push button as a bit.

Page 20: Programmable Controller Basics Introduction

20

| |I:0.0

0

Timers

• Timer OperationThe timer times as long as its rung conditions are TRUE.

When the timer times up to a specified value, it alerts the rest of the program by setting a bit. When the rung becomes FALSE, the timer stops timing and resets itself to zero.

Page 21: Programmable Controller Basics Introduction

21

T4:0

File Type

File Number

Timer Number

4Timers

File #4 = Timers• File #4

– TON, TOF, and RTO• Timer On Delay (Turn On when the timer reaches preset value)• Timer Off Delay (Turn Off when the timer reaches preset value)• Retentive Timer On (Even after rung conditions are false this timer remembers where it left off.)

– .01 and 1 second time base

Page 22: Programmable Controller Basics Introduction

22

Preset T4:0.PRE How long the timer should time for.

Accumulated T4:0.ACC How long the timer has timed for already.

Done T4:0/DN Set to “1” when accumulated value > preset value.

Timer Timing T4:0/TT Set to “1” when accumulated value < preset value.

Enable T4:0/EN Set to “1” when the rung containing the timer is true.

T4:0

File Type

File Number

Timer Number

4Timers

Preset Value

Accumulated Value

15 14 13

EN TT DNWord 0

Word 1

Word 2

Addressing Timers

Page 23: Programmable Controller Basics Introduction

23

| |I:0.0

0

Counters

• Counter Operation– The counter counts (by one) every time its rung goes

from FALSE to TRUE. When a specified number of counts has been reached, the counter alerts the rest of the program by setting a bit. The program must reset the counter to start counting from zero again.

Page 24: Programmable Controller Basics Introduction

24

C5:0

File Type

File Number

Counter Number

5Counters

File #5 = Counters

• Up, Down, and Up/Down Counters

Page 25: Programmable Controller Basics Introduction

25

Preset C5:0.PRE How many the counter should count up to

Accumulated C5:0.ACC How many the counter has counted already.

Done C5:0/DN Set to “1” when accumulated value > preset value.

Count Up C5:0/CU Set to “1” when state of CTU rung are true.

Count Down C5:0/CD Set to “1” when state of CTD rung are true.

Over/Underflow C5:0/OV,UN Set to “1” when counter counts past 32,767 or -32,768.

C5:0

File Type

File Number

Counter Number

5Counters

Preset Value

Accumulated Value

15 14 13

CU CD DN OV UN

12 11

Word 0

Word 1

Word 2

Addressing Counters

Page 26: Programmable Controller Basics Introduction

Programmable Controller Basics

So what is ladder logic and how do I connect devices and write a

program?

Page 27: Programmable Controller Basics Introduction

27

• What is Relay Ladder Logic?– Is the primary programming language for PLCs– A graphical representation of the program designed to look

like relay logic– Called ladder logic because it resembles the rungs of a

step ladder you might have at home.

Relay Ladder Logic (RLL)

Page 28: Programmable Controller Basics Introduction

28

Conversion Example Relay Diagram to Ladder Logic

L1 L2

PB1 LS1 PS2 SOL6

DEVICE NAMEPB1

LS1

PS2

SOL6

| | ( )| | | |I/5 I/6 O/0I/7

PLC ADDRESSI:0/5

I:0/6

I:0/7

O:0/0

Relay Diagram Ladder Logic

Page 29: Programmable Controller Basics Introduction

29

Addressing Input Instructions

Unused I / 2I / 1I / 0COM I / 3 I / 6I / 5COMI / 4 I / 7 I / 9I / 8

Supply

Voltage

Unused

LS 1

False

True

Examine OFF

-|/|-XIO

False

The instruction is:The input

bit is

Logic 0

Logic 1 True

Examine ON

-| |-XIC

If the input

device is

Open (0)

Closed (1)

These are not normally open (N.O.) and normally closed (N.C.)

XIC = Examine When Closed, ON or when voltage is present

XIO = Examine When Open, OFF or when voltage is not present

Page 30: Programmable Controller Basics Introduction

30

GNDL 1 O / 0VACVDC

L 2 / N VACVDC

VACVDC

O / 2VACVDC

O / 1 O / 3 O / 5O / 4VACVDC

SupplyVoltage

Addressing Output Instructions

RungState

OutputBit

OutputTerminal

De-energized

TRUE

FALSE

ON

OFF

OTEOutput Energize

-( )-

| | |/| ( )

T T T

ENERGIZED

Page 31: Programmable Controller Basics Introduction

31

Ladder Logic Concepts

Read / Conditional Instructions

Write / Control Instructions

No Logical Continuity

|/| | |

T F F

( )

( )|/| | |

T T T

Logical Continuity

Page 32: Programmable Controller Basics Introduction

32

Logical AND example

IF input 4 AND input 5 have power THEN energize output 0

| |I/4

| |

I/5

( )O/0

Logical Continuity

T T T

On

Page 33: Programmable Controller Basics Introduction

33

Logical OR example

IF input 4 OR input 5 have power THEN energize output 0

| |I/4

| |I/5

( )O/0

Logical Continuity

F

T

On

T

| |I/4

| |I/5

( )O/0

Logical ContinuityF

On

Page 34: Programmable Controller Basics Introduction

34

TIMER ON DELAYTimer T4:0Time Base 1.0Preset 10Accum 0

TON

Stop Start Motor

]/[ ] [

] [

( )I:0/0I:0/1

M1O:0/3

O:0/3

] [

M1O:0/3

]/[T4:0/DN

(EN)

(DN)

Timer Done

Example Timer Program

• The Timer’s “done bit” turns the motor off after a 10 second time delay

Page 35: Programmable Controller Basics Introduction

35

Count UpCounter C5:0Preset 10Accum 0

CTU

Stop Motor

]/[

] [

( )

Start

] [I:0/0I:0/1

M1O:0/3

O:0/3

] [

M1O:0/3

]/[C5:0/DN

(CU)

(DN)

Counter Done

Reset

] [I:0/4

(RES)C5:0

Example Counter Program

• The Counters “done bit” stops the motor from running, after 10 operations.

Page 36: Programmable Controller Basics Introduction

Programmable Controller Basics

Understanding the PLC operating cycle and examining a

real application.

Page 37: Programmable Controller Basics Introduction

37

Input Scan

Program ScanOutput Scan

Housekeeping

START

Each ladder rung is scanned using the data in the Input file. The resulting status (Logic being solved) is written to the Output file (“Output Image”).

The status of external inputs (terminal block voltage) is written to the Input image (“Input file”).

The Output Image data is transferred to the external output circuits, turning the output devices ON or OFF.

Internal checks on memory, speed and operation. Service any communication requests, etc.

Understanding the PLC Operating Cycle

Page 38: Programmable Controller Basics Introduction

38

Motor

Ingredient ASolenoid Valve 1

Ingredient BSolenoid Valve 2

DrainSolenoid Valve 3

Sensor 2

Ingredient B

Typical PLC application

Start/ Stop Switch

Ingredient A

Sensor 1

Page 39: Programmable Controller Basics Introduction

39

Motor Solenoid Valve 1 Solenoid Valve 2

Solenoid Valve 3

Sensor 1

Sensor 2

Ingredient A

Ingredient B

Sequence of Operation of the MixerSolenoid Valve 1

On = Sol 3 is off, and Motor is off, and Sensor 2 is off, and Start

Switch is on

Off = Sol 3 is on, or Motor is on, or Sensor 2 is on

Solenoid Valve 2

On = Sol 3 is off, and Motor is off, and Sensor 2 is on

Off = Sol 3 is on, or Motor is on, or Sensor 1 is on

Automatic / Manual Switch

Step One:

I need to add some ingredient A to the mixer, but I only want to do that when the mixer is empty, the drain is closed,

and the motor is not running. Stop when I fill to Sensor 2 level.

Step Two:

I then need to add some ingredient B to the mixer, but I only want to do that after I’ve added enough ingredient A, the drain is closed, and the motor is

not running. Stop when filled to Sensor 1 level.

Page 40: Programmable Controller Basics Introduction

40

Motor Solenoid Valve 1 Solenoid Valve 2

Solenoid Valve 3

Sensor 1

Sensor 2

Ingredient A

Ingredient B

Sequence of Operation of the MixerStep 3

Once I have added my ingredients, I need to mix them for 30 seconds, then I need to drain them from the

vessel. I can close the drain after a minute of draining.

Automatic / Manual Switch

Solenoid Valve 3On = Sol 1 is off, and Sol 2 is off, and Motor

has run for 30 sec.

Off = Solenoid 3 has been on for 60 sec, Sol 1 is on, Sol 2 is on, motor is running.

MotorOn = Sensor 1 is on, Sensor 2 is on and

Sol 1 is off, Sol 2 is off, Sol 3 is off

Off = Sol 3 on, Sol 1 is on, Sol 2 is on

Page 41: Programmable Controller Basics Introduction

So what are a few of the

‘Killer’ applications that have been done with

MicroLogix controllers?

Page 42: Programmable Controller Basics Introduction

42

• Customer: Tait Towers – World renowned stage design

• Concerts– Rolling Stones / U2– Brooks & Dunn / Reba McEntire

• Broadway– Phantom of the Opera– Miss Saigon

• Television– MTV Video Music Awards– VH-1 Fashion Awards

• Requirement: Solution to operate trendy “theater-in-the-round” set design with dramatic effects, flexibility of stage height, plus trouble-shooting capabilities so the show can go on!

• MicroSolution: 17 MicroLogix 1000s and 1 SLC 500 control and coordinate: (Other products include: limit switches, motors, operator interface, contactors)

– Motor driven raising/lowering of 2 band risers with variable height options– Rolling center deck to join both band pits– Fiery light show with 60 ft. tall “volcano” and drape

Boot Scootin’

Page 43: Programmable Controller Basics Introduction

43

Monster Truckin’• Customer: Dan Patrick

– Designer and driver of monster trucks• Sampson

• Requirement: Cost effective solution that provides accident-proofed muscle truck able to operate at max speed for most of race, and not require race-day repairs.

• MicroSolution: 1 MicroLogix 1000 and Hand-Held Programmer:

– Replaced relays– Controls shifting mechanism

• Race 5-6 seconds long• 1.5 seconds to shift from 1st to 4th gear with 100 shifts per night

– Keeps rpms steady by eliminating possibility of over-revving the motor– $300 control solution protects $55,000 investment in transmission and motor– Hand-Held Programmer trace key reduces troubleshooting time

Page 44: Programmable Controller Basics Introduction

44

“Operation MicroLogix”Customer: United States ArmyRequirement: Real-Time control of multiple targets on full scale 30

acre urban assault training site.

MicroSolution:

330+ MicroLogix 1500 controllers and 1761-NET-ENI’s. – Pop-Up targets and count successful hits.– Communicate using Ethernet and Fiber Optic cables to all

MicroLogix controllers.– Interface to advanced human interface software for control.

Page 45: Programmable Controller Basics Introduction

Questions?