04 chapter 1_plc

47
1 CHAPTER 1 PROGRAMMABLE LOGIC CONTROLLERS 1.1 Learning Outcomes After completing this course, students should be able to: 1. Understand PLC’s terminology, configuration, I/O modules addressing and types of PLC memory devices, 2. Program instructions that perform logical operations and ladder logic programs, 3. Program the control of outputs using the timer instruction control bits, 4. Apply the PLC counter function and associated circuitry to control systems, 5. Install hardware components used in PLC systems. 1.2 Theory 1.2.1 Introduction Programmable Logic Controllers (PLC) consists of a Central Processing Unit (CPU) containing an application program and input and output interface module, which is directly, connected to the field I/O devices (Figure 1.1). The program controls the PLC so that when an input signal from an input device turn ON, the appropriate response normally involves turning ON an output signal to some sort of output devices. PLC is a specialized computer to control machines and processes. It uses a programmable memory to store instructions and execute specific functions that include on/off control, timing, counting and data handling. Programmable logic controllers offer several advantages over a conventional relay type of control. Relays have 1

Upload: saliana-binti-sanusi

Post on 16-Nov-2014

895 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 04 Chapter 1_plc

1 CHAPTER 1

PROGRAMMABLE LOGIC CONTROLLERS

1.1 Learning Outcomes

After completing this course, students should be able to:1. Understand PLC’s terminology, configuration, I/O modules addressing

and types of PLC memory devices,2. Program instructions that perform logical operations and ladder logic

programs,3. Program the control of outputs using the timer instruction control bits,4. Apply the PLC counter function and associated circuitry to control

systems,5. Install hardware components used in PLC systems.

1.2 Theory

1.2.1 Introduction

Programmable Logic Controllers (PLC) consists of a Central Processing Unit (CPU) containing an application program and input and output interface module, which is directly, connected to the field I/O devices (Figure 1.1). The program controls the PLC so that when an input signal from an input device turn ON, the appropriate response normally involves turning ON an output signal to some sort of output devices. PLC is a specialized computer to control machines and processes. It uses a programmable memory to store instructions and execute specific functions that include on/off control, timing, counting and data handling.

Programmable logic controllers offer several advantages over a conventional relay type of control. Relays have to be hardwired to perform a specific function. When the system requirements change, the relay wiring has to be changed or modified. In extreme cases, such as in the auto industry, complete control panels had to be replaced since it was not economically feasible to rewire the old panels witch each model changeover. The programmable controllers have eliminated much of the hardwiring associated with conventional relay control circuits. It is small and inexpensive compared to equivalent relay-based process control systems.

In addition to cost savings, PLCs provide many other benefits including: Increased Reliability More Flexibility Lower Cost Communication Capability Faster Response Time Easier Troubleshoot

1

Page 2: 04 Chapter 1_plc

Figure 1.1: PLC System

1.2.2 Parts of a PLC

A typical PLC can be divided into parts, as illustrated in Figure 1.2. These components are the central processing unit (CPU), the input/output (I/O) section, the power supply and the programming device.

Figure 1.2: PLC Parts

2

Page 3: 04 Chapter 1_plc

1.2.2.1 Central Processing Unit

The Central Processing Unit (CPU) is the brain of the PLC. CPU (Figure 1.3) is a microprocessor that coordinates the activities of the PLC system. It executes the program, processes I/O signals and communicates with external devices. The processor requires memory for storing the results of the logical operations performed by the microprocessor.

Figure 1.3: CPU Component (Courtesy of Omron)

Memory is also required for the program EPROM or EEPROM plus RAM. Depending on users need, various types of memory are available for choice:

a) Volatile memory:

Those that lose their contents when power is switched off.

Random Access Memory (RAM) is the name given to read/write memory, which allows individual signals or data words to be written in or read out when correct control signals are present.

(a) CPU Omron CJ1G

(a) CPU Omron CPM

3

Page 4: 04 Chapter 1_plc

b) Non-Volatile memory:

Those that retain their contents when power is switched off.

Non-erasable memories consist of:

Read Only Memory (ROM): This is permanently programmed manufacture and cannot be altered. ROMSs are used when large bathes of identically programmed devices are to be produced.

Programmable ROMs (PROMS) can be programmed by the user using a PROM programmer.

Erasable memories consist of:

Erasable PROMs (EPROMs) hold data permanently just like PROMs. Their contents can be erased by exposure to ultraviolet light for approximately 30 minutes. EPROMs can then re-programmed over and over again.

Electrically Erasable PROMs (EEPROMs) are similar to EPROMs but can be erased electrically while connected in the circuit.

1.2.2.2 Input/Output Module

The I/O units (Figure 1.4) form the interface between the internal microelectronics of the PLC and the outside world. The I/O units form the interface between the PLC and outside devices. This unit receives any input signal, converts it into low voltage signal and sends it to the processor. The processor will determine and interpret the data due to the program. Then the processor sends the data to the output unit. The output unit produces the output signal and sends it to the output device.

(a)

4

Page 5: 04 Chapter 1_plc

Figure 1.4: I/O Configurations (a) modular I/O, (b) fixed I/O

1.2.2.3 Power Supply

The power supply supplies dc power to the other modules that plug into the rack. For large PLC systems, this power supply does not normally supply power to field devices. With larger systems, power to field devices is provided by external alternating current (ac) or direct current (dc) supplies. For small and micro PLC systems, the power supply is used to power field devices.

Electrical supply is used in bringing electrical energy to central processing unit. Most PLC controllers work either at 24 Vdc or at 220 Vac. On some PLC controllers you'll find electrical supply as a separate module. Those are usually bigger PLC controllers, while small and medium series already contain the supply module. User has to determine how much current to take from I/O module to ensure that electrical supply provides appropriate amount of current. Different types of modules use different amounts of electrical current.

1.2.2.4 Programming Devices

The programming devices, or terminal, is used to enter the desired program into the memory of the processor. Handheld programming devices (Figure 1.5a) are sometimes used to program small PLCs because they are inexpensive and easy to use. Once plugged into the PLC, they can be used to enter and monitor programs. Compact handheld units are frequently used on the factory floor for troubleshooting equipment, modifying programs, and transferring programs to multiple machines.

(b)

5

Page 6: 04 Chapter 1_plc

A personal computer (PC) is the most commonly used programming device (Figure 1.5b). All leading brands of PLCs have software available so that a PC can be used as the programming device. The software allows users to create, edit, document, store and to generate printed report. The personal computer communicates with the PLC processor via a serial or parallel data communications link.

Additional optional PLC components are often available, includes:

Operator interface devices to allow data entry and or/data monitoring by operators.

Communications adaptors for remote I/O, so that a central controller can be connected to remote sensors and actuators.

Network interfaces to allow interconnecting of PLCs and /or other controllers into distributed control systems.

Figure 1.5: Programming devices (a) handheld unit; (b) personal computer.

1.2.3 The I/O SectionThe input and output interface modules provide the equivalents of eyes, ears, and tongue to the brain of a PLC: The I/O section consists of an I/O rack and individual I/O modules similar to that shown in Figure 1.6. Input interface modules accept signals from the machine or process devices and convert into signals that can be used by controller. Output interface modules convert controller signals into external signals used to control the machine or process.

Figure 1.6: I/O Section

6

Page 7: 04 Chapter 1_plc

Figure 1.7: Remote I/O Rack

One benefit of a PLC system is the ability to locate the I/O modules near the field devices to minimize the amount of wiring required. The rack (Figure 1.7) is referred to as remote rack when it is located away from the processor from processor module. To communicate with the processor, the remote rack uses a special communication network.

Each input or output device must have a specific address. The processor to identify where the device is located, to monitor or control it uses this address. In addition, there is some means of connecting field wiring on the I/O module housing. Connecting the field wiring to the I/O housing allows easier disconnection and reconnection of the wiring to change modules. Lights are also added to each module to indicate the ON or OFF status of each I/O circuit.

1.2.3.1 Addressing I/O Memory Areas

In general, basic addressing elements include:

Type: The type determines if an input or output is being addressed.

Channel: The slot number is the physical location of the I/O module. This may be combination of the rack number and the slot number when using expansion racks.

Word and bits: The word and bit are used to identify the actual terminal connection in a particular I/O module.

7

The processor receives signals from the remote input modules and sends signals back to their input modules via the communication module

Page 8: 04 Chapter 1_plc

Figure 1.8: Input devices

a) Photoelectric sensors b) Vision

c) Resistance sensor d) Motor

8

Page 9: 04 Chapter 1_plc

Figure 1.9: Output devices

1.2.4 Fundamentals of PLC Programming

The term PLC programming language refers to the method by which the user communicates information to the PLC. The three most common language structures are ladder diagram, Boolean language and functional chart. Although each language structure is similar from one PLC model to another, there are differences between manufactures in the method of application. However, these differences are usually minor and easy to understand.

Ladder diagram language is by far the most commonly used PLC language. Ladder logic programming language uses instead of words, graphic symbols that show their intended outcome.

The typical set of generic Boolean statements is refers to the basic AND, OR and Not logic gate function. With small handheld programming devices, the program is entered using Boolean program individually or in combination to form logical statements.

The function chart system of programming was originally developed in Europe and is called GRAFCET. It is a method of programming a control system using more structured approach. Function chart programming language use function blocks (steps and transition units), often controlled by Boolean expressions. A function chart program is a pictorial representation or special type of flowchart of a sequential control process. It shows the possible path the process can take and the condition necessary to go from one block to another.

a) Rotary encoder

c) Buzzer

b) Lamp

d) Cylinder

9

Page 10: 04 Chapter 1_plc

1.2.4.1 Ladder Diagram

Ladder diagram uses standard symbols to represent the circuit components and functions found in a control system.

Input symbols Output Symbols

Normally-open contact

Normally-closed contact

Normally-open out load

Normally-closed out load

Timer , Counter etc.

switch MotorSensors Solenoids

pushbutton Lamp/bulbs

Figure 1.10: Ladder Symbols

Figure 1.11: Ladder Logic Interpretation

Referring to Figure 1.11 above, between these two rails, a horizontal straight line was drawn with two symbols. These two symbols refer to the input and output devices, which are used in the actual process/system. On the left, we put all kinds of input. While on the right, we place all types of the outputs.

Sometimes in designing a program, there is another contact or out load link to the rung in parallel. This is what we call “branch” as shown at Figure 1.12.

Figure 1.12: Branch

TIM/CNT

Input

Interface Output

+24V -0V

Branch

Rung

10

Page 11: 04 Chapter 1_plc

Once we complete one line of the program, it seems like a ladder. This horizontal line, which places the input and output, make one rung. (Figure 1.13)

Figure 1.13: Rung

Latching / Self-Holding Program

Latching technique is used to hold an output device maintain activated although the input contact has deactivated. Both input and output device has another device, which is setup parallel to their actual device (Figure 1.14). Simply, we set a branch to the input/output device. The additional device actually is an internal relay which can maintain the operating current to the rung.

Figure 1.14: Latching

It is important to note that the internal relay used in the latching diagram must be the same, both for input/output.

Multiple Right Hand Instructions

Branch of a rung is not only specific to input only. It also can be applied to the output devices. For a simple example, one pushbutton is pressed and two lamps are switched on and at the same time the bell ring. This shows us that by using one input device we can manage a lot of output no matter how we design it. Combination between multiple output and internal relay can synergize a sequence logic control. In the other side, we said it has memory the program.

Rung 1

Rung 2

LatchingIR1 IR1

Switch Lamp

11

Page 12: 04 Chapter 1_plc

Figure 1.15: Multiple Output

1.2.4.2 Boolean Instruction/Logic Instruction

Logic instructions are used as the basic programming language for PLCs. Although logic instructions are easy to earn and use, it can be very time consuming to check and relate a large coded program to the actual circuit function. Furthermore, logic instructions tend to vary with different types of PLC. A factory or plant may use a range of different PLC. Table 1.1 shows some basic instruction and function of Boolean instruction with graphic symbol.

Table 1.1: Boolean Instruction and Function

Boolean Instruction and Function Graphic SymbolStore (STR) – Load (LD)Begins a new rung or an additional branch in a rung with a normally open contactStore Not (STR NOT) – Load (LD NOT)Begins a new rung or an additional branch in a rung with a normally closed contactOr (OR)Logically ORs a normally open contact in parallel with another contact in rung

Or Not (OR NOT / NOR)Logically ORs a normally closed contact in parallel with another contact in rung

And (AND)Logically ANDs a normally open contact in parallel with another contact in rungAnd Not (AND NOT / NAND)Logically ANDs a normally closed contact in parallel with another contact in rungAnd Store (AND STR) – And Load (AND LD)Logically ANDs two branches of a rung in series

Lamp 1

Lamp 2

Bell

Switch

12

Page 13: 04 Chapter 1_plc

Or Store (OR STR) – Or Load (OR LD)Logically ORs two branches of a rung in parallel

Output (OUT)Reflects the status of the rung (on/off) and outputs the discrete (ON/OFF) state to the specified image register point or memory locationOutput Not (OUT NOT)Reflects the status of the rung (on/off) and output OFF for an ON execution condition; turns the output ON for an OFF execution condition

1.2.4.3 Guidelines for Installation

Figure 1.16 indicates an example of ladder program pressing the push button (0.06) will activate solenoid (1.03) and bulb (1.14). Hardware installation for generate this program as shown in Figure 1.17.

Figure 1.16: Ladder Program

Figure 1.17: Hardware Installation

END

+24V -0V

Push Button (0.06) Solenoid (1.03)

Bulb (1.14)

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

CPU

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

Input Device

Output terminal

Input Terminal

Bulb 1.14

Push Button 0.06

Solenoid 1.03

+24V

0V

Output Device

13

Page 14: 04 Chapter 1_plc

Proximity Sensors Configuration

Figure 1.18: NPN and PNP Configurations

1 OUTPUTS

1 INPUTS 4

COM

COM

PLC

+

-

1 OUTPUTS

1 INPUTS 4

COM

COM

PLC

+

-

24V

0V

NPN

PNP

24V

0V

14

Page 15: 04 Chapter 1_plc

1.2.5 Programming Timers

PLC timers are output instructions that provide the same function as mechanical timing relays. They are used to active or deactivate device(s) after a preset interval time. The number of timers that can be programmed depends on the model of PLC. The advantage of PLC timers is that their settings can be altered easily, or the number of then used in a circuit can be increased or decreased, through the use of programming changes rather than wiring changes. Timer addresses are usually specified by the programmable controller manufacturer and are located in a specific area of data organization table.

1.2.5.1 Timer Symbol

Timer is used to set a period of an event. It starts measure 0.1 second once it is executed. The measurement will last long due to the ‘Set Value’ time. Once it reaches the set value, timer will reset.

Each timer has a time basis, or more precisely has several timer bases. Typical values are: 1 second, 0.1 second, and 0.01 second. If programmer has entered 0.1 as time basis and 50 as a number for delay increase, timer will have a delay of 5 seconds (50 x 0.1 second = 5 second).

Timers also have to have value SV set in advance. Value set in advance or ahead of time is a number of increments that timer has to calculate before it changes the output status. Values set in advance can be constants or variables. If a variable is used, timer will use a real time value of the variable to determine a delay. This enables delays to vary depending on the conditions during function. Example is a system that has produced two different products, each requiring different timing during process itself. Product A requires a period of 10 seconds, so number 10 would be assigned to the variable. When product B appears, a variable can change value to what is required by product B.

Figure 1.19: Timer Symbol

Typically, timers have two inputs. First is timer enable, or conditional input (when this input is activated, timer will start counting). Second input is a reset input. This input has to be in OFF status in order for a timer to be active, or the whole function would be repeated over again. Some PLC models require this input to be low for a timer to be active; other makers require high status. All of them function in the same way. However, if reset line changes status, timer erases accumulated value.

TIM

0001

#100

Timer

Timer Number

Set Value (SV)

15

Page 16: 04 Chapter 1_plc

1.2.5.2 Types of Timer

ON – Delay Timer

This type of timer simply "delays turning on". In other words, after our sensor (input) turns on we wait x-seconds before activating a solenoid valve (output). This is the most common timer. It is often called TON (timer on-delay), TIM (timer) or TMR (timer). The on-delay timer operates such that when the rung containing the timer is true, the timer time-out period commences. At the end of the timer time-out period, an output is made active as shown in Figure 1.20.

(a) Ladder Diagram

(b) Timing Diagram

Figure 1.20: On-Delay Timer

OFF – Delay Timer

This type of timer is the opposite of the on-delay timer listed above. This timer simply "delays turning off". After our sensor (input) sees a target, we turn on a solenoid (output). When the sensor no longer sees the target, we hold the solenoid on for x-seconds before turning it off. It is called a TOF (Timer Off-delay) and is less common than the on-delay type listed above. (i.e. few manufacturers include this type of timer). The operation will keep the output energized for a time period after the rung containing the timer has gone false. Figure 1.21 illustrates the generic programming of an on and off-delay timer instruction.

10 sec

Input 0.01

Output 1.01

16

Page 17: 04 Chapter 1_plc

(a) Ladder Diagram

(b) Timing Diagram

Figure 1.21: Off-Delay Timer

1.2.6 Programming Counters

Counter (CNT) is used to count down from SV when the execution condition on the count pulse (CP) goes from OFF to ON i.e., the present value (PV) will be decremented by one whenever CNT is executed with an ON execution condition for CP and execution condition was OFF for the last execution. If the execution condition was OFF for the last execution. If the execution condition has not changed or has changed from ON to OFF, the PV of CNT will not change. The completion Flag for a counter is turned ON when the PV reaches zero and will remain ON until the counter is reset.

10 sec

Input Signal

ON/OFF Delay Output

5 sec

17

Page 18: 04 Chapter 1_plc

CNT is reset with a reset input, R. When R goes from OFF to ON, the PV is reset to SV. The PV will not be decremented while R is ON. Counting down from SV will begin again when R goes to OFF. The PV for CNT will not be reset in interlocked program section or by power interruptions. .

1.2.6.1 Counter Symbol

Counter is used to count down when it is activated. It can count incrementally or in detrimental manners. It will count until it reaches the set value where the counter will reset. Counter numbers in a PLC depend on memory available in PLC. Maximum SV is 9999 counts.

Figure 1.22: Counter Symbol

1.2.6.2 Types of Counter

What kinds of counters are there? Well, there are up-counters (they only count up 1, 2, 3...). These are called CTU (count up), CNT, C, or CTR. There are down counters (they only count down 9, 8, 7,...). These are typically called CTD (count down) when they are a separate instruction. There are also up-down counters (they count up and/or down 1, 2, 3, 4, 3, 2, 3, 4, 5,...) These are typically called UDC (up-down counter) when they are separate instructions.

Typically, counters can count from 0 to 9999, -32,768 to +32,767 or 0 to 65535. Why the weird numbers? Because most PLCs have 16-bit counters. We will get into what this means in a later chapter but for now it is suffice to say that 0-9999 is 16-bit BCD (binary coded decimal) and that -32,768 to 32767 and 0 to 65535 is 16-bit binary.

Here are some of the instruction symbols we will encounter (depending on which manufacturer we choose) and how to use them. Remember that while they may look different they are all used the same way. If we can setup one, we can setup any of them.

In this counter, we need 2 inputs. One goes before the reset line. When this input turns on the current (accumulated) count value will return to zero. The second input is the address where the pulses we are counting are coming from. Changes in execution conditions, the Completion Flag, and the PV are illustrated below. PV line height is meant only to indicate changes in the PV.

CNT

001

#1000

Counter

Counter Number

Set Value (SV)

CP

R

18

Page 19: 04 Chapter 1_plc

Figure 1.23: Counter with Two Inputs

Figure 1.24: Counting Diagram

For example, if we were counting how many widgets pass in front of the sensor that is physically connected to input 0001 then we would put normally open contacts with the address 0001 in front of the pulse line.

C0001 is the name of the counter. If we want to call it counter 0001 then we would put "C0001" here.

#3 is the number of pulses we want to count before doing something. If we want to count 3 widgets before turning on a physical output to box them we would put 3 here. If we wanted to count 100 widgets then we would put 100 here, etc. When the counter is finished, it will turn on a separate set of contacts that we also label C0001.

Note that the counter accumulated value ONLY changes at the off to on transition of the pulse input.

Execution condition on count pulse (CP)

SV

SV SV-1

SV-2 0002

0001 0000

ON

OFF

ON

OFF

ON

OFF

Execution condition on count reset (R)

Completion Flag

PV

19

Page 20: 04 Chapter 1_plc

Figure 1.25: Delay-On Counter

Below is one symbol we may encounter for an up-down counter. We will use the same abbreviation as we did for the example above.(i.e. UDCxxx and yyyyy).

Figure 1.26: Up-Down Counter

In this up-down counter, we need to assign 3 inputs. The reset input has the same function as above. However, instead of having only one input for the pulse counting, we now have two. One is for counting up and the other is for counting down. In this example, we will call the counter UDC000 and we will give it a preset value of 1000 (we will count 1000 total pulses). For inputs, we will use a sensor that will turn on input 0001 when it sees a target and another sensor at input 0003 will also turn on when it sees a target. When input 0001 turns on, we count up and when input 0003 turns on we count down. When we reach 1000 pulses, we will turn on output 500. Again note that the counter accumulated value ONLY changes at the off to on transition of the pulse input. The ladder diagram is shown below.

Figure 1.27: Example of Up-Down Counter Application

20

Page 21: 04 Chapter 1_plc

1.3 Equipments

Equipments needed for programming PLCs are:

1. PLCs2. I/O Modules3. Programming devices (PC)4. Programming software

1.4 Procedures

The following are typical procedures for programming PLCs:

1. Justify the problem to be controlled2. Identify the available equipment and the address3. Design the PLC program in PC4. Simulate and debug the program in PC5. Install electrical and pneumatic/hydraulic circuit6. Load the program to PLC unit7. Commission the control

Here are some guidelines of initiating the PLC program in PC. In UTHM, we are using OMRON PLCs for teaching and learning. The software used for OMRON PLCs programming is CX-Programmer IEC by Omron Corporation.

1. Start the software and create a new file. You will be prompted with a small window. Enter the information as shown in Figure 1.28 below.

2. After you clicked OK, your PLC program will be ready to be designed using ladder diagram (see Figure 1.29).

3. Use the appropriate symbols and enter their names and addresses.4. Once your program is completed, you may check for errors by compiling

the program (see Figure 1.30).5. After you finished debugging the errors, you may simulate the program by

connecting it to the PLC and work online (see Figure 1.31). Before you work online, make sure you have switched on your PLC.

6. When you are satisfied with your program, you may load the program to the PLC unit (see Figure 1.32).

7. Once the program is loaded, you may start the commissioning of your control system.

21

Page 22: 04 Chapter 1_plc

Figure 1.28

Figure 1.29

Figure 1.30

22

Page 23: 04 Chapter 1_plc

Figure 1.31

Figure 1.32

23

Page 24: 04 Chapter 1_plc

1.5 Tasks

1.5.1 Exercise 1 – Basic PLC

Consider the simple process control problem illustrated in Figure 1.33. Here a mixer motor is to be used to automatically stir the liquid in a vat when the temperature and pressure reach preset values. In addition, direct manual operation of the motor is provided by means of a separate push button station. The process is monitored with temperature and pressure sensor switches that close their respective contacts when conditions reach their preset values.

Figure 1.33: Mixer Process Control Problem

Answer the following with reference to the Figure 1.33:

i. List the I/O components in separately according to that figure.ii. Omron CJ1G CPU42H / CJ1M CPU, each channel consist of 16 bit which

have channel 0 and 1 representing input and output module respectively. List an I/O address which referring answer question i.

iii. Sketch the PLC system of these problems. Illustrate the CPU diagram in detail for I/O module connection to device referring to question ii.

24

Page 25: 04 Chapter 1_plc

1.5.2 Exercise 2 – Boolean Operator

Answer the questions according to Figure 1.34 and 1.35 below:

Figure 1.34

i. When PB1 & PB2 are not pressed; Light1 is ______, Light2 is ______

ii. When PB1 & PB2 are pressed; Light1 is ______, Light2 is ______

iii. The Boolean operator for the diagram above is ___________

Figure 1.35

iv. When PB1 is pressed; L1 is _______

v. When PB2 is pressed; L1 is _______

vi. The Boolean operator for the diagram above is ___________

25

Page 26: 04 Chapter 1_plc

1.5.3 Exercise 3 – Single Actuator

A simple drilling operation requires the drill press to turn on only if there is a part present and the operator has one hand on each of the start switches. The precaution will ensure that the operator’s hands are not in the way of the drill. Switches 1 & 2 and the part sensor must be activated to make the drill motor operate.

i. Replace the drill motor with double acting linear cylinder that uses 5/2way DCV single solenoid spring return and sketch proper pneumatic circuit.

ii. Sketch the electrical circuit diagram with proper I/O connection.iii. Give the tabular/motion plan iv. Design the ladder program that will execute the hardwired control circuit

in Figure 1.36.

Figure 1.36

26

Page 27: 04 Chapter 1_plc

1.5.4 Exercise 4 – Sequential Actuator

Parts are manually placed in a receptacle. A pneumatic cylinder A pushes the receptacle under drilling operation. The drill feed unit is controlled by a pneumatic actuator B. After drilling, cylinder A must not return until drill feed unit has reached its start position. The sequence will begin when start button is pressed. Each cylinder is controlled by a double solenoid valve spring return (Figure 1.37).

i. Sketch a proper pneumatic circuit.ii. Sketch the electrical circuit diagram with proper I/O connection.iii. Give the tabular/motion plan iv. Design the ladder program that will execute the hardwired control circuit

in Figure 1.32.

Figure 1.37

27

Page 28: 04 Chapter 1_plc

1.5.5 Exercise 5 – Timer

a) Auto Light Off

When the lights are turned off in a building, and exit door light is to remain on for an additional 2 min, and parking lot lights are to remain on for an additional 3 min after the door light goes out. Write a program to implement this process.

b) Plastic Clamping Machine

Plastic components are to be joined together by the application of adhesive, heat and pressure (see Figure 1.38). Operation starts when a push button is activated. Two cylinders will clamp the product. Next, a compression cylinder will reach the forward end position and components are to be pressed together for 10 seconds. After that, the piston rod will return automatically to its starting position.

Figure 1.38

c) Traffic Light

You have assigned the task of developing a stoplight application. Your company thinks there is a large market in intelligent street corner control. Your company is to develop a PLC based system in which light will adapt their timing to compensate the traffic volume. Your task is to program normal stoplight to be sequence used as comparison to new system.

Red light: 25secYellow light: 5 secGreen light: 20 sec

28

Page 29: 04 Chapter 1_plc

1.5.6 Exercise 6 – Counter

a) Part Sorting

In Figure 1.39, the number of parts carried on a conveyor is counted by a through hole head proximity switch. When the set value of 10 is reached a cylinder extends and retracts automatically on full extend and the red light will turn on. System will restart again when the reset switch is pressed.

Figure 1.39

b) Packaging workstation

One operator is responsible to ensure 10 box of tissue will package in the one big box. The flow process will be started by pressing a push button. Transfer unit will take 10 tissue boxes to be put into one big box. After cycle complete the cylinder will stay at home position for 5 second for operator remove the big box and put a new big box to the workstation.

29

Page 30: 04 Chapter 1_plc

c) Automatic Stacking Program

In the process shown in Figure 1.40, conveyor M1 is used to stack metal plates onto conveyor M2. The photoelectric sensor provides an input pulse to the PLC counter each time a metal drops from conveyor M1 to M2. When 15 plates have been stacked, the PLC timer activates conveyor M2 for 5 sec.

Figure 1.40

30

Page 31: 04 Chapter 1_plc

1.6 Group Project

You need to work in groups for project preparation and presentation. Please select one of below project title. Develop relevant pneumatic circuit, ladder diagram and circuit installation diagram. You can also propose the group project from your own working environment. Project presentation outline should include:

Project Background Process Flow Description PLC Program Development Device Installation Discussion Conclusion

1.6.1 Project Titles

a) Operating a Charge and Discharge Process

Charge and discharge of a reservoir is a common process in industry as well as a need for mixing two or more substances. By using automated valves, this process can be completely automated. Let us say that fluid used in the example is water, and that a reservoir has to be filled up and emptied four times.

When you push T1 on the operating panel, valve V1 opens and a reservoir starts filling up with water. At the same time, motor M of the mixer starts working. When the reservoir fills up, water level goes up and reaches the level set by a sensor S1. V1 valve closes and motor of the mixer stops. Valve V2 opens then and a reservoir start emptying. When water level falls below the level set by a sensor S2, valve V2 closes. By repeating the same cycle four times, lamp that indicates end of a cycle is activated. Pressing T1 key will start a new cycle.

Both types of differentiators are used in this example. You can get an idea of what their role is from picture below. Level S1 and S2 sensors provide information on whether fluid level goes beyond a specified value. This type of information is not important when you wish to know whether fluid level goes up or down in a certain sequence. Mainly, event of approaching the upper level, or a moment when fluid that fills up a reservoir goes beyond upper level and activates sensor S1 is detected in segment 3 of a ladder diagram. Brief activation of IR200.02 output has a consequence a turn off of an output V1 (valve for water, prevents further flow of water but also motor operation in the mixer). Moment prior to this (segment 5) valve V2 turns on which marks a beginning of fluid outflow. Other two differentiators (in segments 6 and 7) have a task of registering events such as closing a valve MV2 and drop in fluid level below allowed minimum.

31

Page 32: 04 Chapter 1_plc

Figure 1.41: Reservoir

b) Automation of Product Packaging

Product packaging is one of the most frequent cases for automation in industry. It can be encountered with small machines (ex. packaging grain like food products) and large systems such as machines for packaging medications. Example we are showing here solves the classic packaging problem with few elements of automation. Small number of needed inputs and outputs provides for the use of CPM1A PLC controller that represents simple and economical solution.

By pushing START key you activate Flag1 which represents an assisting flag (Segment 1) that comes up as a condition in further program (resetting depends only on a STOP key). When started, motor of an conveyor for boxes is activated. The conveyor takes a box up to the limit switch, and a motor stops then (Segment 4). Condition for starting a conveyor with apples is actually a limit switch for a box. When a box is detected, a conveyor with apples starts moving (Segment 2). Presence of the box allows counter to count 10 apples through a sensor used for apples and to generate counter CNT010 flag which is a condition for new activation of a conveyor with boxes (Segment 3). When the conveyor with boxes has been activated, limit switch resets counter which is again ready to count 10 apples. Operations repeat until STOP key is pressed when condition for setting Flag1 is lost. Picture below gives a time diagram for a packaging line signal.

32

Page 33: 04 Chapter 1_plc

Figure 1.42: Product Packaging Workstation

c) Automation of Storage Door

Storage door or any door for that matter can be automated, so that man does not have to be directly involved in their being opened or closed. By applying one three-phased motor where you can change direction of its movement, doors can be lifted up and lowered back down. Ultrasonic sensor is used in recognizing presence of a vehicle by the doors, and photoelectric sensor is used to register a passing vehicle. When a vehicle approaches, the doors move up, and when a vehicle passes through the door (a ray of light is interrupted on photoelectric sensor) they lower down.

By setting a bit IR000.00 at the PLC controller input where ultrasonic sensor is connected, output IR010.00 (a switch is attached to this output) is activated, so that a motor lifts the doors up. Aside from this condition, the power source for lifting the doors must not be active (IR010.01) and the doors must not be in upper position already (IR000.02). Condition for upper limit switch is given as normally closed, so change of its status from OFF to ON (when doors are lifted) will end a condition for bit IR010.00 where power source for lifting the doors is (Segment 1).

Photoelectric switch registers a vehicle that passes by, and sets flag IR200.00. DIFD instruction is used. This instruction is activated when a condition that precedes it changes status from ON to OFF. When a vehicle passes through a

33

Page 34: 04 Chapter 1_plc

door, it interrupts a ray and bit IR000.01 status changes from ON to OFF (Segment 2).

By changing status of an assisting flag from OFF to ON a condition for lowering a door is executed (Segment 3). Aside from this condition, it is necessary that a unit power source for lifting a door is turned off, and that door is not in lower position already. Bit which operates this power source for lowering, IR010.01 is automatic, so doors are lowered until they come to the bottom limit switch which is represented in a condition as normally closed. Its status change from OFF to ON interrupts a condition of the power source for lowering doors. With oncoming new vehicle, cycle is repeated.

Figure 1.43: Storage Door

d) Separate Conveyor

Write a program to implement the process illustrated in Figure 1.44. An up counter must be programmed as part of a batch – counting operation to sort parts automatically for quality control. The counter is installed to divert 1 part out of every 10 for quality control or inspection purpose. The circuit operates as follows:

A start/stop push button stations is used to turn the conveyor motor on and off.

A proximity sensor counts the parts as they pass by on the conveyor. When a count of 10 is reached, the counter’s output activates the gate

solenoid, diverting the part into the inspection line.

34

Page 35: 04 Chapter 1_plc

The gate solenoid is energized for 2 sec, which allows enough time for the part to continue to the quality control line.

The gates return to its normal position when the 2 sec time periods ends. The counter reset to 0 and continue accumulates counts. A reset pushbutton is provided to reset the counter manually.

Figure 1.44

e) Safety Conveyor

In a large car factory, before the main conveyor system starts operating, a warning system is required. This is done so that the workers can stay clear from the machine.

The warning system is as follows:

When main START button is pressed, a siren ON/OFF for 5 times. After that the siren is kept ON for a period 5 sec. Then the siren is switched OFF, the conveyor system starts operating

continuously.

The conveyor system stops only when STOP button is pressed.

35