Measure Precisely with Machine Vision
To make precise and accurate measurements using a machine vision system, one must pick components appropriate to the part or object being measured and meet the required precision. Simple-to-use and inexpensive machine vision components are available for precise 2-D part measurement. Many parts are effectively planar and it makes sense to try to use 2-D measurement on 3-D parts.
The inspection of electrical connector pins done by Faber Associates (Clifton, NJ) is an example of precision 2-D measurement on 3-D parts.
These electrical connectors have a flat lug for a mating connection and perpendicular tabs that are crimped to connect the lug to a source wire. Parts are positioned in the fields of view of two perpendicular cameras, lenses and light sources. The vertical camera views the outline of the lug and the horizontal camera checks the height of the perpendicular tabs.
Lighting is chosen to improve the contrast of the part elements to be measured. For the electrical connectors, collimated lights behind the parts give a very sharp shadow cast, or orthographic projection image. A collimated light source is one where all the rays of light are parallel-in a column. The advantages of collimated light are that perspective distortion is minimized and part edge sharpness is maximized as only light rays from one direction reflect off an edge.
Lens LimitationsThe lens map magnifies or minifies the part view onto the camera’s sensor. Lens limitations on precision include perspective distortion, depth of field, spatial frequency response and optical distortion. Perspective distortion is the apparent change in imaged part size as the part moves toward or away from the front of the lens, along the Z or optical axis. This apparent size change is proportional to 1/Z.
Depth of field is the range of distance along the Z axis where the resulting part image is in acceptable focus. As the part moves away from the plane of best focus, the image blurs. A little blurring is not a problem for making measurements of edges, but will reduce the contrast of part features. When measuring elements such as defect dimensions, reducing contrast makes these small features harder to detect and measure.
Limited depth of field is a major reason why 2-D planar measures are preferred. Depth of field increases with decreasing lens aperture, but this also decreases the amount of light through the lens and, hence, the image contrast.
Spatial frequency is the inverse of part feature size. As part feature size decreases, the image contrast also decreases. Some decrease in contrast is required to prevent aliasing (sampling) artifacts with the camera sensor’s array of pixels. As with depth of field, this reduction in contrast has more impact on detecting small spots and features than on edge-based dimensioning.
Optical lens distortion appears as changes in size of a calibration rule as you move away from the optical axis. This distortion can be measured and computationally removed, but it is better for precision measurements to choose a lens with little optical distortion.
Perspective and optical distortion are nearly eliminated by using a telecentric lens, so these lenses are recommended for making precision visual measurements. This type of lens only allows rays of light parallel to the optical axis to pass to the camera’s sensor. The field of view of a telecentric lens is limited to the diameter of the front lens element, the element nearest the part.
Lens MagnificationThe camera’s pixel size and number of pixels along with the required field of view (part size plus some surrounding area) sets the lens magnification. Dividing the sensor pixel size by the magnification gives the size of a pixel on the part being measured. The field of view for an electrical connector is 0.92 by 0.69 inch (width multiplied by height) and a camera with 1,600 by 1,200 pixels gives a lens magnification of 0.3X. The pixel size on the object is 0.575 mil (A mil is a short-hand term for 1/1000 of an inch) or about six ten-thousands of an inch. The required measurement precision is three ten-thousands of an inch (0.3 mil).
The chain of electrical connector pins are tensioned to suspend them above the lights and at specified distances from cameras with telecentric lenses. Vibration from the stamping press moves the connector around this specified distance, but not so much that sharp focus is lost. Because the light is collimated and the telecentric lens only accepts collimated light, the shadow-cast images produced are very sharp and insensitive to part motion along the Z axis.
Image ProcessingThe images are processed on a small computer that is specialized for machine vision and using machine vision software. The measurements include part edge-to-edge dimensions, center circle dimensions and part-to-part spacing. In addition, some inspection is done for burrs and foreign matter on the parts. The primary question answered by the vision system is if the die used in the progressive punch press has worn down beyond tolerance, as indicated by a change in size of the stamped electrical connectors.
How can a required edge location precision of 0.3 mil be attained with an on-the-part pixel size of 0.6 mil? How can a measurement be made when one cannot see “inside” a pixel? If an operator can approximate the optical blurring function, they can model what an ideal step edge looks like in the image after optical blurring. Then they can fit the pixel values to this model to recover an approximation to the ideal edge position. A little blurring is not bad in this case.
This assumes that the part edge is ideal and that the optical blurring is mathematically well behaved. In practice, part edges can be located to within at least ¼ of a pixel and to a much greater precision in controlled conditions. So the edge location precision is comfortably at 0.15 mil. This sub-pixel method can sometimes be applied to measuring areas and edge lengths, but there are other issues that complicate this.
Last, the measurement in pixels-say the diameter of the hole in the electrical connector tab-is converted to world measures through a calibration process. This process is automatically done by the vision system after being trained on a calibration grid. This converts precision to accuracy.
The precise and accurate measurement of part features such as edges requires collimated light, careful placement of the part, a telecentric lens, calibration-and perhaps optical distortion correction-and computation by the vision system’s computer. Vendors of these elements provide consultations and wizards to help operators select the right parts. The vision system software and processor are designed to be easy-to-use, fast and supporting that portion of the chain of precision from part to real-world measurement. V&S