An introduction to programmable logic controllers, part I PLC are used in almost every industry to control the process and the operation of equipment as well as in electrical power distribution substations. Despite the vast range of configurations and levels of sophistication that specific applications demand, there are some basic elements common to all programmable logic controllers (PLCs). Understanding how these building blocks work can go a long way toward better PLC selection for your plant's processes and equipment. A PLC is a solid state device that works on conventional microprocessor computer principles. The microprocessor is programmed to respond as a programmable controller which continuously and sequentially performs certain functions. PLCs receive input from a variety of switches and sensors, make decisions based on input status and program logic and, finally, write outputs to affect equipment control. The control function that a PLC system performs has three basic elements: the sense, the decision and the control. Input from the field is generated by push buttons, limit switches, relay contacts, selector switches, and other sensors and switches. Outputs are sent to the field to control motor starters, valve actuators, solenoids, and relays. The decisions a processor make are executed by manipulating the registers which reside in the PLC processor. (A register is a small portion of memory that can be used by the processor to store different kinds of information). This manipulation does not occur unless a user developed control program is stored in the processor memory. The control program is developed using ladder diagram programming. In the ladder diagram all I/Ps are shown as contact symbols and all O/Ps as coil symbols along with an associated number which is the address. These address numbers reference either the location of the external I/P and O/P connections to the PLC or the internal relay equivalent address within the processor. Refer to Figure 1 for a schematic of relay logic as performed by a PLC. THE PROCESSOR The processor is a selfcontained device which houses the control processor, the communication ports, user memory, scan processor, registers, fault monitoring circuity, realtime clock and status light emitting diodes. The principal function of the processor is scanning. More specifically, the processor reads inputs, consults the ladder diagram, and updates outputs accordingly. The longer the program, the longer the scan time. Another reason for a slow scan time is fragmented registers registers containing both input and output data. Registers hold in their memory the changing information upon which the processor bases its decisions. Registers can hold the status of digital I/O (for example, 16 bits) or a single number representing a timer, a counter or any data value. Input and output devices connected to a PLC are assigned address numbers. The registers could be assigned and used for digital I/O, internal relays, data storage or as register modules. The limitation on the usage and addressing of registers is based on the processor design. Processor memory can be classified in a number of ways, including PROM (programmable read only memory) factory programmed executive program, which makes the microprocessor perform as a programmable controller, and RAM user memory used to store the ladder diagram. Random access memory is volatile and needs battery backup. It is used for data handling and variables storage, including the status of timers, counters, and digital I/O. Set points and tables can also
be stored in these registers. Some types of processors gave a user memory RAM and UVPROM (ultra violet programmable read only memory). A RAM/UVPROM processor not only provides the capability of storing regular ladder rungs in UVPROM but also allows the programming of critical circuits in an unchangeable format. LED indicators on the front of the processor will signal run (processor operating properly), halt (processor is not scanning), memory (processor detected an error in user memory), force (one or more inputs or outputs have been forced to ON or OFF), I/O (malfunction occurred within the I/O registers or external system), battery low (backup battery is low), write protect (part or all user memory is protected from alterations). The processor is mounted in the CPU slot of a digital or register rack assembly.
INPUT/OUTPUT MODULES The input/output modules used to interface between the field and the processor are numerous but there are some basic configurations. A broad classification for these modules is whether or not they can be classified as intelligent. •Digital input modules. These modules are capable of receiving signals from four, eight, or twelve field input devices (switches and sensors) or five volt dc devices. Inputs are either electrically isolated or not isolated from each other. Each of the optically isolated inputs has a LED indicator on the front of the module which illuminates on receiving an ON signal from the field I/P device. •Digital output module. These modules are capable of driving loads such as motor starters, solenoids, and pilot lights. These outputs may or may not be electrically isolated from each other. The front cover of such modules could have up to three LED indicators: one illuminates when the processor issues a command to energize the output, another when the I/P voltage is provided on the O/P terminal, and the third could be a blown fuse indicator. These modules are installed in I/O digital rack assemblies. •Analog input modules. These modules are inserted in any slot of a register rack except the CPU or into the register slot of a digital rack. The analog module is made up of several subsystems: the analog to digital converter, the input multiplexer, the onboard microprocessor, the autocalibration system, the dctodc converter, signal and power isolation circuitry. This type of module is capable of recieving a number of channels (up to four) of high level analog input signals. The signal is then converted through the analog to digital converter subsystem and then inputted to processor. •Analog output modules. These modules can be plugged in the same location as analog input modules. This type of module is made up of digital to analog converter, sample and hold circuit, onboard microprocessor, dctodc converter, signal and power isolation circuitry. The module is capable of generating a number of analog output signals for controlling equipment action ( valves, rheostat,.. ). PROCESS CONTROL MODULE The process control module permits proportional/intergral/derivative (PID) control of one to four loops.
It can be used as a standalone loop controller or tied into a large distributed control system containing other modules, terminals, PLC, and computers. It is an intelligent I/O module that monitors the input process variable, compares the I/P to the desired set point, calculate the analog O/P based on the control algorithm programmed in the module. Closed loop control is used when disturbances require more elaborate corrective action to maintain the process. (Figure 2 shows a simplified PID closed loop system).
The instrumentation used to measure the process variable is usually analog. The output is usually an analog control device termed "final control element." These field values are inputted to or outputted from the processor via analog I/P, O/P modules. Figure 3 shows a sample system with one loop.
There are three modes of process control module (PCM) operation: manual, auto and cascaded (which permits two loops to control one process). Algorithms exist to solve each of the three types of PID problems: reverse acting, direct acting and manual. A process control station can be used in conjunction with this module to allow the adjustment and monitoring of the loop parameters and alarms.This module solves each loop in order, starting with the first, then the second and so on. The module reads the PV at the start of this loop calculation and sends the result to the output module at the end of such loop's calculation. Registers can be defined as loop (the registers associated to a particular loop), PCM registers (registers associated with a PCM 4 times the loop registers for a 4 loop PCM) and rack addressing registers (addreses assigned to the registers as part of the rack system). For a typical configuration to pass information between PCMs, refer to fig. 4.
STEPPING MOTOR CONTROLLER This module allows the programmable control of stepper motors using PLC. Accelerations, decelerations, constant velocities and final positioning can be programmed in single moves or combinations of moves to suit a variety of motion applications. Data and commands sent to the stepper
motor controllers are converted to pulse outputs to be applied to the controlled motor through the translator. The desired motion of the stepper motor can be accelerated, decelerated or maintained at a constant rate by controlling the output pulse rate. Positioning modes that could be available with this module include single step, which allows the control of individual moves one at a time and continuous mode that allows the blend of moves continuously into a move profile with fully programmed accelerations and decelerations. A typical module may have 7 input terminals which are the 525 V supply, the manual/automatic, the slow down, the stop, the clear, the jog clockwise and jog counter clockwise. The 5 output terminals are the power supply, the C.C.W. pulse, the C.W pulse and the common which are connected to the translator (driver amplifier). LEDs are provided to indicate the condition of the SMC, refer to fig. 5 for the typical available functions. One method of setting this module could be through the use of dip switches. The setting of such switch will allow the selection of the following: output pulse duration (eg. 5 or 20 microsec.), the polarity of the pulse of the C.W. and C.C.W. pulses (eg. negative or positive), the method by which the SMC will stop the stepping motor if the processor is placed in halt (eg. stop immediately or decelerate to stop) and finally whether the SMC will have external inputs that would control the slowing down and stopping of the motor. For a block diagram and external connections, refer to fig. 5.
In general, the SMC will maintain an accumulated bidirectional pulse count (a continous total number of produced pulses). It can preset or be cleared by the user program or the input clear connection to the SMC. A brief description of stepping motors, the different types and a few definitions will follow. The stepping motor is a device that translates electrical pulses into mechanical movements. Per each incoming pulse the output shaft rotates or moves a specific angular rotation. This displacement is repeated precisely with each succeeding pulse (which is transleted by the drive circuitrytranslsator). The error introduced by the stepping motor is less than 5 % per step and is noncumulative. The basic motor types are the variable reluctance (VR), the permanent magnet (PM) and the hybrib. The VR motor operates generally with step angles of 5 deg. to 15 deg. The PM one generally has step angles of 45 or 90 deg. The hybrid exhibit steps between 0.9 and 5 deg. The basic principle of operation of stepping motors is based on the permanent magnet theory "like poles repel and opposite polarities attract". The number of teeth on the rotor and stator determines the step angle that will be achieved each time the polarity of one winding is changed. STEP ANGLE:the motor shaft rotates its specific increment each time the winding polarity changes. This specific degree of rotation or increment is the step angle and is measured in degrees.
ERROR FREE START STOP (EFSS): it is an additional curve that may be found on some speedtorque curves which indicates the maximum step rate to which the particular motor can start and stop without loosing step or falling out of synchronism. This condition assumes no acceleration/deceleration time. STEPS PER SECOND: it replaces the RPM figure of a standard motor. The number of angular movements accomplished by the motor in one second. Steps per revolution is the total number of steps required to have the output shaft rotating 360 deg. TRANSLATOR: it is an electronic device with circuitry to convert pulses into the proper switching sequence, resulting in one motor step taken for each pulse received from the SCM. PULSE RATE: it is the rate at which the motor windings are switched. When one pulse equals one motor step, the pulse rate is also the motor stepping rate. RAMPING: it is the process of controlling pulse frequency to accelerate the motor from zero to maximum speed as well as to decelerate the motor from maximum speed to zero. It increases the capability of driving the motor and load to higher speed levels. SLEW RATE: it is an area of high speed where the motor can run unidirectionally in synchronism, but it cannot instantaneously stop, reverse or start. The stepping motor is brought up to a slewing rate using acceleration and is then decelerated to the EFSS where it can be stopped without the loss of a step. STEP RESPONSE: when given a command to take a step the motor will respond with a specific time period. This time for a single step is function of the torque to inertia ratio of the rotor and of the characteristics of the electronic drive system.