PLC Introduction PDF
Document Details
Uploaded by Deleted User
Electronics Engineering Department
Tags
Summary
This document provides a comprehensive introduction to Programmable Logic Controllers (PLCs). It covers the basics of PLC hardware, software, and applications, targeting a professional audience. The content delves into topics like the CPU and buses, memory types, input and output (I/O) devices, and programming methods, essential knowledge points for anyone working in industrial automation and control systems.
Full Transcript
Introduction to PLC ELECTRONICS ENGINEERING DEPARTMENT What is PLC? A programmable logic controller (PLC) is a special form of microprocessor- based controller that uses a programmable memory to store instructions and to implement functions such as logic, sequencing, timing,...
Introduction to PLC ELECTRONICS ENGINEERING DEPARTMENT What is PLC? A programmable logic controller (PLC) is a special form of microprocessor- based controller that uses a programmable memory to store instructions and to implement functions such as logic, sequencing, timing, counting and arithmetic in order to control machines and processes. Input devices and output devices in the system being controlled are connected to the PLC. The operator then enters a sequence of instructions into the memory of the PLC. The controller then monitors the inputs and outputs according to this program and carries out the control rules for which it has been programmed. Advantage PLCs have the great advantage that the same basic controller can be used with a wide range of control systems. To modify a control system and the rules that are to be used, all that is necessary is for an operator to key in a different set of instructions. There is no need to rewire. The result is a flexible, cost effective, system which can be used with control systems which vary quite widely in their nature and complexity. Programming Device Program & Communications Data Memory Interface Input Output Interface Processor Interface Power Supply Hardware The processor unit or central processing unit (CPU) is the unit containing the microprocessor and this interprets the input signals and carries out the control actions, according to the program stored in its memory, communicating the decisions as action signals to the outputs. Hardware The programming device is used to enter the required program into the memory of the processor. The program is developed in the device and then transferred to the memory unit of the PLC. Hardware The memory unit is where the program is stored that is to be used for the control actions to be exercised by the microprocessor and data stored from the input for processing and for the output for outputting. Hardware The programming device is used to enter the required program into the memory of the processor. The program is developed in the device and then transferred to the memory unit of the PLC. Hardware The input and output sections are where the processor receives information from external devices and communicates information to external devices. Hardware The communications interface is used to receive and transmit data on communication networks from or to other remote PLCs. It is concerned with such actions as device verification, data acquisition, synchronization between user applications and connection management. Internal Architecture Internal Architecture It consists of a central processing unit (CPU) containing the system microprocessor, memory, and input/output circuitry. The CPU controls and processes all the operations within the PLC. The CPU is supplied with a clock with a frequency of typically between 1 and 8 MHz. This frequency determines the operating speed of the PLC and provides the timing and synchronization for all elements in the system. The information within the PLC is carried by means of digital signals. The internal paths along which digital signals flow are called buses. In the physical sense, a bus is just a number of conductors along which electrical signals can flow. It might be tracks on a printed circuit board or wires in a ribbon cable. The CPU The internal structure of the CPU depends on the microprocessor concerned. In general they have: An arithmetic and logic unit (ALU) which is responsible for data manipulation and carrying out arithmetic operations of addition and subtraction and logic operations of AND, OR, NOT and EXCLUSIVE-OR. Memory, termed registers, located within the microprocessor and used to store information involved in program execution. A control unit which is used to control the timing of operations. The Buses The buses are the. The information ipaths used for communication within the PLCs transmitted in binary form, i.e. as a group of bits with a bit being a binary digit of 1 or 0, i.e. on/off states. The term word is used for the group of bits constituting some information. Thus an 8-bit word might be the binary number 00100110. Each of the bits is communicated simultaneously along its own parallel wire. The system has four buses: The data bus carries the data used in the The Buses processing carried out by the CPU. A microprocessor termed as being 8-bit has an internal data bus which can handle 8-bit numbers. It can thus perform operations between 8-bit numbers and deliver results as 8- bit values. The address bus is used to carry the addresses of memory locations. Every memory location is given a unique address so that data stored at a particular location can be accessed by the CPU either to read data located there or put data there. It is the address bus which carries the information indicating which address is to be accessed. If the address bus consists of 8 lines, the number of 8-bit words, and hence number of distinct addresses, is 28 = 256. With 16 address lines, 65 536 addresses are possible. The system has four buses: The Buses The control bus carries the signals used by the CPU for control. For example: To inform memory devices whether they are to receive data from an input or output data. It is also used to carry timing signals used to synchronize actions. The system bus is used for communications between the input/output ports and the input/output unit. There are several memory elements in a PLC system: System read-only-memory (ROM) to give permanent Memory storage for the operating system and fixed data used by the CPU. Random-access memory (RAM) for the user’s program. Random-access memory (RAM) for data. This is where information is stored on the status of input and output devices and the values of timers and counters and other internal devices. The data RAM is sometimes referred to as a data table or register table. Part of this memory, i.e. a block of addresses, will be set aside for input and output addresses and the states of those inputs and outputs. Part will be set aside for preset data and part for storing counter values, timer values, etc. Erasable and Programmable read-only-memory (EPROM) for ROMs that can be programmed and then the program made permanent. Memory The programs and data in RAM can be changed by the user. All PLCs will have some amount of RAM to store programs that have been developed by the user and program data. However, to prevent the loss of programs when the power supply is switched off, a battery is used in the PLC to maintain the RAM contents for a period of time. After a program has been developed in RAM it may be loaded into an EPROM memory chip, often a bolt-on module to the PLC, and so made permanent. In addition there are temporary buffer stores for the input/output channels. The storage capacity of a memory unit is determined by the number of binary words that it can store. Thus, if a Memory memory size is 256 words then it can store 256 × 8 = 2048 bits if 8-bit words are used 256 × 16 = 4096 bits if 16-bit words are used. Memory sizes are often specified in terms of the number of storage locations available with 1K representing the number 210, i.e. 1024. Manufacturers supply memory chips with the storage locations grouped in groups of 1, 4 and 8 bits. A 4K x 1 memory has 4 x 1 x 1024 bit locations. A 4K x 8 memory has 4 x 8 x 1024 bit locations. The term byte is used for a word of length 8 bits. Thus the 4K x 8 memory can store 4096 bytes. With a 16-bit address bus we can have 216 different addresses and so, with 8-bit words stored at each address, we can have 216 x 8 storage locations and so use a memory of size 216 x 8/210 = 64K x 8 which we might be as four 16K x 8 bit memory chips. Input/output unit The input/output unit provides the interface between the system and the outside world, allowing for connections to be made through input/output channels to input devices such as sensors and output devices such as motors and solenoids. Input/output unit It is also through the input/output unit that programs are entered from a program panel. Every input/output point has a unique address which can be used by the CPU. The input/output channels provide isolation and signal conditioning functions so that sensors and actuators can often be directly connected to them without the need for other circuitry. Input/output unit Electrical isolation from the external world is usually by means of optoisolators /optocoupler. Outputs Outputs are specified as being of relay type, transistor type or triac type. With the relay type, the signal from the PLC output is used to operate a relay and is able to switch currents of the order of a few amperes in an external circuit. The relay not only allows small currents to switch much larger currents but also isolates the PLC from the external circuit. Relays are, however, relatively slow to operate. Relay outputs are suitable for a.c. and d.c. switching. They can withstand high surge currents and voltage transients. Outputs The transistor type of output uses a transistor to switch current through the external circuit. This gives a considerably faster switching action. It is, however, strictly for d.c. switching and is destroyed by overcurrent and high reverse voltage. As a protection, either a fuse or built-in electronic protection are used. Outputs Triac outputs, with optoisolators for isolation, can be used to control external loads which are connected to the a.c. power supply. It is strictly for a.c. operation and is very easily destroyed by overcurrent. Fuses are virtually always included to protect such outputs. Programming PLCs Programming devices can be a hand-held device, a desktop console or a computer. Only when the program has been designed on the programming device and is ready is it transferred to the memory unit of the PLC. Hand-held programming devices will normally contain enough memory to allow the unit to retain programs while being carried from one place to another. Programming PLCs Desktop consoles are likely to have a visual display unit with a full keyboard and screen display. Programming PLCs Personal computers are widely configured as program development work-stations. Some PLCs only require the computer to have appropriate software; others require special communication cards to interface with the PLC. A major advantage of using a computer is that the program can be stored on the hard disk or a CD and copies easily made. PLC Input Devices A mechanical switch generates an on−off signal or signals as a result of some mechanical input causing the switch to open or close. Such a switch might be used to indicate the presence of a workpiece on a machining table, the workpiece pressing against the switch and so closing it. The absence of the workpiece is indicated by the switch being open and its presence by it being closed. PLC Input Devices Proximity switches are used to detect the presence of an item without making contact with it. There are a number of forms of such switches, some being only suitable for metallic objects. PLC Input Devices Reed switch consists of two overlapping, but not touching, strips of a springy ferromagnetic material sealed in a glass or plastic envelope. When a magnet or current-carrying coil is brought close to the switch, the strips become magnetized and attract each other. The contacts then close. The magnet closes the contacts when it is typically about 1 mm from the switch. PLC Input Devices Photoelectric switch devices can either operate as transmissive types where the object being detected breaks a beam of light, usually infrared radiation, and stops it reaching the detector or reflective types where the object being detected reflects a beam of light onto the detector PLC Input Devices Encoder is a device that provides a digital output as a result of angular or linear displacement. An increment encoder detects changes in angular or linear displacement from some datum position, while an absolute encoder gives the actual angular or linear position. PLC Input Devices A beam of light passes through slots in a disc and is detected by a light sensor. When the disc rotates, the light beam is alternately transmitted and stopped and so a pulsed output is produced from the light sensor. The number of pulses is proportional to the angle through which the disc has rotated, the resolution being proportional to the number of slots on a disc. With 60 slots then, since one revolution is a rotation of 360o, a movement from one slot to the next is a rotation of 6o. PLC Input Devices The absolute encoder differs from the incremental encoder in having a pattern of slots which uniquely defines each angular position. The rotating disc has four concentric circles of slots and four sensors to detect the light pulses. The slots are arranged in such a way that the sequential output from the sensors is a number in the binary code, each such number corresponding to a particular angular position. With 4 tracks there will be 4 bits and so the number of positions that can be detected is 24 = 16, i.e. a resolution of 360/16 = 22.5o. Typical encoders tend to have up to 10 or 12 tracks. The number of bits in the binary number will be equal to the number of tracks. Thus with 10 tracks there will be 10 bits and so the number of positions that can be detected is 210, i.e. 1024, a resolution of 360/1024 = 0.35o. PLC Input Devices Temperature Sensors such as bimetallic thermometers, thermocouples and RTDs. PLC Input Devices Position/Displacement sensors such as potentiometers and LVDTs. Strain Gauge Pressure Sensors Liquid Level Detectors Flow Meters PLC Input Devices Smart sensors - a sensor which is integrated with the required buffering and conditioning circuitry in a single element. The circuitry with the element usually consists of data converters, a processor and firmware, and some form of non-volatile EEPROM memory (electrically erasable programmable read only memory, it is similar to EPROM. Because the elements are processor- based devices, such sensors can be programmed for specific requirements. For example, it can be programmed to process the raw input data, correcting for such things as non-linearities, and then send the processed data to a base station. It can be programmed to send a warning signal when the measured parameter reaches some critical value. Output Devices Generally, the digital signal from an output channel of a PLC is used to control an actuator which in turn controls some process. The term actuator is used for the device which transforms the electrical signal into some more powerful action which then results in the control of the process. Solenoids form the basis of a number of output control actuators. When a current passes through a solenoid a magnetic field is produced and this can then attract ferrous metal components in its vicinity. Relay One example of such an actuator is the relay, the term contactor being used when large currents are involved. When the output from the PLC is switched on, the solenoid magnetic field is produced and pulls on the contacts and so closes a switch or switches. The result is that much larger currents can be switched on. Thus the relay might be used to switch on the current to a motor. Relay Output Devices Directional control valves Another example of the use of a solenoid as an actuator is a solenoid operated valve. The valve may be used to control the directions of flow of pressurized air or oil and so used to operate other devices such as a piston moving in a cylinder. Output Devices Directional control valves Directional control valves are described by the number of ports they have and the number of control positions. The valve shown in the previous example has four ports, i.e. A, B, P and T, and two control positions. It is thus referred to as a 4/2 valve. The basic symbol used on drawings for valves is a square, with one square being used to describe each of the control positions. Output Devices Directional control valves Direction valves can be used to control the direction of motion of pistons in cylinders, the displacement of the pistons being used to implement the required actions. single acting cylinder - is powered by the pressurized fluid being applied to one side of the piston to give motion in one direction, it being returned in the other direction by possibly an internal spring. double acting cylinder – is powered by fluid for its motion in both piston movement directions. Output Devices Control of a Single-Acting Cylinder Output Devices Control of a Double-Acting Cylinder Output Devices Stepper Motor The stepper or stepping motor is a motor that produces rotation through equal angles, the so- termed steps, for each digital pulse supplied to its input. Thus, if one input pulse produces a rotation of 1.8o then 20 such pulses would give a rotation of 36.0o. To obtain one complete revolution through 360o, 200 digital pulses would be required. The motor can thus be used for accurate angular positioning. Such a motor is used with computer printers, robots, machine tools and a wide range of instruments where accurate positioning is required. Output Devices Motor Sometimes a PLC is required to reverse the direction of rotation of the Many industrial processes only require motor. This can be done using relays the PLC to switch a d.c. motor on or off. to reverse the direction of the current This might be done using a relay. The applied to the armature coil. For diode is included to dissipate the induced rotation in one direction, switch 1 is current resulting from the back e.m.f. closed and switch 2 opened. For rotation in the other direction, switch 1 is opened and switch 2 closed.