A properly designed machine vision system can inspect products with speed and precision, increasing throughput on a production line. Getting such systems from the design lab to the factory, however, can sometimes be challenging. With some basic vision system troubleshooting skills, operators can speed new systems through setup challenges as well as handle errors that may arise later.
Troubleshooting a system begins with understanding its key elements and performance factors. Stripped to basics, a machine vision inspection system has four key elements. The first element is the vision section, consisting of the camera, lens, lighting and image processor with software. This section captures an image of the object being inspected, processes the image to extract information about the object and makes a decision about the object’s conformance to specifications.
The other three elements work with the vision section to complete the automated inspection task. A transport mechanism moves the objects to be inspected through the vision section’s field of view. This can be accomplished either by moving the object, as on a conveyor belt, or by moving the camera. In addition to the transport mechanism, there are sensors to determine when the object is in position for imaging or for action, and an action mechanism that serves to reject parts that fail inspection. The image processor controls the action mechanism, typically through a programmable logic controller (PLC). The action mechanism is often designed so that the system must make a positive decision accepting a part to prevent an otherwise automatic rejection. Such designs serve as a fail-safe, preventing flawed parts from passing through the inspection system if the system has failed in some way.
The quality of the image captured for processing is a critical factor in the operation of a machine vision system. In order to obtain consistent inspection results, the image must have good contrast between the background and the regions of interest. This contrast supports the image processor in extracting needed information such as dimensions and relative positions. Proper lighting is the key to obtaining good contrast.
It also is important that the image be uniform across the field of view. When the brightness and contrast of the image is uniform, the image processor has an easier time determining which part of an image contains information and which part is background. Both lighting and lens quality affect the uniformity of an image. Lenses that are designed specifically for machine vision applications will provide greater uniformity than lenses designed for security or other camera applications.
Verify System SpecsWith the system’s key elements and performance factors in mind, troubleshooting can begin. During a machine vision system’s development phase, a good place to start troubleshooting is to verify that the system’s design specifications are right for the task. The camera system’s field of view, for instance, must be large enough to contain the entire part or at least the key area of interest on the part. At the same time, it must not be too large, or the image will not have sufficient resolution. Experience has shown that the system’s resolution-the distance two features must be separated for the system to be able to distinguish between them-should be at least five to 10 times the dimension of the smallest defect to be detected. Resolution also sets the accuracy of any measurements the system must make.
Another performance metric to evaluate is the speed with which the image processor completes its calculations as compared to the rate at which objects are presented for inspection. If a system is to present five objects per second for inspection, for example, the processing time required should not be 200 milliseconds or even 190 milliseconds. The design needs to build in spare time to accommodate transport speed variations, object spacing variations and action delays that might occur.
The design also should provide adequate mechanical stability, especially if there is significant vibration in the system or surrounding installation environment. The camera mount, for instance, should be rigid enough to resist camera movement from vibration or accidental impacts. Lenses in fixed-focus applications should include locking set screws to prevent vibration from moving them out of adjustment.
Whether working within the user company or designing under contract, machine vision system developers will need samples of the objects to be inspected in order to test the system. These samples should include a mix of known-good, known-bad and borderline objects so that developers can fully evaluate system performance. The samples should be as exact a match to the target object as possible. Even attributes that do not appear to be relevant to the inspection criteria should match because they might affect the image the machine vision system obtains. A measurement system handling 10 to 40 screws, for instance, may only need to inspect length and thread spacing, but the vision system may react differently to a stainless steel finish than to a brass finish because of the variations in the way they reflect light.
Developers using these parts to evaluate system performance will need to be thorough in their testing. Hundreds of test runs using the same set of samples are necessary to gather the statistical data that proves the system’s consistency in decision-making. Developers also will have to work with users to fine-tune the tolerances allowed during inspection. The goal is to tune the system to achieve a balance between rejecting acceptable parts and passing unacceptable ones. Ultimately, these tests will help developer and user validate that the design performs satisfactorily.
Communication between developer and end-user also is essential to ensure that the system performs as well after installation as in the development lab. One of the primary sources of installation problems is a change in the object lighting. Installers should never alter the lighting design unilaterally; it risks serious degradation of system performance. Accidental installation problems, such as shadows from mounting brackets and reflections from other equipment, also can be avoided with adequate communication between vision-system developer and installation designer.
Solving Field ProblemsIf a system that has been designed and installed properly and has achieved a history of proper performance starts behaving badly-making too many false rejections or failing to reject properly, for example-a different set of troubleshooting tactics are needed. To help isolate the problem, one of the first steps to take is to examine the image that the vision system is currently capturing. Some problems become obvious immediately. A burned-out light source, reflections and glare from the object, improper object positioning, or the object missing from the image altogether point to factors outside of the camera and image processor as the trouble source. Examining the image also can quickly reveal simple camera and lens problems such as failure to capture an image, misadjustment of the camera aim or focus, or dirt on the lens.
To find more subtle problems, the use of a reference image will be helpful. Capturing and storing images taken after installation, when the system is working properly, provides a baseline that troubleshooters can use to compare with the current image. Trouble signs to look for include changes in image quality such as contrast and brightness, variations in focus and changes in the object being inspected.
If the image quality shows significant change, the next step is to separate camera effects from lens effects. Problems with the camera or the sensor inside the camera typically affect the entire image. Representative camera problems include shifts in brightness or contrast that are not the result of lighting changes, the presence of significant noise in the image and shifts in the white balance of color images.
Lens problems tend to be more localized in their effect, such as variations in focus across the image or darkened corners that may indicate misalignment. Stationary lenses rarely fail, but moving parts can wear out. Inspecting the adjustable focus, aperture or magnification mechanisms of a lens system may reveal slippage, misadjustment or binding that is affecting image quality. If the lens itself has a problem, it is typically the result of damage, not failure. Vibration may loosen retaining mounts, impact may knock lenses out of position or alignment, or objects may scratch the lens, all of which damage the lens and adversely affect image quality. Most lens damage requires the expertise of vendors for accurate diagnosis and proper replacement. Use of industrialized lenses can reduce the influence of outside elements.
If what has changed is the appearance of the object itself, the machine vision system may prove to be working correctly-according to its original design parameters. Often what seems to be a failure of the machine vision system is actually the result of disturbing the match between the system’s design parameters and the task’s requirements. A change of surface finish on an object, for instance, may alter the way it reflects light, requiring changes in lighting to restore proper system operation. Setup parameters such as working distance and field of view may have been altered during rearrangement of the production line, making the object image too small or too big. Similarly, the lighting arrangement may have been altered, causing reflections where there were none before. This also may require a change in lighting, or the use of filters such as polarizers.
Sometimes it is the environment itself that has changed. In one instance, the machine vision inspection worked correctly for a few months and then suddenly began making mistakes, but only in the late afternoon. The cause turned out to be stray light from the afternoon sun affecting the image. The problem had not arisen before because the equipment was installed during the summer when the sun was high in the afternoon. Only as winter approached did the sun begin to shine directly onto the vision system.
Look Beyond the Vision SystemIf the image does not appear to have changed from the baseline, the error most likely lies with one of the other system elements. One place to look is at the results the image processor is producing. Make sure the system is providing correct measurements and that it is producing appropriate pass/fail results. Software typically does not suddenly change behavior unless it has been altered. If there has been a recent update or alteration, restoring the old software provides a way to check if the error is in the new software or if there has been a hardware failure. Another place to look for change is in the pass/fail criteria. If acceptable tolerances have been relaxed from 2% to 5%, for example, the system will suddenly begin rejecting an increased percentage of acceptable parts if it is still programmed to use the 2% tolerance.
When the image processor is producing appropriate results the problem may lie in the system’s interconnections. Checking that the appropriate sensor and control signals both are generated and received can help isolate I/O problems. In one instance, for example, the system was not capturing images at all. The problem arose from a broken inspection sensor, which resulted in the camera not receiving the trigger to capture an image. In other instances, the image processing system was making valid pass/fail decisions, but the action mechanism was not responding correctly. One case proved to be a wire between the image processor and the PLC that had pulled loose. Another case turned out to be a matter of timing. The PLC received the reject command, but had too many other tasks to perform and sometimes responded too slowly, producing erratic results.
Erratic results also may be an indication of a systemic weakness in the system design. Troubleshooters may need to upgrade camera and lens resolution to decrease measurement error if the original design has been called on to operate too close to its limits. Similarly, if the system speed requirement is such that the image processor barely has enough time to make its decision before action is required, the system may need a processor upgrade to increase timing margins. Variations in ambient lighting also can produce inconsistent performance. Use of narrow-wavelength lighting and filters can make the system less sensitive to ambient light changes, although making such changes may require the aid of outside expertise.
Properly designed, a machine vision inspection system will work correctly when installed and, barring changes in installation, environment or task requirements, should provide long and productive service. Creating and storing reference images when the system is operating correctly can help speed troubleshooting if a failure does occur.
Troubleshooters can use the reference as a starting point for a few simple steps that can quickly identify many problems that are easily resolved. When troubleshooting identifies problems with lenses and lighting, expert help is available and should be sought. Q
Quality OnlineVisit www.qualitymag.com or www.visionsensorsmag.com for more on machine vision, including:
- “Machine Vision ‘Sees’ Color”
- Quality 101: “Using Machine Vision”
- “Machine Vision Makes Gaging Easy”