1
CHAPTER 1
PROGRAMMABLE LOGIC CONTROLLERS 1.1 1.1 Le Lear arni ning ng Out Outco com mes After completing this course, students should be able to: 1. Understand Understand PLC’ PLC’ss terminology terminology,, configuration configuration,, I/O modules modules addressing addressing and types of PLC memory devices, 2. Program Program instructio instructions ns that that perform perform logical logical operation operationss and ladder logic programs, 3. Program Program the control control of output outputss using using the timer timer instruction instruction contro controll bits, 4. Apply the PLC PLC counter counter function function and and associated associated circuitry circuitry to control control systems, 5. Install Install hardware hardware components components used in PLC PLC systems systems..
1.2 Theory 1.2. 1.2.1 1 Intr Introd oduc ucti tion on 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 outp output ut devi devices ces.. PLC PLC is a speci speciali alized zed compu computer ter to cont contro roll machi machine ness and and proce process sses. es. It uses uses a program programmab mable le memory memory to store store instru instructio ctions ns and execut executee 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
1
•
Easier Troubleshoot Troubleshoot
Figure 1.1: PLC System
1.2. 1.2.2 2 Part Partss of a PLC PLC A typical typical PLC can be divide divided d into into parts, parts, as illustr illustrated ated in Figure 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
1.2.2. 1.2.2.1 1 Centr Central al Proc Process essing ing Unit Unit
The Central Processing Unit (CPU) is the brain of the PLC. CPU (Figure 1.3) is a microproces microprocessor sor that coordinates coordinates the activities activities of the PLC system. system. It executes executes the program, program, processes I/O signals signals and communicates communicates with external external devices. devices. The proce process ssor or requir requires es memory memory for storin storing g the result resultss of the logical logical operat operation ionss performed by the microprocessor. microprocessor.
(a) CPU Omron CJ1G
(a) CPU Omron CPM
Figure 1.3: CPU Component (Courtesy of Omron) Om ron)
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 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.
3
b) Non-Volatile memory:
Those that retain their contents when power is switched off. Non-erasable memories consist of: Read Read Only Only Memor Memory y (ROM (ROM): ): This This is perma permane nent ntly ly prog program ramme med d 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: Eras Erasab able le PROM PROMss (EPR (EPROM OMs) s) hold hold data data perm perman anent ently ly just just like 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. 1.2.2. 2.2 2 Inpu Input/ t/Ou Outp tput ut Mod Modul ulee
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 output unit. The output unit produces the output signal and sends sends it to the output output device.
4
(a)
(b)
Figure 1.4: I/O Configurations (a) modular I/O, (b) fixed I/O
1.2. 1.2.2. 2.3 3 Powe Powerr Sup Suppl ply y
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 fi eld devices devices.. With With larger larger systems systems,, power power to field field devices devices is provid provided ed by externa externall alternating current (ac) or direct current (dc) supplies. For small and micro PLC systems, the power supply is used to power field devices.
5
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 controllers you'll you'll find electrical supply as a separate separate module. Those 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. 1.2.2. 2.4 4 Prog Progra rammi mming ng Devi Device cess
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. Compa ompact ct han handhel dheld d units nits are are freq frequ uentl ently y used on the the fact factor ory y flo floor for for troublesho troubleshooting oting equipment, equipment, modifying modifying programs, programs, and transferring transferring programs to multiple machines. A person personal al comput computer er (PC) (PC) is the most most common commonly ly used used progra programmi mming ng device 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, docu docume ment nt,, stor storee and and to gene genera rate te prin printe ted d repo report rt.. The The pers person onal al comp comput uter er communicate catess with the PLC processor via a serial or para aralle llel data ata 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. s ystems. •
Figure 1.5: Programming devices (a) handheld unit; (b) personal computer.
6
1.2. 1.2.3 3 Th Thee I/O I/O Se Sect ctio ion n The 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 indivi individua duall I/O module moduless similar similar to that that shown shown in Figure Figure 1.6. 1.6. Input Input interfa interface ce 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
The processor receives signals from the remote input modules and sends signals back to their input modules via the communication module
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 identify where the device is located, located, to monitor monitor or control control it uses this address. address. In addition, there is some means of connecting field wiring on the I/O module hous housin ing. g. Conn Connec ecti ting ng the the fiel field d wiri wiring ng to the the I/O I/O hous housin ing g allo allows ws easi easier er
7
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.2.3.1 1 Addre Addressi ssing ng I/O I/O Memor Memory y Are Areas as
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.
8
a) Photoelectric sensors
b) Vision
c) Resistance sensor
d) Motor
Figure 1.8: Input devices
9
a) Rotary encoder
b) Lamp
c) Buzzer
d) Cylinder
Figure 1.9: Output devices
1.2.4 1.2.4 Fundam Fundament entals als of of PLC Pro Progr gramm amming ing The term PLC programming language refers to the method by which the user comm commun unica icates tes info informa rmati tion on to the the PLC. PLC. The The three three most most commo common n lang langua uage ge structures structures are ladder diagram, Boolean Boolean language and functional functional chart. Although 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 Ladder diagra diagram m langua language ge is by far the most common commonly ly used used PLC language 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 individually or in combination 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.
10
1.2. 1.2.4. 4.1 1 Ladd Ladder er Diag Diagra ram m
Ladder diagram uses standard symbols to represent the circuit components and functions found in a control system. s ystem.
Input symbols
Output Symbols TIM/ CNT
Normally Normallyopen contact closed contact switch Sensors pushbutton
Normally-open Normally-closed out load out load Motor Solenoids Lamp/bulbs
Timer , Counter etc.
Figure 1.10: Ladder Symbols
+24V
-0V Interface Input
Output
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.
Rung
Branch Figure 1.12: Branch
11
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)
Rung 1
Rung 2
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.
Switch
Lamp
IR1
Latching
IR1
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 inpu inputt devi device ce we can can mana manage ge a lot lot of outp output ut no matt matter er how how we desi design gn it. 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.
12
Switch
Lamp 1
Lamp 2
Bell
Figure 1.15: Multiple Output
1.2.4.2 1.2.4.2 Boolean Boolean Instruct Instruction/L ion/Logic ogic Instruct Instruction ion
Logi Logicc inst instru ructi ction onss are used used as the the basi basicc prog program rammi ming ng langu languag agee for for PLCs PLCs.. Alth Althou ough gh logi logicc inst instru ruct ctio ions ns are easy easy to earn earn and and use, use, it can be very very time time cons consum umin ing g to chec check k and and relat relatee a larg largee code coded d prog program ram to the the actua actuall circu circuit it 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 i nstruction with graphic symbol. Table 1.1: Boolean Instruction and Function Boolean Instruction and Function Store (STR) – Load (LD) Begins a new rung or an additional branch in a rung with a normally open contact Store Not (STR NOT) – Load (LD NOT) Begins a new rung or an additional branch in a rung with a normally closed contact Or (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 paralle l with another contact in rung And Not (AND NOT / NAND) Logically ANDs a normally closed contact in paral lel with another contact in rung And Store (AND STR) – And Load (AND LD) Logically ANDs two branches of a rung in series
13
Graphic Symbol
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 location Output 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. 1.2.4.3 3 Guidel Guideline iness for for Instal Installat lation ion
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. +24V
-0V
Solenoid (1.03)
Push Button (0.06)
Bulb (1.14) END
Figure 1.16: Ladder Program +24V
Output Device
Solenoid 1.03
Bulb 1.14
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Output terminal
CPU 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Input Device
Push Button 0.06
Input Terminal
0V
Figure 1.17: Hardware Installation
14
Proximity Sensors Configuration
1
OUTPUTS
COM
PLC 1
INPUTS
4
COM
24V
+ NPN
0V
1
OUTPUTS
COM
PLC 1
INPUTS
4
COM
0V
+ PNP
-
24V
Figure 1.18: NPN and PNP Configurations
15
1.2. 1.2.5 5 Prog Progra ramm mmin ing g Time Timers rs PLC timers are output output instructions instructions that provide provide the same function as mechanical 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 specifi specified ed by the progra programma mmable ble contro controller ller manufac manufactur turer er and are located located in a specific area of data organization table.
1.2. 1.2.5. 5.1 1 Timer imer Symb Symbol ol
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. TIM
Timer
0001
Timer Number
#100
Set Value (SV)
Figure 1.19: Timer Symbol
Typically 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.
16
1.2. 1.2.5. 5.2 2 Types ypes of Time Timerr
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
Input 0.01
Output 1.01
10 sec
(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.
17
(a) Ladder Diagram Input Signal
ON/OFF Delay Output
10 sec
5 sec (b) Timing Diagram
Figure 1.21: Off-Delay Timer
1.2. 1.2.6 6 Prog Progra ramm mmin ing g Count Counter erss Counter Counter (CNT) is used to count down from SV when the execution condition condition on the count pulse (CP) goes from OFF to ON i.e., the present value (PV) will be decremented decremented by one whenever CNT is executed executed with an ON execution 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.
18
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. 1.2.6. 6.1 1 Coun Counte terr Symb Symbol ol
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. CP
R
CNT
Counter
001
Counter Number
#1000
Set Value (SV)
Figure 1.22: Counter Symbol
1.2. 1.2.6. 6.2 2 Types ypes of Coun Counte terr
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 suffice to say that 0-9999 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, a nd the PV are illustrated ill ustrated below. below. PV line height is meant only to indicate changes in the PV. PV.
19
Figure 1.23: Counter with Two Inputs
Execution condition on count pulse (CP)
Execution condition on count reset (R)
ON OFF
ON OFF
ON Completion Flag OFF
PV
SV
SV1
SV
SV-
2
0002 0001
0000
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 number of pulses pulses we want to count before doing something. 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, finished, it will turn on a separate set of contacts contacts that we also label C0001. Note that the counter accumulated value ONLY changes at the off to on transition of the pulse input.
20
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 functio function n as above. above. However However,, instead instead of having having only one input for the pulse counting, counting, we now have two. One is for counting up and the other is for counting 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 Application
21
1.3 Equipments Equipments needed for programming PLCs are: 1. 2. 3. 4.
PLCs I/O Modules Prog Program rammi ming ng dev device icess (PC) (PC) Prog Program rammi ming ng soft softwa ware re
1.4 Procedures The following are typical procedures for programming PLCs: 1. 2. 3. 4. 5. 6. 7.
Justify Justify the problem problem to be be contr controll olled ed Identi Identify fy the availa available ble equip equipmen mentt and the addre address ss Desi Design gn the the PLC PLC pro progr gram am in in PC Simula Simulate te and and debu debug g the the progr program am in in PC Install Install electri electrical cal and pneuma pneumatic/ tic/hy hydrau draulic lic circuit circuit Load Load the the pro progr gram am to to PLC PLC uni unitt Comm Commis issi sion on the the cont contro roll
Here are some guidelines of initiating the PLC program in PC. In UTHM, we are using OMRON PLCs OMRON PLCs for teaching and learning. The software used for OMRON for OMRON PLCs programming is CX-Programmer IEC by IEC by Omron Corporation. 1. Start the the software software and create create a new file. file. You You will will be prompted prompted with with a small window. window. Enter the t he information as shown in Figure 1.28 below. below. 2. After you you clicked clicked OK, OK, your your PLC program program will be ready to be design designed ed using ladder diagram (see Figure 1.29). 3. Use the the appropriate appropriate symbols symbols and enter their their names names and addresses. addresses. 4. Once your your program program is is completed, completed, you may may check check for errors errors by compiling compiling the program (see Figure 1.30). 5. After you you finished finished debuggin debugging g the errors, errors, you you may simulate simulate the the program 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 you are satisfie satisfied d with your program, program, you you may load load the the program program to the PLC unit (see Figure 1.32). 7. Once the the program program is loaded loaded,, you may start start the commis commissioni sioning ng of your control system.
22
Figure 1.28
Figure 1.29
Figure 1.30
23
Figure 1.31
Figure 1.32
24
1.5 Tasks 1.5. 1.5.1 1 Exer Exerci cise se 1 – Bas Basic ic PLC PLC Consider the simple process control problem illustrated in Figure 1.33. 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 moni monito tore red d with with tempe tempera ratu ture re and and pres pressu sure re sens sensor or switc switche hess that that clos closee thei their r 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 List the I/O comp compone onents nts in in separat separately ely accor accordin ding g to that that figure. figure. ii. Omron CJ1G CJ1G CPU42 CPU42H H / CJ1M CPU, each each channel channel consist consist of 16 16 bit which which have channel 0 and 1 representing input and output module respectively respectivel y. List an I/O address which referring answer question i. iii. Sketch the the PLC system of these these problems. problems. Illustrate Illustrate the CPU diagram diagram in detail for I/O module connection to device referring to question ii.
25
1.5.2 1.5.2 Exerc Exercis isee 2 – Boolea Boolean n Opera Operator tor Answer the questions according to Figure 1.34 and 1.35 below:
Figure 1.34
i.
When PB1 & PB2 are not not pressed; pressed; Light1 Light1 is ______ ______,, Light2 Light2 is ______ ______
ii. When PB1 PB1 & PB2 are pressed; pressed; Light1 Light1 is ______, ______, Light2 Light2 is ______ ______ iii. The Boolean Boolean operator operator for the diagram above above is ________ ___________ ___
Figure 1.35
iv. iv. When PB1 PB1 is pressed; pressed; L1 is _______ _______ v. When When PB2 PB2 is presse pressed; d; L1 L1 is ______ _______ _ vi. The Boolean Boolean operator operator for the diagram above above is ________ ___________ ___
26
1.5.3 1.5.3 Exerc Exercis isee 3 – Sing Single le Actuat Actuator or A simple drilling operation requires the drill press to turn on only if there is a part pres presen entt and and the the opera operato torr has has one one hand hand on each each of the the star startt switc switche hes. s. 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 Replace the drill drill motor motor with with doubl doublee acting acting linear linear cylinder cylinder that uses uses 5/2way DCV single solenoid spring return and sketch proper pneumatic circuit. ii. Sketch the electrical electrical circuit circuit diagram diagram with with proper proper I/O I/O connection connection.. iii. Give the tabular/moti tabular/motion on plan iv. iv. Design Design the ladder program program that will execute execute the hardwired hardwired control circuit circuit in Figure 1.36.
Figure 1.36
27
1.5.4 1.5.4 Exerc Exercis isee 4 – Sequent Sequentia iall Actua Actuator tor Parts are manually placed in a receptacle. A pneumatic cylinder A cylinder A pushes the recep receptac tacle le unde underr dril drillin ling g oper operati ation on.. The The drill drill feed feed unit unit is cont contro rolle lled d by a pneumatic actuator B. B. After drilling, cylinder A must must not return until drill feed fee d unit has reached reached its start start positi position. on. The sequen sequence ce will will begin begin when when start start button button is pressed. Each cylinder is controlled by a double solenoid valve spring return (Figure 1.37). i. ii. iii. iv. iv.
Sket Sketch ch a pro prope perr pneum pneumat atic ic circ circui uit. t. Sketch the electrical electrical circuit circuit diagram diagram with with proper proper I/O I/O connection connection.. Give the tabular/moti tabular/motion on plan Design Design the ladder program program that will execute execute the hardwired hardwired control circuit circuit in Figure 1.32.
Figure 1.37
28
1.5. 1.5.5 5 Exer Exerci cise se 5 – Time Timerr a) Auto Light Light Off 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 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 deve develo lop p a PLC PLC base based d syst system em in whic which h ligh lightt will will adap adaptt thei theirr timi timing ng to compensate the traffic volume. Your task is to program normal stoplight to be sequence used as comparison to new system. Red light: 25sec Yellow light: 5 sec Green light: 20 sec
29
1.5. 1.5.6 6 Exer Exerci cise se 6 – Coun Counte terr 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.
30
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
31
1.6 Group Pr Projec ject 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.6.1 1 Proj Projec ectt Titl Titles es 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 Valve V2 opens then and a reservoir start emptying. emptying. When water level falls below the level set by a sensor 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) valv valvee V2 turn turnss on whic which h mark markss a begi beginn nnin ing g of fluid fluid outf outflo low w. Othe Otherr two 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.
32
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 show showin ing g here here solv solves es the the clas classi sicc pack packag agin ing g prob problem lem with with few elem elemen ents ts of automation. Small number of needed inputs and outputs provides for the use of CPM1A PLC 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. box. When a box is detected, detected, a conveyor conveyor with apples starts moving moving (Segment 2). Presence of the box allows counter to count 10 apples through a sensor used for appl apples es and and to gene generat ratee coun counte terr CNT0 CNT010 10 flag flag whic which h is a cond conditi ition on for for new 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.
33
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 lifted up and lowered lowered back down. down. Ultras Ultrasoni onicc sensor sensor is used used in recogni recognizin zing g 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 DIFD instru instructio ction n is used. used. This instru instructio ction n is activate activated d when when a condit condition ion that that precedes it changes status from ON to OFF. When a vehicle passes through a door, it interrupts a ray and bit IR000.01 status changes from ON to OFF (Segment 2).
34
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. already. Bit which operates this power source for lowering, IR010.01 is automatic, so door doorss are lowe lowered red unti untill they they come come to the the bott bottom om limit limit swit switch ch whic which h 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. conveyor. When a count of 10 is reached, the counter’s output activates the gate solenoid, diverting the part into the inspection line.
35
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 START button is pressed, a siren ON/OFF for 5 times. ti mes. After that the siren is kept ON for a period 5 sec. Then the siren is switched OFF, OFF, the conveyor system starts operating continuously.
The conveyor system stops only onl y when STOP button is pressed.
36