Académique Documents
Professionnel Documents
Culture Documents
Abstract
Despite the tremendous development in CNC programming facilities, linear and circular cuts parallel to the coordinate planes continue
to be the standard motions of modern CNC machines. However, the increasing industrial demand for parts with intricate shapes cannot
be satisfied with only these standard motions. This paper proposes an efficient and accurate method for developing a class of precise
interpolation algorithms which can drive the cutter of a CNC machine along three-dimensional (3D) trajectories. Engaging a pair of
primitive shapes, the method uses their implicit or parametric definition to interpolate their intersection curve on the basis of Danielson’s
step selection rules. The presence of Danielson’s criteria guarantees a position error of at most one step. A general-purpose computer
for path generation and real-time control of the machine is employed. The user first chooses a suitable combination of shapes whose
intersection gives the desired form of the 3D trajectory and then initiates the algorithm with the desired information of the two shapes.
© 2003 Elsevier Science B.V. All rights reserved.
0924-0136/$ – see front matter © 2003 Elsevier Science B.V. All rights reserved.
doi:10.1016/S0924-0136(03)00286-3
344 S.L. Omirou / Journal of Materials Processing Technology 141 (2003) 343–350
p1 = (x − x1 )2 + (y − y1 )2 + (z − z1 )2 ,
Fig. 2. Motion generation along the intersection curve of two parametri-
cally defined surfaces. p2 = (x − x2 )2 + (y − y2 )2 + (z − z2 )2 (16)
346 S.L. Omirou / Journal of Materials Processing Technology 141 (2003) 343–350
The effect of each contemplated step on the above distances using the last values of them as a starting point. A similar
is expressed, respectively, by the differentials system is solved for u2 , v2 in the case of P2 .
dp1 = p1x dx + p1y dy + p1z dz,
dp2 = p2x dx + p2y dy + p2z dz (17) 4. Implementation issues
where p1x , p1y , p1z and p2x , p2y , p2z are the partial deriva-
tives of p1 , p2 , respectively. The operation of a CNC machine tool is controlled by
The proximity condition may, thus, be expressed as the a program written in the G-code programming language
set of inequalities called part program. A part program contains an ordered
sequence of statements specifying in detail the cutter mo-
p1 dp1 < 0, p2 dp2 < 0 (18)
tions to be executed and the auxiliary operations (e.g., spin-
or simply dle on/off, spindle speed and feedrate) to be realized by the
CNC machine in order to machine a specified part. A state-
dp1 < 0, dp2 < 0 (19)
ment is made up of words. Characters, and numerical digits
since p1 , p2 are permanently positives. are the elements that constitute a word. For example, the
After the above interpretation, the step selection problem statement
for interpolation of a curve obtained as the intersection of
two parametrically defined surfaces, may be formulated as N10 G01 X200 Y300 Z100 F200 M03 S800
follows:
consists of the words “N10”, “G01”, “X200”, “Y300”,
maximize tx dx + ty dy + tz dz
“Z100”, “F200”, “M03”, “S800”, meaning that the state-
∂p1 ∂p1 ∂p1 ment with sequence number N10, requires movement of the
subject to dp1 = dx + dy + dz < 0,
∂x ∂y ∂z tool from its current position to position (200, 300, 100)
(20)
∂p2 ∂p2 ∂p2 linearly (G01) with a feedrate of 200 mm/min and with the
dp2 = dx + dy + dz < 0,
∂x ∂y ∂z spindle rotating clockwise (M03) at 800 rpm.
dx, dy, dz ∈ [−1, 0, 1], |dx| + |dy| + |dz| ≥ 1 Each of the codes other than G and M has a unique func-
tion. The G and M have many functions depending on the
As in the implicit formulation, the problem is solved again
following two-digit number. These functions have been stan-
as an integer programming problem, in which the unknown
dardized and are commonly known as “G and M codes”.
variables dx, dy, dz, take on values from theset [−1, 0, 1].
Generally, a G-code, named preparatory function code, de-
Once a step is determined and carried out, the coordinates
fines one type of motion or one mode of operation while
of P1 , P2 are updated to maintain the normality conditions.
an M-code, named miscellaneous function code, turns var-
The updating process is applied separately for each of P1 ,
ious operations on/off (e.g., coolant flow, spindle, etc.). It
P2 by solving a system derived from the conditions
must be noted that not all the possible code numbers are
PP1 × N̄1 = 0, PP2 × N̄2 = 0 (21) allocated, which means that control systems manufacturers
can use those remaining for whatever purpose they wish.
that is, the vectors PP1 , PP2 must be kept parallel to the
New CNC programming capabilities are among those pur-
normals N̄1 , N̄2 , respectively.
poses. Pythagorean-hodograph curves [12] and real time sur-
For P1 , for example, the parallelism condition is written
face interpolation [13] are representative examples of such
as
new programming capabilities. In these works, authors, be-
ī j̄ k̄
sides the presentation of the new CNC interpolators, pro-
x − x 1 y − y1 z − z1 = 0 (22)
pose G-codification for performing the respective interpola-
N N1y N1z tion. In the same way, the space curve interpolator proposed
1x
in the present paper may be embedded in a CNC controller
It is worth noting that from the above condition only two
under specific G-codification.
equations are extracted, since by setting the two coordinates
The architecture of the proposed space curve interpola-
of the cross product equal to 0, the third one is implied.
tor is depicted in the two flow charts of Fig. 3 covering
Setting, for example, the first two coordinates equal to 0, we
the respective modes of representing the primitive surfaces
obtain the system
(implicit and parametric). Two non-allocated G-codes, one
(y − y1 (u1 , v1 ))N1z (u1 , v1 ) for each representation type, may be engaged to codify the
−(z − z1 (u1 , v1 ))N1y (u1 , v1 ) = 0, space curve motion in the part program. The respective state-
(x − x1 (u1 , v1 ))N1z (u1 , v1 ) ment must contain the geometric information included in
the input data box of the flow charts as well as the required
−(z − z1 (u1 , v1 ))N1x (u1 , v1 ) = 0 (23)
cutting conditions. Based on these information, the CNC
Applying the Newton’s method for systems, the unknown computer performs the space curve interpolation, issuing in
variables u1 , v1 , of this system, are computed iteratively each program-iteration the selected stepping command to
S.L. Omirou / Journal of Materials Processing Technology 141 (2003) 343–350 347
Fig. 3. Flow charts of the space curve interpolation program. The intersecting surfaces are (a) implicitly defined and (b) parametrically defined.
the driving motors of the machine axes. This process is re- Pe (xe , ye , ze ) of the desired circular arc and those of the
peated until the programmed terminal point is reached. sphere center c(xc , yc , zc ). Assuming that these points are
not collinear the equation of the plane may be written as
x y z 1
5. Test results x ys zs 1
g = s =0
(26)
xe ye ze 1
The algorithm was implemented and tested in both its xc yc zc 1
versions, implicit and parametric. Two representative exam-
ples, one for each version, were selected to demonstrate the
effectiveness of the proposed method.
Fig. 5. Cutter path along the test circle of Example 1, generated with a step size of 0.1 in the 3D presentation (a) and with a step size of 1 in the
projections on the XY plane (b), on the XZ plane (c) and on the YZ plane (d).
from which the coefficients A, B, C are extracted by expand- The estimation of the position error per step size is de-
ing the respective determinants. picted in Fig. 5b–d. The figures present the projections of
the generated path on the three coordinate planes XY, XZ
and YZ. A step size of 1 was used to see the path clearly.
After the above definitions of the two surfaces, the inter-
The projections on the XY and YZ planes are ellipses while
polation of their intersection curve (3D circular arc) may be
the projection on the XZ plane is a straight-line segment
implemented by a program developed on base of the flow
chart illustrated in Fig. 3a.
Fig. 5a shows the interpolated 3D path, with a step size =
0.1, for a full circle which is obtained as the intersection of
a sphere with radius r = 30, with an inclined plane forming
a 30◦ angle with the horizontal plane and containing the
Y-axis.
In addition to the sphere center (x = 0, y = 0, z = 0), a
start point with coordinates (x = 25.98, y = 0, z = 15) and
an intermediate point with coordinates (x = 0, y = 30, z =
0) were used to define the particular plane. The introduction
of the coordinates of an intermediate point instead of those of
the final point is necessary in the cases of full circles or semi-
circles because in these two cases, the three points (start, end,
center) become collinear and the plane cannot be defined. Fig. 6. A 3D curve defined as the intersection of a sphere and an ellipsoid.
S.L. Omirou / Journal of Materials Processing Technology 141 (2003) 343–350 349
traversed twice for each traversal of the full circle. It may and the parametric equations of the foot normal lying on the
be seen in all three figures, that the generated path, which is ellipsoid are
also drawn in the figures, nowhere diverges from the ideal
path by more than one step. x2 = 80 cos u2 cos v2 , y2 = 40 cos u2 sin v2 ,
π π
Example 2. The following example was selected to illus- z2 = 60 sin u2 , − ≤ u2 ≤ , −π ≤ v2 ≤ π (28)
2 2
trate the parametric formulation and processing of the algo-
rithm. Consider the intersection curve formed by the inter- For the starting point, the computed initial values are
secting surfaces of a sphere (r = 50) and an ellipsoid (a =
80, b = 40, c = 60). Assume the orientation and the relative x = x1 = x2 = 41,054, y = y1 = y2 = 0,
position (O1 O2 = 80) of the two solids as are illustrated z = z1 = z2 = 51,496, u1 = 2177 rad,
in Fig. 6. A circle and an ellipse are the intersection curves
of the two surfaces with the coordinate plane XZ. The right u2 = 1031 rad, v1 = 0 rad, v2 = 0 rad
one point lying on XZ plane where the two curves meet each
After the above definitions of the two surfaces, the interpo-
other was selected as a convenient starting point to initiate
lation of their intersection curve may be implemented by a
the algorithm. At the same point the initial positions of the
program developed on base of the flow chart illustrated in
feet normal were set.
Fig. 3b.
Using the above numerical values, the parametric equa-
tions of the foot normal lying on the sphere are
Fig. 7a shows the interpolated 3D path with a step size 0.1,
x1 = 50 sin u1 cos v1 , y1 = 50 sin u1 sin v1 , while the accuracy of the method, in its parametric version,
z1 = 50 cos u1 + 80, 0 ≤ u1 ≤ π, 0 ≤ v1 ≤ 2π (27) is demonstrated in Fig. 7b–d, where the same path generated
Fig. 7. Cutter path along the test curve of Example 2, generated with a step size of 0.1 in the 3D presentation (a) and with a step size of 1 in the
projections on the XY plane (b), on the XZ plane (c) and on the YZ plane (d).
350 S.L. Omirou / Journal of Materials Processing Technology 141 (2003) 343–350