Abstract:
An automatic system for inspecting products having an edge or edges which, for an acceptable product, are straight (within predetermined tolerances) without accurate orientation of such products which includes a raster-scanned television camera (or its equivalent) for generating a composite video signal corresponding to the product being inspected. The number of horizontal sweep intervals in each edge to determine its length and comparing such length information with pre-stored reference length to determine if the two correspond, rejecting the capsule if it is shorter than the reference length but, if it is longer than the acceptable length, determining if the greater length is a result of the product&#39;s being tilted or torn.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to automatic product inspection systems and methods. 
     2. Prior Art 
     Automatic inspection of products has been done, in the past, by means of pattern comparisons. Such systems involve the use of masks, or the like, and require accurate orientation of the product being inspected. Such orientation is time consuming and difficult. Visual inspection, which has been used in the past for drug capsule and semi-conductor chip products, is slow, monotonous and inaccurate. Operators soon become tired and errors rise intolerably. 
     Therefore, it is an object of this invention to provide a novel product inspection system which is free of the problems experienced in connection with the use of prior art systems. 
     It is a further object of this invention to provide an automatic inspection system for products which, when acceptable, have straight edges of predetermined length, such system requiring no accurate orientation of the products. 
     SUMMARY OF THE INVENTION 
     Stated succinctly, a scanning, photo-electric transducer, for example a television camera, views the products, for example drug capsules, being carried on a conveyor belt with minimally controlled orientation. The video signal derived as the products are moved into the view of the raster-scanned television camera (and are simultaneously illuminated, as by a strobe lamp) is stripped of its synch pulses and is shaped into a binary signal. Transitions from &#34;zero&#34; to &#34;one&#34; and from &#34;one&#34; to &#34;zero&#34; are detected along each horizontal scanning line. Those transitions indicate a change in the image seen by the camera. More specifically, a point along any edge will thus be indicated. 
     The length of any edge is determined by counting the number of horizontal sweep intervals it contains. If that length is shorter than a stored reference length, a reject signal is generated. If the length is acceptable further analysis is done to determine if the incorrect length is a result of the product&#39;s being tilted, or the edges thereof curved or torn. That analysis includes subtracting the &#34;X&#34; minimum coordinate from the &#34;X&#34; maximum coordinate along the maximum line length measured in the &#34;Y&#34; direction and comparing the result with a reference value. If X max-X min does not exceed a predetermined value the product is passed, while if X max-X min exceeds that value further analysis occurs. 
     A summation of incremental &#34;Y&#34; lengths for a series of incremental &#34;X&#34; changes in a uniform direction is compared with a third reference value and if it is smaller than this value, a curved line is indicated and a reject signal is generated, while; if it is not smaller than this reference value another analysis takes place. 
     Finally, the difference between the mean or average value of the &#34;Y&#34; increments in a region and each value of such &#34;Y&#34; increments is compared with a reference value and if it exceeds that value a reject signal is generated while, if the reference value is satisfied the product (in this case a drug capsule) is passed. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The features of the present invention which are believed to be novel are set forth with particularity in the appended claims. The present invention, both as to its organization and manner of operation, together with further objects and advantages thereof, may best be understood by reference to the following description taken in conjunction with the accompanying drawings, in which: 
     FIG. 1 is an outline drawing showing the profile of two products having straight edges which could be inspected by the system of the present invention; 
     FIG. 2 is an outline drawing showing the type of defect which can be detected with the system of the present invention; 
     FIG. 3 is a block diagram of the inspection system according to the present invention; 
     FIG. 4 is a diagram showing the timing relationship between certain pulses in the system of FIG. 3; 
     FIG. 5 is a diagrammatic representation of the scanning pattern utilized in the present system showing binary transition points; 
     FIG. 6 is a memory map of certain coordinate and length values determined for a particular product by the system of FIG. 3; 
     FIG. 7 is a block diagram of a portion of the system of FIG. 3; 
     FIG. 8 is a timing diagram for the system portion of FIG. 6; 
     FIG. 9 is a flow chart of the microcomputer operations in the system of FIG. 3; 
     FIG. 10 A through E is a series of diagrams showing various coordinate and length data used in the inspection analysis process performed by the microcomputer. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     In FIG. 1 A, capsule 100 is shown having an edge 102 which, for an acceptable capsule, is straight, as shown. The product of FIG. 1 B may be a semiconductor substrate or chip 104 which has multiple edges 106, 108, 110, 112, which, for an acceptable product should be straight. These are the types of edges which, it is intended, be automatically checked by this system and method. Cardboard boxes are included. The projections of the edges on the X and Y axes are straight lines. 
     In FIG. 2 A a section 114 has been lost from cap 116. In FIG. 2 B the cap 118 has been torn and folded under at 120. Both of these defects can be detected by this system and method at high speed and with great accuracy. 
     FIG. 3 shows a block diagram of the inspection system according to this invention. In FIG. 3 capsules 1 and 1&#39; are carried in recesses on conveyor belt 2. The recesses only nominally orient the capsules. Accurate orientation, as would be required in a pattern recognition system, is not required with this system. 
     Capsules 1 and 1&#39; are illuminated by strobe light 3 as they pass within the field of view of image converter 4, which may be an industrial television camera with conventional raster scan. 
     The composite television signal from camera 4 passes to synch stripper 5, where the horizontal synch pulses HD and the vertical synch pulses, VD, are removed, leaving the video signal envelope, which is applied to signal shaper 6, from which a squared, or binary signal emerges for application to signal processing and storage circuit 7. The functions performed in circuit 7 are set forth in more detail in FIG. 7. A microcomputer 10 addresses the memory in circuit 7 through address bus 8 and extracts data for processing from data bus 9. Control circuit 11 receives processed data signals from microcomputer 10 and supplies control signals to it. Control circuit 11 also receives vertical drive (VD) information from synch stripper 5, and capsule position information from photo-electric cell 3. It supplies a strobe trigger (ST) pulse to strobe 3 and an accept-reject signal to ejection control circuit 13. 
     In FIG. 4, curve A shows the pulse applied to control circuit 11 from position sensor 12 when a capsule 1 is within the field of view of camera 4. This pulse of FIG. 4, curve A enables control circuit 11, which also receives the vertical synch or drive pulses VD shown in FIG. 4B to supply a trigger pulse (ST), shown in FIG. 4 C, to strobe 3 in synchronism with the beginning of a vertical sweep interval, T 1 , FIG. 4 D, during which period microcomputer 10 is put in a &#34;hold&#34; condition as shown in FIG. 4 E. During the period T 2  (FIG. 4 E) the Microcomputer 10 performs its analysis of stored data in circuit 7. 
     In FIG. 5, the video pattern of capsules 1 and 1&#39; is shown in binary form, i.e. after shaping in shaping circuit 6, and on a horizontal-line-by-horizontal basis. As can be seen, capsule 1 starts at the &#34;Y&#34; coordinate YB 1  and has a diameter measured in horizontal lines of X UN  which is shown as YL 1 . 
     The profile of capsule 1&#39; has its first video segment at the &#34;Y&#34; coordinate YB 2  and its width (the diameter of capsule 1&#39;) in terms of horizontal lines is X DM  which is shown as YL 2  in FIG. 5. The transition points in the shaped video are aligned, showing an un-mutilated and acceptable capsule edge at the joint between the two halves of each capsule. 
     As can be seen from FIG. 5 the vertical resolution of this system is 240 lines and the horizontal resolution is 320 lines. 
     In FIG. 6 the information inherent in FIG. 5 is presented in memory map or chart form with &#34;Y&#34; coordinates as addresses. Until &#34;Y&#34; coordinate YB 1  is reached the data stored at each address is a &#34;zero&#34; in binary terms. After it reaches YB 1  the shaped video signal goes to a &#34;one&#34; because the upper edge of the outer cap of capsule 1 is detected by camera 4 and then the data stored are X U1  thru X UN  at respective addresses. The extent of horizontal lines X U1  through X UN  is the transverse or width dimension of capsule 1 in terms of horizontal lines, the separation of which is determined by the vertical deflection circuits of camera 4. 
     The binary signal falls to zero again when the camera is scanning the space between capsules 1 and 1&#39; and, at YB 2  the top edge of capsule 1&#39; produces video output and a &#34;one&#34; in binary terms, which continues for M horizontal lines from X D1  to X DM  to give a diameter length of YL 2 . The video and binary signals then return to zero. This information is stored in Y coordinate memory. 
     FIG. 6 B shows the storage of edge length data (as projected on the &#34;Y&#34; axis) for capsules 1 and 1&#39;. 
     In FIG. 7, signal processing and storage circuit 7 includes a set, re-set flip-flop 14 which may be a type SN74LS107 with an SN7400 and an SN7404. This flip-flop is set by the leading edge of the shaped video signal &#34;a&#34; shown in line (E) of FIG. 8. Flip-flop 14 also receives horizontal drive pulses HD and is re-set by the trailing edge of the next horizontal drive pulse, as shown in lines &#34;F&#34; and &#34;G&#34; of FIG. 8. That pulse train is fed to &#34;D&#34;-type flip-flop 15, which additionally receives horizontal synch or drive pulses HD. The leading edge of horizontal drive pulse which reset flip-flop 14 turns on flip-flop 15 and that flip-flop remains on, or in a &#34;one&#34; state, until the arrival of the trailing edge of the first horizontal drive pulse which arrives when curve &#34;b&#34; of FIG. 1 is a &#34;zero&#34;. The resulting gating signal is shown at line (H) signal &#34;c&#34; of FIG. 8. 
     The signal &#34;c&#34; is fed to leading edge or rising detector 16, which may be an SN74LS107 with an SN7400. The result is the generation of signal &#34;d&#34;, line (I), FIG. 8. 
     Signal &#34;c&#34; is also fed to trailing edge detector 17 which may be an SN74LS107 with an SN7400. The resulting signal &#34;e&#34; is shown at line &#34;J&#34; of FIG. 8. 
     Signals &#34;d&#34; and &#34;e&#34; are fed to &#34;OR&#34; gate 19 (which may be an SN7400) and the resulting signal is shown as signal &#34;f&#34; at line &#34;K&#34; of FIG. 8. 
     Signal &#34;f&#34; controls flip-flop 22 to produce switching signal &#34;g&#34; shown at line &#34;L&#34; of FIG. 8. Signal &#34;g&#34; switches switch 25 to the solid-line position shown when signal &#34;g&#34; is a &#34;one&#34;, and &#34;Y&#34; coordinate data is stored in memory 28. When signal &#34;g&#34; is a &#34;zero&#34; switch 25 goes to the dotted-line position and &#34;Y&#34; length data goes into memory 28. 
     Signal &#34;c&#34; also is fed to &#34;and&#34; gate 18 which is receiving horizontal drive pulses HD. &#34;And&#34; gate 18 may be a type SN74161N. The resulting signal is shown as &#34;h&#34; in FIG. 8 and is the number of horizontal intervals within gate &#34;g&#34;. That signal &#34;h&#34; is fed to &#34;Y&#34;-length counter 20 which may be an SN74161N. Thus the length of an edge is determined in terms of number of horizontal lines it spans. 
     Signal &#34;f&#34;, in addition to being fed to flip-flop 22 is fed to capsule-number counter 21, which may be an SN74161N. Counter 21 receives a strobe trigger signal (ST) which coincides with a vertical synch pulse, and puts out a capsule count signal as an address signal to memory 28. 
     The signal from capsule counter 21 is fed to the divide-by-two circuit 23, which may be an SN74161N, and through I/O device 24, which may be an SN74367N, to data bus 9. 
     Signal &#34;a&#34;, in addition to being fed to set-reset flip-flop 14 is fed to trailing edge detector 31 which is effective to detect the first trailing edge in each horizontal interval of signal &#34;a&#34;. The signal &#34;i&#34; appearing at line &#34;N&#34; of FIG. 8 is thus produced and fed to &#34;OR&#34; gate 32, to which horizontal drive pulses HD are also fed. The &#34;OR&#34; gate 32 may be an SN7400. The output of &#34;OR&#34; gate 32 is a signal &#34;j&#34; shown at line (0) in FIG. 8. 
     This signal &#34;j&#34; is fed to memory 36 to which is also fed the pulses, at the rate of 320 per horizontal line, out of &#34;X&#34; coordinate counter 34 which also receives horizontal drive pulses. Counter 34 determines the &#34;X&#34; coordinate of any &#34;Y&#34; increment, as will be discussed in connection with FIG. 10 E. 
     After signal &#34;g&#34; returns to &#34;zero&#34; the control circuit 11 switches changeover circuits 25, 26, 27, 30 and 35 from the &#34;write&#34; to the &#34;read&#34; mode and microcomputer 10 processes the stored data to determine if any detected edge is straight, free of defects and of the right length. If these criteria are met the capsule is accepted, if not it is rejected by accept-reject mechanism 13. 
     Changeover circuits 25, 27 and 30 may be of type SN74157N. Changeover circuit 26 may be an SN74368N. Changeover circuit 35 may be an Intel 8216. Memory 36 may be a 2112A-4 of Intel. 
     FIG. 9 shows the calculation functions performed by microcomputer 10 when signal &#34;g&#34; goes to zero and outside the &#34;hold&#34; time T 1  in FIG. 4. 
     FIG. 9 can best be discussed in connection with FIG. 10. 
     At the outset, X-coordinates representing an edge of the examined object are read out from memory 36 and a transverse dimension YL is found over which the difference between the X-coordinates of the edge being studied for successive horizontal lines does not exceed 1. (Here, coordinates are given by integers). In FIG. 10 A, two edges are seen by the camera 4. One is edge 110 and the other is edge 112. As projected on the &#34;Y&#34; axis edge 110 has a length YL 1  and edge 112 has a length YL 2 . Computer 10 will judge edge 112 as having the maximum length YL max and will compare that length with a reference length LVL1. If YL max is smaller than LVL1 a reject signal will be sent to accept-reject control 13, FIG. 3. 
     If YL max≧(LVL1 (Eq. 1), the analysis will continue by subtracting X min (along YL max) from X max (along YL max). If the result satisfies the equation: X max-X min≦LVL2 (Eq. 2), it indicates that the edge under consideration is relatively straight and untorn. For example, if the capsule is properly oriented and the edge is straight X max-X min will equal zero and the second test is met. If the outer cap has a notch in it, as at 120 in FIG. 2 B, while the first test of length might be satisfied, the second test of X max-X min over the length YL max would not be satisfied. X max and X min are seen in FIG. 10 C. If the second equation is not satisfied, the analysis continues to determine if the reason is tilting of the capsule, as shown in FIG. 10 D. Edge 120, which is of interest, would satisfy the first test, not the second test. 
     As can be seen from FIG. 10 E, values of the length of Y for successively evenly increased values of X (YP 1  →YP N ) can be summated, to form the values VL&#39;, and compared with a third reference value LVL3. If equation 3: 
     YL&#39;≧LVL3 (Eq. 3), is not satisfied, a reject signal is sent to accept-reject unit 13 (FIG. 3). If equation 3 is satisfied, a further analysis occurs in which each value YP K  is compared with the average or mean value of all of the YP K  elements. If the following equation is met, the capsule is accepted: 
     [te,ovs/YP/ -YP K  ]≦LVL4 (Eq. 4). where, LVL4 is a fourth reference value. If the separate YP values differ significantly from the mean value of YP there is an indication of a curve or other shape to the edge which differs from a straight line. If equation 4 is not met the capsule is rejected. 
     While a particular embodiment has been shown and described it would be apparent to one skilled in the art that variations and modifications may be made without departing from the scope of my invention. It is the purpose of the attached claims to cover all such variations and modifications.