Performing High-Speed Cylinder Inspection Using LabVIEW Real-Time and the NI Vision Development Module


"With built-in multicore support, versatile vision libraries, and NI PCI Express Camera Link frame grabbers available off-the-shelf, we were able to divert our attention away from the basic hardware and interfacing issues and toward the difficult domain challenges at hand."

- Markus Tarin, MoviMED

The Challenge:
Implementing a machine vision application to gauge 20 cylindrical parts per second that are 2 or 3 in. long and 9 mm in diameter to micron tolerances at line speeds of 52 in. per second.

The Solution:
Using NI hardware and software along with a custom, eight-core Xeon workstation running the NI LabVIEW Real-Time Module, two synchronized Camera Link cameras, dual NI Camera Link frame grabbers, and other custom and third-party components to solve a particularly challenging gauging problem for a national government contractor.

Markus Tarin - MoviMED
Carlos Agell - MoviMED
Jesi Kinnevan - MoviMED
Dave Ritter - MoviMED

System Software and Hardware Components

The selected NI products for the system included LabVIEW Real-Time and NI vision software, two NI PCIe-1427 Camera Link image acquisition boards, an NI PCI-6254 Multifunction M Series data acquisition (DAQ) board for encoder tracking, and an NI PCI-8433 serial interface board for RS422 communication with the factory programmable logic controller (PLC). We used two DALSA Falcon 4M30 Camera Link cameras for the profile measurements and two NI 1772 Smart Cameras for the cross-sectional gauging.

Optical components from SILL included a custom-designed dual-lens collimated light source and matched SILL S5LPJ1007 telecentric lenses. Advanced Illumination supplied strobe controllers and NI Smart Camera backlighting units. In addition, we used a rotary encoder from BEI for camera triggering and EDT supplied two pairs of Camera-Link-to-fiber-optic converters to extend the Camera Link cable length to 60 ft, which was required for factory installation.

Difficult Optical Challenges

Several factors made this project especially challenging. The first issue was the physical dimensions of the part. At 9 mm in diameter and a length between 2 and 3 in., the aspect ratio of the part was problematic. The specs called for a measurement resolution of 1.5 µm, but even with specialized hardware, achieving the 1.5 µm target would be a formidable challenge. A 16 megapixel camera with a telecentric lens at 1:1 magnification was specified. However, even with this configuration, engineers at MoviMED, a National Instruments Alliance Partner, quickly concluded that sub-pixel interpolation would be necessary to increase the effective resolving power of the measurement system.

To further complicate matters, there were no standard 16 megapixel camera lenses available that could meet all of the optical specifications. It quickly became clear that it would be impossible to achieve the necessary minimum spatial resolution of 7 µm using a single camera; therefore, we had to implement our next best solution using two cameras and a prism that would allow us to fold one of the cameras out of the way while we used the 1X optics we needed. This complicated the matter because we needed to calibrate two camera imaging spaces and treat them as one. We had to calibrate for multiple axes of freedom between both cameras and account for a small amount of jitter due to vibration between the two cameras.

Another problem was the line speed because the camera would need a global shutter to ensure that motion blur was not introduced during gauging. At a line speed of 52 in. per second and tight tolerances, motion blur could quickly become an issue. In this application, a single pixel of motion blur could introduce enough measurement uncertainty to exceed the specified tolerances. Therefore, an exposure time in the order of 5 µs was necessary to “freeze” the part and prevent motion blur from introducing gauging errors.

To meet the optical system challenges, we combined two DALSA Falcon 4M30 cameras to create a single image space. Each camera was equipped with a 1X magnification lens to image the part onto the cameras’ 7.4 µm pixel sensors. Unfortunately, the minimum shutter speed for these cameras was 15 µs, so we used an Advanced Illumination strobe controller to reduce the overall exposure window. The strobe controller drives a custom SILL (blue LED) backlight with a current of 6A for 5 µs to freeze the motion of the part onto the two cameras’ sensors (Figures 1 and 2).

Figure 1. Optical System Setup and Profile Measurements

Going the Extra Distance to Meet the Spec

Although we achieved the goal of 7 µm optical resolution using commercial off-the-shelf (COTS) cameras, it was still not adequate to meet the 1.5 µm measurement specifications required by the customer. Therefore, we indicated edge detection algorithms with sub-pixel interpolation. Fortunately, this requirement was well within the capabilities of the LabVIEW Real-Time Module image processing tools. Having the sub-pixel capabilities available out-of-the-box in the LabVIEW Real-Time.

Figure 2. The Optical System Setup with Two NI 1772 Smart Cameras for Cross-Sectional Gauging

Performance Challenges

With the optical challenges addressed, the next issue was system throughput. After gauging 20 parts per second, there is only 50 ms left to capture the images, take the measurements, and transmit the results to the PLC. While 50 ms may seem like a relatively large time window in the context of modern system throughput, it is important to note that each of the Dalsa cameras generates a 4 megapixel image. That means to consistently and accurately apply sub-pixel processing algorithms to 8 megapixels of 16-bit image data, we need system throughput of 320 Mbytes per second.

PCI Express was the only bus option when looking for ways to continuously stream this much image data; therefore, we interfaced the Dalsa cameras to two NI PCIe-1427 Camera Link DAQ boards. We integrated both frame grabbers into a single, custom, industrial PC workstation running LabVIEW Real-Time for Phar Lap.

The PC used for this application was not a standard COTS industrial workstation PC. To handle the sub-pixel processing and throughput load for 320 Mbytes of image data each second, our engineers assembled a custom, eight-core Xeon powerhouse with 4 GB of RAM and redundant solid state drives. The custom real-time PC supplied the hardware platform and the muscle while a fine-tuned LabVIEW Real-Time application, enabled by sophisticated NI vision tools, contributed to the processing finesse to meet the unusually challenging application requirements.

Iterative Software Development Approach 

To meet the rigorous throughput demands, several iterative cycles were undertaken before settling on the final software architecture. It is not always easy to predict how LabVIEW Real-Time will allocate tasks to multiple processor cores; therefore, we investigated several gauging strategies and software design approaches to better understand multicore utilization in a LabVIEW Real-Time context. These investigations helped our software engineers find the optimal balance between measurement integrity and system performance.

This project would have been difficult to complete without the use of LabVIEW Real-Time, NI vision software, and NI hardware. With built-in multicore support, versatile vision libraries, and NI PCI Express Camera Link frame grabbers available off-the-shelf, we were able to divert our attention away from the basic hardware and interfacing issues and toward the difficult domain challenges at hand. The NI tools enabled us to focus on the more esoteric and problematic challenges presented by the requirements and deliver an application that would have been extremely difficult or perhaps impossible to complete using standard tools.

Illustration Courtesy of Vision System Design Magazine

Figure 3. Imaging Systems Block Diagram

Author Information:
Markus Tarin
15540 Rockfield Blvd, Suite C-110
Irvine, CA 92618
Tel: 949.699.6600

Bookmark and Share

Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community

Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI