Welcome
To
Mechatronics World

Friday 30 December 2016

Basic Steps In PLC Programming

Development of an algorithm

The first step in developing a control program is the definition of the control task. The control task specifies what needs to be done and is defined by those who are involved in the operation of the machine or process. The second step in control program development is to determine a control strategy, the sequence of processing steps that must occur within a program to produce the desired output control.

This is also known as the development of an algorithm.
A set of guidelines should be followed during program organization and implementation in order to develop an organized system.
Approach guidelines apply to two major types of projects: new applications and modernizations of existing equipment.
Flow charting can be used to plan a program after a written description has been developed. A flowchart is a pictorial representation of the process that records, analyzes, and communicates information, as well as defines the sequence of the process.
Logic gates or contact symbology are used to implement the logic sequences in a control program. Inputs and outputs marked with an “X” on a logic gate diagram represent real I/O.
Three important documents that provide information about the arrangement of the PLC system are the I/O assignment table, the internal address assignment table, and the register address assignment table.
  1. The I/O assignment table documents the names, locations, and descriptions of the real inputs and outputs.
  2. The internal address assignment table records the locations and descriptions of internal outputs, registers, timers, counters, and MCRs.
  3. The register address assignment tablelists all of the available PLC registers.
Certain parts of the system should be left hardwired for safety reasons. Elements such as emergency stops and master start push buttons should be left hardwired so that the system can be disabled without PLC intervention.
Special cases of input device programming include the program translation of normally closed input devices, fenced MCR circuits, circuits that allow bidirectional power flow, instantaneous timer contacts, and complicated logic rungs.
  • The programming of contacts as normally open or normally closed depends on how they are required to operate in the logic program. In most cases, if a normally closed input device is required to act as a normally closed input, its reference address is programmed as normally open.
  • Master control relays turn ON and OFF power to certain logic rungs. In a PLC program, an END MCR instruction must be placed after the last rung an MCR will control.
  • PLCs do not allow bidirectional power flow, so all PLC rungs must be programmed to operate only in a forward path.
  • PLCs do not provide instantaneous contacts; therefore, an internal output must be used to trap a timer that requires these contacts.
  • Complicated logic rungs should be isolated from the other rungs during programming.
Program coding is the process of translating a logic or relay diagram into PLC ladder program form.
The benefits of modernizing a relay control system include greater reliabilityless energy consumptionless space utilization, and greater flexibility.

Example Of Simple Start/Stop Motor Circuit

Figure 1 shows the wiring diagram for a three-phase motor and its corresponding three-wire control circuit, where the auxiliary contacts of the starter seal the start push button. To convert this circuit into a PLC program, first determine which control devices will be part of the PLC I/O system; these are the circled items in Figure 2. In this circuit, the start and stop push buttons (inputs) and the starter coil (output) will be part of the PLC system.
The starter coil’s auxiliary contacts will not be part of the system because an internal will be used to seal the coil, resulting in less wiring and fewer connections.




Table 1 shows the I/O address assignment, which uses the same addressing scheme as the circuit diagram (i.e., inputs: addresses 000 and 001, output: address 030).
I/O Address
Module TypeRackGroupTerminalDescription
Input000Stop PB (NC)
001Start PB
002
003
Output030Motor M1
031
032
033
To program the PLC, the devices must be programmed in the same logic sequence as they are in the hardwired circuit (see Figure 3). Therefore, the stop push button will be programmed as an examine-ON instruction (a normally open PLC contact) in series with the start push button, which is also programmed as an examine-ON instruction.
This circuit will drive output 030, which controls the starter.




If the start push button is pressed, output 030 will turn ON, sealing the start push button and turning the motor ON through the starter. If the stop push button is pressed, the motor will turn OFF.
Note that the stop push button is wired as normally closed to the input module. Also, the starter coil’s overloads are wired in series with the coil.

Thursday 29 December 2016

SIEMENS Simatic - Working with STEP7



  • Each section is split into two parts: a descriptive part, marked in gray, and a process-oriented part, marked in green. The instructions start with an arrow in the green margin and may be spread out over several pages, finishing in a full stop and a box containing related topics.

    Previous experience of working with the mouse, window handling, pull-down menus, etc. would be useful, and you should preferably be familiar with the basic principles of programmable logic control.


  • The STEP 7 training courses provide you with in-depth knowledge above and beyond the contents of this Getting Started manual, teaching you how entire automation solutions can be created with STEP 7.
    ☺😊
    Contents of manual:
    1.) Introduction to STEP7
    2.) The SIMATIC Manager
    3.) Programming with Symbols
    4.) Creating a Program in OB1
    5.) Creating a Program with Function Blocks and Data Blocks
    6.) Configuring the Central Rack
    7.) Downloading and Debugging the Program
    8.) Programming a Function
    9.) Programming a Shared Data Block
    10.) Programming a Multiple Instance
    11.) Configuring the Distributed I/O with Profibus DP
    Appendix A

    Filename: Simatic-Working-with-STEP-7.pdf             1.8Mb

    SIEMENS Simatic - Programming with STEP7
    This manual provides a complete overview of programming with STEP 7. It is designed to support you when installing and commissioning the software. It explains how to proceed when creating programs and describes the components of user programs.

    The manual is intended for people who are involved in carrying out control tasks using STEP 7 and SIMATIC S7 automation systems.

    In order to understand this manual, general knowledge of automation technology is required.

    In addition, you must be familiar with using computers or PC-similar tools (for example, programming devices) with the MS Windows 2000 Professional, MS Windows XP Professional or MS Windows Server 2003 operating system.

    Contents of manual:
    1.) Introducing the Product and Installing the Software
    2.) Installation
    3.) Working Out the Automation Concept
    4.) Basics of Designing a Program Structure
    5.) Startup and Operation
    6.) Setting Up and Editing the Project
    7.) Editing Projects with Different Versions of STEP7
    8.) Defining Symbols
    9.) Creating Blocks and Libraries
    10.) Creating Logic Blocks
    11.) Creating Data Blocks
    12.) Parameter Assignment for Data Blocks
    13.) Creating STL Source Files
    14.) Displaying Reference Data
    15.) Checking Block Consistency and Time Stamps as a Block Property
    16.) Configuring Messages
    17.) Controlling and Monitoring Variables
    18.) Establishing an Online Connection and Making CPU Settings
    19.) Downloading and Uploading
    20.) Testing with the Variable Table
    21.) Testing Using Program Status
    22.) Testing using the Simulation Program (Optional Package)
    23.) Diagnostics
    24.) Printing and Archiving
    25.) Working with M7 Programmable Control Systems
    26.) Tips and Tricks
    Appendix A

    Filename: Simatic-Programming-with-STEP-7.pdf           5.5Mb

Monday 26 December 2016

PLC TIPS AND HINTS:


Four topics are covered:
1)  Make and use a ‘one shot’
2)  Make toggling logic
3)  Beating PLC scan time issues
4)  Implementing a simple proportional controller in PLC logic


--  The ‘one shot’, what it is, what it is good for,  how to make one if your PLC does not have this feature:

A one shot is a coil which goes true each time the enabling rung ahead of it is true, and it stays true for one scan only, no matter how long the enabling rung is true.  The one shot is useful when you have some condition that goes on and off and you want to have the PLC take action on that true state for only one scan each time the enabling rung goes from true to false.  For example, say you want to count the number of times some event that lasts longer than one scan happens, but the total count will exceed the capacity of the PLC’s built in counter.  One way to deal with this problem, if your PLC has floating point registers available,  is to add one to a floating point register each time the rung goes true.
BUT if you use logic like this: 

           

what will happen is that as long as the rung is true you will add one to the F8:1 register  every time the PLC scans.   With a one shot in the logic:

           

this counter will operate as expected.


Make your own one shot.

Quite a few PLC brands do not offer the useful one shot feature.  In that case, you can make your own with a few rungs of logic:

                           

This is one of the few cases in common PLC programming where the order in which you place the rungs is important.  Here’s how the logic works:  When you start out, the input I:3/0, the memory bit B3:0/2, and the one shot output bit B3:0/1 are all false.  When the input goes true, the memory bit is still false, so the second rung is true, and both the memory bit and the one shot output bit are set by the second rung.  The PLC completes his scan and comes around to this section of logic again, where the first rung finds the output bit true, so that rung resets the output (output has remained on for one full scan).  The memory bit is still true, so the second rung does not set the output bit again.  As long as the input remains true the third rung is not true, so the memory bit remains set.  When the input goes false the third rung resets the memory bit and the next scan which finds the input true can start the whole process over again.  The order of the rungs is important because you don’t want the PLC to see the first rung until after it has completed a full scan with the output bit on.


-- Toggling logic

I have never seen a PLC which offers a toggling feature.  A toggling output would switch from off to on when the input goes true.  It remains on until the input goes false and then goes true again, then the output goes off.  This process repeats itself each time the input goes off then back on.  This kind of logic is useful where you want one button to control a device with this kind of toggling action (press once for on, press same button again for off), or where you want to split a stream of parts so that alternate parts go into two different lanes or bins.  (These are all subsets of the class of circuits commonly called ‘divide by 2’ circuits.)

Here is the logic for a toggling output:

           

Note that the input for the second rung must be a one shot on the control bit.  This logic takes advantage of the way the PLC solves the logic for each rung – basically the PLC logic solver takes the first true path it finds through the branches of the rung and it ignores all the other branches, whether they are true or not. If your particular brand of PLC does not adhere to this convention, then this logic will not work.  It works in Allen Bradley SLC, PLC, and Micrologix, Mitsubishi, Toshiba, and Siemens Step 5 PLCS.


--  PLC scan time issues and how to beat them

If you design controls for high speed machines or processes you will eventually come across a case where the PLC scan time is long enough that it causes a problem.  The first time I saw this was with a machine builder who used an incremental encoder to report machine position.  The incremental encoder generates a number (usually 180, 360, or more) of pulses on a single output line each time it’s shaft is turned through one revolution.  If you count these pulses in a counter in the PLC, and  if you have a zero position sensor that will reset the counter each time the shaft turns through the zero location, then the number in the counter will correspond to the shaft position.  Then you can build ‘cams’ in the PLC logic by comparing the counter value to preset values to create outputs that go on and off at different preset shaft positions.  This company had used this method successfully for years until the day that they decided to increase machine speed by a factor of two.  Suddenly machines began trying to tear themselves apart.  They would run fine at the old slower speed, but when the speed was turned up synchronization was lost and moving parts were moving at the wrong time causing ‘crashes’.   Numerous encoders were tested, always with the same result.  Further investigation revealed that the counter was not counting a full complement of 360 pulses each time the shaft made a revolution.  What was happening was that the output from the encoder operating at a higher speed was going from false to true and back to false during the time it took for the PLC to make one scan.  The PLC scan consists of three actions: look at all the inputs and copy their states in to an input table, solve the ladder logic based on the values in the input table and write results into an output table, then copy the output table to the physical outputs.  Since the PLC is ignoring the value of the inputs during the logic solve step (which takes most of the scan time) and during the write outputs step, he was ignoring some of the rapid transitions from the properly functioning encoder.   In this case the best solution was to replace the incremental encoder with an absolute position encoder.  This type of encoder has a multitude of output lines so that it can send the PLC the absolute value of it’s shaft position in binary or BCD coded format at all times.  Any time the PLC looks at inputs from the absolute encoder he sees a number corresponding to shaft position at that instant.  Now if the PLC does not scan fast enough to notice each transition from one state to the next, he at least will not accumulate a greater and greater error as the shaft rotates.  Each individual ‘cam’ could possibly be mistimed by a small amount, but the error is never more than the PLC scan time and the error does not accumulate as the shaft turns.   There are advantages and disadvantages to each kind of encoder:  The absolute encoder is not susceptible to errors as machine speed increases, but it requires typically 12 to 16 PLC input lines instead of just two for the incremental encoder.  The incremental encoder is never subject to the extremely annoying ‘missed states’ or ‘linear discontinuities’ that a poorly designed absolute encoder can produce.  Missed states refers to the case where, as the encoder shaft is turned very slowly through positions that should take the outputs from the two consecutive values  001111 to 010000 you may briefly get a transition value where some of the bits change and others do not   001111  >>  001100  >>  011100  >>  010000.  This is very troublesome.  No modern absolute encoder will exhibit this kind of action at any position of it’s input shaft.  If yours does, return it to the manufacturer and get one that works correctly with no ‘skipped states’

Another consequence of PLC scan time is that the timing of outputs or the transition time from an input changing state and the output that it is controlling changing will not be completely consistent from one scan to another.  In any PLC the ‘latency’ or time between input change and output change will always vary from scan to scan by as much as +/- one scan time.  This is because the input change is not synchronized with the scanning action.  An input might change just before the PLC copies inputs into the table (in which case it will be recognized on the same scan and will change the output with the shortest delay).  On the other hand, if the input changes just after the inputs are copied into the table, then that change will not be recognized until the next scan, resulting in the longest delay before the output changes.  The delay will be random from scan to scan unless the change at the input is somehow synchronized with the PLC scan, which seldom if ever happens in real life applications.  Here is an example where scan time errors of this kind can cause a problem:  We have a fairly slow motor which we would like to have make one revolution and stop at a fixed position which is determined by a cam lobe on the motor shaft and a prox switch connected to the PLC.  The PLC enables the motor (by closing the ‘run’ contact in a VFD for example), and keeps the motor enabled until he sees the prox signal saying the cam lobe has moved back around to the reference position.  In this case the stop time of the VFD, the response time of the prox switch, and the motor speed are all constant and predictable, but still the motor does not always stop at the same position. (In fact, if the cam is too narrow sometimes the motor doesn’t stop AT ALL.)  The easy solution in this case was to add a pair of external relays connected so that as long as the prox switch was not made the coil of the relay controlling the VFD ‘run’ contact was held closed.  Any time the motor shaft was moved away from the rest position (causing the prox output to go off) the VFD would run, bringing the cam around to the high spot at the reference position where the relay would drop out and the motor would stop in a very predictable and repeatable position.  The PLC started each ‘index’ of the motor by applying a momentary pulse just long enough to move the motor ‘off the cam’.  Now the stop position is not dependent on PLC scan time at all, because the PLC does not control the stop position.   Normally PLC designers try to eliminate all external relays. (This is after all one of the main reasons to use a PLC in the first place.)  But in this case two cheap relays eliminated the need for much more expensive solutions such as a higher performance PLC or a servo or stepper motor drive.

A note about the ‘instant’ contacts and outputs found in some PLC products:  Some PLC manufacturers (Allen Bradley is one) offer what they call ‘instant’ inputs and outputs.  These specific I/O points or instant I/O commands BYPASS the input and output tables in an effort to give the designer another tool to fight scan time problems with.  In the case of Allen Bradley SLC family these are instant instructions that work with any discrete I/O point.  When the logic solver encounters these instructions he looks directly at the input (not at it’s value which has been earlier scanned into the input table) to get it’s value or, in the case of an output, he immediately writes that output as soon as the rung is solved instead of putting the result in the output table to be sent out later with all of the other outputs at the end of the scan.   I have not addressed the use of these instant I/O instructions here because very few PLC families offer them, and because their effective use is very dependent on how your program is laid out and whether there are branches in the program.    Basically you can use these instructions to beat scan time issues by repeating the critical rungs at several places evenly distributed throughout your ladder program.  Then those rungs will be instantly solved several times during each scan, thereby effectively reducing the scan time for those rungs only.  It is important to make sure the placement of the rungs is such that they are solved as frequently as necessary to get down to the scan time value needed, and that this happens for all different possible branching situations that may exist in the program.  Even with use of these instructions you will still see the ‘latency dither’ effects that result from inputs changing asynchronously with respect to the PLC scan cycle – the amount of dither will just be less.  Instant I/O instructions also slow down execution of the rest of the program, sometimes significantly.

Allen Bradley Control Logix PLCs and others of that ilk which allow you to assign processor resources according to scan time requirements are very versatile in that you can generate two or more ladder programs and dictate how often each one is scanned.  You can write a short, frequently scanned program where this is necessary while ‘simultaneously’ running a longer, slower program for non-time-critical functions.   But Control Logix hardware and programming tools cost roughly 2x what equivalent SLC family parts cost, and 4x or more what parts comparable to SLC from other manufacturers cost (today, in 2002), so it would be a poor designer indeed who took the brute force approach of using Control Logix just to solve a scan time problem when there was no other need for this advanced, more expensive product.


--  Implementing a simple proportional controller in PLC logic.

Proportional controllers are used in many process control applications.  A very common use is for controlling heating of a process vessel.  Heaters are generally sized to meet some maximum time-to-temperature specification.  If the heater is adequate to heat the tank in a reasonable time, then there will be significant reserve capacity beyond what is available to hold the process at the setpoint temperature.  A likely consequence of this is that, if a simple on-off temperature controller is used to control this process, the temperature will overshoot the setpoint  If we wait until the temperature reaches the setpoint before turning off the heater, enough residual heat will remain in the heater to cause the actual temperature to exceed the setpoint during the few minutes just after the heater is shut off by the temperature control.   Attempting to anticipate the overshoot and turn off the heater a few degrees before the setpoint will not help, because then the process may never actually achieve the setpoint.  In the world of relay logic, relatively inexpensive PID process controllers are readily available which implement a fully compensated control algorithm which measure and anticipate the heating and cooling rates of the process and correct themselves automatically.  PID stands for Proportional/Integral/Derivative, and these controllers have separate tunable response characteristics which derive an output which is proportional to the difference between the actual process value and it’s setpoint.  The proportional output is modified according to how fast the actual value is approaching the setpoint (the derivative term) and also by any offset in the setpoint after a stable control point has been established (the integral term).  A few of the more expensive brands of PLC also contain PID instructions which allow you to set up PID control for several process loops inside the PLC.  But the PID instruction is not common on middle or low end PLCs.

Here is a way to implement a basic proportional control in PLCs which do not have a built in PID instruction.  We will assume that this PLC is controlling the heater for a large tank of liquid.  What we want to do is turn the heater on whenever the temperature is more than some predetermined value (which we will call the ‘offset’) lower than the setpoint.  When the temperature is between the offset value and the setpoint, we will cycle the heater on and off, with the duty cycle being proportional to the difference between the setpoint and the actual temperature.  You can adjust the offset value according to the specific process conditions to give the best compromise between quick response and minimum overshoot.  A good starting point for the offset value can be obtained by running the process with on-off control (where the heater stays on until the process temperature reaches the setpoint and is then turned off).  Note how much overshoot occurs and make the offset value equal to or somewhat larger than the amount of overshoot.  There is a compromise involved in choosing the time base for the adjustable duty cycle output.  The quickest response and minimum deviation from the setpoint will be obtained with a short duty cycle (the ultimate limit of this idea is the proportional controller where a phase controlled triac or scr switches each half cycle of the AC voltage on at a level proportional to the amount of heat required).  On the other hand, unless you are using a solid state output device to control the heater, rapid cycling will result in premature failure of the output device.  For the sort of large, slow processes this approach is suited for, a time base of at least 10 seconds is recommended.  Time bases as long as a minute will generally work quite well with large tanks.

So, here is what our PLC program will do:
1)  Compute difference between actual and setpoint
2)  Multiply difference x 100
3)  Compare difference x 100 with the accumulator of a free running timer, if difference > counter, turn on the output; if < then turn off the output.
4)  Reset the free running timer every 10 seconds.  (timer accumulator increments each 0.01 seconds, so during the 10 second cycle the output will be on from 0-100.0 percent of the time depending on how far the actual temperature is from the setpoint.  Proportional control will be occurring in the range between setpoint  minus 10 degrees and setpoint.
  
Some cautions:
1)  For heating applications, observe safety precautions.  A complete heater control application will include a backup safety thermostat and independent disconnecting means to prevent overtemperature faults in case of a malfunction of the main controller.
2)  This simple proportional only controller will work well with large tanks and fairly stable process conditions.  A more elaborate control algorithm may be required if the thermal mass is low or if the process is subject to events which rapidly change conditions (like adding or removing large quantities of liquid from the heated tank).

Friday 23 December 2016

Basics of PLCs

Programmable logic controllers provide dependable, high-speed control and monitoring demanded by a wide variety of automated applications.

Programmable logic controllers(PLCs) have gained a substantial hold in the industrial manufacturing arena, and we would be remiss if this technology were not given the due attention it has earned. As such, we are featuring a series of articles based on the fundamentals of PLCs in this new EC&M department covering the technology of solid-state industrial automation. Throughout this series on PLC fundamentals, we'll cover PLC hardware modules; software capabilities; current applications; installation parameters; testing and troubleshooting; and hardware/software maintenance.
What is a PLC?
The National Electrical Manufacturers Association (NEMA) defines a PLC as a "digitally operating electronic apparatus which uses a programmable memory for the internal storage of instructions by implementing specific functions, such as logic, sequencing, timing, counting, and arithmetic to control through digital or analog I/O modules various types of machines or processes."
One PLC manufacturer defines it as a "solid-state industrial control device which receives signals from user supplied controlled devices, such as senors and switches, implements them in a precise pattern determined by ladder-diagram-based application progress stored in user memory, and provides outputs for control of processes or user-supplied devices, such as relays or motor starters."
Basically, it's a solid-state, programmable electrical/electronic interface that can manipulate, execute, and/or monitor, at a very fast rate, the state of a process or communication system. It operates on the basis of programmable data contained in an integral microprocessor-based system.
A PLC is able to receive (input) and transmit (output) various types of electrical and electronic signals and can control and monitor practically any kind of mechanical and/or electrical system. Therefore, it has enormous flexibility in interfacing with computers, machines, and many other peripheral systems or devices.
It's usually programmed in relay ladder logic and is designed to operate in an industrial environment.
What's it look like?
PLCs come in various sizes. Generally, the space or size that a PLC occupies is in direct relation to the user systems and input/output requirements as well as the chosen manufacturer's design/packaging capabilities.
The chassis of a PLC may be of the open or enclosed type. The individual modules plug into the back plane of the chassis.
The electronic components are mounted on printed circuit boards (PCBs) that are contained within a module.
Where did it come from?
The first PLC was introduced in the late 1960s and was an outgrowth of the programmable controller or PC (not to be confused with the notation as used for the personal computer). PCs have been around the industry since the early 60s.
The need for better and faster control relays that fit into less space as well as the frustration over program inflexibility (hard-wired relays, stepping switches, and drum programmers) gave birth to the PC.
Although the PC and PLC have been interchanged in speech, the difference between them is that a PC is dedicated to control functions in a fixed program, similar in a sense to the past problem of limited ability. A PLC, on the other hand, only requires that its software logic be rewritten to meet any new demands of the system being controlled. Thus, a PLC can adapt to changes in many processes or monitoring application requirements.
How does a PLC work?
To know how the PLC works, it is essential that we have an understanding of its central processing unit's (CPU's) scan sequence. The methodology basically is the same for all PLCs. However, as special hardware modules are added into the system, additional scanning cycles are required.
Here's one simple scanning process that involves every PLC. First, the I/O hardware modules are scanned by the ladder logic software program as follows.
Upon power-up, the processor scans the input module and transfers the data contents to the input's image table or register. Data from the output image table is transferred to the output module.
Next, the software program is scanned, and each statement is checked to see if the condition has been met. If the conditions are met, the processor writes a digital bit "1" into the output image table, and a peripheral device will be energized. If the conditions are not met, the processor writes a "0" into the output image table, and a peripheral device (using "positive logic") remains deenergized.
A PLC interfaces numerous types of external electrical and electronic signals. These signals can be AC or DC currents or voltages. Typically, they range from 4 to 20 milliamperes (mA) or 0 to 120VAC, and 0 to 48VDC. These signals are referred to as I/O (input/output) points. Their total is called the PLC's I/O capability. From an electronic point-of-view, this number is based on how many points the PLC's CPU is able to look at, or scan, in a specified amount of time. This performance characteristic is called scan time. From the practical perspective of the user, however, the number of I/O modules needed as well as the number of I/O points contained on each I/O module will drive what the system's I/O capability should be.
It's important to have sufficient I/O capability in your PLC system. It's better to have more than less so that, when more I/O points are required at a future time, it's easier to write the existing spare I/O points into the software (since the hardware is already there). There's no harm to the operating system in having spare I/O points; the software can be programmed to ignore them, and these points will have a negligible effect on the PLC's scan time.
The PLC's software program
The software program is the heart of a PLC and is written by a programmer who uses elements, functions, and instructions to design the system that the PLC is to control or monitor. These elements are placed on individually numbered rungs in the relay ladder logic (RLL). The software's RLL is executed by the processor in the CPU module or controller module (same module, different name).
There are many types of PLC software design packages available. One frequently selected software package is of the RLL format and includes contacts, coils, timers, counters, registers, digital comparison blocks, and other types of special data handling functions. Using these elements, the programmer designs the control system. The external devices and components are then wired into the system identical to that of the programmer's software ladder logic. Not all of the software elements will have a hard-wired, physical counterpart, however.
As the PLC's processor scans (topdown) through the software program (rung-by-rung), each rung of RLL is executed. The hard-wired device that the software is mirroring then becomes active. The software is thus the controlling device and provides the programmer or technician the flexibility to either "force a state" or "block a device" from the system operation. For example, a coil or contact can be made to operate directly from the software (independent of the control cabinet's hard-wiring to source or field input devices). Or, a device can be made to appear invisible (removed from the system's operation), even though it's electrically hard-wired and physically in place.
Individual PLC sections
Common to all PLCs are four sections, each of which can be subdivided into smaller but equally important sections. These primary sections include the power supply section, which provides the operating DC power to the PLC and I/O base modules and includes battery backup; the program software section; the CPU module, which contains the processor and holds the memory; and the I/O section, which controls peripheral devices and contains the input and output modules.
Power supply section. The power supply (PS) section gets its input power from an external 120VAC or 240VAC source (line voltage), which is usually fused and fed through a control relay and filter external to the PS. In addition, the PS has its own integral AC input fuse.
This line voltage is then stepped-down, rectified, filtered, regulated, voltage- and current-protected, and status-monitored, with status indication displayed on the front of the PS in the form of several LEDs (light-emitting diodes). The PS can have a key switch for protecting the memory or selecting a particular programming mode.
The output of the PS provides low DC voltage(s) to the PLC's various modules (typically, with a total current capability of 20A or 50A) as well as to its integral lithium battery, which is used for the memory backup. Should the PS fail or its input line voltage drop below a specific value, the memory contents will not change from what they were prior to the failure.
The PS output provides power to every module in the PLC; however, it does not provide the DC voltages to the PLC's peripheral I/O devices.
CPU module. "CPU," "controller," or "processor" are all terms used by different manufacturers to denote the same module that performs basically the same functions. The CPU module can be divided into two sections: the processor section and the memory section.
The processor section makes the decisions needed by the PLC so that it can operate and communicate with other modules. It communicates along either a serial or parallel data-bus. An I/O base interface module or individual on-board interface I/O circuitry provides the signal conditioning required to communicate with the processor. The processor section also executes the programmer's RLL software program.
The memory section stores (electronically) retrievable digital information in three dedicated locations of the memory. These memory locations are routinely scanned by the processor. The memory will receive ("write" mode) digital information or have digital information accessed ("read" mode) by the processor. This read/write (R/W) capability provides an easy way to make program changes.
The memory contains data for several types of information. Usually, the data tables, or image registers, and the software program RLL are in the CPU module's memory. The program messages may or may not be resident with the other memory data.
A battery backup is used by some manufacturers to protect the memory contents from being lost should there be a power or memory module failure. Still others use various integrated circuit (IC) memory technologies and design schemes that will protect the memory contents without the use of a battery backup.
A typical memory section of the CPU module has a memory size of 96,000 (96K) bytes. This size tells us how many locations are available in the memory for storage. Additional memory modules can be added to your PLC system as the need arises for greater memory size. These expansion modules are added to the PLC system as the quantity of I/O modules are added or the software program becomes larger. When this is done, the memory size can be as high as 1,024,000 (1024K) bytes.
Manufacturers will state memory size in either "bytes" or "words." A byte is eight bits, and a bit is the smallest digit in the binary code. It's either a logic "1" or a logic "0." A word is equal in length to two bytes or 16 bits. Not all manufacturers use 16-bit words, so be aware of what your PLC manufacturer has defined as its memory word bit size.
Software program. The PLC not only requires electronic components to operate, it also needs a software program. The PLC programmer is not limited to writing software in one format. There are many types available, each lending itself more readily to one application over and above another. Typical is the RLL type previously discussed. Other S/W programs include "C," State Language, and SFC (Sequential Function Charts).
Regardless of which software is chosen, it will be executed by the PLC's CPU module. The software can be written and executed with the processor in an online state (while the PLC is actually running) or in the off-line state (whereby the S/W execution does not affect current operation of the I/O base).
In the RLL software program, we find several types of programming elements and functions to control processes both internal to the PLC (memory and register) as well as external (field) devices. Listed below are some of the more common types of elements, functions, and instructions:
* Contacts (can be either normally opened or closed; highlighted on the monitor means they are active).
* Coils (can be normal or latched; highlighted means they are energized).
* Timers (coil can either be ON or OFF for the specified delay).
* Counters (can count by increments either up or down).
* Bit shift registers (can shift data by one bit when active).
* One-shot (meaning active for one scan time; useful for pulse timer).
* Drums (can be sequenced based on a time or event).
* Data manipulation instructions (enable movement, comparison of digital values).
* Arithmetic instructions (enable addition, subtraction, multiplication, and division of digital values).
Peripheral devices
Peripheral devices to the PLC and its I/O base(s) can be anything from a host computer and control console to a motor drive unit or field limit switch. Printers and industrial terminals used for programming are also peripheral devices.
Peripheral devices can generate or receive AC or DC voltages and currents as well as digital pulse trains or single pulses of quick length (pulse width).
These external operating devices, with their sometimes harsh and/or fast signal characteristics, must be able to interface with the PLC's sensitive microprocessor. Various types of I/O modules (using the proper shielded cabling) are available to do this job.
Input module
The input module has two functions: reception of an external signal and status display of that input point. In other words, it receives the peripheral sensing unit's signal and provides signal conditioning, termination, isolation and/or indication for that signal's state.
The input to an input module is in either a discrete or analog form. If the input is an ON-OFF type, such as with a push button or limit switch, the signal is considered to be of a discrete nature. If, on the other hand, the input varies, such as with temperature, pressure, or level, the signal is analog in nature.
Peripheral devices sending signals to input modules that describe external conditions can be switches (limit, proximity, pressure, or temperature), push buttons, or logic, binary coded decimal (BCD) or analog-to-digital (A/D) circuits. These input signal points are scanned, and their status is communicated through the interface module or circuitry within each individual PLC and I/O base. Some typical types of input modules are listed below.
* DC voltage (110, 220, 14, 24, 48, 15-30V) or current (4-20 mA).
* AC voltage (110, 240, 24, 48V) or current (4-20 mA).
* TTL (transistor transistor logic) input (3-15VDC).
* Analog input (12-bit).
* Word input (16-bit/parallel).
* Thermocouple input.
* Resistance temperature detector.
* High current relay.
* Low current relay.
* Latching input (24VDC/110VAC).
* Isolated input (24VDC/85-132VAC).
* Intelligent input (contains a microprocessor).
* Positioning input.
* PID (proportional, intregal, differentiation) input.
* High-speed pulse.
Output module
The output module transmits discrete or analog signals to activate various devices such as hydraulic actuators, solenoids, motor starters, and displays the status (through the use of LEDs) of the connected output points. Signal conditioning, termination, and isolation are also part of the output module's functions. The output module is treated in the same manner as the input module by the processor.
Some typical output modules available today include the following:
* DC voltage (24, 48,110V) or current (4-20 mA).
* AC voltage (110, 240v) or current (4-20 mA).
* Isolated (24VDC).
* Analog output (12-bit).
* Word output (16-bit/parallel).
* Intelligent output.
* ASCII output.
* Dual communication port.
TERMS TO KNOW
A/D: A device or module that transforms an analog signal into a digital word.
Address: A numbered location (storage number) in the PLC's memory to store information.
Analog input: A varying signal supplying process change information to the analog input module.
Analog output: A varying signal transmitting process change information from the analog output module.
Baud rate: The number of bits per second that is either transmitted or received; also the speed of digital transmission acceptable by a device.
BCD: Binary coded decimal. A method used to express the 0-thru-9 (base 10) numbering system as a binary (base 2) equivalent.
Bit: A single binary digit.
Byte: Eight bits.
Central Processing Unit (CPU): An integrated circuit (IC) that interprets, decides, and executes instructions.
D/A: A device or module that transforms a digital word into an analog signal
Electrically Erasable Programmable Read-Only Memory (EEPROM): Same as EPROM but can be erased electrically.
Erasable Programmable Read-Only Memory (EPROM): A memory that a user can erase and load with new data many times, but when used in application, it functions as a ROM. EPROMs will not lose data during the loss of electrical power. They are nanvolatile memories.
Image register/image table: A dedicated memory location reserved for I/O bit status.
Input module: Processes digital or analog signals from field devices.
I/O points: Terminal points on I/O modules that connect the input and output field devices.
Millisecond: One thousandth of a second (1/1000 sec, 0.001 sec).
Modem: Modem is an acronym for modulator/demodulator. This is a device that modulates (mixes) and demodulates (separates) signals.
Operator interface: Devices that allow the system operators to have access to PLC and I/O base conditions.
Output module: Controls field devices.
Parallel data: Data whose bytes or words are transmitted or received with all their bits present at the same time.
Program: One or more instructions or statements that accomplish a task.
Programming device: A device used to tell a PLC what to do and when it should be done.
Random Access Memory (RAM): A memory where data can be accessed at any address without having to read a number of sequential addresses. Data can be read from and written to storage locations. RAM has volatile memory, meaning a loss of power will cause the contents in the RAM to be lost.
Read-Only Memory (ROM): A memory from which data can be read but not written. ROMs are often used to keep programs or data from being destroyed due to user intervention.
Software: One or more programs that control a process.

Featured post

Reading Robot Minds with Virtual Reality

Figuring out what other people are thinking is tough, but figuring out what a robot is thinking can be downright impossible. With no bra...

Popular Posts