Programmable Logic Controllers (PLCs)

Programmable Logic Controllers (PLCs)

1

Programmable Logic

Controllers (PLCs)

An Overview

Photo courtesy Rockwell Automation, Inc.

Chapter Objectives

After completing this chapter, you will be able to:

1.1

Defi ne what a programmable logic controller (PLC) is and list its advantages over relay systems

1.2

Identify the main parts of a PLC and describe their functions

1.3

Outline the basic sequence of operation for a PLC

1.4

Identify the general classifi cations of PLCs

This chapter gives a brief history of the evolution of the programmable logic controller, or PLC.

The reasons for changing from relay control systems to PLCs are discussed. You will learn the basic parts of a PLC, how a PLC is used to control a process, and the different kinds of PLCs and their applications. The ladder logic language, which was developed to simplify the task of programming PLCs, is introduced.

Each chapter begins with a brief introduction outlining chapter coverage and learning objectives.

1

pet10882_ch01_001-016.indd 1 10/06/10 10:09 AM

Figure 2-49

Human Machine Interfaces (HMIs).

Source: Photo courtesy Omron Industrial Automation,

www.ia.omron.com. time. Through personal computer–based setup software, you can confi gure display screens to:

• Replace hardwired pushbuttons and pilot lights with realistic-looking icons. The machine operator

Figure 2-50

Allen-Bradley Pico GFX-70 controller.

Source: Photo courtesy Rockwell Automation, Inc. pushbuttons.

• Show operations in graphic format for easier viewing.

• Allow the operator to change timer and counter presets by touching the numeric keypad graphic on the touch screen.

• Show alarms, complete with time of occurrence and location.

• Display variables as they change over time.

The Allen-Bradley Pico GFX-70 controller, shown in

Figure 2-50 , serves as a controller with HMI capabilities.

This device consists of three modular parts: an HMI,

processor/power supply, and I/O modules.

The display/keypad can be used as an operator interface or can be linked to control operations to provide realtime feedback. It has the ability to show text, date and time, as well as custom messages and bitmap graphics, allowing operators to acknowledge fault messages, enter values, and initiate actions. Users can create both the control program and HMI functionality using a personal computer with PicoSoft Pro software installed or the controller’s on-board display buttons. pet10882_ch02_017-042.indd 39

PLC Hardware Components

Chapter 2

39

14/06/10 1:32 PM

Output module

0

Word corresponding to output module

1

Output image

OFF

ON

L2

Data table files

Figure 5-5

Connections of pilot lights to the output image table fi le through the output module. connection of two pilot lights to the output image table fi le through the output module. Its operation can be summarized as follows.

• The status of each light (ON/OFF) is controlled by the user program and is indicated by the presence of

1 (ON) and 0 (OFF).

L1

L2

Discrete Inputs

L2

• Each connected output has a bit in the output image table fi le that corresponds exactly to the terminal to which the output is connected.

• If the program calls for a specifi c output to be ON, its corresponding bit in the table is set to 1.

• If the program calls for the output to be OFF, its corresponding bit in the table is set to 0.

• The processor continually activates or deactivates the output status according to the output table fi le status.

Typically, micro PLCs have a fi xed number of inputs and outputs. Figure 5-6 shows the MicroLogic controller from the Allen-Bradley MicroLogic 1000 family of controllers. The controller has 20 discrete inputs with predefi ned addresses I/0 through I/19 and 12 discrete outputs with predefi ned addresses O/1 through O/11.

Some units also contain analog inputs and outputs embedded into the base unit or available through add-on modules.

5.2

Program Scan

When a PLC executes a program, it must know—in real time—when external devices controlling a process are changing. During each operating cycle, the processor reads all the inputs, takes these values, and energizes or de-energizes the outputs according to the user program.

This process is known as a program scan cycle. Figure 5-7 illustrates a single PLC operating cycle consisting of the

input scan, program scan, output scan, and housekeeping duties. Because the inputs can change at any time, it constantly repeats this cycle as long as the PLC is in the

RUN mode.

L1

AC

COM

I/0 I/1 I/2 I/3 AC

COM

I/4 I/5 I/6 I/7 I/8 I/9 I/10 I/11 I/12 I/13 I/14 I/15 I/16 I/17 I/18 I/19

VAC

VDC

O/0

VAC

VDC

O/4

VAC

VDC

O/2 O/3

VAC

VDC

O/4 O/5 O/6 O/7

VAC

VDC

O/8 O/9 O/10 O/11

CR CR CR CR CR CR

L1

L2

VAC 2 VDC 1

VAC 2

COM

VDC 2

VDC 1

COM

Discrete Outputs

VDC 3

VDC 2

COM

Figure 5-6

Typical micro PLC with predefi ned addresses.

Source: Photo courtesy Rockwell Automation, Inc.

CR CR CR CR

VDC 3

COM

Addressing of a micro PLC illustrated.

76 Chapter 5 Basics of PLC Programming pet10882_ch05_071-094.indd 76 6/21/10 5:19 PM

Input device

Field-device power supply

Ι:3/6

Input module

Processor memory

Data

Input image table file

Ι:3/6

Output image table file

O:4/7

Output module

Ι:3/6

O:4/7

Program

Figure 5-9

Scan process applied to a single rung program.

Output device

O:4/7

Field-device power supply

• During the program scan, the processor examines bit I:3/6 for a 1 (ON) condition.

• In this case, because input I:3/6 is 1, the rung is said to be TRUE or have logic continuity.

• The processor then sets the output image table bit

O:4/7 to 1.

• The processor turns on output O:4/7 during the next

I/O scan, and the output device (light) wired to this terminal becomes energized.

• This process is repeated as long as the processor is in the RUN mode.

• If the input device opens, electrical continuity is lost, and a 0 would be placed in the input image table. As a result, the rung is said to be FALSE due to loss of logic continuity.

• The processor would then set the output image table bit O:4/7 to 0, causing the output device to turn off.

Ladder programs process inputs at the beginning of a scan and outputs at the end of a scan, as illustrated in Figure 5-10 . For each rung executed, the PLC processor will:

Step 1 Update the input image table by sensing the voltage of the input terminals. Based on the absence or presence of a voltage, a 0 or a 1 is stored into the memory bit location designated for a particular input terminal.

Step 2 Solve the ladder logic in order to determine logical continuity. The processor scans the ladder program and evaluates the logical continuity of each rung by referring to the input image table to see if the input conditions are met. If the conditions controlling an output are met, the processor immediately writes a 1 in its memory location, indicating that the output will be turned ON; conversely, if the conditions are not met a 0 indicating that the device will be turned

OFF is written into its memory location.

Step 3 The fi nal step of the scan process is to update the actual states of the output devices by transferring the output table results to the output module, thereby switching the connected output devices ON (1) or OFF (0). If the status of react to them until the next processor scan.

Each instruction entered into a program requires a certain amount of time for the instruction to be executed. The amount of time required depends on the instruction. For example, it takes less time for a processor to read the status of an input contact than it does to read the accumulated value of a timer or counter. The time taken to scan

Input image table

0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0

START

END

0 0 0 0 0 0 0 0 0 0 0 1 0 0

Output image table

1 0

Step 1

Read input module

Step 2

Solve the ladder program

Step 3

Transfer to output module

Figure 5-10

Scan process applied to a multiple rung program.

78 Chapter 5 Basics of PLC Programming pet10882_ch05_071-094.indd 78 6/21/10 5:19 PM

L1

Wiring of field inputs and outputs to a micro

PLC illustrated.

L2

Stop Start

Motor/controller

Controller

Servo amplifier

L1 L2

I2

I1 I2

I1

Inputs

Q1

Position feedback

Speed feedback

Servo motor

Load

Feedback device

Tachometer: speed

Encoder: position

Figure 6-43

Closed-loop servo motor system.

Source: Photos courtesy Omron Industrial Automation,

www.ia.omron.com.

Q1

Q1

Outputs

Q2 Q3 Q3

M

Motor starter coil

Figure 6-45

Motor seal-in circuit implemented using an

Allen-Bradley Pico controller.

The motor stop/start circuit shown in Figure 6-44 is a typical example of a seal-in circuit. The hardwired circuit consists of a normally closed stop button in series with a normally open start button. The seal-in auxiliary contact of the starter is connected in parallel with the start button to keep the starter coil energized when the start button is released. When this circuit is programmed into a PLC, both the start and stop buttons are examined for a closed condition because both buttons must be closed to cause the motor starter to operate.

Figure 6-45 shows a PLC wiring diagram of the motor seal-in circuit implemented using an Allen-Bradley Pico controller. The controller is programmed using ladder logic. Each programming element can be entered directly via the Pico display. This controller also lets you program the circuit from a personal computer using PicoSoft programming software.

6.9

Latching Relays

Electromagnetic latching relays are designed to hold the relay closed after power has been removed from the coil.

Latching relays are used where it is necessary for contacts to stay open and/or closed even though the coil is energized only momentarily. Figure 6-46 shows a latching relay that uses two coils. The latch coil is momentarily energized to set the latch and hold the relay in the latched

L1

Start

M

Seal-in contact

Stop

Motor starter coil

M

L2 L1

Inputs

Stop

Start

Hardwired

Figure 6-44

Hardwired and programmed seal-in circuit.

Start

Ladder logic program

Stop

Motor starter coil

M

Programmed

Output

L2

M

Motor starter coil

Developing Fundamental PLC Wiring Diagrams and Ladder Logic Programs

Chapter 6

111

pet10882_ch06_095-124.indd 111 6/25/10 6:11 PM

Wiring of field inputs and outputs to a SLC 500

PLC illustrated.

Man/Auto

Ladder logic program

Low sensor switch OFF/ON

Motor

I:2/4

Man/Auto

I:2/8

Latch/Unlatch

I:2/0 O:3/1

I:2/4

Man/Auto

I:2/4

Man/Auto

I:2/4

B3:0/0

High sensor switch

I:2/12

Low sensor switch

I:2/8

Man/Auto

Latch coil

L

B3:0/0

Unlatch coil

U

B3:0/0

G Motor

I:2/4

O:3/1

Low sensor switch

O:3/5

R

I:2/8

High sensor switch

O:3/9

Y

I:2/12

0

Slots

1 2 3 4 5 6

O:3/13

Power supply

0

1

2

3

Input module

4

5

6

7

8

9

10

11

12

13

14

15

24 VDC

16 point discrete input module

L2

Field device power supply

L1

240 VAC

Output module

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

240 VAC

16 point discrete output module

OFF ON

Man Auto

Low sensor switch

High sensor switch

⫹DC

24 VDC

⫺DC

Field device power supply

IN 0

IN 1

IN 2

IN 3

IN 4

IN 5

IN 6

IN 7

IN 8

IN 9

IN 10

IN 11

IN 12

IN 13

IN 14

DC

COM

IN 15

DC

COM

Motor

M

Pump running

G

Low level

R

High level

Y

VAC

OUT 0

OUT 1

OUT 2

OUT 3

OUT 4

OUT 5

OUT 6

OUT 7

OUT 9

OUT 11

OUT 10

OUT 12

OUT 13

OUT 8

OUT 14

OUT 15

AC

COM

Figure 6-52

Water level control program implemented using an Allen-Bradley modular SLC 500 controller.

Developing Fundamental PLC Wiring Diagrams and Ladder Logic Programs

Chapter 6

115

pet10882_ch06_095-124.indd 115 6/25/10 6:11 PM

E X A M P L E 6 - 3

Figure 6-67 shows the sketch of a continuous fi lling operation. This process requires that boxes moving on a conveyor be automatically positioned and fi lled.

The sequence of operation for the continuous fi lling operation is as follows: tarily pressed. tarily pressed. operating. stopped. fi rst sensed by the photosensor. open the solenoid valve and allow the box to fi ll. Filling should stop when the level sensor goes true. should remain energized until the box is moved clear of the photosensor.

Solenoid

Hopper

Level switch

PL Run

PL

Standby

PL Full

Photo switch

Motor

Start

Stop

Figure 6-67

Sketch of the continuous fi lling operation. the operation.

a sketch of the process.

Inputs

L1

Stop

Start

Photo

Level

Stop

Ladder logic program

Start

Run

Run

Run

Standby

Level Photo

Full

Full

Photo Run

Motor

Full

Run Level Full Photo

Solenoid

Figure 6-68

Continuous fi lling operation PLC program.

Outputs

Motor

L2

Solenoid

Run

Standby

Full pet10882_ch06_095-124.indd 121

Developing Fundamental PLC Wiring Diagrams and Ladder Logic Programs

Chapter 6

121

6/25/10 6:11 PM

Contactor

PLC

Magnetic starter

Motor

Overload relay

Drawings and photos of real world field input

L1

and output devices have been added.

Pushbuttons

Start

Stop

OL

Inputs

PLC Program

Start Stop OL

M

M

Output

Starter coil

M

L2

Figure 6-7

Motor starter is a contactor with an attached overload relay.

Source: Photo courtesy Rockwell Automation, Inc.

• Control contact M (across START button) closes to seal in the coil circuit when the START button is

released. This contact is part of the control circuit and, as such, is only required to handle the small amount of current needed to energize the coil.

• An overload (OL) relay is provided to protect the motor against current overloads. The normally closed relay contact OL opens automatically when

Start

Stop

M

OL

Magnetic starter

M

Low-current control circuit

M

OL

L1

L2

M

M

OL

OL

T1

T2

Threephase motor

T3

L3

High-current power circuit

Figure 6-8

Three-phase magnetic motor starter.

Source: This material and associated copyrights are proprietary to, and used with the permission of Schneider Electric.

Figure 6-9

PLC control of a motor. an overload current is sensed to de-energize the M coil and stop the motor.

Motor starters are available in various standard National Electric Manufacturers Association (NEMA) sizes and ratings. When a PLC needs to control a large motor, it must work in conjunction with a starter as illustrated in

Figure 6-9 . The power requirements for the starter coil must be within the power rating of the output module of the PLC. Note that the control logic is determined and executed by the program within the PLC and not by the hardwired arrangement of the input control devices.

6.4

Manually Operated Switches

Manually operated switches are controlled by hand.

These include toggle switches, pushbutton switches, knife switches, and selector switches. manual control. A pushbutton operates by opening or closing contacts when pressed. Figure 6-10 shows commonly used types of pushbutton switches, which include:

Normally open (NO) pushbutton , which makes a circuit when it is pressed and returns to its open position when the button is released.

Normally closed (NC) pushbutton, which opens the circuit when it is pressed and returns to the closed position when the button is released.

Break-before-make pushbutton in which the top section contacts are NC and the bottom section contacts are NO. When the button is pressed, the top contacts open before the bottom contacts are closed.

Developing Fundamental PLC Wiring Diagrams and Ladder Logic Programs

Chapter 6

99

pet10882_ch06_095-124.indd 99 6/25/10 6:11 PM

L1

Stop

Hardwired relay circuit

Start

L2

TD

The relay equivalent of the virtual programmed instruction is explained first, followed by the appropriate

PLC program.

TD-1

TD-2

(5 s)

M

Ladder logic program

Inputs

Stop Start

Internal relay

Output

L1

Stop

Motor

Start

Internal relay

Motor

M

Timer

PR: 5

TB: 1 s

Output line

Figure 7-17

Instantaneous contact instruction can be programmed using an internally referenced relay coil.

M

L2

• Contact TD-1 is the instantaneous contact, and contact TD-2 is the timed contact.

• The ladder logic program shows that a contact instruction referenced to an internal relay is now used to operate the timer.

• The instantaneous contact is referenced to the internal relay coil, whereas the time-delay contact is referenced to the timer output coil.

Figure 7-18 shows an application for an on-delay timer that uses an NCTO contact. This circuit is used as a warning signal when moving equipment, such as a conveyor motor, is about to be started. The operation of the circuit can be summarized as follows:

• According to the hardwired relay circuit diagram, coil CR is energized when the start pushbutton PB1 is momentarily actuated.

• As a result, contact CR-1 closes to seal in CR coil, contact CR-2 closes to energize timer coil TD, and contact CR-3 closes to sound the horn.

• After a 10-s time-delay period, timer contact TD-1 opens to automatically switch the horn off.

• The ladder logic program shows how an equivalent circuit could be programmed using a PLC.

• The logic on the last rung is the same as the timertiming bit and as such can be used with timers that do not have a timer-timing output.

Timers are often used as part of automatic sequential control systems. Figure 7-19 shows how a series of motors can be started automatically with only one start/stop control station. The operation of the circuit can be summarized as follows:

• According to the relay ladder schematic, lube-oil pump motor starter coil M1 is energized when the start pushbutton PB2 is momentarily actuated.

• As a result, M1-1 control contact closes to seal in

M1, and the lube-oil pump motor starts.

• When the lube-oil pump builds up suffi cient oil pressure, the lube-oil pressure switch PS1 closes.

• This in turn energizes coil M2 to start the main drive motor and energizes coil TD to begin the timedelay period.

• After the preset time-delay period of 15 s, TD-1 contact closes to energize coil M3 and start the feed motor.

• The ladder logic program shows how an equivalent circuit could be programmed using a PLC.

132 pet10882_ch07_125-148.indd 132 6/25/10 4:03 PM

L1

Inputs

PB

SW

I:1/0

I:1/1

I:1/0

I:1/1

B3:0/0

OSR

TOD

To BCD

Source

Destination

T4:1.ACC

O:6

TON

TIMER ON DELAY

Timer

Time base

Preset

Accumulated

T4:1

1.0

1000

0

EN

DN

O:6

Output

6

7

4

5

8

9

2

3

0

1

10

11

12

13

14

15

0 0 0 0

Figure 8-19

OSR instruction used to freeze rapidly displayed LED values.

• When the timer is running, SW (I:1/1) closed, the accumulated value changes rapidly.

• Closing the momentary pushbutton PB (I:1/0) will freeze and display the value at that point in time.

The alarm monitor PLC program of Figure 8-20 illustrates the application of an up-counter used in conjunction with the programmed timed oscillator circuit studied in

Chapter 7. The operation of the program can be summarized as follows:

• The alarm is triggered by the closing of fl oat switch FS.

• The light will fl ash whenever the alarm condition is triggered and has not been acknowledged,

L1

Inputs

FS

T4:6

DN

Ladder logic program

TON

TIMER ON DELAY

Timer

Time base

Preset

Accumulated

T4:5

1.0

1

0

EN

DN

Light

Output

L2

T4:5

DN

TON

TIMER ON DELAY

Timer

Time base

Preset

Accumulated

T4:6

1.0

1

0

EN

DN

FS

OFF ON

SS

CTU

COUNT-UP COUNTER

Counter

Preset

Accumulated

C5:1

1

0

CU

DN

Drawings and photos of real world field input and output devices have been added to the logic diagrams.

C5:1 T4:5

Light

DN

C5:1

DN

FS

DN

SS

C5:1

RES

Figure 8-20

Alarm monitor program.

158 pet10882_ch08_149-175.indd 158 6/28/10 3:31 PM

File type

Counter number

5

Counters

C5:3

File number

Counter address

C5:3

C5:3.0

C5:3.1

C5:3.2

Bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

Word

0

Word

1

Word

2

CU CD DN OV UN UA

Preset value

Accumulated value

Internal use (not addressable)

Figure 8-9

SLC 500 counter fi le.

• Each false-to-true transition of rung 1 increases the counter’s accumulated value by 1.

• After 7 pulses, or counts, when the preset counter value equals the accumulated counter value, output

DN is energized.

C5:3/UA is the address for the update accumulator bit of the counter.

Bradley SLC 500 controller. The control word uses status control bits consisting of the following:

Count-Up (CU) Enable Bit —The count-up enable bit is used with the count-up counter and is true energizes output O:2/1 to switch the green pilot whenever the count-up counter instruction is true. If

controller instruction sets for the programming examples.

is false.

• The counter is reset by closing pushbutton PB2,

Count-Down (CD) Enable Bit —The count-down which makes rung 4 true and resets the accumulated enable bit is used with the count-down counter and is count to zero. true whenever the count-down counter instruction is

• Counting can resume when rung 4 goes false again. true. If the count-down counter instruction is false, the

The Allen-Bradley SLC 500 counter fi le is fi le 5 ( Fig-

CD bit is false. ure 8-9 ). Each counter is composed of three 16-bit words, collectively called a counter element. These three data words are the control word, preset word, and accumulated word. Each of the three data words shares the same base address, which is the address of the counter itself. There can be up to 256 counter elements. Addresses for counter fi le 5, counter element 3 (C5:3), are listed below.

Done (DN) Bit —The done bit is true whenever the accumulated value is equal to or greater than the preset value of the counter, for either the count-up or the count-down counter.

Overfl ow (OV) Bit —The overfl ow bit is true whenever the counter counts past its maximum value, which is 32,767. On the next count, the counter will wrap around to 32,768 and will continue counting

C5

5 counter fi le 5

:3

5 counter element 3 (0–255 counter elements per fi le)

Counter Table

C5:3/DN is the address for the done bit of the counter.

C5:3/CU is the address for the count-up enable bit of the counter.

C5:3/CD is the address for the count-down enable bit of the counter.

C5:0

C5:1

C5:2

C5:3

C5:4

C5:5

/CU

0

0

0

0

0

0

/CD

0

0

0

0

0

0

/DN

0

0

0

0

0

0

/OV

0

0

0

0

0

0

/UN

0

0

0

0

0

0

/UA

0

0

0

0

0

0

.PRE

0

0

0

50

0

0

.ACC

0

0

0

0

0

0

C5:3/OV is the address for the overfl ow bit of the counter.

Address C5:3 Table: C5: Counter

C5:3/UN is the address for the underfl ow bit of the counter.

Figure 8-10

SLC 500 counter table.

Programming Counters

Chapter 8

153

pet10882_ch08_149-175.indd 153 6/28/10 3:31 PM

1 2 3 7

8

10

5

11

6 4 12 7

Figure 9-24

Safety PLC.

Source: Image Used with Permission of Rockwell Automation, Inc.

9

7

8

9

10

Number Feature

1 Module status indicators

2 Alphanumeric display

3

4

5

6

Node address switches

Baud rate switches

USB port

DeviceNet communication connector

Terminal connectors

Input status indicators

Output status indicators

IP address desplay switch

The content has been updated and reflects the changes in technology since the publication of the previous edition.

Safety PLCs, such as the one shown in Figure  9-24 , are now available for applications that require more advanced safety functionality. A safety PLC is typically certifi ed by third parties to meet rigid safety and reliability requirements of international standards. Both standard and safety PLCs have the ability to perform control functions but a standard PLC was not initially designed to be fault tolerant and fail-safe. That is the fundamental difference.

Some of the differences between standard and safety

PLCs include the following:

• A standard PLC has one microprocessor that

executes the program, Flash memory area that stores the program, RAM for making calculations, ports for communications, and I/O for

detection and control of the machine. In contrast, a safety PLC has redundant microprocessors,

Flash and RAM that are continuously monitored by a watchdog circuit, and a synchronous

detection circuit. Redundancy is duplication. The probability of hazards arising from one malfunction in an electrical circuit can be minimized by creating partial or complete redundancy

(duplication).

• Standard PLC inputs provide no internal means for testing the functionality of the input circuitry. By contrast, safety PLCs have an internal output circuit associated with each input for the purpose of testing the input circuitry. Inputs are driven both high and low for very short cycles during runtime to verify their functionality.

• Safety PLCs use power supplies designed specifi cally for use in safety control systems and redundant backplane circuitry between the controller and

I/O modules.

Safety considerations should be developed as part

of the PLC program. A PLC program for any application will be only as safe as the time and thought spent on both personnel and hardware considerations make it. One such consideration involves the use of a motor starter auxiliary seal-in contact, shown in Figure 9-25 , in place of the programmed contact referenced to the output coil instruction. The use of the fi eld-generated starter auxiliary contact status in the program is more costly in terms of fi eld wiring and hardware, but it is

safer because it provides positive feedback to the processor about the exact status of the motor. Assume, for example, that the OL contact of the starter opens under an overload condition. The motor, of course, would stop operating because power would be lost to the starter coil. If the program was written using an examine-on contact instruction referenced to the output coil instruction as the seal-in for the circuit, the processor would never know that power had been lost to the motor. When the OL was reset, the motor would restart instantly, creating a potentially unsafe operating condition.

of stop buttons. A stop button is generally considered a safety function as well as an operating function. As such, all stop buttons should be wired using a nor-

mally closed contact programmed to examine for an on

192 Chapter 9 Program Control Instructions pet10882_ch09_176-199.indd 192 7/2/10 5:54 PM

Analog output

PLC

Ultrasonic level sensor

Set-point

(potentiometer)

PLC controller

4 to 20 mA analog input

Adjustable valve

Figure 10-43

Proportional control process.

Measurement of variable to be controlled

(sensor)

Control element

(heater-valve) the output to degrade closing the valve by different percentages, adjusting the valve to maintain a set-point.

Figure 10-42

Closed-loop control system.

(error) exists between the actual and desired levels, the

PLC control program will take the necessary corrective action. Adjustments are made continuously by the PLC until the difference between the desired and actual output is as small as is practical.

With on/off PLC control (also known as two-position and bang-bang control ), the output or fi nal control element is either on or off—one for the occasion when the value of the measured variable is above the set-point and the other for the occasion when the value is below the set-point. The controller will never keep the fi nal control element in an intermediate position. Most residential thermostats are on/off type controllers.

On/off control is inexpensive but not accurate enough for most process and machine control applications. On/ off control almost always means overshoot and resultant system cycling. For this reason a deadband usually exists around the set-point. The deadband or hysteresis of the control loop is the difference between the on and off operating points. most sophisticated and widely used type of process control.

PID operations are more complex and are mathematically based. PID controllers produce outputs that depend on the

magnitude, duration, and rate of change of the system error signal. Sudden system disturbances are met with an aggressive attempt to correct the condition. A PID controller can reduce the system error to 0 faster than any other controller.

A typical PID control loop is illustrated in Figure 10-44 .

The loop measures the process, compares it to a set-point, and then manipulates the output in the direction which nology used in conjunction with a PID loop can be summarized as follows:

• Operating information that the controller receives from the machine is called the process variable

(PV) or feedback.

• Input from the operator that tells the controller the desired operating point is called the set-point (SP).

• When operating, the controller determines whether the machine needs adjustment by comparing (by subtraction) the set-point and the process variable hunting or cycling associated with on/off control. They allow the fi nal control element to take intermediate positions between on and off. This permits analog control of the fi nal control element to vary the amount of energy to the process, depending on how much the value of the measured variable has shifted from the desired value.

The process illustrated in Figure 10-43 is an example

Flow rate

Set-point

(SP)

Level detector

Σ

Error

Process variable

(PV)

PID equation of a proportional control process. The PLC analog output module controls the amount of fl uid placed in the holding tank by adjusting the percentage of valve opening. The valve is initially open 100 percent. As the fl uid level in the tank approaches the preset point, the processor modifi es

Figure 10-44

Typical PID control loop.

Control variable

(CV)

220 Chapter 10 Data Manipulation Instructions pet10882_ch10_200-225.indd 220 7/3/10 8:45 PM

Length —Is the number of steps of the sequencer fi le starting at position 1. Position 0 is the start-up position. The instruction resets (wraps) to position 1 at each cycle completion. The actual fi le length will be

1 plus the fi le length entered in the instruction.

Position —Indicates the step that is desired to start the sequencer instruction. The position is the word location or step in the sequencer fi le from which the instruction moves data. Any value up to the fi le length may be entered, but the instruction will always reset to 1 on the true-to-false transition after the instruction has operated on the last position. Before we start the sequence, we need a starting point at which the sequencer is in a neutral position. The start position is all zeros, representing this neutral position; thus, all outputs will be off in position 0.

To program a sequencer, binary information is fi rst entered into the sequencer fi le or register made up of a series of consecutive memory words. The sequencer fi le is typically a bit fi le that contains one bit fi le word representing the output action required for each step of the sequence.

Data are entered for each sequencer step according to the requirements of the control application. As the sequencer advances through the steps, binary information is transferred from the sequencer fi le to the output word.

To illustrate the purpose and function of the sequencer fi le we will examine the operation of the four-step sequence process shown in Figure 12-8 . This sequencer is to be used to control traffi c in two directions. The operation of the process can be summarized as follows:

• Six outputs are to be energized from one 16-point output module.

• Each light is controlled by one bit address of output word O:2.

• The fi rst 6 bits are programmed to execute the following sequence of light outputs:

- Step 1: Outputs O:2.0 (red) and O:2.5 (green) lights will be energized.

- Step 2: Outputs O:2.0 (red) and O:2.4 (yellow) will be energized.

- Step 3: Outputs O:2.2 (green) and O:2.3 (red) will be energized.

- Step 4: Outputs O:2.1 (yellow) and O:2.3 (red) will be energized.

O:2.0

O:2.1

O:2.2

N/S E/W

O:2.3

O:2.4

O:2.5

N/S

Step 1

E/W

N/S E/W

N/S

Step 2

E/W

How Programs Operate

When the operation of a program is called for, a bulleted list is used to summarize its execution.

246

Step 3 Step 4

Output word

O:2

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

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

B3:0

B3:1

Sequencer file

B3:2

B3:3

0

0

0

B3:4

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

0

0

0

0

0

1

0

0

0

0

0

1

1

0

0

0

1

0

0

0

0

0

1

0

0

0

Positions

Start

1 Step 1

1 Step 2

0 Step 3

0

Step 4

Figure 12-8

Four-step sequencer.

Chapter 12 Sequencer and Shift Register Instructions pet10882_ch12_242-267.indd 246 06/07/10 8:35 AM

Enclosure

Ground for slot power supply

Ground bus

Grounding electrode system

CPU or I/O rack

Equipment grounding conductor

CPU or I/O rack

CPU or I/O rack

CPU or I/O rack

Figure 13-8

PLC grounding system.

Equipment grounding conductor

To grounding electrode system

Chassis mounting tab

Star washer addition, most manufacturers provide detailed infor-

diagrams.

enclosure.

Equipment grounding conductor (ground lug with (8 AWG) wire)

To ground bus

Figure 13-9

Make ground connections using a star washer. properly installed grounding system will provide a lowimpedance path to earth ground. The complete PLC installation, including enclosures, CPU and I/O chassis, and power supplies are all connected to a single low- impedance ground. These connections should exhibit low

DC resistance and low high-frequency impedance. A central ground bus bar is provided as a single point of reference inside the enclosure to which all chassis and power supply equipment grounding conductors are connected.

The ground bus is then connected to the building’s earth ground.

In the event of a high value of ground current, the temperature of the conductor could cause the solder to melt, resulting in interruption of the ground connection. Therefore the grounding path must be permanent

(no solder), continuous, and able to conduct safely the ground-fault current in the system with minimal impedance. Paint or other nonconductive material should be scraped away from the area where a chassis makes contact with the enclosure. The minimum ground wire size should be No. 12 AWG stranded copper for PLC equipment grounds and No. 8 AWG stranded copper for enclosure backplane grounds. Ground connections should be made with a star washer between the grounding wire and lug and metal enclosure surface, as illustrated in

Figure 13-9 .

Source

No ground loops

Source

Ground bus

Figure 13-10

Formation of ground loops.

Source

Ground loop formed

Ground loops can cause problems by adding or subtracting current or voltage from input signal devices.

A ground loop circuit can develop when each device’s ground is tied to a different earth potential thereby allowing current to fl ow between the grounds, as illustrated in

Figure 13-10 . If a varying magnetic fi eld passes through one of these ground loops, a voltage is produced and current fl ows in the loop. The receiving device is unable to differentiate between the wanted and unwanted signals and, thus, can’t accurately refl ect actual process conditions. Certain connections require shielded cables to help reduce the effects of electrical noise coupling. Each shield should be grounded at one end only, as a shield grounded at both ends forms a ground loop.

PLC Installation Practices, Editing, and Troubleshooting

Chapter 13

273

pet10882_ch13_268-290.indd 273 06/07/10 8:16 PM

Communication

Processor

PLC

Motion

Conveyor servo motor

Bottle filler servo motor

Conveyor servo drive

Filler servo drive

Figure 14-23

Bottle-fi lling motion control process.

• In addition it updates the controller with motor and drive information used to monitor drive and motor performance.

Servo Drive

• The servo drive receives the signal provided by the motion module and translates this signal into motor drive commands.

• These commands can include motor position, velocity, and/or torque.

• The servo drive provides power to the servo motors in response to the motion commands.

• Motor power is supplied and controlled by the servo

Fundamentals of PLC motion control have been added.

velocity by use of an encoder mounted on the motor shaft. This feedback information is used within the servo drive to ensure accurate motor motion.

Servo Motor

• The servo motors represent the axis being controlled.

• The servo motors receive electrical power from their servo drive which determines the motor shaft velocity and position.

• The fi ller motor must accelerate the fi ller mechanism in the direction the bottles are moving, match their speed, and track the bottles.

• After the bottles have been fi lled, the fi ller motor has to stop and reverse direction to return the fi ller mechanism to the starting position to begin the process again.

A robot is simply a series of mechanical links driven by servo motors. The basic industrial robot widely used today is an arm or manipulator that moves to perform industrial operations. Figure 14-24 illustrates the motion of axis of motion. Figure 14-23 illustrates a bottle-fi lling motion control process. This application requires two axes of motion: the motor operating the bottle fi ller mechanism and the motor controlling the conveyor speed. The role of each control component can be summarized as follows:

Programmable Logic Controller

• The controller stores and executes the user program that controls the process.

• This program includes motion instructions that control axis movements.

• When the controller encounters a motion instruction it calculates the motion commands for the axis.

• A motion command represents the desired position, velocity, or torque of the servo motor at the particular time the calculations take place.

Motion Module

• The motion module receives motion commands from the controller and transforms them into a compatible form the servo drive can understand.

Shoulder swivel

2

3

Elbow extension

4

Pitch

Arm sweep

1

Figure 14-24

Six-axis robot arm.

5

Yaw

6

Roll

302 Chapter 14 Process Control, Network Systems, and SCADA pet10882_ch14_291-316.indd 302 07/07/10 9:21 PM

Corporate network

Office applications, internetworking, data servers, storage Back-office mainframes and servers (ERP, MES, etc.)

Phone

Camera

Controller

I/O

Supervisory control

Safety controller

HMI

Safety

I/O

Motors, drives actuators

Sensors and other input/output devices

Robotics

Industrial network

Figure 14-43

EtherNet/IP information links.

Source: Image Used with Permission of Rockwell Automation, Inc.

Examines communications at all levels in an industrial network in much greater detail.

build into their equipment without having to pay royalties.

It has become a standard communications protocol in industry, and is one of the most commonly available means of connecting industrial electronic devices. Figure 14-44 shows an Omron PLC with Modbus-RTU network communication capabilities via RS-232C and RS-422/485

serial ports.

Fieldbus

Fieldbus is an open, serial, two-way communications system that interconnects measurement and control equipment such as sensors, actuators, and controllers. At the base level in the hierarchy of plant networks, it serves as a network for fi eld devices used in process control applications.

There are several possible topologies for fi eldbus networks. Figure 14-45 illustrates the daisy-chain topology.

With this topology, the fi eldbus cable is routed from device to device. Installations using this topology require

Connectors

Figure 14-44

Omron PLC with Modbus-RTU network communication capabilities.

Source: Photo courtesy Omron Industrial Automation, www.ia.omron.com.

Field device

Fieldbus interface

Figure 14-45

Fieldbus implemented using daisy-chain topology.

312 Chapter 14 Process Control, Network Systems, and SCADA pet10882_ch14_291-316.indd 312 07/07/10 9:21 PM

If Your Output

Circuit LED Is . . .

ON

2

3

0

1

Output

6

7

4

5

8

9

10

11

12

13

14

15

OFF

2

3

0

1

Output

6

7

4

5

8

9

10

11

12

13

14

15

And Your Output

Device Is . . .

On/Energized

Off/De-energized

On/Energized

Off/De-energized

And

Your program indicates that the output circuit is off or the output circuit will not turn off.

Your output device will not turn on and the program indicates that it is on.

Your output device will not turn off and the

program indicates that it is off.

Your program indicates that the output circuit is on or the output circuit will not turn on.

Probable Cause

Programming problem:

- Check for duplicate outputs and addresses.

- If using subroutines, outputs are left in their last state when not executing subroutines.

- Use the force function to force output off. If this does not force the output off, output circuit is damaged. If the output does force off, then check again for logic/programming problem.

Output is forced on in program.

Output circuit wiring or module.

Low or no voltage across the load.

Output device is incompatible: check specifications and sink/source compatibility

(if dc output).

Output circuit wiring or module.

Output device is incompatible.

Output circuit off-state leakage current may

exceed output device specification.

Output circuit wiring or module.

Output device is shorted or damaged.

Programming problem:

- Check for duplicate outputs and addresses.

- If using subroutines, outputs are left in their last state when not executing subroutines.

- Use the force function to force output on. If this does not force the output on, output circuit is damaged. If the output does force on, then check again for logic/programming problem.

Output is forced off in program.

Output circuit wiring or module.

Figure 13-32

Output troubleshooting guide.

13.10

Extended coverage of practical

PLC Programming Software

You must establish a way for your personal computer

PC. You cannot download multiple projects to the PLC only one program at a time, but the program can consist

(PC) software to communicate with the programmable of multiple subroutine fi les which can be conditionally logic controller (PLC) processor. Making this connection called from the main program. is known as confi guring the communications. The method

RSLinx software is available in multiple packages to used to confi gure the communications varies with each meet the demand for a variety of cost and functionality brand of controller. In Allen-Bradley controllers, RSLogix requirements. This software package is used as the driver software is required to develop and edit ladder programs. between your PC and PLC processor. A driver is a com-

A second software package, RSLinx, is needed to monitor puter program that controls a device. For example, you

PLC activity, download a program from your PC to your must have the correct printer driver installed in your PC

PLC, and upload a program from your PLC into your

286 Chapter 13 PLC Installation Practices, Editing, and Troubleshooting pet10882_ch13_268-290.indd 286 06/07/10 8:16 PM

PART 5 REVIEW QUESTIONS

1. Construct a ControlLogix ladder rung with a math instruction that executes when a toggle switch is closed to add the tag named Pressure_A (value 680) to the constant of 50 and store the answer in the tag named Result.

2. Construct a ControlLogix ladder rung with a math instruction that executes when two normally open limit switches are closed to subtract the tag named

Count_1 (value 60) from the tag named Count_2

(value 460) and store the answer in the tag named

Count_Total.

3. Construct a ControlLogix ladder rung with a math instruction that executes when either one of two normally open pushbuttons is closed to multiply the tag named Cases (value 10) by the constant 24 and store the answer in the tag named Cans.

4. Construct a ControlLogix ladder rung with a compare instruction that will energize a pilot light output anytime the value stored at Data_3 is 60.

5. Construct a ControlLogix ladder rung with a compare instruction that will energize a pilot light output anytime the value stored at Data_2 is not the same as that stored at Data_6.

6. Construct a ControlLogix ladder rung with compare instructions that will energize a pilot light output anytime the pressure of a system goes above 300 psi or below 100 psi.

PART 5 PROBLEMS

1. While checking the operation of the parts tracking system with the Monitor Tags window, you note that the value of Conveyor_Sensor_1 remains at 1 with parts passing by. What can you surmise from this? Why?

2. Three conveyors are delivering the same parts in different packages. A package can hold 12, 24, or 18 parts. Proximity switches installed on each of the conveyor lines are used to advance the accumulated value of the three counters. Write a ControlLogix program that uses multiply and add instructions to calculate the sum of the parts.

3. A single pole switch is used in place of the two pushbuttons for the variable preset timer program.

When this switch is closed the timer is to be set for

10 seconds and when open to 15 seconds. Make the necessary changes to the program.

Chapters conclude with a set of review questions and problems. The review questions are closely related to the chapter objectives and require students to recall and apply information covered in the chapter. The problems range from easy to difficult, thus challenging students at various levels of competence.

360

Part 5 Math, Comparison, and Move Instructions pet10882_ch15_317-371.indd 360 7/14/10 7:54 PM

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement