Abstract:
An improved sensor for body-to-lead tolerances for very odd components includes multiple light beams formed by LED/photodiode pairs, or multiple independent light detectors with a multidirectional light source. The sensor is self-contained, not requiring position data from a robot carrying the components.

Description:
BACKGROUND OF THE INVENTION 
     1.1 Field of the Invention 
     The invention relates to an improved apparatus for measuring body to lead tolerances of very odd components (&#34;VOCs&#34;) . 
     1.2 Related Art 
     When VOCs are inserted automatically into a printed circuit board, a gripper holds the body of the component. However, at the moment of insertion, the leads have to be at the right location. The controller for the gripper knows where the leads should be; but, if the lead locations differ too much from the &#34;ideal&#34; component, the insertion will fail. Automatic insertion requires an accurate measurement of the body-to-lead tolerance. 
     FIG. 1 illustrates a known system for measuring body to lead tolerances. In the known apparatus a robot moves a VOC through feedthrough area 101. The leads of the VOC interrupt laser-light beams 102 and 103. Laser-light beams 102 and 103 come from laser 106, via mirror 107, and semi-transparent mirror IOS. The interruptions are detected in the photocells 104 and 105. Based on the interruptions, positions of the leads are calculated. 
     The known system has the disadvantage that there may be occlusions between leads. The known system has the further disadvantage that a laser is needed. The known system is also not self-contained. It requires input from the gripper controller. In addition, improved cost, speed, and accuracy are needed. 
     SUMMARY OF THE INVENTION 
     An object of the invention is to provide increased redundancy in measuring body to lead tolerances, in order to achieve higher accuracy and in order to be able to measure more complex lead patterns. 
     A further object of the invention is to obviate the need for a laser in measuring body to lead tolerances. 
     It is still a further object to have a self-contained sensor, which does not need input from the controller of the robot which is moving the VOC. 
     Redundancy is achieved in that at least two independent light beams or more than two independent light detectors are used. 
     In one embodiment, light beams are produced by LED&#39;s rather than lasers. 
     The self-containment comes from the fact that the position of the robot is measured by using the same sensor which detects lead positions, rather than by using the robot controller. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     The invention will now be described by way of non-limitative example with reference to the following drawings. 
     FIG. 1 illustrates a known system. 
     FIG. 2a is a plan view of beam layout in one embodiment of the invention. 
     FIG. 2b is an elevation view of the beam layout of FIG. 2a, taken along the plane through the y-axis. 
     FIG. 3 shows an automated assembly system using the sensor. 
     FIG. 4 is a flowchart of the software used by the sensor subsystem. 
     FIG. 5 is a plan view of an alternate beam layout according to the invention. 
     FIG. 6 is a second alternate beam layout according to the invention. 
     FIG. 7 is another alternate beam layout according to the invention. 
     FIG. 8a shows a top view of measurement of a lead location using a dual dell diode. 
     FIG. 8b shows signals resulting from the locations of FIG. 8a. 
     FIG. 8c shows a front view of the dual cell diode. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIGS. 2a and 2b illustrate beam layout in one embodiment of the invention. In the figure, beams 2, 3, and 4 are used to measure lead locations. Beams 1 and 5 are used to measure velocity of the VOC during motion through the feedthrough area 101. Beams 1 and 5 therefore help eliminate the need to get data from the controller of the robot which carries the VOC. Beam 6 is used to determine if any of the leads on the VOC are too long. Beam 6 triggers an alarm function. 
     Each beam comprises a matched infrared LED/photodiode/thresholds amplifier pair with focusing lenses, such as the KEYENCE FU 36. These lenses create a very narrow beam more cheaply than would be possible using a laser. An alternative way of creating a narrow beam is to use a very narrow receiving area at the photodiode. The receiving area should be no wider than the leads of the component. 
     With this apparatus and geometry, lead measurement accuracy has been measured to be 0.1 mm. The maximum velocity of the component can be 400 mm/s. 
     FIG. 2a also shows two axes, x and y, which form the basis for a Cartesian coordinate system defined by the geometry of the sensor. The axes, x and y, do not have a physical existence, but merely serve as a reference frame for calculations. Each beam can be characterized by an equation of the form 
     
         y=a.sub.i x+b.sub.i, 
    
     where i is an integer indicating the beam number. In other words, each beam is defined by a pair of parameters (a i ,b i ). 
     FIG. 3 shows an assembly unit using the sensor. The assembly unit includes a robot arm 301 having a gripper in which is held the VOC. The gripper holds the body of the component. A tool 307 is a lead mounted on the robot gripper used to trigger all measurements and to measure velocity of the VOC during motion through the sensor feedthrough area. The robot controller 303 causes the robot arm to move the VOC through the sensor 304. The sensor subsystem 305, which is a computer, calculates the body-to-lead tolerances of the VOC, as the VOC passes through the sensor 304. The computer then sends data to the robot controller 303, which allows the robot controller to place the VOC in the target board 306. 
     FIG. 4 is a flowchart of the software in the sensor subsystem. The software has four main functions: Data Acquisition 401, Measurement Simulation 402, Lead Location Measurement 403, and Component Location Measurement 404. 
     The Data Acquisition module 401 acquires measurement data and organizes it in a format that is convenient for the Lead Location Measurement module 403. First, the user provides measurement parameters. The module then enters a wait state until the tool 307 interrupts the first beam and the measurement is triggered. During data acquisition, the software continuously polls the output of the light beam photodiode amplifiers. The output for each beam is binary--beam is either OPEN or CLOSED. The six beam amplifier outputs are represented as a six-bit data word. The current value of that data word describes completely the current state of all the beams. The polling routine checks the data word to see if it changed state since the last time it was checked. If it did, the data word and an associated time stamp are stored in two respective arrays: a data array and a time stamp array. 
     The polling routine is the only software that has to run &#34;real-time&#34;. Real-time in this context means that the polling loop has to run an order of magnitude faster than the response time of the photodiodes and amplifiers. 
     The software acquires data for a specified period. Over the entire measurement, each lead should interrupt each beam at most one time. Each interruption will cause a particular beam to change state two times from OPEN to CLOSED and from CLOSED to OPEN. The associated time are referred to herein as &#34;tclose&#34; and &#34;topen&#34;, respectively. The data words stored in the data array are analyzed to determine which beam cause the interruption. The associated tclose and topen are used to calculate an estimate for the moment of interruption using the equation 
     
         tavg=(tclose+topen)/2 
    
     and for the diameter of the lead using the equation 
     
         tdiff=topen-tclose. 
    
     The times tavg and tdiff are stored in a beam timing matrix 405. Each row in the matrix contains a sequence of tavg&#39;s and tdiff&#39;s of interruptions of one beam. The tavg&#39;s are given in increasing value. The tdiff&#39;s are also stored in the matrix, to be used in calculation of lead thickness. The beam timing matrix 405 does not contain any information about which lead caused a specific interruption. 
     The software also measures the actual velocity of the gripper 302 when it moved through the sensor. The velocity is calculated by using the timing data from beam 1 and 5 interruptions caused by the tool 307. The orthogonal distance between the two beams divided by the difference in interruption times is used as an estimate for the gripper velocity &#34;man --  velocity&#34;. 
     The primary function of the Measurement Simulation module 402 is to provide the correspondence matrix 406. This matrix is required to interpret the beam timing matrix 405. The correspondence matrix 406 gives, for each tavg entry in the beam timing matrix 405, the lead number &#34;leadnb&#34; that caused that interruption. 
     The correspondence matrix 406 is derived with a simulation based on the expected lead layout 407, the beam layout 408, and the measurement parameters 4Og. Measurement parameters 409 include, for instance, expected gripper velocity and expected lead offsets. The expected moment &#34;texp&#34; of each lead beam interruption is determined from 407, 4O8, and 4O9, by calculating the travelling distance from the location at triggering until the interruption with the beam, and dividing this distance by the expected gripper velocity. 
     For each beam, the texp&#39;s are ranked in a sequence with increasing values. The sequence of corresponding leadnb&#39;s is stored as a row in the correspondence matrix 406. 
     The correspondence matrix 406 can be calculated off-line and stored as part of the component data base. 
     The Measurement Simulation module can be an interactive evaluation tool for lead layouts. It is not possible to measure all leads in some types of more complex components. The main reason for this is the shadowing effect: the light beam cannot see a particular lead because another lead is obstructing the view. The user has to evaluate expected lead-beam interruption times and check, for each beam, the time differences between consecutive leads. If this difference is small, chances are that one lead will obstruct the view of the other and that the lead location measurements for both leads will be unreliable. If lead location measurements are unreliable, a different angle, of the component with respect to the sensor, has to be selected by the user. 
     Individual lead locations are calculated in the Lead Location Measurement module. The system uses the three beams in the sensor plane to derive the lead locations (x lead , y lead ). For each lead, three linear equations (with two unknowns) are constructed in the form. 
     
         y.sub.lead =a.sub.i *x.sub.lead +b.sub.i +tavg*man.sub.-- velocity (1) 
    
     where i=2,3,4 and a i  and b i  are the beam parameters. Equations (1) are constructed from the beam timing 405 and correspondence 406 matrices. Each equation (1) represents a line and the lead location is at the intersection point of the three lines. However, because of measurement noise, the three lines will not intersect in a single point. The lead location is therefore estimated by calculating the average of the three intersection points of the three possible pairs of lines, i.e. (linel,line2), (linel,line3), and (line2,line3). The standard deviation of the average is also calculated and is used as a measure of accuracy for the lead location measurement. 
     The Component Location Measurement module 404 calculates the overall component location and verifies the component lead regularity. The measurement is based on a point pattern matching technique described in S. Lee et al., &#34;A Fast Computational Method for Minimum Square Error Transform&#34;, Proc. 9th Int&#39;l Conf. Pattern Recognition, (Rome, Italy, 11/88) pp. 392-394. In this paper, a computationally efficient method is described for the matching of two 2-D point patterns (with already established correspondence). The proposed algorithm is implemented and calculates rapidly the translation and rotation which, applied to one pattern, minimizes the sum of the squared distances between corresponding points in the two patterns. 
     One pattern, for the present software, is the expected lead layout 407 coming from the component database. The other pattern is the measured lead layout 4IO from the Lead Location Measurement module 403. The translation and rotation parameters are calculated relative to the expected lead layout 407. In this way, the controller 303 can apply the calculated translation and rotation, called &#34;deviation from expected component&#34; 412 directly to the component target location. If required, however, the translation and rotation parameters can be transformed easily to other coordinate systems. 
     In physical terms, a minimal cumulative squared distance between component leads and holes in a board does not guarantee that insertion is possible. A component can not be inserted successfully if one lead is bent too much, even though all other leads are perfect. If all leads are bent only a small amount, the component can be inserted although the cumulative squared distance might be the same or even bigger as in the one-bent-lead case. The Component Location Measurement module 404 therefore also calculates another measure called residual error for each lead: the distance between the transformed (i.e., translated and rotated) expected lead location and the measure lead location. This error is a measure for the local distortion of the lead pattern. The lead can not be inserted if the residual error of that lead is above a certain threshold. If desired, the user can specify different residual errors for different leads (for example when not all the holes have same dimensions). In the current implementation, the maximum of all residual errors of a component is compared with a user selectable threshold to make the go/no-go component decision 411. The residual error is calculated as described in the above-described paper of Lee et al. according to the following equations 
     
         r.sub.j =SQRT((x.sub.l-a,j -x.sub.exp,j).sup.2 +(Y.sub.l-a,j -Y.sub.exp,j).sup.2) ##EQU1## where c is the cumulative residual error, r.sub.j is the residual error of the lead j, x.sub.l-a,j is the average of x.sub.lead for lead j, x.sub.exp,j is the expected x position of lead j, y.sub.l-a,j is the average of y.sub.lead for lead j, y.sub.exp,j is the expected position of lead j, and SQRT is the square root function. 
    
     FIG. 5 shows an alternate beam layout according to the invention. 
     FIG. 6 shows an alternate embodiment in which there is a light source 600 which is multidirectional, and a plurality of sensors 601. Alternatively, one can use a single light source with a line scan camera. 
     FIG. 7 shows an alternate embodiment with another beam layout. 
     As shown in FIG. B, for additional accuracy, a dual or quad cell photodiode may be used for detecting light beams. Such photodiodes detect gradual interruption of a light beam as a lead passes in front. In conjunction with such photodiodes, a differential amplifier should be used rather than a threshold amplifier. 
     FIG. 8a shows a top view of measurement of a lead location using a dual dell diode. At position 801 to lead does not interrupt the light beam from LED 806 at all. At position 802, the lead interrupts the portion of the light beam in front of area 1, 807. At position 803, the lead interrupts the portions of the light beam which are in front of both the portion of the light beam which is only in front of area 2, 808. At position 805, the lead again does not interrupt the light beam at all. FIG. 8c is a front view of the two cell photodiode. 
     These interruptions of the light beams result in the amplifier signals from the photodiode shown in FIG. 8b. The zero crossing signals give accurate measurements of lead locations.