Vision systems can automate tasks such as part measurement and inspection quickly, accurately, and with high repeatability, helping manufacturers improve product quality and productivity. Vision systems generate valuable monitoring data at every step of the manufacturing process, which in turn helps control engineers expand the capabilities of process diagnostics.
Non-contact measurement is faster
The most common application of machine vision in quality control is measurement. Bryan Boatner, Marketing Manager for Cognex's In-Sight series of vision sensors, says that the unique precision of vision system measurement components, reaching up to one-thousandth of an inch, makes it suitable for many applications that previously required contact measurement methods.
He stated, "Manufacturers adopt vision-based measurement for many reasons. Speed is a major factor. Contact-based measurement struggles to keep pace with high-throughput production lines, so traditional measurements are typically performed during product sampling." In contrast, machine vision systems can keep up with these production lines, performing thousands of measurements per minute, and can be embedded within the production line system for 100% monitoring.
By eliminating physical contact, vision-based measurements can "avoid damage to parts and reduce maintenance such as wear and scratches on mechanical measurement surfaces. Ultimately, vision systems can measure certain parts that cannot be measured using contact methods," Boatner said.
Arnaud Lina, head of the imaging software group at Matrox Imaging, agreed, stating that machine vision offers many new possibilities for metrology, such as the precise measurement of objects. Ben Dawson, director of integrated product development strategy at Dalsa's Digital Imaging group, outlined some key points helpful for building machine vision measurement systems and other applications.
Diagnostic function
Boatner said: "Besides measurement, machine vision can provide an effective data acquisition tool for diagnostics, enabling process measurement and analysis of data trends. Vision systems can provide real-time images for monitoring operations and can also archive digital images by time stamp for easy retrieval later."
Boatner gives an example: on a canning line, as a camera passes a bottle, it can capture an image of each bottle and compare it to a series of standard parameters, checking for fullness, cap, seal, label, appearance, and degree of deformation. When a parameter exceeds the standard, a signal is sent indicating that the bottle needs to be moved to the waste storage room. Furthermore, this can be configured to store images of defective bottles in a database for analysis. Engineers can observe the images to perform root cause analysis, rather than re-sampling from the waste storage room to find the source of the defect. Archiving defective bottle images for later use can serve as a diagnostic tool, aiding in troubleshooting and reducing downtime.
Optimal method
Boatner says vision products are increasingly being categorized into three main types: vision sensors (generally standalone, low-power detection devices), PC-based vision systems (powered and flexibly programmable using simple graphical programming languages), and expert sensors (low-power technologies for specific automation problems). All three categories of vision products include cameras, processors, image analysis software, light sources, and network connectivity.
Ken Brey, Technical Director at DMC Systems Integration, suggests that sharing methods and techniques for machine vision technology can help end users understand what they should and shouldn't do.
Based on the above, we can list several optimal methods: many components are interdependent, so this list is not strictly ordered. For example, powerful software can compensate for the deficiencies of suboptimal light sources; proper use of lenses can reduce hardware power consumption.
Assembly tools: Every vision system setup area or lab should have a range of spare parts, lenses, and other components, along with simple machine vision cameras, light sources, and mounting options. Engineers can choose from these materials to build the vision system. Brey says a reasonable set of raw materials will cost around $300.
Accessories for setting up the system: A plastic ruler, approximately $2, can be used to measure the field of view for both front and rear light sources. Position it at a 45-degree angle, focusing on the center (not the edge), to measure depth of field (e.g., a 15mm ruler distance divided by 1.41 gives the depth of field). For high magnification applications, use a simple $40 Ronchi grating to check for optical system distortion. Change the lens and adjust the camera position at the minimum field of view. There's no need to buy more cameras than actually needed, but it will take time to mathematically convert the results.
Accessories for setting up the system: A set of color filters, approximately $150, which can reduce the influence of ambient light; filter out the common wavelengths in light waves from different materials, thereby increasing contrast.
Accessories needed for system setup: A focal length extender, approximately $95, allows you to simulate a longer focal length lens by using a 2x focal length extender, such as transforming a 50mm focal length into a 100mm focal length or a 35mm focal length into a 70mm focal length. However, the exposure time for this method will be four times that of using a telephoto lens with the corresponding f-stop. Brey says this is a drawback of the extender. If exposure time is not a concern, the focal length extender can be incorporated into the system because it provides a shorter optical distance in tight spaces and can reduce the overall cost of the optical system.
System setup accessories: A mirror beam splitter, valued at $50, can be used with a ring light source or an integrated camera light source, ensuring the camera and light source are perpendicular to the part. At a 45-degree angle, by reflecting half the light and transmitting the other half, a diffuse coaxial light source (DOAL; as shown) can be simulated. For diffuse reflection, the camera can be adjusted so that the central aperture surrounds the part under test, thus eliminating measurement errors. In robotics applications, such as around an engine assembly, it allows for robot teaching at each measurement point. It can also increase accuracy for remote measurements. A diffuse coaxial light source (DOAL) can reduce reflections and glare, eliminate bright spots and foreign objects, and, for example, eliminate clumps on painted surfaces by providing edge contrast.
Application guidelines: Know what you are testing: Understand the difference between good and bad parts or products. The more precise the specifications, the easier it is to solve problems. More importantly, selecting borderline products for testing can reduce judgment errors.
Application considerations for vision systems: Before selecting a vision sensor, it's crucial to determine the system's application scope to ensure sufficient performance margins in terms of speed, accuracy, and acquisition requirements. This is because users, already familiar with machine vision capabilities, want to accomplish as many vision-related tasks as possible, while also considering future needs for increased throughput, new product production, and retrofitting of existing products.
Application considerations: Camera performance and resolution: The camera must have sufficient pixels to analyze even the smallest points. For electrical measurements, such as pinhole defect measurement, a minimum point size of at least 3×3 pixels is desirable. Excellent machine vision software can perform edge-to-edge distance measurements at a scale of 1/10 of a pixel, or even better. This can significantly improve resolution for certain types of measurements.
Application Notes: Hardware: The image acquisition hardware (i.e., the "image acquisition card") must have low noise and low jitter in order to perform stable measurements.
Application Notes, Software: Ensure that vision-based measurements provide a clear definition of measurement tolerances. For example, there are many different methods to measure perpendicularity, so you must first ensure that this vision solution can perform the required tests.
Application Considerations, Repeatability: Any sensing operation, including vision sensing, requires repeated measurements to ensure reliable detection as many times as possible. To test repeatability, a part must be placed under the vision system, “with at least five measurements performed, and the part’s position, light source, or other variables cannot be changed during the measurements. Based on this, you can plot the repeatability of the measurements and ensure that any changes in the results are within the measurement tolerances,” Boatner said.
Before making a purchase, consider additional features: Don't just look at the price and decide whether to buy something without considering the potential additional features it will bring. Investing in a vision system with robust software support can save money because it reduces the need for more expensive light sources, optics, or part clamping devices.
Before purchasing, use a pre-sales demonstration to check the actual parts: have the vision system vendor give a pre-sales demonstration to demonstrate and verify the concepts of various products or parts, from good to bad.
Lens selection to avoid distortion: Standard machine vision lenses have optical distortion, negative distortion, or barrel distortion, and perspective distortion can occur when measurements are taken at different distances from the lens. While these distortions can be partially corrected by the machine vision system, a better solution is to use low-distortion lenses or telecentric lenses. Dawson suggests "seeking help from the vendor."
Lens selection, field of view, resolution: Choose a lens based on the required field of view and the resolution for the smallest point of interest. Dawson says that the limiting factor for resolution should be the camera, not the lens.
Light source, avoiding reflections: Provide a light source that enhances the measurement and suppresses human influence; unnecessary reflections are human influences. For example, when backlighting parts like stamped metal sheets, we use a parallel light source to highlight their edges. Correct light source selection requires experience and experimental testing. Similarly, you can seek help from vision system vendors.
Light source, contrast: Lina said that since the accuracy of the test can be affected by contrast and noise, it is best to obtain images under optimal conditions.
Light source, contrast, color: Keep in mind that light source is crucial for producing easily observable contrast and obtaining a high-quality image. When considering light source, consider both the type and color of the light source.
Light source, depth of field: Boatner says, make sure the light source is appropriate for the depth of field and field of view.
Installation: In typical measurement applications, a camera is mounted above or to the side of the part. When the part enters the field of view, it captures an image for measurement. Measurement software is then used for graphical analysis, calculating the distances between different points in the image. Based on these calculations, the vision system determines whether the part's precision is within tolerance limits. If it is, the vision system sends a non-compliance signal to a logic device (such as a programmable logic controller, PLC), which can then drive a mechanical mechanism to remove the non-conforming product from the production line.
Software, automatic setup: Select a measurement tool that can automatically set up a measurement template (measurement area map). For example, if geometric pattern recognition is used to determine the position and orientation of a part, the system can automatically adjust the measurement area based on the results of these recognitions.
The software is geometry-based: it relies on basic geometric operations rather than complex mathematics. By employing a measurement toolkit with a multi-repeating coordinate system, you can easily derive new features from existing features using geometric methods.
Software, camera positioning, calibration: Calibration! Choose a software package that operates in a real-world coordinate system, then position the camera to avoid major distortions and perspective. Extract the features to be measured from the source image (distorted), then measure them in the space where the calibration operation is performed. This way, performing measurement operations on the distorted image will not degrade the accuracy level.
Software and ease of use: Choose machine vision software that is easy to set up and use, can correct optical or perspective distortion, and provides sub-pixel accuracy; even if the measurement resolution is as high as 1/25 of a pixel or even higher, software setup and distortion correction can be completed in minutes.
The software, feature-based: The method for measuring images should be feature-based, a technique that extracts geometric features from grayscale pixel values. Lina says: This algorithm can simulate how measurements are performed in the real world, and it is robust enough to handle variations in brightness.
Software, field of view: To optimize operation, the field of view area should surround the feature to be tested as closely as possible.
Software, Measurement Tools: A pre-configured software toolkit simplifies the setup of machine vision applications, including measurement. Measurement tools work by measuring the distances between edges in an image. In an image composed of grayscale pixels, the edges are where the grayscale values change abruptly. These changes can be from dark to light or from light to dark. In addition to calculating the distances between edges, measurement tools also measure the angles between edges and the size and location of holes on parts.
Software, setup/programming: Boatner points out, "Some vision software platforms are easier to use than others." This is because these platforms provide users with point-and-click controls, eliminating the need for users to configure them using high-level programming languages.
Vision-based measurement software includes:
*Edge detection: Ignore changes in the background and locate the edges in the image, calculating the angle and magnitude of the edges.
*Calibers: Provide high-speed, subpixel-level measurement of the feature width of parts.
*Blob Analysis: Demonstrates high repeatability by measuring the area, size, and centroid of part features.
*Scale calibration: Converts camera pixels into engineering units in the real world.
*Nonlinear calibration: Optimizes system accuracy, correcting distortions caused by the lens and projected light. It also allows for the use of smaller, more manageable correction templates in wide-field-of-view applications.
Setting measurement thresholds through simple statistical methods: Repeatedly changing measurement limits and evaluating results is very time-consuming, and even after all the changes and evaluations are complete, you can't say the measurement limits are in an optimal position. Only after all the time has been wasted can you determine if it works, and even then, you can't be completely certain. To save time, Brey says:
* Configure your vision system to output standard values; the critical values that products must pass through are set based on these standard values.
The collected images are processed, and the output values are then compiled into a spreadsheet.
*Separate the inspection data for qualified and unqualified parts.
Calculate the standard deviation of these two sets of data.
* Generate a bar chart. The bar distributions of these two sets of data must not overlap. If they do overlap, a more suitable standard value must be found.
* Calculate the average value for the nonconforming groups, and select a critical value such that the portion above the critical value reaches 3Sigma (99.73%). The nonconforming rate is determined by the Sigma level of the conforming groups.
If there is no critical value that can reach the 3Sigma level for both the acceptable and unacceptable groups, then find a new standard value.
Setup and optimization of the inspection scheme: Using stored graphics to improve inspection efficiency: Vision engineers spend several hours optimizing the inspection scheme. Costs include funding, parts, and the time required to execute the inspection process. Waiting for a rare defect is necessary; however, spending time waiting or creating the defect is wasteful. Furthermore, validating the effectiveness of these changes is time-consuming. Therefore:
* Arrange the cameras and light sources optimally. Ensure all objects of interest are visible and have the best contrast.
*The calibration system is used to bring it into focus.
Collect images of a dozen, sometimes hundreds, of different parts. Generate a smaller working sample set of 10 to 20 images, including a few images of acceptable parts and several images of various defective parts. Completing this task could require collecting billions of images.
* Generate a detection scheme and then optimize it until all images in the working sample group can be correctly evaluated.
* Inspect all images in a large sample group. Optimize the inspection protocol until there are no more "falsely accepted" nonconforming samples and the rejection rate is acceptable.
Apply this detection protocol to the system. Continue collecting all images. Add any problematic images to the working sample group, and then further optimize the detection protocol offline. This reduces waiting time at the working sample group.