Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
High-Performance Automatic Optical Inspection and Handler Control on a Cost-Effective PC Platform

Author:
Michael Hansson, M. Hansson Consulting, Inc., Philippines

Products Used:
NI PCI-1428 Camera Link card
NI PCI-1407 Image Acquisition card
NI PCI-6527 Isolated Digital I/O Cards
CB-100 I/O Connector Kits
NI LabVIEW 7 Express
NI Vision Development Module

The Challenge:
Developing a high-performance machine on a limited budget to perform electrical and optical inspection of connectors with parallel inspection stations, automatic tube feeding, dual-camera inspection of features as small as 20 μm, and electrical testing at voltages exceeding 1 kV.

The Solution:
Manufacturing a stand-alone, PC-based tester and handler using National Instruments’ image acquisition cards and digital I/O cards, as well as developing powerful multi-threaded control software using NI LabVIEW 7 Express™ and NI IMAQ Vision™.

Abstract
This paper describes the design of a semi-automated production tester for PCB-mount connectors where the use of virtual instrumentation and PC-based software allow for a drastic reduction in cost while yielding high performance and maximum flexibility.

Introduction
When a multinational manufacturer of connectors needed a combined electrical tester, optical tester and handler for one of their product lines, they provided product samples to M. Hansson Consulting and asked us if “we could come up with something”. Not only should the machine be able to handle both surface-mount and DIP-type connectors of lengths ranging from 17 mm to 37 mm, it should also be able to perform withstanding voltage tests at 1,200 VDC and automatic optical inspection of the connector pins with a resolution of 5 μm and a speed of over 1,400 connectors per hour.

While their budget was limited, they still needed to drastically improve the inspection quality over their existing manual inspection method. On a 16-pin connector, there are over 100 individual dimensions that need to be measured and compared against preset limits. Some of the connector features turned out to be very tricky to measure, such as the angle of the tip of a pin deep inside a hole measuring only 0.5 mm in width. Considering the complex gauging requirements, clearly commercially available off-the-shelf vision inspection subsystems would not suffice.

Hardware
We decided early on that due to the customer’s limited budget, we would use a standard desktop PC running Microsoft Windows, and see how far we could take this platform in terms of production performance and reliability. We settled on a tower PC equipped with a 2GHz processor and Windows XP Professional. We used two NI PCI-6527 digital I/O boards to interface to the many sensors and actuators in the handler. Since we already had a powerful processor in the system, and since the real-time requirements on this stand-alone tester were low, we didn’t need a separate Programmable Logic Controller (PLC).

The mechanical handling system was designed around a gravity-fed rail down which the connectors slide at an angle, from a manual feeder station at the top to a dual-tube loading station at the bottom. Streams of compressed air along the track slow down the connectors before they hit a stopper and a clamp at each test station. After the manual loading station we placed a high-voltage electrical test station, which subjects each consecutive pair of connector pins to a voltage of 1,200VDC using a Kikusui TOS5030 Withstanding Voltage Tester to test for microscopic shorts.

Following the electrical test station is a dual-camera optical inspection station. Here, the rail on which the connectors rest is anodized black and three different illuminators provide diffuse on-axis lighting and adjustable backlighting on three sides to yield crisp images. For the vision system we use an NI PCI-1428 Camera Link card to acquire images from a top-mounted progressive scan JAI CV-M4+CL camera, which has a 2/3” CCD and an image size of 1392x1040 pixels. A rear-mounted JAI CV-A50 camera feeds images to an NI PCI-1407 image acquisition card.

A large telecentric lens ensures that we are able to inspect inside each connector hole with no perspective error. After the optical inspection station, a reject station shunts bad connectors into a bin while the good connectors are allowed to proceed to a loading station. At the loading station, an automatic shifter allows the operator to replace the full tube while a new tube is being loaded. Every station is equipped with sensors to detect the presence of connectors, and all pneumatic cylinders are equipped with limit switches. Additional sensors were added to detect error conditions such as a full reject bin, an open cover or a loss of auxiliary power.

Software
The core of the machine lies in its software, which was a joy to develop despite the usual time constraints.

The control software for each station of the machine, from the feeder to the tube loader, is written as a separate, stand-alone state-machine virtual instrument (VI) in LabVIEW. Each station is separated from the others and communicates with its up- and downstream neighbors only through “handshake” flags. In this manner, we quickly and efficiently broke down the software into separate chunks that were easy to integrate and test with the hardware. Each state-machine VI concerned itself only with the I/O (the actuators and sensors) for the station it was to control. Not only was the code easy to debug; each station runs as fast as it can and asynchronously in parallel with the other stations.

A major feature of the software, which saved us weeks of development time, was our ability to test all the hardware control code early in the project without actually having the hardware present. All input signals are reflected in a global array, and all output commands are issued to the I/O cards through a single VI. This VI operates differently depending on the state of a “debug switch”. If we are not in debug mode, all output commands are actually issued to the I/O cards to effect the various hardware actuators. But if we are in debug mode, all output commands are merely reflected in another global array. In this manner, the global VI becomes a “simulator control panel” where we can manually simulate the mechanical behavior of the machine’s subsystems, verify the correct sequence of I/O events, and verify the proper communication among all stations.

Along the same vein, the user interface (UI) code was written loosely coupled from the rest of the code, which in turn is able to update the main front panel only by pushing commands onto a UI control stack. The UI could thus be written and tested separately and in parallel with the rest of the code. All test limits and I/O channel indices are stored in a separate configuration file, so that the behavior of the machine can be altered without necessitating changes to the software.


NI IMAQ Vision simplifies connector pin inspection


Automatic Optical Inspection
A major challenge was the Automatic Optical Inspection (AOI) code, due to the complex inspection criteria and the small size of the features to be inspected (see figure above). The rich set of functions that come with the NI IMAQ Vision library was a great help, and the NI Vision Assistant was absolutely invaluable to us when prototyping the algorithms and determining suitable parameters and test limits.

The AOI code was written such as to perform an automatic self-calibration prior to the inspection of each individual connector. Special marks in the machine components within the camera’s field of view allows the software to establish a correct coordinate system even in the presence of undesirable camera movement. Very small features can then easily be located, and all measurements can be taken in real-world units. The parameters that are inspected include the position and angle of all connector pins, as well as the angle of the tip of the pins inside the cavities and the gap (if any) between the tip and the inside cavity wall.

Conclusion
Without tools as powerful and as flexible as LabVIEW 7 Express and the NI Vision Development Module, we would either have had to throw more hardware such as high-end PLCs at the machine, or we would have had to spend many more months developing customized software. Either way, the cost would have been prohibitively expensive for the customer. After a week or so of fine-tuning the inspection algorithms and the test limits, we were able to meet the speed criteria while simultaneously demonstrating that the machine is so accurate it is now able to catch tooling problems from preceding manufacturing stations that were not visible with the old manual inspection method using a profile projector.

The company’s Assistant Manager for Engineering says about the machine: “we find the machine very reliable and accurate; it has reduced the number of customer claims from 2-3 per month to zero in seven months, while maintaining the line speed and reducing the manpower requirements by two operators.”