Tool path curve generation method and tool path curve generation apparatus
10088825 ยท 2018-10-02
Assignee
Inventors
Cpc classification
International classification
Abstract
A tool path curve generation method for generating a curve from a tool path designated by a command point sequence includes: a step of defining a region based on a polygonal line path connecting the command point sequence; a step of determining whether the curve is included in the region on the basis of the geometric shape of the surface of the region; and a step of generating a curve that has been determined to be included in the region in the determination step.
Claims
1. A machine tool, comprising: a tool path curve generation apparatus adapted to generate a tool path curve from a tool path designated by command points in a command point sequence, the apparatus comprising a processor configured to: define a tolerance region which is based on a polygonal line path connecting the command points in the command point sequence, which includes the polygonal line path, and in which the tool path curve is to be included, determine whether the tool path curve is included in the tolerance region on the basis of a geometric shape of a surface of the tolerance region, and output the tool path curve which has been determined to be included in the tolerance region, wherein the tolerance region includes a plurality of element regions, each element region among the plurality of element regions is a rotating body having a rotation axis that is a segment of the polygonal line path connecting a pair of adjacent command points in the command point sequence, the tool path curve includes a plurality of curve sections each corresponding to an element region among the plurality of element regions, and the processor is configured to determine that a curve section among the plurality of curve sections is included in the corresponding element region when the element region includes a spheroid having ends of the curve section as focal points, and a length of the curve section as a sum of distances from points on the spheroid to the focal points, wherein the processor is configured to determine that the element region includes the spheroid by projecting the spheroid and the element region onto a plane that is orthogonal to the rotation axis of the element region, and the machine tool is configured to machine a workpiece in accordance with the outputted tool path curve.
2. The tool path curve generation apparatus according to claim 1, wherein the geometric shape of the surface of the tolerance region is specifiable by setting.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The above and other objects and features of the present invention will be obvious from the ensuing description of embodiments with reference to the accompanying drawings, in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
(14) The following will describe an embodiment of the present invention with reference to the accompanying drawings. Unless otherwise specified, the product of vectors will indicate an inner product.
(15) First, the terms used in the present description will be defined. Each point sequence obtained by division to generate a curve is defined as a partial point sequence, and a curve generated from the partial point sequence will be defined as an arc. Further, a region which is defined on the basis of a polygonal line path connecting the points of a partial point sequence and in which a curve should be included so as to ensure the shape error of the curve is defined as an allowable region. The allowable value of the distance between each point of the partial point sequence and the curve or the distance between a segment that connects the points of the partial point sequence and the curve is defined as a tolerance.
(16) The method in accordance with the present invention will be specifically described.
(17) The NC command decoder 10 is identical to an NC command decoder mounted on a numerical controller, which controls a machine tool, and decodes an NC command 2 (machining program) to extract point sequence data of a point sequence constituting a tool path. The point sequence data is the data that indicates the positions of points on the tool path. In the case of five-axis machining, the point sequence data also includes the data that indicates the orientation of a tool.
(18) The point sequence acquirer 20 sends a request to the NC command decoder 10 to acquire necessary point sequence data. Basically, the data on the points of a predetermined number N is acquired. If there is a place determined to have a bend point of a tool path in the requested point sequence, then the point sequence data up to the bend point is acquired. The curve generator 30 generates an arc. The arc is a parametric curve that passes the start point and the end point of a partial point sequence and passes by the remaining points. As the parametric curve, a B-spline curve is used. Alternatively, however, other type of curve, such as a NURBS curve or a partitioned polynomial curve, may be used. The arc is represented by expression (1).
(19)
(20) where u denotes a parameter of the curve and takes a value in a range defined by 0u1; N.sub.i,3(u) denotes a three degree B-spline basis function; and {right arrow over (P)}.sub.i(u) denotes a control point of a B-spline curve.
(21) The codomain of the parameter u is divided by a set of numbers called knot (U={U.sub.0, . . . , U.sub.n+4}). The B-spline basis function N.sub.i,3 (u) depends on the knot. Thus, expression (1) represents a curve, using a knot and a control point as variables. Deciding the values of the variables defines the curve. There are several methods available for defining the curve as represented by expression (1), but the descriptions thereof will be omitted, because they are widely known, as described in Les Piegl, Wayne Tiller, The NURBS Book, Springer-Verlag, pp 405-453, and I. J. Schoenberg, Spline functions and the problem of graduation, Proceedings of the National Academy of Sciences of the U.S.A., 52 (1964), pp 947-950.
(22) Ensuring the shape error of a curve means to verify that the curve represented by expression (1) is included in an allowable region. The allowable region is formed of connected element regions, each of which is defined for each segment constituting a polygonal line. In the following description, for the purpose of simplicity, the element regions will be cylinders each having a segment as its axis and a tolerance as its radius, and a sphere that covers a cylinder connection part in which a curve is included in neither of the cylinders (
(23) When the element region is denoted by Di and an element of the curve corresponding to the element region Di (the method for determining the element will be described later) is denoted by Ci, the curve being included in the allowable region can be represented by expression (2).
C.sub.i.Math.D.sub.i(i=1,2, . . . ,N.sub.d)(2)
(24) where Nd denotes the number of the element regions.
(25) A curve with the ensured shape error is generated as follows. The values of the numbers of the knots and the control points are decided to generate a curve according to the method described in Les Piegl, Wayne Tiller, The NURBS Book, Springer-Verlag, pp 405-453, or I. J. Schoenberg, Spline functions and the problem of graduation, Proceedings of the National Academy of Sciences of the U.S.A., 52 (1964), pp 947-950), and it is verified whether the curve is included in the allowable region. Until the curve is included in the allowable region, the knots and the control points are repeatedly added to generate curves and the verification is repeatedly performed, thereby generating the curve with an ensured shape error.
(26) For a curve to be included in the allowable region, the distance of each point of the partial point sequence from the curve must be the tolerance or less. In other words, the relationship represented by expression (3) is required.
|{right arrow over (C)}(.sub.k){right arrow over (Q)}.sub.k|(k=0, . . . ,N1)(3)
(27) where denotes the tolerance; {right arrow over (Q)}.sub.k denotes a point of the partial point sequence; and .sub.k denotes the value of a parameter of a point closest to {right arrow over (Q)}.sub.k on the curve and {right arrow over (C)}(.sub.k) denotes the point.
(28) Always verifying expression (2) leads to a high calculation load. Hence, in the foregoing verification, it is first checked whether each point of the partial point sequence lies within the allowable region according to expression (3). If a point that is not within the allowable region is found, then a knot and a control point are added to generate another curve without carrying out the verification according to expression (2). Only when expression (3) is satisfied, expression (2) is calculated for the verification.
(29) Referring now to the flowchart of
(30) Step SA100: Set the numbers of knots and control points to initial values.
(31) Step SA101: Generate an arc.
(32) Step SA102: Whether each point of the partial point sequence lies within a tolerance from the curve is determined according to expression (3). If all points lie within the tolerance, then the procedure proceeds to step SA103, or if not, then the procedure proceeds to step SA104.
(33) Step SA103: Whether each curve element is included in its corresponding element region is determined according to expression (2). If all curve elements are included, then it means that the curve is obtained, so that the processing is terminated. If the determination result is negative, then the procedure proceeds to step SA104.
(34) Step SA104: The numbers of knots and control points are increased, and the procedure returns to step SA101.
(35) A description will now be given of the method for determining in the foregoing step SA103 whether the curve elements are included in their corresponding element regions. First, the case where the element region is cylindrical as illustrated in
(36) First, a first method will be described. This method is used to verify that the maximum value of the length of a perpendicular drawn from a point P on a curve section sandwiched between Ak and Bk down to the axis of the cylinder is the tolerance or less. The foot of the perpendicular is denoted by Q, and the point at which the length of PQ reaches a maximum value is determined. If the maximum value is the tolerance or less, then the curve is included in the cylinder. The maximum value lies either at the end point Ak or Bk of the section or at a point at which the length of PQ takes an extreme value therebetween. Hence, the distance between each of these points and the curve is determined and a maximum value among the obtained results is adopted.
(37) At the point where the length of PQ takes an extreme value, a tangent {right arrow over (C)}(v) of the curve at P, the position thereof is denoted by {right arrow over (C)}(v), and PQ will be orthogonal to each other, where the differential related to a parameter of the curve is denoted by a dash (): {right arrow over (C)}(v)=d {right arrow over (C)}(v)/dv
(38) The position of Q is represented by expression (4), using the parameter u.
(39)
(40) However, the relationship represented by expression (5) must be satisfied.
(41)
(42) where u.sub.k denotes the ratio of the length of the polygonal line from the start point of the partial point sequence to Qk with respect to the total length of the polygonal line (the length from the start point to the end point of the partial point sequence). The relationship represented by expression (6) holds between parameters of {right arrow over (C)}(v) and {right arrow over (Q)}(u).
(43)
(44) Then, expression (7) is derived from the orthogonality condition between the tangent {right arrow over (C)}(v) and P Q.
{right arrow over (C)}(v)({right arrow over (C)}(v){right arrow over (Q)}(u))=0(7)
(45) From expression (4), expression (5) and expression (6), solving expression (7), which is a fifth degree equation related to the parameter , determines the parameter of the point at which the length of PQ takes an extreme value. Thus, the positions of P and Q are determined, and the maximal value (or the minimal value) of the length can be obtained. The solution of the fifth degree equation is determined using the Newton method. The codomain of the parameter is defined by 0u1, and therefore no extreme value exists in some cases. In such a case, the distance will be maximum at the end point Ak or Bk. The Newton method is a well-known method, so that the description thereof will be omitted.
(46) AkQk and QkQk+1 are orthogonal to each other. Therefore, when the position of Ak is denoted by {right arrow over (C)}(v.sub.k), the length of AkQk is represented by expression (8).
{right arrow over (Q)}({right arrow over (C)}(v.sub.k){right arrow over (Q)}.sub.k)=0(8)
(47) Expression (8) is a three degree equation related to .sub.k, so that the solution thereof can be easily obtained. The position of Bk is determined in the same manner. Thus, the extreme values of AkQk, BkQk+1, and PQ have been determined, and the maximum value thereamong is defined as dmax (or AkQk or BkQk+1, whichever is larger, is defined as dmax if PQ does not have an extreme value).
(48) Therefore, if expression (9) is satisfied, then it means that the curve section AkBk is included in the cylinder.
d.sub.max(9)
(49) At a place in a connection part between cylinders where the curve is not included in either of the cylinders, as illustrated in
{right arrow over (C)}(v)({right arrow over (C)}(v){right arrow over (Q)}.sub.k)=0(10)
(50) Expression (10) is a fifth degree equation. As with the case of the cylinders, the Newton method is applied to obtain the solution.
(51) The position of Bk1 has already been determined in determining the cylindrical element region. Hence, whether the curve section Bk1Ak is included in the sphere can be determined using the same procedure as that for the cylinders.
(52) A second determination method will now be described. This method is based on the fact that a curve having a length Lk between two points Ak and Bk is included in a spheroid having Ak and Bk as focal points and the sum of the distances from the focal points is Lk, as illustrated in
(53) Whether the spheroid protrudes from the side surface of the cylinder can be directly determined by projecting the spheroid and the cylinder onto a plane that is orthogonal to the axis of the cylinder. However, a simpler method described below is adopted.
(54) As illustrated in
L.sub.kMin{L.sub.1+L.sub.2}(11)
(55) Thus, checking whether expression (11) is satisfied makes it possible to determine whether the spheroid protrudes from the side surface of the cylinder, so that the problem to be solved comes down to determining the minimum value of L.sub.1+L.sub.2.
(56) The procedure for determining the minimum value will now be described. In a coordinate system having Qk as its origin and QkQk+1 as its Z-axis, when the coordinates of Ak, Bk and P in the coordinate system are defined as A.sub.k(x.sub.1, y.sub.1, z.sub.1), B.sub.k(x.sub.2, y.sub.2, z.sub.2), and P(x, y, z), the relationship represented by expression (12) holds.
L=L.sub.1+L.sub.2
L.sub.1=AP={square root over ((xx.sub.1).sup.2+(yy.sub.1).sup.2+(zz.sub.1).sup.2)}
L.sub.2=PB={square root over ((xx.sub.2).sup.2+(yy.sub.2).sup.2+(zz.sub.2).sup.2)}(12)
(57) Therefore, the minimum value of L under the condition defined by expression (13) is determined.
x.sup.2+y.sup.2=.sup.2(13)
(58) Expression (13) indicates an extreme value problem with constraint conditions and the solution can be obtained by a well-known method, such as Lagrange's method of undetermined multipliers, Goldstein, Classical Mechanics, Yoshioka Shoten (1967), pp 46-51.
(59) The connection part of the cylinder can be also handled as the extreme value problem with constraint conditions. The following will describe the procedure. In this case, it will be verified whether a curve is included in a circle having a center Qk and a radius , as illustrated in
L=L.sub.1+L.sub.2
L.sub.1=B.sub.k1P={square root over ((xx.sub.1).sup.2+(yy.sub.1).sup.2)}
L.sub.2PA.sub.k={square root over ((xx.sub.2).sup.2+(yy.sub.2).sup.2)}(14)
(60) Accordingly, the minimum value of L under the constraint conditions of expression (13) is determined. As with the case of the cylinder, the solution can be obtained by the Lagrange's method of undetermined multipliers.
(61) The procedure for verifying whether a curve is included in an allowable region according to the method described in the foregoing embodiment will be described with reference to the flowchart of
(62) Step SB100: A curve section is set to an initial value. If k=0, then the curve section corresponds to the one defined by point Q0 and point Q1.
(63) Step SB101: The end point Bk of the curve section and the curve length Lk from the end points Ak and Bk are determined.
(64) Step SB102: The determination is made in the case where the element region is cylindrical, as illustrated in
(65) Step SB103: If the determination result of step SB102 indicates that the curve section is not included in the cylinder, then the procedure proceeds to step SB109. If the determination result indicates that the curve section is included in the cylinder, then the procedure proceeds to the determination in the connection part in step SB104.
(66) Step SB104: Determination is carried out for the case where the element region is the connection part illustrated in
(67) Step SB105: If the determination result of step SB104 indicates that the curve section is not included in the connection part, then the procedure proceeds to step SB109. If the determination result indicates that the curve section is included in the connection part, then the procedure proceeds to step SB106.
(68) Step SB106: It is determined whether the curve section is a last one. If the curve section is the last curve section, then the procedure proceeds to step SB108. If the curve section is not the last one, then the procedure proceeds to step SB107.
(69) Step SB107: The procedure increments k by 1 and proceeds to the next curve section and returns to step SB101.
(70) Step SB108: It is determined that the curve is included in the allowable region.
(71) Step SB109: It is determined that the curve is not included in the allowable region.
(72) Referring now to the flowchart of
(73) Step SC100: The curve length Lk from Ak to Bk is determined. Lk is obtained by expression (15).
L.sub.k=.sub..sub.
(74) where |{right arrow over (C)}(u)| denotes the length of {right arrow over (C)}(u). .sub.k and .sub.k+1 denote the values of parameters at which {right arrow over (C)}(v.sub.k) reaches the position of A.sub.k and {right arrow over (C)}(v.sub.k+1) reaches the position of B.sub.k, and are obtained when the positions of Ak and Bk are determined.
(75) Then, the solutions of the extreme value problems of expression (12) and expression (13) are obtained to provide L.sub.min.
(76) Step SC101: Expression (11) is assessed, applying Min{L.sub.1+L.sub.2}=L.sub.min. If expression (11) holds, then the procedure proceeds to step SC102, or if not, then the procedure proceeds to step SC103.
(77) Step SC102: It is determined that the curve section is included in the cylindrical region.
(78) Step SC103: It is determined that the curve section is not included in the cylindrical region.
(79) Referring now to the flowchart of
(80) Step SD100: The curve length Lk from Bk1 to Ak is determined. Lk is given by expression (16).
L.sub.k=.sub..sub.
(81) Then, the solutions of the extreme value problems of expression (14) and expression (13) are obtained to provide L.sub.min.
(82) Step SD101: Expression (11) is assessed, applying Min{L.sub.1+L.sub.2}=L.sub.min. If expression (11) holds, then the procedure proceeds to step SD102, or if not, then the procedure proceeds to step SD103.
(83) Step SD102: It is determined that the curve section is included in the region of the connection part.
(84) Step SD103: It is determined that the curve section is not included in the region of the connection part.
(85) It should be noted that although the embodiments described above use the B-spline curve as the parametric curve, the extension of the curve to another form, such as the NURBS curve, can be accomplished by modifying the representation form of expression (1) and by applying the same concept.