Abstract:
A numerical control method for controlling a numerical control device and prereading the numerical control data in a succeeding block during the execution of numerical control in accordance with the current block. A plurality of line segments, each specified by a block of numerical control data, approximate a curve. When the length of a line segment is less than a prescribed length (defined by required machining precision), control of movement of a member such as a tool based on the data specifying said line segment is skipped. This eliminates intermittent tool movement, improves machining precision, and prevents damage to the machine tool.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to a numerical control method and, more particularly, to a numerical control method for application to a numerical control device for reading the numerical control data in a succeeding block during the execution of numerical control as defined by the current block. 
     2. Description of the Prior Art 
     The increased use of numerically controlled machine tools and the improvements which have been made in methods of creating numerical control (hereinafter &#34;NC&#34;) data now make it possible to produce more sophisticated shapes by numerically controlled machining. Numerically controlled machine tools rely upon interpolation systems of two kinds. One is a linear interpolation system for interpolation along two or three axes simultaneously, and the other is a circular interpolation system for interpolation in XY, YZ and ZX planes, or in planes parallel thereto. In the machining a workpiece into a complex shape such as one having a sculptured (i.e., three-dimensional) surface or profile, the workpiece must be cut continuously by combining the linear and circular interpolation systems. It is also necessary to create the NC data required for such cutting. To this end, curves are approximated by a multiplicity of minute straight line segments or arcs, and NC data is created having one block, including a positional command, for each straight line segment. When a curve is approximated in this manner, the amount of movement specified by one block is extremely small, and may be on the order of only several microns in some cases. It follows then that very little time is required for machining or movement based upon one block of command data. This is particularly so when machining a workpiece made of a soft material such as wood, since cutting speed can be raised significantly. 
     When a very short time interval is required for movement based upon one block of data, a so-called prereading technique may be employed for reading data in such fashion so as to enhance machining efficiency. Before describing this technique, a conventional method that does not employ prereading is discussed. 
     In the conventional method, NC data is read in block-by-block, and each time machining or movement based on one block is completed, data from the next block is read in. The data read in followed by a format check, decoding, calculation of the specified amount of movement (namely an incremental value), and by other preprocessing, after which machining or movement is controlled based upon said next block. With this method, however, processing executed by the NC device does not keep up with the action of the machine tool because of such factors as preprocessing time and the response of the motor for driving the movable element of the machine tool, such as the table. The attendant disadvantages are reduced machining efficiency and a failure to attain a highly precise machined surface. 
     The abovementioned prereading technique is employed in an effort to solve these problems. With this technique, the next block of NC data is read in while numerically controlled machining based on the current block is being executed. This is known as &#34;prereading&#34; data. Thus, while numerically controlled machining based on the current or first block is in progress, preprocessing based on the next or second block may be performed in advance. Then, simultaneous with the completion of machining specified by the first block, there is a transition to machining based on the preprocessed data of the second block. Movement based on the second block may therefore be executed immediately without waiting for the completion of preprocessing following movement based on the first block. The result is a more efficient machining operation. Moreover, since control of movement specified by the second block can take place immediately upon completion of the preceding pulse distribution (interpolation) operation, curves, such as rounded corners, can be formed without &#34;jerky&#34; motion of the machine tool. Accordingly, the data prereading method affords the advantages of higher machining efficiency and greater machining precision. 
     Still, when approximating a curve by a multiplicity of lines or line segments wherein the time for movement specified per block is short, there are often cases where the preprocessing associated with a succeeding block is unfinished at the end of movement specified by the preceding block, even when the data is preread. This causes intermittent movement of the object being controlled, such as a cutting tool, resulting in diminished machining precision, damage to the machine tool, and prolonged machining time. 
     SUMMARY OF THE INVENTION 
     The present invention invention seeks to eliminate the aforementioned disadvantages encountered in the prior art. 
     Specifically, the object of the present invention is to provide a numerical control method for controlling the movement of a tool in such fashion that the length of each of a plurality of straight line segments approximating a curve is not allowed to fall below a prescribed value. 
     To this end, the present invention provides a numerical control method based on computing the lengths of a plurality of straight line segments that approximate a curve, determining whether the length of each line segment is less than a preset permissible length, and inhibiting control of movement based on a line segment when its length is less than the preset length. In such case the distance from the extension of said line segment to the end point of the next contiguous line segment is computed, and movement is controlled toward the end point of the contiguous line segment if the computed distance is less than a separately entered permissible distance. If not, then movement is controlled toward the starting point of the contiguous line segment. In another aspect of the invention, numerical control data for controlling a tool in the abovementioned manner is created to enable an ordinary numerical control device to be employed without modification thereof. 
     In accordance with the invention, therefore, preprocessing for a successive increment of movement can be completed while a tool or other movable member is in motion, thereby shortening machining time and preventing intermittent machine operations. 
     Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 including FIGS. 1A-1F, illustrates a method of creating a curved surface on a three-dimensional body; 
     FIG. 2 illustrates a machining method according to the present invention; 
     FIG. 3 is a flowchart of processing according to the present invention; 
     FIG. 4 is a diagram embodying the present invention; 
     FIG. 5 is a flowchart for creating an NC tape according to the present invention; and 
     FIG. 6 is a block diagram of a circuit for creating an NC tape according to the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     A curved surface of a three-dimensional metal mold or the like, when drawn out on the plane of a blueprint, is generally represented by a plurality of predefined section curves, but no data is shown for the shapes of the areas lying between the adjacent predefined section curves. When machining the workpiece in accordance with a numerical control method, however, it is essential that the adjacent section curves be connected smoothly, despite the absence of data indicating the shape of the surface between them. In other words, this means that machining must be performed by generating the curved surface lying between the adjacent section curves from the data indicating the predefined section curves, punching a numerical control tape to provide the tape with the data relating to the generated curved surface, and then machining the workpiece in accordance with the instructions on the NC tape. 
     To this end, a method of creating the curved surface of a three-dimensional body, namely a method of creating NC data has been developed. This method includes generating a plurality of intermediate sections and finding a section curve (i.e., an intermediate section curve) for each of the intermediate sections in accordance with predetermined rules, from section data specifying the predefined sections of the three-dimensional body and from data specifying section curves with in the given sections, and generating data defining the curved surface, namely the NC data, from the plurality of generated intermediate section curves. 
     Stating this method in another way, a first of two given section curves is, in effect, shifted in space while being modified so as to be superimposed on a second section curve, thereby generating a curved surface. In other words, the plurality of intermediate section curves, when taken together, define the curved surface. In generating an intermediate section curve, uniform correspondence is established between the predefined first and second section curves in their entirety. That is, each of the two section curves is partitioned into M-number of segments to define dividing points on each curve, correspondence is established between the i-th (i=1,2, . . . n) dividing points P i , Q i  on the first and second section curves, respectively, and each of the intermediate section curves is generated on the basis of the corresponding relationship between each pair of points, i.e., between each section curve on which the points lie. 
     FIG. 1 illustrates a method of creating a surface for a case where two section curves and one reference curve are given. Reference numerals 11 and 12 denote two sections of a three-dimensional body, and 11a and 12a denote predefined or given section curves for a case where the body is cut in the given sections 11 and 12. Reference numeral 21 denotes a reference section containing points P 1  and P 1  &#39; on the respective section curves 11a and 12a. Numeral 21a denotes a reference curve lying in the reference section 21 and specifying the external form of the body. Numeral 13 designates an intermediate section so generated as to contain a dividing point S i  at which the length of the reference curve 21a is partitioned into two sections having the ratio m:n. 
     The method of creating a curved surface proceeds in the following manner. 
     (1) The first step is to enter data specifying: the given sections 11 and 12; the given section curves 11a and 12a, the reference section 21; the reference curve 21a; the data relating to the corresponding positional relationship between the given section curves 11a and 12a; information on the partitioning of the reference curve; and the intervals at which the section curves are partitioned. It will be assumed that point P 1  corresponds to point P 1  &#39;, and that point P 2  corresponds to point P 2  &#39;. Further, the number of partitions or the partition intervals are entered as the partition information. 
     (2) The next step is to find the coordinates of the dividing point S i , at which the reference curve 21a is partitioned into two sections having the ratio m:n, using the partition information entered in the foregoing step. For example, letting the number of partitions be M, the coordinates of the dividing point S i  may be found through the following steps (2-1) through (2-4), explained below. We will assume that M=m+n. 
     (2-1) The length of each element constituting the reference curve 21a is found (where the term &#34;element&#34; is taken to mean a line segment or an arc), and the obtained lengths are added together to find the total length D of the reference curve. 
     (2-2) The equation m/(m+n)·D=D&#39; is solved for D&#39;. 
     (2-3) An element is extracted containing a point at a distance D&#39; from one end, which point serves as a reference point for partitioning. If D 1  is taken as the length of the initial element, D 2  as the length of the next element, D i  as the length of the i-th element and so on, the extraction of elements is carried out by finding the k that satisfies the following inequality: ##EQU1## 
     (2-4) This step is to find the point on the k-th element whose distance from the starting point thereof is D&#34;, where D&#34; is found from: ##EQU2## The obtained point is that which partitions the given curve into the ratio m:n from one end thereof. It will be assumed that, in step (2-3), ##EQU3## where k=1. Therefore, if we let M=M+n and m=m+i, and if i is varied over integral numbers from 0 to M-1 [namely i=0,1,2 . . . (M-1)], then we can find the coordinates of each dividing point S i  that divides the reference curve uniformly into M partitions. 
     (3) The given section curves 11a and 12a are transformed into the same plane (FIG. 1B). It should be noted that the given curves 11a and 12a can be considered to be curves which lie on the same plane if they are manipulated by the following steps (3-1) through (3-3): 
     (3-1) The points of intersection P 1  and P 1  &#39; between the reference curve 21a and the given sections 11 and 12 are taken as the same point. 
     (3-2) When the lines of intersection HL and HL&#39; (in FIG. 1A), between the reference section 21 and the given section 11 and 12 are considered, it is seen that both of these lines HL and HL&#39; are divided into two segments by the points of intersection P 1  and P 1  &#39;, respectively. Of these divided segments, those that have the same direction (A, A&#39;) with respect to the reference curve 21a are superposed. 
     (3-3) When straight lines VL and VL&#39; (which respectively pass through the points of intersection P 1  and P 1  &#39; of the reference curve 21a and the two given sections 11 and 12, and which are normal to the reference curve 21a), are considered, it is seen that these lines of intersection, VL and VL&#39;, are divided into two segments by the points P 1 , P 1  &#39;, respectively. Of these partitioned segments, those that have the same direction (B, B&#39;) with respect to the reference curve 21a are superposed. Thus, the given section curves 11a and 12a are transformed into the respective curves 11a&#39;, and 12a&#39; on the same plane, as shown in FIG. 1B. 
     (4) By using the two given section curves 11a&#39;, 12a&#39; lying in the prescribed plane obtained from step (3) above, an intermediate section curve 13a&#39; is generated in the plane. 
     The intermediate section curve 13a&#39; is generated through the following procedure. Note that the division interval N (mm) is an input quantity. 
     (4-1) On the given section curves 11a&#39;, 12a&#39;, the respective lengths L 1 , L 2  of the portions from P 1  to P 2  and from P 1  &#39;, P 2  &#39; are found. See FIG. 1B. 
     (4-2) The operations specified by M 1  =(L 1  /N), M 2  =(L 2  /N) are performed, and the magnitudes of M 1  and M 2  are compared. The larger value is taken to be the number of partitions of the line segments P 1  P 2  and P 1  &#39;P 2  &#39;. We will assume that M 1  &gt;M 2 . Note that M 1  and M 2  are whole numbers obtained by rounding fractions up to the next higher unit value. 
     (4-3) The segments P 1  P 2  and P 1  &#39;P 2  &#39; are partitioned into M 1  segments. The partitioning process is executed using steps (2-2) and (2-3) described above, and results in finding the dividing points P i , Q i  (i=1, 2, 3, . . . ). See FIG. 1C. 
     (4-4) A dividing point R i  is computed, which point partitions a straight line connecting the dividing points P i , Q i  at the partitioning ratio m:n of step (2). See FIG. 1D. 
     If we let the coordinates of the dividing points P i , Q i  be (x 1 ,y 1 ) and (x 2 ,y 2 ), respectively, then the coordinates of the dividing point R i  (X, Y) may be calculated from: ##EQU4## 
     (4-5) Thereafter, i is incremented through the integral values ranging from 1 to M 1  -1 (that is, 1,2 . . . M 1  -1) to create the intermediate section curve 13a&#39; constituted by the series of dividing points R i  (i=1,2 . . . ). See FIG. 1E. 
     (5) The intermediate section curve 13a&#39; on the prescribed plane found in step (4) is transformed into a curve lying in the defined spacial intermediate section 13 (FIG. 1A). The equation for the transformation that transforms the prescribed plane obtained from step (3) into the intermediate section 13 can be expressed by a combination of parallel and rotational translation in space. The transformation equation generally is expressed in the form of a matrix. Accordingly, by setting up the transformation matrix for the points R i  (i=1,2 . . . ) obtained in step (4), the points R i  can be transformed into points in defined space. The curve connecting the series of points in the defined space obtained by the matrix transformation is the intermediate section curve 13a in the intermediate section 13. See FIG. 1F. 
     Following the above, the operations m=i+1, n=M-m are performed to find the coordinates of the next dividing point S i+1  of reference curve 21a, and steps (2) through (5) are repeated. In this manner a curved surface is created as a collection of multiple intermediate section curves. 
     To create the NC data specifying the intermediate section curve 13a, one block of positional command data is prepared in the form of the coordinate values (absolute values, by way of example) obtained when a point R i  is transformed into the defined space (e.g., plane 13). Then, in similar fashion, individual blocks of positional command data are prepared for all of the points R i  (i=1,2 . . . ) constituting the curve 13a. This provides the necessary NC data for the curve 13a. All of the necessary NC data for the curved surface is obtained by aggregating the NC data relating to the intermediate sections containing each of the dividing points S i  [i=1,2 . . . (M-1)]. 
     As stated earlier, the dimensions of the surface shape lying between section curves are not given. Therefore, the following holds in connection with the machining of a curved surface. Specifically, though a workpiece can be machined into a curved surface if the cutting tool is moved in accordance with the NC data created as described above, it is not necessary to move the cutting tool entirely in accordance with NC data since the shapes of the intermediate sections are not given. If cutting is capable of being carried out in such fashion so as to smoothly connect two given section curves, then it is permissible to machine a workpiece with a portion of the NC data omitted. Accordingly, in the present invention, a permissible travelling distance (described below) is set so as to enable smooth cutting of a surface, and a portion of the NC data is deleted so as to move the cutting tool over the permissible travelling distance, whereby the distance traversed by the tool compared to that defined by the machining data is increased. 
     FIG. 2 illustrates a machining method according to the present invention and shows an enlargement of an intermediate section curve. A processing flowchart is illustrated in FIG. 3. Reference will be had to these drawings to describe the method of the invention. 
     (1) The first step is to preset permissible distances TD and TW, determined by the desired machining precision and surface smoothness. TD serves as a permissible travel distance. 
     (2) When the current position of the tool is R o , the position of point R 1  is found by prereading data, and then the distance, AD, to point R 1  is computed. 
     (3) After the distance AD is found, the magnitudes of AD and TD are compared. 
     (4) If the relation AD≧TD holds, then the tool is moved along the straight line R o  R 1  to point R 1 , during which time R 1  is regarded as R o  and R 2  as R1 (i.e., R 1  →R o , R 2  →R 1 ). At this time the next block of data is preread, and steps (2) through (4) are repeated. If the relation AD&lt;TD holds, on the other hand, processing shifts to the next step. 
     (5) In this step, a straight line S connecting points R o , R 1  is computed, i is set equal to 2, and the NC data corresponding to the next point R i  is preread. 
     (6) Next, the distance AW from the point R i  to the straight line S, which is the extension of S 1 , is computed. 
     (7) After the distance AW is found, the magnitudes of AW and TW are compared. 
     (8) If AW≧TW holds, then the preceding point R i-1  is taken as the target point (end point), and the tool is moved along the straight line R i-2  R i-1  (e.g., the line R o  R 1 ) to point R i-1  (e.g., R 1 ). During tool movement, R i-1  is regarded as the new R o  (R i-1  →R o ), and hereinafter R 1 , R 2  . . . are determined anew on the basis of R i-1 , the next block of data is preread, and steps (1) through (8) are repeated. If the inequality AW&lt;TW holds, then the operation i+1→i is performed, the NC data corresponding to point R i  is preread, and steps (6) through (8) are repeated. 
     When the foregoing operations are executed up to the last point R n  of the intermediate section curve and the cutting tool is moved to point R n , machining of the intermediate section curve is complete. Thus, even though the distance between points R i  and R i+1  based on the created NC data may be very small, in accordance with the present invention, NC data is omitted or &#34;skipped&#34; so as to move the tool over a larger distance; that is, the permissible travelling distance, thereby lengthening the distance covered by the tool. The increased machining distance allows time to preprocess the next increment of movement while the tool is in motion. 
     A block diagram of a circuit for practicing the method of the invention is illustrated in FIG. 4. Numeral 101 denotes a paper tape in which NC tape is punched. The paper tape 101 is read by a paper tape reader 102 for reading the data into an arithmetic circuit 103 adapted to compute the distance AD between the points R o , R 1  in FIG. 2. The arithmetic circuit 103 delivers a signal indicative of AD to a discriminating circuit 104 for comparing the distance AD against the preset permissible travel distance TD. An arithmetic circuit 105 for computing incremental values receives the output of the discriminating circuit 104 and delivers the incremental values to a pulse distributor 106. When the discriminating circuit 104 detects the condition AD≧TD, the arithmetic circuit 105 computes incremental values from R o  to R 1  along each axis. The pulse distributor 106 distributes pulses on the basis of the incremental values and applies the pulses to a servo system, not shown, for transporting the tool. Numeral 107 denotes an arithmetic circuit for computing the straight line S (FIG. 2) when the condition AD&lt;TD holds. An arithmetic circuit 108 receives the output of the circuit 107 and computes the distance AW from the point R i  to the straight line S. A discriminating circuit 109 receives the output AW of the discriminating circuit 107 and compares the distance AW against the preset permissible distance TW. When the condition AW≧TW is found to hold, the incremental value computing arithmetic circuit 105, taking the point R i-1  as the target position, computes incremental values from R o  to R i-1  along each axis and delivers these values to the pulse distributor 106. The tape reader 102 reads in the next block of NC data when AD&lt;TD or AW&lt;TW holds. 
     Described hereinabove is an example in which various process steps are carried out when executing control of tool movement. It should be noted, however, that the foregoing can be achieved when creating the NC tape. A method of preparing such a tape will now be described with reference to the flowchart of FIG. 5, while referring also to FIG. 2. 
     (1) The first step is to preset the first and second permissible distances TD, TW, determined by the desired machining precision and surface smoothness. 
     (2) Next, the distance AD, namely the length of the first straight line segment R o  R 1  (on straight line S 1 ), is computed. 
     (3) After AD is computed, the magnitudes of AD and TD are compared. 
     (4) NC data is created for the case where the relation AD≧TD holds, the data specifying, as absolute values, the coordinates of the end point R 1  of the straight line S 1  toward which the tool is to be moved while travelling along the straight line S 1 . Thereafter steps (2) through (4) are repeated. 
     (5) When the relation AD&lt;TD holds, a formula specifying the straight line S1 is computed, i is set equal to 2, and the distance AW from the end point R i  (=R 2 ) of the straight line R 1  R 2  (straight line S i ) to the straight line S is computed. 
     (6) After the distance AW is computed, the magnitudes of AW and TW are compared. 
     (7) NC data is created for the case where AW≧TW holds, the data taking the end point R i-1  (=R 1 ) of the preceding straight line S i-1  (=S 1 ) as the target point, and moving the tool along the straight line R i-2  R i-1  (=R o  R 1 ). Thereafter, steps (1) through (8) are repeated, using the conditions R i-1  →R o , R i  →R 1 , R i+1  →R 2  . . . and so on. If the inequality AW&lt;TW holds, then the operation i+1→i is performed, the distance AW from the end point R i+1  (=R 3 ) of the next straight line to the straight line is computed, and steps (6) and (7) are repeated. 
     Creating NC data by executing the foregoing operations up to the last straight line segment of the intermediate section curve completes the preparation of NC data for the intermediate section curve 13a, in accordance with the invention. 
     A block diagram of a circuit for creating the NC data in accordance with the present invention is illustrated in FIG. 6. 
     Referring to FIG. 6, numeral 201 denotes a memory for storing the coordinates of points R i  (=1,2 . . . ). The output of the memory 201 is connected to a read control circuit 202 for reading the NC data into an arithmetic circuit 203 which computes the distance AD between the starting point R o  and end point R 1  of the straight line S 1  (FIG. 2), namely the length of the straight line S 1 . The output AD of the arithmetic circuit 203 is applied to a discriminating circuit 204 which compares the magnitude of AD against the magnitude of the preset first permissible travel distance TD. An NC data generating circuit 205 also receives the data read in by the read control circuit 202, as well as the output of the discriminating circuit 204. The output of the NC data generating circuit 205 is connected to an NC data storage memory 206. When the condition AD≧TD holds, the NC data generating circuit 205 generates NC data specifying, in the form of an absolute command, the coordinates of the end point R 1  of the straight line S 1 , which data is stored successively in the NC data storage memory 206. The output of the NC data storage memory 206 is applied to an NC tape puncher 207 for punching the NC data (read successively out of the memory 206), into a paper tape 208. Numeral 209 denotes an arithmetic circuit for computing the straight line S 1  (FIG. 2) when the condition AD&lt;TD holds. An arithmetic circuit 210, which receives the output of the circuit 209 and the data read in by the read control circuit 202, computes the distance AW from the point R i  to the straight line S 1 . The output AW is applied to a discriminating circuit 211 which compares the magnitude of the distance AW against the preset second permissible distance TW. When the condition AW≧TW holds, the NC data generating circuit 205 generates NC data in which the point R i-1  is the target point. When the condition AD&lt;TD or AW&lt;TW holds, the read control circuit 202 reads in the coordinates of the next point. 
     Thus, even though the travelling distance specified by one block of NC data may be very small, in accordance with the present invention, that NC data is omitted while maintaining the travelling distance permitted by the desired machining precision, thereby lengthening the distance covered by the tool. This enables preprocessing for the next increment of movement to be completed while the tool is in motion. As a result, the tool (or any controlled element) need not wait for the completion of preprocessing after travelling the specified distance. Instead, the current increment of movement ends at the same time that the next begins, thereby shortening machining time and raising machining efficiency. Moreover, tool movement is substantially continuous rather than intermittent, contributing to the durability of the machine and to a smoother cutting operation. 
     The foregoing effects can be obtained by creating an NC tape, so that existing numerical control devices may be applied without modification. While hardware has been utilized to construct the arrangements shown in FIGS. 4 and 6, the same can be achieved through use of a microcomputer or the like. 
     As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims.