Troubleshooting PLCs

May 1, 1996
Once you get over the "black box" syndrome, PLCs are actually easier to troubleshoot than traditional hard-wired control systems.

Programmable logic controllers (PLCs) have become important building blocks for automated systems. Because they have constantly increased in capability while decreasing in cost, PLCs have solidified their position as the device of choice for a wide variety of control tasks.

What is a PLC? In brief terms, a PLC is a digital electronic device that contains a programmable (changeable) memory in which a sequence of instructions is stored. Those instructions enable the PLC to perform various useful control functions like relay logic, counting, timing, sequencing, and arithmetic computation. These functions usually are used to monitor and control individual machines or complex processes via inputs and outputs (I/Os). I/O modules connected to the PLC provide analog or digital electronic interfaces to the external world. The PLC reads inputs, processes them through a program, and generates outputs. [ILLUSTRATION FOR FIGURE 1 OMITTED].

One reason for the popularity of PLCs is their high reliability in harsh industrial environments; occasionally, however, things do go wrong and troubleshooting becomes necessary. Those unfamiliar with PLCs often fear troubleshooting a device that appears to be a mysterious "black box" (see side bar on page 22), but in fact today's PLCs actually are very open systems that lend themselves to relatively easy diagnosis.

The internal operation of a PLC can be monitored via a handheld programmer, terminal, or personal computer, and many indicator lights are provided for I/O troubleshooting.

Upfront assumptions

The intent of this article is to cover only the basics of PLC troubleshooting, so there are some limitations on what will be discussed. First, it's assumed that the PLC system under analysis was operating correctly at some time in the recent past, so the problems of program debugging and wiring errors that are more typical of a startup situation will not be addressed. It's also assumed that the PLC is programmed using some form of ladder-logic and not a higher-level language, and the discussion is limited to the most common I/O module types, namely those that support digital and analog inputs and outputs.

Divide and conquer

The first step in PLC troubleshooting is to decide if the problem is internal to the processor or in the I/O system. It seems to be natural to assume that most malfunctions of PLC systems are due to processor problems, but in fact the opposite is true. Experience has shown that more than 80% of all PLC malfunctions can be traced to problems with I/O modules or field equipment. Furthermore, it's relatively easy to determine whether a problem is located in the processor or in the I/O system because each type of problem has a unique signature.

Problems that can be localized to a specific I/O module or even a specific input or output device are usually external, while internal problems normally result in large groups of failures, globally erratic behavior, or even total failure of the PLC system.

Let's look first at the possible causes for internal problems.

The first thing to check is the integrity of the PLC's power and ground. Visually inspect the power and ground wiring, looking for loose, corroded, or otherwise questionable connections. The integrity of the ground can be electrically checked by measuring the voltage between the PLC ground terminal and a known ground. Using a digital meter set on the lowest scale, both the AC and DC voltages should be zero.

The power supply also can be tested electrically. If the PLC processor has an AC power source, check the input voltage; it should be within the manufacturer's recommended range. PLC processors actually operate on DC power, so that also must be checked. Measure each of the outputs of the DC power supply and check if the voltages are within the recommended ranges.

Also check the DC supplies for AC ripple. This can be done using a digital meter set on a low AC range, and the value measured should be well below the manufacturer's specifications. Excess ripple has drastic effects on the operation of the microprocessors and memory devices typically found in PLC processors.

The final power check is to measure the voltage of any batteries in the system. Battery power is often used to prevent a PLC from losing its program during power outages, and battery voltages should be within recommended values.

Other causes for erratic processor behavior are electro-magnetic interference (EMI) or radio frequency interference (RFI). Try to correlate the erratic behavior with an external EMI or RFI event like a large motor starting, arc welding in the area, lightning strikes, or even the use of handheld radio transmitters. Although they may seem harmless, handheld radios commonly used by maintenance personnel emit powerful RF radiation and can seriously disrupt the operation of unprotected electronic equipment.

Long-term solutions to EMI and RFI problems usually involve improvements in power conditioning, grounding, and shielding.

Power, grounding, and interference problems all can cause the corruption of the PLC memory, so the next step is to verify that the program is still correct. All PLCs have some method for doing this, most of which involve comparing the program in the PLC with a backup copy on tape or disk.

Verify the program with the backup, and reload the program if problems are encountered.

Keep the program backups up-to-date and safely away from temperature extremes, high humidity, and EMI and RFI exposure to ensure they will always be usable.

Troubleshooting inputs and outputs

Now on to the more common problem of troubleshooting inputs and outputs. The primary goal of I/O troubleshooting is to find out why the internal status of the PLC (what the PLC thinks is happening) does not agree with the external situation (what is actually happening). The first thing that must be done is to determine the relationship between physical I/O modules and the I/O instructions in the PLC program. This is done by using the addressing scheme for the particular PLC that you are working on, and this scheme differs from one manufacturer to another. Somewhere in the documentation there will be an explanation of how to determine which physical I/O point a specific program address is connected to and vice versa. Once this scheme is understood, each problem can be isolated to a single I/O module and a program monitoring device (usually a handheld unit, terminal, or personal computer) can be used to check the internal status of the input or output in question.

Troubleshooting digital input modules

The function of a digital input module is to determine the ON/OFF status of a signal or signals in the external world and communicate that information to the PLC processor. Most digital input modules detect changes in voltage levels, and they are available with various AC, DC, or universal ratings, with universal modules typically accepting a fairly wide range of either AC or DC signals. A typical AC input channel is shown in Fig. 2. Note that the figure shows indicator lamps on both the power and logic sides of the circuit; many modules, however, have only one or the other of these. If only one indicator is present, it's important for troubleshooting purposes to determine where it is connected. If the threshold unit on an active input has failed, for example, a power-side indicator would be ON while a logic side indicator would be OFF.

The power to drive PLC inputs usually is not supplied by the input module, so it's important to find out where that power comes from. There are two types of inputs: Isolated and nonisolated. Troubleshooting differs depending on which type you are dealing with. Each channel on an isolated input module is electrically separated from the others and may have a different source of power. On the other hand, one side of each input channel on a non-isolated module is connected to a common reference. Both module types are shown in Fig. 3.

Determine if the power for the input in question is present, as faults in field wiring and devices can blow a fuse, trip a breaker, or cause some other power disruption. If input power is not present, determine and rectify the cause of the failure before proceeding.

If input power is present, connect a voltmeter across the input as shown in Fig. 3, actuate the input device in the field, and measure the voltage at the PLC input to determine if it changes adequately when the field device changes state. If it does not, the field device or wiring are most likely at fault. If a proper voltage change is observed, the power and/or logic indicators on the module should change when the voltage does, and the addressed location in the PLC, when monitored with the programming device, also should change state. If the indicators do not properly reflect the state of the input, replace the input module.

If the input module is working properly but the PLC still is not registering the input internally, the problem lies in the system used to communicate input information from the module to the processor. Consult the manufacturer's documentation to determine how to troubleshoot this equipment, which may include an I/O rack, back plane, communication module, and cabling.

Troubleshooting analog input modules

Instead of monitoring the on/off status of an input, analog inputs measure the actual value of a voltage or current and communicate it to the processor. Analog input modules are available in many DC voltage and current ranges, and basic troubleshooting is almost identical to that for digital modules.

First determine if the input is isolated or nonisolated, and determine the source of power and verify that it is present.

Next, change the voltage or current level generated by the field device, verify that the change is reflected at the input module terminals, and verify that the content of the address associated with the input reflects the voltage or current change.

There are two additional complications introduced by analog modules, however. First, there usually is no indication on the module to reflect the level of the input, so an external meter must be relied upon. Second is the scale problem: You must determine what range of voltage or current the module is designed to measure, and what numerical scale is associated with that range in the PLC. An input with a 1-5 VDC range may be expected to generate a change from 0 to 1000 in a PLC register, for example. Just determining if the number changes when the input does is not enough. A good approach is to adjust the external voltage or current to minimum, half scale, and maximum values, and to observe the PLC register to determine if corresponding changes have occurred. In the previous example, 1 VDC should generate 0 in the PLC register, 3 VDC should generate 500, and 5 VDC should generate 1000. If the field device cannot be easily manipulated in this manner, it can be temporarily replaced for troubleshooting purposes by a signal transmitter. The signal transmitter can be connected directly to the input module, and if the module does not respond correctly it should be replaced. If it does respond properly, the problem most likely is in the field device or wiring.

Field wiring can be tested by temporarily replacing the field device with a signal transmitter and observing the reaction at the PLC to signal changes.

Troubleshooting digital output modules

Output modules are designed to cause some change in the external world in response to an instruction in the PLC processor. Digital outputs will often be used to perform tasks like starting motors, turning on indicating lights, and energizing solenoid valves. Many different digital output module types are available, with the most common varieties being DC outputs that rely on transistors as switching devices, AC outputs that rely on triacs, and universal outputs that use relay switching. A block diagram for a typical output channel is shown in Fig. 4 (on page 28). Both power and logic indicators are shown once again, but as in the case of digital inputs, only one or the other may actually be present.

The power to drive PLC outputs, like inputs, is usually not supplied by the module, so it's important to find out where that power comes from. Once again, there are isolated and nonisolated modules, and troubleshooting differs depending on which type you are dealing with. [ILLUSTRATION FOR FIGURE 5 OMITTED]

Again, the first step in troubleshooting is to determine if the power for the output in question is present and to restore that power if it is not. There is a further complication to troubleshooting most output modules, because they typically contain a fuse to protect the output switching device [ILLUSTRATION FOR FIGURE 4 OMITTED]. Faults in field wiring and devices can blow that fuse, so its condition must be verified before proceeding. Many modules are equipped with a "fuse blown" indicator that shows which channel or module has a blown fuse. These fuses may be accessible from the front of the module, or the module may have to be removed or even disassembled in order to gain access to them.

Once power has been verified and the fuses checked, the procedure for troubleshooting digital outputs is somewhat the reverse of that for digital inputs.

First the programming device must be hooked up to the PLC, and the address that is associated with the output in question must be determined. The output then can be "forced" ON or OFF internally in the PLC, and the module can be observed for a reaction. If the indicators on the module do not reflect the forced condition, change the output module. If the module is working properly but still does not react to the forcing, the problem again lies in the communication between the processor and the module, and the manufacturer's documentation is your best source for troubleshooting information.

If the indicators are observed to be reacting to the forced state, measure the voltage across the output device [ILLUSTRATION FOR FIGURE 5 OMITTED] to see that it's changing as the state of the output changes. If the voltage is changing but the device is not reacting, the problem is in the output device.

If the voltage is not changing, the problem can most likely be found in the field wiring. If the field wiring is in doubt, it can be temporarily disconnected and a test load can be connected to the module. If the test load operates properly, the problem lies in the field wiring or field device. It's important that a test load be used as opposed to just disconnecting the field wiring. Because they leak a small amount of current in the OFF state, the voltage at most solid-state outputs will not change a large amount as the output device is switched with no load. A properly sized resistor, solenoid valve, or relay coil provides a good test load.

Troubleshooting analog output modules

Analog outputs are used to generate a variable voltage or current typically used to perform tasks like throttling the speed of a variable speed drive, adjusting the position of a control valve, or driving a panel indicator. As with input modules, analog output modules are available in many DC voltage and current ranges. Usually, there is no indication on the module to reflect the level of the input. As such, you must determine what range of voltage or current the module is designed to produce and what numerical scale is associated with that range in the PLC. An output with a 4-20 mA DC range may be expected to react to a change from 0 to 1000 in a PLC register, for example.

A good approach to testing analog outputs is to "force" the number in the PLC register associated with the output in question to minimum, half scale, and maximum values, and to measure the voltage or current generated at the output. In the previous example, a 0 in the appropriate PLC register should generate 4 mA at the output terminals, 500 should generate 12 mA, and 1000 should generate 20 mA. If the field wiring or field device are in doubt, they can be temporarily disconnected and replaced by a test load. If the proper currents or voltages are not measured at the test load, the analog output module should be replaced. A properly sized resistor, typically between 250 and 1000 ohms, is usually used as a test load in analog circuits.

SUGGESTED READING

EC&M Articles:

"Knowing the Basics of PLCs - Part 1," October 1995, p. 20.

"Servicing PLC 120V I/O Modules," November 1995, p. 24.

"Troubleshooting PLC Circuits by Testing Thumbwheel Switches," December 1995, p. 20.

"Understanding PLC Networks," January 1996, p. 22.

Books:

George L. Batten, Jr., Programmable Controllers: Hardware, Software, and Applications, McGraw-Hill, 1994.

Gilles Michel, Programmable Logic Controllers: Architecture and Applications, John Wiley and Sons, 1990.

L.A. Bryan and E.A. Bryan, Programmable Controllers: Theory and Implementation, Industrial Text Co., 1988.

RELATED ARTICLE: TERMS TO KNOW

Address: a numbered location (storage number) in the PLC's memory to store information.

Analog input: A varying signal supplying process change information to an analog input module.

Analog output: A varying signal transmitting process change information from an analog output module.

Central processing unit (CPU): An integrated circuit that interprets, decides, and executes instructions.

Input module: A component of a PLC that processes digital or analog signals transmitted from field devices.

Output module: A component of a PLC that controls field devices.

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.

RELATED ARTICLE: A PLC IS NOT A "BLACK BOX" . . . OR IS IT?

While working as a student engineer on a coop assignment in a hardboard siding manufacturing plant, I had the opportunity to participate in the design and installation of the first PLC-based control system ever installed in the plant. This project represented a major commitment for the company to a new technology, and my boss and I were determined to make it a success. We went to great lengths to alleviate fears of the new technology amongst our maintenance electricians, who questioned the replacement of well-understood relay logic with an electronic "black box." We repeatedly explained the advantages of the PLC, including the simplicity of wiring, the usefulness of indicator lights on input and output modules for troubleshooting, and the similarities between ladder-logic programming and relay control.

Just when we thought the situation was under control, we received a call from the electricians assigned to the project announcing that the "black box" had arrived. Upon repeating our reasons for believing that the PLC was a useful, flexible controller and not a mysterious black box, we were told to come and take a look for ourselves. When we did, we discovered the reason for the renewed concern. Unpacking the new PLC had revealed a rectangular metal box . . . painted black.

Ryan G. Rosandich, Ph.D. is Assistant Professor, Engineering Management, University of Kansas Regional Center.

About the Author

Ryan G. Rosandich

Voice your opinion!

To join the conversation, and become an exclusive member of EC&M, create an account today!

Sponsored Recommendations

Electrical Conduit Comparison Chart

CHAMPION FIBERGLASS electrical conduit is a lightweight, durable option that provides lasting savings when compared to other materials. Compare electrical conduit types including...

Considerations for Direct Burial Conduit

Installation type plays a key role in the type of conduit selected for electrical systems in industrial construction projects. Above ground, below ground, direct buried, encased...

How to Calculate Labor Costs

Most important to accurately estimating labor costs is knowing the approximate hours required for project completion. Learn how to calculate electrical labor cost.

8 Types of Electrical Conduit and Their Uses

Electrical conduit is a tube or raceway used to house and protect electrical wires within a building or structure. From data centers to underground subways to ports and bridges...