Navigation

  • Page 1

    Industrial Programmable Logic Controllers (PLCs) Eng. R. L. Nkumbwa Copperbelt University School of Technology 2010

  • Page 2

    Eng. R. L. Nkumbwa @ CBU 2010 2 Programmable Logic Controllers (PLC’s) A programmable logic controller (PLC) is a special purpose computer aimed at implementing control solutions. Historically PLC‟s have been used mainly for on-off or logic type applications. However, modern PLC‟...

  • Page 3

    Eng. R. L. Nkumbwa @ CBU 2010 3 Programmable Logic Controllers These notes emphasize the switching capability of a PLC. However, the reader is urged to think of the dynamics of the underlying system. For example, we recently heard of a seemingly straightforward application of a PLC to a re...

  • Page 4

    Eng. R. L. Nkumbwa @ CBU 2010 4 Programmable Logic Controllers This can be seen as an approximate form of integral control. However, pure integral control when applied to a tank (which is also an integrator) will lead to self sustained oscillations. The reader is encouraged to verify t...

  • Page 5

    Eng. R. L. Nkumbwa @ CBU 2010 5 Industrial Robustness of PLC’s If you have ever had a personal computer lock-up or reset in the middle of something important you will appreciate that a similar failure in a large industrial application would have severe consequences. A PLC is simply an in...

  • Page 6

    Eng. R. L. Nkumbwa @ CBU 2010 6 Industrial Robustness of PLC’s It is common in the mining industry to have PLC‟s on large mobile equipment to monitor and control everything from lights to large electrical drives. The vibration and operating temperature of this environment require the u...

  • Page 7

    Eng. R. L. Nkumbwa @ CBU 2010 7 Some Physical Tolerances of leading PLC brands

  • Page 8

    Eng. R. L. Nkumbwa @ CBU 2010 8 Typical Areas of Application For past 30 years PLC‟s have been in the first level of control because of their ability to run uninterrupted for extended periods of time (usually measured in months or even years). The PLC layer in industrial applications is ...

  • Page 9

    Eng. R. L. Nkumbwa @ CBU 2010 9 Control hierarchy of PLC’s

  • Page 10

    Eng. R. L. Nkumbwa @ CBU 2010 10 Ladder Logic The remained of this chapter will look at Ladder Logic, which is the most common programming structure used in PLC‟s. Several examples of common Ladder Logic programs will be demonstrated to show the simple structure of this coding style.

  • Page 11

    Eng. R. L. Nkumbwa @ CBU 2010 11 Relay Ladder Logic Ladder logic is possibly the simplest programming language. The principle behind the language is illustrated by a simple electrical relay. (Electrical relay logic preceded PLC‟s as initially all logic was implemented in hard wired panel...

  • Page 12

    Eng. R. L. Nkumbwa @ CBU 2010 12 Simple Relay Circuit

  • Page 13

    Eng. R. L. Nkumbwa @ CBU 2010 13 Circuit representation in Ladder Logic The above circuit is represented in Ladder logic as shown in figure below (only the low voltage circuit is used in ladder logic diagrams):

  • Page 14

    Eng. R. L. Nkumbwa @ CBU 2010 14 Boolean Logic The above diagram can be expressed in Boolean logic “Motor Coil = Switch”, ie if the Switch is on the Motor coil is energized and Motor is activated. All ladder logic takes the form of that shown in Figure above. Thus it connects the po...

  • Page 15

    Eng. R. L. Nkumbwa @ CBU 2010 15 Ladder Logic Instructions The three most common instructions in ladder logic are:

  • Page 16

    Eng. R. L. Nkumbwa @ CBU 2010 16 PLC Switching The majority of simple PLC switching tasks can be implemented using these simple instructions. However there exists a set of 60 to 100 individual instructions such as those above which form the complete PLC language. Other functions vary f...

  • Page 17

    Eng. R. L. Nkumbwa @ CBU 2010 17 Multi Input/Output Rungs

  • Page 18

    Eng. R. L. Nkumbwa @ CBU 2010 18 Multi Input/Output Rungs Each of the inputs in series such as „S2‟ and „S3‟ are equivalent to the Boolean “AND”{.} statement while a “Bridge” in a rung is seen as an “OR”{+} statement. In the case shown in Figure above the Boolean expres...

  • Page 19

    Eng. R. L. Nkumbwa @ CBU 2010 19 Multi Output Rungs It is also possible to have multi output rungs provided the OTE instructions are never placed is series, they must always be in parallel and in contact with the Neutral (right) rail, as shown in figure below. (While multi output rungs are nec...

  • Page 20

    Eng. R. L. Nkumbwa @ CBU 2010 20 Multi Output Rungs

  • Page 21

    Eng. R. L. Nkumbwa @ CBU 2010 21 Start-Stop Rung Any large rung can always be broken down into simple Boolean expressions such as for the simple rungs shown above. Just as common electrical relays have auxiliary outputs, which are used for feedback and indication, a similar strategy is used...

  • Page 22

    Eng. R. L. Nkumbwa @ CBU 2010 22 Use of Auxiliary Output

  • Page 23

    Eng. R. L. Nkumbwa @ CBU 2010 23 Push Button Example In this case the push buttons are “normally open” i.e. they return a low signal in their normal position and a high signal when pressed. Initially assume the Coil output is off, and the Push Buttons (PB) not activated so they are also...

  • Page 24

    Eng. R. L. Nkumbwa @ CBU 2010 24 Push Button Example Pressing the „stop‟ button (stop =1) breaks the rung so the coil is turned OFF and remains off after the stop button is released.

  • Page 25

    Eng. R. L. Nkumbwa @ CBU 2010 25 Other PLC Programming languages While Ladder logic is the most common form of PLC language it is worth noting that other languages do exist which where developed in conjunction with Relay Ladder Logic.

  • Page 26

    Eng. R. L. Nkumbwa @ CBU 2010 26 Other Languages Blocks are built from small ladder logic subroutines and used through the code as user defined ladder logic instructions, the advantages of this approach is the reduction of repetitive ladder logic code. Sequential Function Chart (SFC) progra...

  • Page 27

    Eng. R. L. Nkumbwa @ CBU 2010 27 Other Languages Note: Some programming packages allow the user to switch between Relay Ladder Logic and Structured text representations of the code.

  • Page 28

    Eng. R. L. Nkumbwa @ CBU 2010 28 PLC Modules The modular nature of PLC components makes the design, instillation and maintenance of the first level of control much simpler. Similar to the peripheral devices, which can be obtained for a personal computer, there are literally thousands of in...

  • Page 29

    Eng. R. L. Nkumbwa @ CBU 2010 29 Digital Inputs/Outputs (I/O) By far the most common industrial signals used in PLC‟s are simple digital control signals. Referred to as Digital I/O (Digital input/output), they can be measured in there thousands for substantial industrial plants. They...

  • Page 30

    Eng. R. L. Nkumbwa @ CBU 2010 30 Digital Inputs/Outputs (I/O) Digital I/O signals come in many forms from 12 Volt DC to 240 Volt AC, but the most common industrial signals are 24Volt DC and 120V AC. There are Digital I/O modules to measure all of these signals, an extra variation is the nu...

  • Page 31

    Eng. R. L. Nkumbwa @ CBU 2010 31 Analogue Inputs/Outputs (I/O) Analogue signals enter and leave the PLC in voltage and current form, The resolution of most analogue signals is between 11 and 16 bits. While voltage is commonly used in practice it can be sensitive to noise (induced voltages ...

  • Page 32

    Eng. R. L. Nkumbwa @ CBU 2010 32 Analogue Inputs/Outputs (I/O) –A signal of 4.0mA equates to zero, –A signal of 20mA equates to 2048 for an 11 bit input, The reason for the 4.0mA starting point is a fail-safe feature, if the instrument fails or the signal cable is damaged the current falls...

  • Page 33

    Eng. R. L. Nkumbwa @ CBU 2010 33 Other interface modules Digital I/O and Analogue I/O signals comprise the vast majority of PLC signals. However, not all devices can be controlled by these simple signals and it is often required that PLC‟s communicate to foreign instruments using many dif...

  • Page 34

    Eng. R. L. Nkumbwa @ CBU 2010 34 Memory (Addressing , Internal Registers) The memory in PLC‟s needs to be predefined by the programmer, similar to defining variables in standard programming. The memory is divided into data files, each data file has a unique number and a character prefix...

  • Page 35

    Eng. R. L. Nkumbwa @ CBU 2010 35 Allen Bradley PLC-5 System

  • Page 36

    Eng. R. L. Nkumbwa @ CBU 2010 36 Allen Bradley PLC-5 System The ASCII character (or characters) denotes the data area type. Other types of defined words include T-timers, C-counters and S-status registers etc. Note that the Output and Input numbers are dropped from file 0 and 1 respectively...

  • Page 37

    Eng. R. L. Nkumbwa @ CBU 2010 37 Allen Bradley PLC-5 System The internal data areas of Integers and Floating point addresses simply point to a linear memory region. However the Input and Output address actually correspond to a physical address. For example I:12/03 has the format, I:{Rack a...

  • Page 38

    Eng. R. L. Nkumbwa @ CBU 2010 38 Physical I/O Addressing

  • Page 39

    Eng. R. L. Nkumbwa @ CBU 2010 39 Physical I/O Addressing Note: PLC‟s usually start counting from zero and use the octal counting system. ie an eight slot rack will have slots numbered from 0 to 7. This is the case for racks, slots and input numbers. So the first possible input would ...

  • Page 40

    Eng. R. L. Nkumbwa @ CBU 2010 40 Addressing Format The addressing format has been demonstrated here because in writing a PLC program the address is used by the PLC in the ladder logic. For example, if in the Start /Stop logic of figure (6) the Start PB = I:13/04 and Stop PB = I:13/05 and t...

  • Page 41

    Eng. R. L. Nkumbwa @ CBU 2010 41 Start/Stop Addressing Example

  • Page 42

    Eng. R. L. Nkumbwa @ CBU 2010 42 PLC Programming Architecture A PLC program can be divided into many small subroutines. In this respect PLC‟s replace function and procedures with subroutines. Each subroutine is executed from top to bottom in a predetermined order. Once all the subrou...

  • Page 43

    Eng. R. L. Nkumbwa @ CBU 2010 43 PLC Programming Architecture For example a program may be divided in the following way: –Subroutine U:20 – Pumps sequencing logic file. –Subroutine U:21 – Pump No.1 alarming and drive file. –Subroutine U:22 – Pump No.2 alarming and drive file. –Su...

  • Page 44

    Eng. R. L. Nkumbwa @ CBU 2010 44 PLC Programming Architecture Here subroutine 20 controls the sequencing of 21,22 and 23 while the drive files are virtually identical for each pump by starting and stopping the pump while reporting alarms and the healthy status to file 20. Fault finding pro...

  • Page 45

    Eng. R. L. Nkumbwa @ CBU 2010 45 PLC Programming Architecture The development of a plant wide PLC standard is an essential step in automating a large control system. The benefits are twofold, if the programming standard is well understood many code developers can work on the code producing...

  • Page 46

    Eng. R. L. Nkumbwa @ CBU 2010 46 Commercially Available PLC’s The next slides give details of some commercial available PLC‟s. The purpose of this is to show the variety of PLC‟s available on the market.

  • Page 47

    Eng. R. L. Nkumbwa @ CBU 2010 47 Allen-Bradley PLC’s Below are AB Plcs Note that AB is part of the Rockwell Automation, a global leading Automation giant.

  • Page 48

    Eng. R. L. Nkumbwa @ CBU 2010 48

  • Page 49

    Eng. R. L. Nkumbwa @ CBU 2010 49 Siemens Simatic PLC’s Below are Siemens Simantic PLCs

  • Page 50

    Eng. R. L. Nkumbwa @ CBU 2010 50

  • Page 51

    Eng. R. L. Nkumbwa @ CBU 2010 51 Modicon TSX PLC’s See Modicon TSX PLC below

  • Page 52

    Eng. R. L. Nkumbwa @ CBU 2010 52

  • Page 53

    Eng. R. L. Nkumbwa @ CBU 2010 53 Other PLC Terminology On-line: Refers to the program code currently in the PLC memory. Off-line: Refers to the copy of the program code stored on the programming computer. Up-Load: Refers to the act of copying the current On-line code from the PLC to the ...

  • Page 54

    Eng. R. L. Nkumbwa @ CBU 2010 54 Other PLC Terminology Run Mode: The PLC actively scanning the code and driving outputs. Program Mode: The PLC is not being scanned (All outputs disabled) Remote Mode: programming computer can change the PLC between Run and Program. Note: There is a phy...

  • Page 55

    Eng. R. L. Nkumbwa @ CBU 2010 55 Programming Procedure PLC‟s are very versatile in the respect that programming changes can be made on-line while the processor is in Run Mode. This is equivalent to making changes in a compiled „C‟ program while it is being executed. To introduce ...

  • Page 56

    Eng. R. L. Nkumbwa @ CBU 2010 56 Programming Procedure Insert edit rungs into the On-line PLC code (as many changes as required). These edits are effectively invisible to the processor during this stage. Once all edit rungs are entered switch the processor to TEST, during TEST mode any new ...

  • Page 57

    Eng. R. L. Nkumbwa @ CBU 2010 57 Programming Example: Simple start/stop ladder logic.

  • Page 58

    Eng. R. L. Nkumbwa @ CBU 2010 58 Programming Example: Simple start/stop ladder logic. This is as it would appear in a windows based programming package. Text in the Yellow and Green box‟s is the Address Description and Address Symbol respectively. The symbols often correspond to SCA...

  • Page 59

    Eng. R. L. Nkumbwa @ CBU 2010 59 Alternative Start/Stop using Latch and Unlatch instructions.

  • Page 60

    Eng. R. L. Nkumbwa @ CBU 2010 60 References Garry Johnston (2010),University of Newcastle, Australia

  • Page 61

    Eng. R. L. Nkumbwa @ CBU 2010 61

x