Method of preparing numerical control data for inserting components

Abstract: The present invention relates to a system in which assembly information and component information for com­ ponents to be automatically inserted by an insertion machine into a printed board can be inputted and stored, which performs required operations based upon the stored infor­ mation and which displays and outputs the results of the processings. In the present method possible mechanical interference, when inserting a component between an insertion head and other components already inserted or other components to be inserted by the same machine are checked, preceding relations of insertion order are prepared from the results of the interference checking, the compo­ nents which can not be inserted automatically according to the preceding relations of insertion order are selected, insertion processes or insertion directions thereof are mod­ ified, the insertion order of the components are decided according to the modified insertion processes or the inser­ tion directions, and numerical control data relating to the automatic insertion of said components are automatically prepared and outputted.

Description: (Field of the Invention) The present invention relates to a method of and an apparatus for preparing numerical control data required by, for example, an automatic insertion machine for inserting electronic components. (Description of the Prior Art) Conventionally, numerical control (NC) data, which are reqired by an automatic insertion machine for inserting electronic components, have been prepared manually in most cases. In the prior art, mechanical interference is checked at every insertion of a component between the automatic insertion machine and components which are already inserted, while inserting components one after another by utilizing the automatic insertion machine. Thus, it is very troublesome in this method to prepare and check these control data, and especially to modify data when there occures the interference. Even when a computer is utilized for checking the interference, it is inevitable that the automatic insertion ratio (the ratio of components which can be automatically inserted by the machine to all components to be inserted) drops to some extent, as this system may check the interference only when the components are inserted according to the predetermined insertion order. Prior art document EPA-A- 0 089 561 discloses a machine tool numerical controller with an interference checking function. In it, a microprocessor is connected to a data input device, a cathode ray tube display device and a data storage device. The microprocessor prepares an NC-program for a workpiece to be machined based upon machining information manually input by the use of the data input device and stored in the data storage device. Then debugging of the prepared NC-program is executed, wherein the microprocessor obtains by calculation a workpiece interference space defined outwardly of the outer periphery of the workpiece, based upon workpiece blank shape and dimension data and workpiece mounting position data stored in the data storage device. Nevertheless, such a device cannot realize the change or possible interferences caused by the successive insertion of electronic parts and components. The object of the present invention is to provide a method of preparing numerical control data for inserting components, which can improve efficiency in preparing NC data for inserting components, realize high reliability for data prepared, and increase the automatic insertion ratio. The object is solved in accordance with the features of the independent claim 1, dependent claims are directed on preferred embodiments of the present invention. In the following, different embodiments according to the present invention are described with reference to the figures, wherein Fig. 1 is a block diagram showing a computer system utilized in the present invention. Fig. 2 shows assembly information utilized in the present invention. Fig. 3 shows component information utilized in the present invention. Fig. 4 shows the procedure for preparing numerical control data according to the present invention. Fig. 5 illustrates the interference checking of the present invention, which is possibly generated when inserting a component. Fig. 6 is a flow chart showing the procedure for deciding preceding relations of insertion order according to the present invention. Fig. 7 (a) and (b) are directed graphs illustrating preceding relations of the insertion order according to the present invention. Fig. 8 shows the relation between a insertion process and insertable directions for each component according to the present method. Fig. 9 shows directed graphs illustrating preceding relations of insertion order for the example shown in Fig. 8. Fig. 10 is a flow chart showing the procedure for deciding insertion directions of the components according to the present invention. Fig. 11 through Fig. 15 show the variation of directed graphs during deciding processings of insertion directions according to the present method. Fig. 16 shows preceding relations of insertion order prepared by the present method. Fig. 17 shows a graphic display unit of the present invention displaying the positional relation between components on a board and a component carring head of a component insertion machine. Fig. 18 shows an example procedure for deciding insertion order of components according to the present invention. Fig. 19 shows collections of insertable components and constraints for each stage according to the present invention. Fig. 20 shows an example procedure for deciding insertion order of components according to the present invention. Fig. 21 and Fig. 22 show insertion orders decided by different approaches according to the present invention. A preferred embodiment according to the present invention utilizes a computer system which can store assembly information and component information relating to components to be automatically inserted to a board by an automatic component insertion machine, can execute required operations on the basis of the above information, and can display and output the results of the operations. The present method comprises steps of: checking possible mechanical interference, when inserting a component, between an insertion head and other components already inserted or other components to be inserted by the same machine; preparing preceeding relations of insertion order from the checking results, selecting components which are impossible to be inserted automatically on the basis of the preceding relations of insertion order so as to modify insertion processes or insertion directions thereof; deciding insertion order of the components on the basis of the insertion processes or insertion directions modified; and then, automatically preparing and out-putting numerical control data for inserting the above components automatically. The above steps of the present method will be described in detail as follows. At first, the computer system of the present invention checks possible mechanical interference, when inserting a component, between an insertion head of an automatic insertion machine and other components which are already inserted or other components which are to be inserted by the same machine, and then, it prepares preceding relations of in sertion order according to the results of the interference checking. (For example, when a component i can not be inserted since a previously inserted component j interferes mechanically with the component i, the following preceding relation of insertion order is prepared for the components i and j: Component i → Component j this preceding relation of insertion order means the component i should be inserted prior to the component j.) Then, the computer system calculates component groups which can not be inserted in any insertion order from the preceding relations of insertion order prepared. For example, when there are the preceding relations of insertion order such as Component i → Component j, Component j → Component k, and Component k → Component i, these components i, j, and, k constitute the uninsertable component group. Next, some attempts are made on some components included in the uninsertable component groups to change insertion processes or insertion directions thereof. For example, when there are two components i and j which are to be inserted by the same machine, and there are the conflicting preceding relations of insertion order of Component i → Component j and Component j → Component i, the insertion process of the component i may be changed to manual insertion. By this operation, the component i will be inserted manually after all other components have been inserted, thus, the preceding relation of insertion order Component j → Component i is satisfied and the preceding relation Component i → Component j is eliminated, since the insertion process of the component i is changed to manual so that the space is no longer required for an insertion head to carry out insertion. Accordingly, the automatic insertion of the component j is possible. Further, when a component without polarity, such as a resistor, is to be inserted, it is possible to reverse the insertion direction of the component. As the insertion head of the automatic insertion machine is rotatable in a 180-degree arc, the mechanical interference may possibly be avoided by inserting the component in the reverse direction. Through these attempts, the final preceeding relations of insertion order having no uninsertable component groups are prepared, and the insertion order is decided according to the above constraints. With this structure and fundamentals, the present method will improve efficiency in preparing NC data for inserting components, attain high reliability for data prepared, and increase the automatic insertion ratio of components. Fig. 1 is a block diagram showing a computer system utilized in the embodiment of the present invention for preparing numerical control data for inserting components. In the figure, a processor 1 is an central portion for executing various operations according to the present invention. Connected to the processor 1 are a disk storage 2 for storing assembly and component information etc., a floppy disk drive 3 for inputting assembly information, a display 4 for entering component information and for displaying and modifying processing results, a paper tape punch 5 for outputting NC data for inserting components, and a line printer 6 for printing out processing results. Firstly, assembly information and component information will be described in accordance with Fig. 2 and Fig. 3. Fig. 2 shows the assembly information for an individual printed board consisting of one board information record 10 and some component records 20 as many as components to be inserted to the board. Each component record 20 includes several data items indicating an electronic component name 21, insertion positions 22 and 23, an insertion direction 25, etc. This component record 20 is generally prepared by a CAD system (CAD = Computer Aided Design), and is entered to the present computer system through a floppy disk. The insertion position items 22 and 23 indicate X and Y co-ordinates of the reference point, which is predetermined for each kind of components, on the printed board. The insertion direction item 25 indicates a rotational angle, when a component is rotated about the reference point from the reference direction predetermined for each component and inserted into a board. The component record 20 further includes data items indicating an insertion process 26 and an insertion order 27. These two data items 26 and 27 are not supplied with their values when they are prepared by the CAD. The component information includes, as shown in Fig. 3, data items indicating a component name 31, an insertion process division 32, a component sizes 33, and component polarity 34, for all components to be used by the system. These data are stored within an assembly information file and a component information file, respectively, in the disk storage 2. In the present method for preparing NC data for inserting components, the insertion processes and insertion order of the components are decided by the following procedure. Here, a process means a group of insertion operations carried out by one machine, for example, an IC component insertion process. As shown in Fig. 4, the present method comprises five steps: (1) a provisional decision step of insertion processes (Step 41); (2) a decision step of preceding relations of insertion order (interference checking) (Step 42); (3) a modification step of insertion processes and insertion directions (Step 43); (4) a decision step of insertion order (Step 44); and (5) a preparation step of NC data for inserting components (Step 45). The function of these steps will be described, in turn, hereinafter in accordance with Fig. 4. (1) A provisional decision step of insertion processes (step 41) In this step, the component information file is searched utilizing the component name 21 of each component record 20 in the assembly information as a key, then, an insertion process is decided provisionally according to the insertion process division 32 of each component, and this insertion process division is written in an insertion process data item 26 of each component record 20 in the assembly information. The insertion process division means a predetermined machine or a process assigned to each component for inserting the component when there is no mechanical interference. For example, if a board is assembled by four machines or proceeses in the order of an IC insertion machine, a coaxial component insertion machine, a vertical component insertion machine, and manual insertion, the insertion process division 1 is assigned to the IC components, the insertion process division 2 is assigned to the coaxial components, and the insertion process division 3 is assigend to the vertical components. The provisional insertion process decided for each component in this step may be modified in the step (3) (a modification step of insertion processes). (2) A decision step of preceding relations of insertion order (interference checking) (Step 42) Here, the interference means possible mechanical interference between the insertion head of the insertion machine and other components already inserted when inserting a component automatically. Further, the preceding relation of insertion order means the condition relating to the insertion order of two components i and j. The preceding relation of insertion order (Component i → Component j) indicates that the component i should be inserted prior to the component j, as the component j interferes with the component i if the component j is inserted prior to the component i. Although mechanical interference may be checked by various methods, one simple method will be taken up in the following description. The fundamental conception of the interference checking of the present invention is that the possible interference can be detected by expressing a region required for the insertion head of the automatic insertion machine to insert a specific component (an insertion operation space) and regions occupied by components (component regions) as simple plain figures (for example, rectangle, circle, etc.). and by checking the overlapping of these figures. Fig. 5 illustrates the checking of the interference, which may be generated when inserting a component, according to the present method. In Fig. 5 (a), P is an insertion head for inserting a component m into a board Q, P' shows the position of the insertion head P at the time of insertion, and k and l are components which are already inserted. In this case, the component l interferes with the insertion head P at the position P' when the head P inserts the component m. Fig. 5 (b) shows plain figures of a component region M of the component m, a component region K of the component k, a component region L of the component l, and an insertion operation space N of the component m. The interference is detected by checking the overlapped portion of these figures K through N. In this case, as the insertion operation space N of the component m and the component region L of the component l are overlapped with each other, the preceding relation of insertion order (Component m → Component l) is decided. It could be understood from Fig. 5, the dimensions of the insertion operation space N should be adjusted according to the heights of the components positioned around the space N. Accordingly, the dimensions of the insertion operation space N may be decided firstly providing that all the components positioned around the space N have the maximum heights among all the components used, so that the interference could be checked utilizing thus decided space N. When the overlapping is detected, the insertion operation space N should be made smaller according to the actual height of the component interfered so that the overlapping could be checked again. Although the shapes of the insertion operation space and the component regions are expressed as simple plain figures such as a rectangle, a circle, etc. in the above method so that the interference can be checked by detecting the overlapping of these figures, these shapes may be expressed as other figures or the combinations of figures. For example, the insertion operation space and the component regions may be expressed, respectively, as the combination of a rectangle and a circle, etc. Further, it is possible to express these space and regions, respectively, as a three-dimensional solid body such as a rectangular parallelepiped, a column, etc. and the combination thereof. These rather complicated figures are also effective to detect the interference by checking the overlapping thereof. Next, the algorithm of the above mentioned overlap checking of the figures will be described in accordance with the embodiment in which the component regions are shown by rectangular or circular figures. First, when all the component regions are shown by rectangular figures, one of rectangles is selected as a reference rectangle. Then, a rectangular region which is defined by two sides crossing at the lower left corner of the reference rectangle (including the reference rectangle) and a rectangular region which is defined by two sides crossing at the upper right corner of the reference rectangle (including the reference rectangle) are defined. If any other rectangle exists within any one of the rectangular regions, this rectangle overlaps with the reference rectangle. When two component regions are shown by a rectangle and a circle, respectively, a region having the width corresponding to the radius of the circle is defined around the rectangle. If the center of the circle exist within the region including the rectangle, the rectangle and the circle overlap with each other. When the component regions are shown by circles, these circles overlap with each other if the distance between centers of the circles is smaller than the sum of radiuses of both circles. Fig. 6 is a flow chart showing the procedure for deciding preceeding relations of insertion order (interference checking) according to the present method. This chart will be described relating to the processings performed in each step of the procedure. (Step 51) On the basis of the component size data 33 within the component information, the component regions are calculated for all components to be inserted which are listed in the assembly information. (Step 52) The preceding relations of insertion order are decided, in turn, for each machine or process, for example, in the order of an IC insertion machine, a coaxial component insertion machine, and so on. When the preceding relations of insertion order can be decided for all processes, all processings of this procedure complete at this step. (Step 53) According to the contents of the insertion process data items 26 of the component records 20 in the assembly information, components to be inserted in an objective process (objective components) and components which are inserted in processes prior to the objective process (already inserted components) are selected for each objective process. (Step 54) The insertion operation spaces are obtained for all objective components. (Step 55) One component is selected from all the objective components. When all components are selected in this step, the procedure goes back to the step 52. (Step 56) The checking is performed for the overlapping between the insertion operation space of the component selected and the components regions of the components already inserted and the component regions of all other components than the selected component which are to be inserted in the objective process. In this step, a region around the board, and regions used by a board holder and a board loader are treated as insertion restricted regions equally to the component regions of the already inserted component. (Step 57) The preceding relation of insertion order is obtained from the results of the step 56, which is entered into a preceding relation of insertion order file 48 on the disk storage. Then, the processing is returned to the step 55. (3) Modification of insertion processes and insertion directions (Step 43) Based upon the preceding relations of insertion order prepared by the above (2) (Step 42), the components which interfere with each other in any insertion order (uninsertable components) are selected so as to modify their insertion processes and insertion directions. This modification processings are executed for each process. The components are regarded as uninsertable in the following two cases: (i) The case having the preceding relation of insertion order of Component i → Component j, in which the insertion process of the component j is carried out prior to the insertion process of the component i. (ii) For the components to be inserted in the same process, the case having the conflicting preceding relations of insertion order such as Component i → Component j and Component j → Component i. When the components are more than three, the case having the preceding relations of insertion order such as Component k → Component l, Component l → Component m, and Component m → Component k. The countermeasures for these cases are: (a) Modification of an insertion process, and (b) Modification of an insertion direction. Supposing that there is the preceding relation of insertion order of Component i → Component j, and the insertion process of the component j is carried out prior to the insertion process of the component i, this preceding relation of insertion order can be satisfied by putting the insertion process of the component j next to the insertion process of the component i. Further, the preceding relation of insertion order of Component i → Component j may be eliminated by changing the insertion process of the component i, for example, to the manual assembly process, as the manual assembly process requires less space for inserting the component. The modification of the insertion direction is also effective to satisfy the preceding relation of insertion order. Supposing that there is the preceding relation of insertion order of Component p → Component q, and that the component p has no polarity, it is possible to turn the component p in a 180-degree. This causes the insertion operation space of the component p to change, so that the preceding relation of insertion order of Component p → Component q may be eliminated. Whichever modification method is used, the preceding relations of insertion order of the entire process are changed according to the modification. Thus, it is required to execute the step 42 (decision of preceding relation of insertion order) (interference checking) again. In order to obtain the uninsertable component groups, which cause the interference in any insertion order, from the components to be inserted in the same process according to the preceding relations of insertion order prepared in the step (2), one solution utilizing graph theory will be described hereinafter. In this solution, the preceding relations of insertion order are expressed by a directed graph, representing each insertion operation (a component to be inserted) as a vertex, and the preceding relations of insertion order as sides (directions shown by arrows). Fig. 7 (a) and (b) are directed graphs showing the preceding relations of insertion order according to the present invention. Fig. 7 (a) shows the preceding relations of insertion order for nine kinds of components 11 through 19. In this graph, strongly connected components, that is, a collection of vertexes reachable with each other along the side, constitute a group of uninsertable components. For example, the components 12, 13, and 14 constitute the uninsertable component group. The preceding relations of insertion order of these components can not be satisfied whatever order they may inserted. Similarly, components 18 and 19 constitute another uninsertable component group. Thus, it should be understood that the uninsertable component groups can be obtained readily by utilizing known graph theory. Accordingly, when all uninsertable component groups are eleminated by modifying insertion processes or insertion directions of the uninsertable components, the final preceding relations of the insertion order may be established. In Fig. 7 (a), if the insertion process of the component 12 is put off and the insertion direction of the component 19 is changed, the preceding relations of insertion order of Component 11 → Component 12, Component 12 → Component 13, Component 14 → Component 12, and Component 19 → Component 18 are all eliminated. Fig. 7 (b) shows the resultant final preceding relations of insertion order having at least one insertion order. Further, according to the present method, the insertion processes and insertion directions of the components can be considered at the same time, so that the automatic insertion ratio can be further improved. Next, the above method will be described in accordance with an actual example. In the example, an IC insertion machine and a RC insertion machine (for resistors, capacitors, etc.) are used in this order to insert fifteen components 1 through 15. Fig. 8 shows insertion process divisions 62 and insertable directions 63 for fifteen components 61, respectively, which are originally assigned to the components without considering the interference. The insertion process may be decided depending on the kind of the component such as IC, coaxial, vertical, etc. Further, the components are divided into two groups: one which can be inserted only in one direction, and the other which can be inserted in two directions (ordinary direction and reverse direction) depending on the component polarity, the component supplying direction, and the machine's insertable direction. Thus, it is important to select the insertion directions of the latter components which can be inserted in two directions so that the automatic insertion ratio is maximized. In actual processings, it is necessary to take all combinations of the insertion directions into account for these components insertable in two directions. For example, when 50 components are insertable in two directions, the total number of the combinations of the insertion directions thereof is 2⁵⁰ = 1.13 x 10¹⁵. It is impossible, however, to calculate these great number of the combinations. Further, it is required to consider the insertion order of those components simultaneously. In order to consider the insertion directions and the insertion order at the same time, it is necessary to obtain the preceeding relation of insertion order for each insertable direction of each component. When the interference occurs in a specific insertion direction, this may be expressed, for example, by the following preceding relation of insertion order with the specific insertion direction II on an arrow: Component i Component j. This preceding relation of insertion order means that the insertion of the component i in the direction II causes the interference when the component j is already inserted, thus, the component i must be inserted prior to the component j when the component i is inserted in the direction II. After all interference checkings have completed, a directed graph should be prepared, representing the components by vertexes, and the preceding relations of insertion order by sides, as shown in Fig. 9. Here, when the preceding relation of insertion order is generated between the components which are to be inserted by different machines such as Component 6 Component 3 in Fig. 9, it should be considered that the preceding relation of insertion order in the reverse direction Component 3 → Component 6 is also generated in order to add a condition relating to the order to use the insertion machines. Further, in order to reduce the scale of the problem, the concept of strongly connected components of the graph theory is applied to this derected graph. The strongly connected components means the collection of vertexes reachable with each other along the side. In the directed graph prepared on the basis of the preceding relations of insertion order, it should be understood that the strongly connected components constitute a component group in which components mutually play parts in generating the interference. Accordingly, the component groups which cause the interference can be readily detected by applying the method for calculating the strongly connected components. Further, it is possible to reduce the number of combinations to be calculated sharply by applying this method. The existence of the strongly connected components indicates the possibility of the interference. Thus, the strongly connected components should be removed to avoid the interference. In order to remove the strongly connected components, it is required to remove either the preceding relation of insertion order or the component, which correspond to the selection of the insertion direction of the component insertable in two directions, or the modification of the insertion process (automatic insertion → manual insertion), respectively. Thus, the automatic insertion ratio will be maximum when the insertion direction is selected so as to minimize the number of components whose insertion processes must be modified. After the preparation of the directed graph has completed, the insertion directions of the components are now decided so that the automatic insertion ratio becomes maximum according to the procedure shown in Fig. 10. 1) Step 71 The strongly connected components are calculated in order to obtain the component groups which participate in the generation of the interference. 2) Step 72 For each component which is not included in the strongly connected component groups, it is possible to select an optional direction from insertable directions. THese components and related preceding relations of insertion order thereof are removed from the graph. (Reduction of the problem) 3) Step 73 For each component having extra insertable direction in addition to the insertion directions based upon all the preceding relations of insertion order derived from the component, this extra insertion direction is selected in order to avoid the possibility of the interference. The components whose insertion directions are decided and their related preceding relations of insertion order are all removed from the graph. 4) Step 74 If there are some components whose insertion directions are decided in the step 73, the processing is returned to the step 71. If there is no such component, the processing goes to the next step 75. 5) Step 75 The insertion directions of the remainder components must be decided taking mutual relation into consideration. If the number of remaining components is small, the insertion directions of these components may be decided by selecting the solution so that the automatic insertion ratio will be maximum from all the combinations of the insertion directions of these components. Even when the number of remaining components are large, the solution can be obtained in a short time by utilizing a method such as the "branch- and bound method" in the combinational problem. After all the insertion directions of the components are thus decided, it is required to list the proceding relation of insertion order relating to the insertion direction decided for each component. Then, the insertion order should be decided so as to satisfy all the preceding relations of insertion order listed. The above deciding method of the insertion processes and the insertion directions will now be described in accordance with the example. For the components shown in Fig. 9, two component groups (strongly connected component groups) [3, 6] and [2, 8, 12, 13, 14, 15] are obtained by performing the calculation of the step 71 shown in Fig. 10. These component groups participate in the interference. In the next step 72, the insertion directions are decided for the components 1, 4, 5, 7, 9 and 10 which are not included in the strongly connected component groups. These components whose insertion directions are decided and related preceding relations of insertion order thereof are removed from the directed graph of Fig. 9. Fig. 12 shows the resultant directed graph. In the step 73, the insertion direction of the component 6 is decided as II. This is because the component 6 is insertable in two directions II and IV, and the preceding relation of insertion order is generated only in the direction IV. Similarly, the insertion direction of the component 12 is decided as II. Then, the component 6 and 12 and their preceding relations of insertion order are removed from the graph as shown in Fig. 13. After that, the strongly connected component groups are calculated again based upon the resultant graph shown in Fig. 13 in the step 71. The strongly connected components are now [2, 8, 14, 15]. Accordingly, the insertion directions of the components 3 and 13 may be selected optionally from thier insertable directions, and they are removed from the graph. Fig 14 shows the resultant directed graph. Here, the calculation of the step 71 is executed again, but the strongly connected components 2, 8, 14, and 15 remain as they are. Thus, the insertion directions of these components must be decided so that the automatic insertion ratio becomes maximum in the next step 75. In this example, since the component 2 is insertable only in the direction I, and the component 15 is insertable only in the direction II, the insertion directions of the components 2 and 15 are necessarily decided. On the other hand, since the components 8 and 14 are insertable in two directions I and III, four combinations are possible for their insertion directions. Fig. 15 (a) through (d) show these four combinations of the possible insertion directions of the components 8 and 14. In the combinations shown in Fig. 15 (a), (b) and (c), however, at least two components must be inserted manually. On the other hand in Fig. 15 (d), the strongly connected component group is removed by shifting only the component 15 to the manual insertion. Accordingly, this is the optimal solution. Fig. 16 shows the resultant insertion directions and the preceding relations of insertion order to be observed at the time when deciding the insertion order obtained by the present method. According to the present method, it is possible to obtain the optimal solution to attain the maximum automatic insertion ratio, as the present method takes all combinations of all possible insertion directions for each component into consideration. Further in the present method, as the scale of the problem is reduced successively in course of the processings by the calculation of the strongly connected component groups and by the reduction of the problem, the optimal solution can be obtained in a short time. In the above mentioned method, the objective function was the maximum automatic insertion ratio. However, since extra costs incurred by changing the insertion process to the manual insertion vary largely depending upon the kind of the components, it is effective, giving a cost for each component, to select the minimum total costs of the components which are shifted to the manual insertion as the objective function. Further, the insertion processes and the insertion directions may be decided interactively on the basis of a designer's judgement. Fig. 17 shows the graphic display unit 4 of the present invention displaying the position and shape of a component carring head at the time when inserting a component i and the position and shape of the component i thereon. The interfered portions (shadowed portions) are recognized readily by this display, thus, a designer may easily decide the insertion processes and insertion directions. The present method is extremely effective for the following cases. In the case wherein vertical components such as film capacitors, plate resistances, etc. are inserted by an insertion machine, some of these vertical components are allowed to be deformed by an insertion head of the insertion machine after they are inserted in places. For example, when another component is inserted just after the film capacitor has been inserted, the insertion head of the insertion machine may insert this component pushing the film capacitor aside. If the flexure of the film capacitor at that time is small, this causes no problem. Accordingly, if the degree of the interference (sizes, shapes, etc. of the interfered portions) may be displayed on the graphic display unit 4 of the present invention as shown in Fig. 17, designers can judge whether the component is insertable or not on the basis of concrete sizes of the components on the display. By this method, the graphic display unit 4 displays the positional relation and the degree of the interference between the components which interfere and the component carring head of the insertion machine. Thus, it is possible to increase the number of automatically insertable components by modifying the results of the interference checking taking errors in modelling (generally modelling is performed on the safety side, that is, on the larger side) and deformation of the film capacitor into account. (4) Decision of insertion order (Step 44) After the final preceding relations of insertion order are decided in the step (3), there always exist at least one insertion order by which the components can be inserted in the objective process satisfying these constraints. Among the possible insertion orders, one optimal insertion order is selected in this step. The optimal insertion order means the insertion order by which the final preceding relations of insertion order are satisfied and the total insertion time of components is minimized. The insertion order should be selected, in turn, for each insertion machine. The insertion time of components includes time required for inserting components, waiting time from the end of the insertion of a component i to the start of the next insertion of a component j, time for shifting a board from its set position in an insertion machine to the start position, and time for shifting the board from the end position after all components are inserted and removing it from the machine. Among them, only the waiting time varies its value depending on the insertion order. Thus, a cost matrix is prepared utilizing the waiting time of the component j as the (i, j) element, providing that the component j is inserted next to the component i. The cost is determined considering the following items i) through iv). i) Waiting time for supplying components Except for the case in which components to be inserted are supplied according to the insertion order by utilizing a sequencer, etc., it is generally inevitable for the waiting time to generate for supplying components when different kinds of components are inserted successively. ii) Waiting time for shifting According to the positional relation between two components to be inserted successively, the waiting time is necessarily generated for shifting an insertion machine head or a board. iii) Waiting time for rotation When the insertion directions of two components to be inserted successively differ from each other, there generates the waiting time to rotate an insertion machine head or a board. iv) Waiting time for changing pitches When pitches (dimensions) of components to be inserted successively differ from each other, the waiting time is generated for changing pitches. These four kinds of waiting time are calculated for each set of components. It depends greatly upon each insertion machine how each waiting time is reflected to the cost. However, the cost can be obtained generally by either one of the following equations: Cost = max (Waiting time for supplying components, Waiting time for shifting, Waiting time for rotation, Waiting time for changing pitches) or Cost = Waiting time for rotation + max (Waiting time for supplying components, Waiting time for shifting, Waiting time for changing pitches) From the above information, it is possible to obtain the insertion order by which no interference is generated by utilizing the present method. Providing that a cost matrix shown in Fig. 18 (b) is given for components P1 through P5, and preceding relations of insertion order of P2 → P5, P2 → P1, and P1 → P3 are prepared as shown in Fig. 18 (c) for the components P1 through P5, the insertion order to minimize the total cost is P4 --→ P1 --→ P2 --→ P3 --→ P5, and the cost amounts to "58". Since this insertion order, however, does not satisfy the preceeding relation of insertion order P2 → P1, it is apparent that this order can not be the solution. In this example, the optimal insertion order is given as P2 --→ P1 --→ P4 --→ P3 --→ P5 by which the total cost comes to "66", and this is the samllest among the solutions satisfying the preceding relations of insertion order of these components. When the number of components to be inserted is small as the above example, it is suitable to use a "perfect enumeration method" which calculates all possible insertion orders and selects the optimal one which minimizes the total cost from the insertion orders satisfying the preceding relations of insertion order given. When the number N of components is large, however, the perfect enumeration method is not practical since the number of possible insertion orders N! increases remarkably. Further, it is well known that, as a method for calculating the optimal insertion order of such a large number of components, the solution of "travelling salesman problem" has been often utilized. But, the constraints based upon the preceding relations of insertion order of the present method can not be introduced to this method, and it is not applicable to the present case. In the method according to the present example, the constraints relating to the insertion orders of the components are illustrated by a directed graph, as shown in Fig. 20, in which the components are represented by vertexes of the graph, and the constraints are represented by the sides ( → ). Fig. 19 (a) shows a collection of the components which is selectable for next insertion in each step, and Fig. 19 (b) shows the preceding relations of insertion order in each step. In this example, the components which are selectable as the first component to be inserted are P2 and P4, and P2 is selected from this collection as the first component. The preceding relations of insertion order P2 → P1 and P2 → P5 are eliminated by this selection, and the components P1 and P5 are added to the next collection of the insertable components. After that, the components P1, P4, P3, and P5 are selected successively. In result, the insertion order P2 --→ P1 --→ P4 --→ P3 --→ P5 satisfies the preceding relations of insertion order given, and minimizes the total cost. Although the optimal solution is casually obtained in this example, it should be understood that the optimal solution is not necessarily obtained in this method. In order to increase the accuracy of the solution, the following method may be further applied. First, a small positive integer n is taken, then, the insertion order of successive n number of components is calculated. Supposing that the i-th component P(0) is already decided, the next (l + l)-th component is obtained by: 1) Selecting the component P(1) which is closest (this minimizes the cost) to P(0) from the next collection of the insertable components. 2) Removing P(1) from the next collection of the insertable components, and adding the components whose preceding relations of insertion order are eliminated by the selection of P(1) to the next collection of the insertable components. 3) Selecting the component P(2) which is closest to P(0) from the next collection of the insertable components. 4) Selecting n number of components successively in departing order from closest one to P(0). 5) Selecting the insertion orders satisfying the preceeding relations of insertion order for the components P(0) through P(n), then, selecting the optimal one which minimizes the cost from the insertion orders selected. 6) Providing that the second component to be inserted next to P(0) in the insertion order selected in the step 5) is P(k), P(k) is the (i + l)-th component to be inserted in the optimal insertion order. The optimal insertion order of all the components can be obtained by repeating the above steps 1) through 6) successively. This method will be described concretly in accordance with the example shown in Fig. 20. In this example, there given nine components P1 through P9 to be inserted as shown in Fig. 20 (a), and there given preceding relations of insertion order P7 → P2 and P6 → P9 as shown in Fig. 20 (c). The first component to be inserted is P1, and n = 4. Further, a cost matrix is given as shown in Fig. 20 (b). Four components are selected in turn from a collection of insertable components in the departing order from the closest one to P1. That is, the collection of insertable components in this step is [P3, P4, P5, P6, P7, P8], and the closest component to P1 is P7, thus, P7 is selected first. P7 is then removed from the collection of insertable components, and P2 is added to the collection. In result, the collection includes [P2, P3, P4, P5, P6, P8]. Next, the closest component to P1 is now P2 which is selected as the second component. By repeating these processings, four components P2, P3, P7, and P8 are selected. As the starting component is provided as P1, there are 24 possible insertion orders for these four components. Among them, the insertion order P1 --→ P8 --→ P7 --→ P2 --→ P3 is optimal, as it satisfies the preceding relations of insertion order given and minimizes the cost. Accordingly, the second component to be inserted is P8. Then, the third component must be selected based upon the insertion order starting from the component P8. Four components selected in this step are P2, P3, P6 and P7, and the optimal insertion order with the minimum cost is P8 --→ P7 --→ P2 --→ P3 --→ P6. Thus, the third component is P7 which is to be inserted next to P8. Repeated the processings as the above, the final insertion order is obtained as P1 --→ P8 --→ P7 --→ P2 --→ P3 --→ P6 --→ P9 --→ P5 --→ P4 as shown in Fig. 21. When the same example is solved by the former method (in which n = 1), the insertion order is obtained as P1 --→ P7 --→ P2 --→ P3 --→ P6 --→ P9 --→ P5 --→ P4 --→ P8. Accordingly, it is apparent that the later method (in which n = 4) is superior. In this example, the latter method reduces the total cost more than 20%. It should be understood from the description for the step 5) that the larger the number n the larger the number of channels which satisfy the constraints. Thus, preferably the number n is 8 at most. This method is applicable to the case having isolated points. Further, this method is also effective for the case dealing with more than 500 components, providing the solution in a short time. (5) Preparation of NC data for inserting components (Step 45) Since the insertion processes and the insertion order of the components are already decided in the above (3) (Step 43) and (4) (step 44), respectively, NC data for inserting components can be prepared readily according to them for each insertion machine by the known technique. As described above, NC data for inserting components can be prepared in a short time by utilizing a computer system of the present invention, taking account of possible mechanical interference between an insertion head of an insertion machine and components already inserted. Accordingly, the present invention is very laborsaving and timesaving in preparing NC data, requires no data check while operating an insertion machine, and reduces insertion errors. Further, insertion processes and insertion directions of components are determined automatically in the present invention so that an automatic insertion ratio becomes maximum, thereby minimizing the number of components shifted to the manual insertion which requires much operation time than the automatic insertion. Thus, the present invention reduces the total operation time required for inserting all components into a printed board. The total operation time can be further reduced by optimizing the insertion order. Accordingly, the present invention is very effective in reducing manhours required both for preparing NC data and for actual operation.

Claims: A method for preparing numerical control data for inserting components which are required by an insertion machine for controlling automatic insertion of the components by utilizing a computer system comprising steps of: deciding insertion processes of the components to be inserted into a board provisionally on the basis of prestored assembly information and component information thereof; checking possible mechanical interference, at the time when inserting a component, between an insertion head of the insertion machine and other components inserted prior to the present insertion so as to prepare preceeding relations of insertion order according to the checking results; selecting the components which are not possible to be automatically inserted according to the preceding relations of insertion order prepared, and modifying the insertion processes or the insertion directions of these components; deciding the insertion order of the components; and preparing numerical control data for inserting said components automatically according to the insertion processes and the insertion order decided. A method according to claim 1, wherein the step for deciding the insertion processes provisionally comprises the procedure for searching a component information file utilizing a component name in each component record in said assembly information as a key, and deciding each insertion process provisionally according to an insertion process division assigned to the component. A method according to claim 1, wherein the step for preparing the preceding relations of insertion order comprises steps of: calculating a region required for an insertion head of the automatic insertion machine and regions already occupied by the components, when inserting the component, as simple plain figures; and checking the overlapping of these figures. A method according to claim 1, wherein the step for preparing the preceding relations of insertion order comprises steps of: calculating component regions for all the components to be inserted stored within the assembly information on the basis of component size data store in the component information; deciding objective processes of the interference checking in turn; selecting the components to be inserted in the objective process and the components already inserted in the processes prior to the objective process; calculating insertion operation spaces for all the components to be inserted in the objective process; selecting one component from the components to be inserted in the objective process; checking the overlapping between the insertion operation space of the selected component and the component regions of the already inserted components and the components to be inserted in the objective process other than the selected one; and calculating the preceding relations of insertion order according to the overlap checking and entering them into a preceding relations of insertion order file. A method according to claim 1, wherein the step for modifying the insertion processes or the insertion directions comprises steps of: illustrating the preceding relations of insertion order in a directed graph, representing the insertion operation of each component as a vertex and the preceding relation of insertion order as a side, and calculating strongly connected component groups so as to obtain component groups which participate in the interference; and calculating, for the components which are included in the strongly connected component groups and are insertable in an extra direction other than the direction presently considered, the component groups which participate in the interference when they are inserted in the extra insertion directions, then, releasing these component groups so as to reduce the possibility of the generation of the interference, and when there remain some components which participate in the interference in spite of said processings, modifying the insertion processes thereof until there remain no component which participate in the interference so as to avoid the generation of the interference. A method according to claim 1, wherein the step for modifying the insertion processes or the insertion directions has the function to display the position and shape of the insertion head of the insertion machine, and the positions and shapes of the components on a graphic display unit. A method according to claim 1, wherein the step for modifying the insertion processes or the insertion directions comprises steps of: calculating constraints relating to the insertion order between the components in order to avoid the generation of the interference by checking the possible interference between the insertion head and other components when inserting the component in all possible directions by the automatic insertion machine for each component; calculating the component groups which participate in the generation of the interference on the basis of these constraints; selecting the component which can be removed from the component groups which participate in the generation of the interference when the insertion direction is specified, and calculating again the component groups which participate in the generation of the interference utilizing the insertion direction specified as that of the component selected; and selecting, for the remainder components within the component groups which participate in the generation of the interference, the insertion direction for each component from the combination of the insertable directions of each component so that the number of the components which can not be inserted automatically is minimized. A method according to claim 1, wherein the step for deciding the insertion order comprises steps of: selecting the first component from a collection of the components satisfying the constraints based upon the preceding relations of insertion order of the components, and removing the first component from the collection; and adding the components whose preceding relations of insertion order are eliminated by the selection of the first component to the collection, selecting the component closest to the first component as the second component, and removing the second component from the collection; and said step decides the insertion order of the components by repeating these steps, sellecting the components one after another.

Inventors: ARAI YOSHINAO, KOBAYASHI HIDEAKI, OIKAWA EIGO, SATO SHIGERU HITACHI HACHIMANY, TAKAHASHI SHINO, ARAI, YOSHINAO, KOBAYASHI, HIDEAKI, OIKAWA, EIGO, SATO, SHIGERU HITACHI HACHIMANYAMA APT. 536, TAKAHASHI, SHINO
Applicants: HITACHI LTD, HITACHI, LTD.
Application year: 1985
Main classification: H05K13
IPC codes: G05B19, H05K13