High-Speed Vision Inspection for Micro Precision Gauging

  Print Print

"Using the motion control feature of LabVIEW, we intend to mark every defective part, so the defective part can be recognized while high speed inspection continues uninterrupted."

- Krishnan R, Zentron Labs Pvt. Ltd

The Challenge:
Designing an online high-speed vision system for optical gauging of several critical dimensions of stamped parts (terminal reel) with the accuracy of ± 12 microns at a rate of 1,200 parts per minute.

The Solution:
Developing a vision system with software based on LabVIEW for high-speed image acquisition, processing, and calculating of several critical dimensions for each terminal.

Krishnan R - Zentron Labs Pvt. Ltd
B Sasikumar - Zentron Labs Pvt. Ltd
Udayakumar KA - Zentron Labs Pvt. Ltd
Anup SK - Zentron Labs Pvt. Ltd
Riya Karmakar - Zentron Labs Pvt. Ltd
Damodaran N - Zentron Labs Pvt. Ltd
Pratim B - Zentron Labs Pvt. Ltd
Bikash Rajguru - Zentron Labs Pvt. Ltd
Ayan Ghosh - Zentron Labs Pvt. Ltd
Narayana P - Zentron Labs Pvt. Ltd
Amaresh Kumar MV - Zentron Labs Pvt. Ltd
Balaji Raghvendra - Zentron Labs Pvt. Ltd
Vijaya B - Zentron Labs Pvt. Ltd

Established in 2011, Zentron Labs is an NI Alliance Partner in the embedded vision domain. We address machine vision needs for industrial applications. We believe that machine vision requires fresh thinking and innovations that lead to easier adoption, quicker customization, scalability after deployment, and better value to customers. We help our clients improve productivity and compete at a global level to help them progress. We offer an unbiased and refreshingly sincere and methodical approach; therefore, we have chosen to address the following engineering challenge.

Introduction to the Engineering Challenge

The existing inspection procedure is tedious, manual, and sometimes only on a sampling basis. This method’s drawbacks include reduced inspection throughput and susceptibility to human error. Industries can look forward for higher speed and better accuracy and; hence, focus on an online machine vision inspection system. Figure 1 shows the stamped terminal and its various dimension measurement locations.

Figure 1. Stamped Terminal

Achieving Accuracy and Precision

During production, it is critical to maintain the dimension of the stamped terminal. The tolerance to variations is small, so the accuracy and precision in measurement had to be tight. Our challenge was measuring the terminal width at several places to an accuracy of +/-12 microns with a precision of +/-3 microns. We also needed to continuously monitor and record the statistical data with key process characteristics, process capability (Cp), and process capability index (Cpk) to help measure the process and yield.

Achieving High Speed

Modern precision stamping presses that produce the stamped and formed terminal reels produce at the rate of 1,200 parts per minute. To match the inspection throughput with the manufacturing throughput, the online machine vision inspection must operate at a rate of 1,200 parts per minute.

Requirement to Part Variety

For a vision system, variety in part type is often problematic. We faced the challenge of developing a configurable system that could be set up quickly to measure any type of stamped reel that falls within the physical dimension limits of the part size.

Consistency in Part Presentation

In optical gauging, we must carefully think through and design how to tackle part presentation and generalized triggering mechanisms that support different part types. We need a versatile system that does not decrease inspection throughput.

System Description

We took a detailed study of the machine vision hardware (system architecture) capable of providing the required inspection speed and accuracy. The various aspects of the designed system include:

1. Camera and Optics

We chose a USB 3.0 monochrome CCD camera from NI’s portfolio of models. We also considered subpixel ability of the NI gauging toolkit to choose the optimal camera pixel resolution. We chose the USB 3.0 interface because it required little processor bandwidth during acquisition. To support the accuracy requirement, we selected a telecentric lens and collimated light system. Every vision system is prone to nonlinear distortion errors, so the camera and lenses are calibrated for perspective and radial distortion using NI calibration algorithms to reduce the optical errors in the system. Using LabVIEW, we quickly developed utilities that helped us physically position and align the camera and the light in a precise fashion. We aligned the camera and collimated lighting along the optic axis and the terminal reel runs perpendicular to them, which gave us the ability to get the silhouette of the connectors. The combination of the telecentric lens and collimated light results in a high-contrast image of the terminal that results in sharp edges.

2. Part Presentation

We developed a mechanical guiding assembly to position the terminal reel within the camera field of view. Because there were multiple terminal sizes, we needed to set the position of the guides depending on the chosen terminal part number to be inspected. We used the ISM-7400E stepper motor with the PS-12 power supply in this positioning. We used the PCI-6518 to control the stepper motor by giving step and direction signals, which in turn control the sliding of the grooves of the linear slider. We positioned an accurate proximity sensor along the reel path to identify the arrival of every new terminal and generate the trigger for the image acquisition. When the camera triggers, an image is taken and sent to an industrial computer system for processing.

3. Algorithm and Software

We developed the inspection software using LabVIEW and the Vision Development Module. LabVIEW contains various measurement algorithms such as Caliper, Line Gauge, Max Clamp, Clamp, and Advance Edge Detection. These helped cover all the kinds of measurements that our customer required. We could also carry out an additional level of customization over these algorithms using LabVIEW.

We can use the software developed across multiple platforms like an embedded vision system, a compact vision system, or an industrial PC. The computer uses the image captured from the monochrome camera to the PC through the USB 3.0 interface. We can extract a reference coordinate system for each terminal along the line. Then, the various dimensions are measured in pixels and converted into real-world units (microns) using the calibration algorithm. Finally, the measurement is compared against the acceptance criteria specified by the customer. The Cp and Cpk values are also calculated in real time and displayed on request.

To support the speed, we used the multithreading feature in LabVIEW to make full use of a quad-core processor. In the end, we could meet the throughput requirement.

We designed the inspection software in such a way that we can easily configure the new terminal with the help of the user-friendly configuration interface window in minimal time. We store all of the configuration information in either a database or a spreadsheet format.

With the user inspection window (see Figure 2), the operator can perform the terminal inspection and monitor the inspection status with statistical data.

Figure 2. Inspection Window

4. System Architecture

Figure 3 shows the system block diagram. One of the major challenges with the system was integrating all the various hardware blocks with the software modules to ensure an error-free, reliable, and robust response from the hardware. NI hardware delivers straightforward communication between various hardware and software modules. We used the PCI-6518 DAQ board in the system for multipurpose communication to the hardware and software modules.

The embedded computer processes an image and deduces the inspection result. If the inspection result is okay/accepted, the tower lamp shows green. If the tower lamp blinks red, the defect is alarmed and recorded in the database, and the terminal reels are paused by sending a not okay signal through the PCI-6518.

Figure 3. Design Architecture

5. State Flow Diagram    

Figure 4 shows the state flow diagram of the entire software. Capturing the user interactions with the system and the corresponding reaction of the system in a state diagram format helps clarify the requirement. LabVIEW can also translate the state diagram into working VIs. The state diagram makes it easy to code using G, the graphical programming language used in LabVIEW.

Figure 4. State Flow Diagram

Final Inspection System

Figure 5 shows the machine vision inspection setup for the dimensional verification of terminal width.

Figure 5. Inspection Setup

Benefits of Using NI Products

Finally, we could achieve the inspection rate of 1,200 terminals per minute with the accuracy of 12 microns and precision of three microns, which surpassed our requirement. The configurability across terminal types also worked well and to the complete satisfaction of the customer. Other than the advantage of easy interoperability between the NI hardware components, LabVIEW was a boon for this project:

  • We completed the complex project in four months, with the software development primarily handled by two engineers.
  • With the help of optimized and efficient algorithms in the Vision Development Module, the measurement process is repeatable and reliable. The repeatability exceeded customer expectations.
  • Parallel processing empowered us to multitask image acquisition, processing, displaying, and logging of the inspection, which helped improve the inspection speed of 20 terminals per second.
  • We could easily integrate with database tools for a systematic method to store and retrieve configuration information across many part types.


Based on the successful and reliable operation of the single camera system, we enhanced the product-family to include a multi-camera system with software ported to actor framework. Further, it also includes a variant with multi-camera but non-telecentric lenses.

Multi-Camera System:

Figure 6. Enhanced UI for Multi-Camera System

Figure 7. 3-Camera, Telecentric Lens System

Figure 8. 2-Camera, Non-Telecentric System

The multi-camera system captured views of the stamped parts from different angles, including the side and the front). With the multi-angle view capability, the system could analyze and measure complex dimensions. It captured up to 30 measurements per part at the rate of 415 parts per minute. This translated to 12,450 measurements per minute. This effectively doubled the earlier throughput, facilitated by the parallel processing of the LabVIEW software and a quad-core processor.

The measurements made from images from one camera, augmented with the measurements from the second and third camera, compensate for errors due to variation in part presentation, thus improving accuracy. The LabVIEW loop parallelism capability resulted in a quick implementation of this feature.

Actor Framework

We evaluated two design patterns, namely, the producer-consumer design pattern and the actor framework. An actor framework is an object-oriented approach that provides the actor and the message parent classes to handle state data and message passing, respectively. Independent actors execute in parallel and communicate with each other through message passing. Each actor is a derived class from an actor-class and handles a specific resource of the system like camera, motor, and the UI. In actor framework, an actor is a LabVIEW object that represent the state of an independently running VI. Here, the UI actor runs independent of the measurement or camera actor and sends a message when a user presses a button to pause or stop, through a message. Thus, UI can always be responsive to users’ inputs while ensuring the other actors are processing the event.

The parent actors launch child actors. For example, UI launches the progress bar actor on demand to show initialization and sends a message for it to exit once its functionality is completed. Thereby, this framework helps keep the runtime software limited to the required functionality.

System Variants

Figures 6 and 7 show the variants with and without telecentric lenses. These variants are possible using the same LabVIEW application that uses the actor framework. They cater to different accuracy requirements of different products and customers. The flexibility of the actor framework has made the implementation of these variants easy and quick.

Future Work

The actor framework allows expansion to a multiprocessor system using the linked network actor feature. We can use this feature to realize a system that caters to the needs of great processing requirement for greater throughput. Using the motion control feature of LabVIEW, we intend to mark every defective part, so the defective part can be recognized while high speed inspection continues uninterrupted. We would also like to improve the measurement accuracy to ±5 microns. Last, we aim to provide a dashboard view for analytics on the measurement data generated and deliver real-time alerts as further enhancements.


Every successful measurement application depends reliability and repeatability, which is even more difficult in a vision-based application. Our inspection system achieved these targets with rugged and optimized hardware and the LabVIEW platform. Using this inspection system, our clients can ship millions of terminals that are inspected thoroughly for dimensional accuracy. This gives our customer the ability to offer better quality to their customers in automotive and electrical segments where quality is a key requirement. We have been able to implement in over 50 different types of terminal strips, more than 250 different feature measurements, with very good accuracy and at a high throughput.


Author Information:
Krishnan R
Zentron Labs Pvt. Ltd
Zentron Labs Pvt. Ltd, No.16, PSS Plaza Gr.Floor, New Thippasandra Main Road, HAL 3rd Stage
Bangalore 560075
Tel: 0091-80-4172 3548

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