CNC Paraboloid Interpolation | Steve Wait – April 26, 2019

The fundamentals of CNC machining require an intimate familiarity with linear ( G1 ) and circular ( G2 / G3 ) interpolation and the application of cutter compensation ( G41 / G42 ) used to produce an offset or parallel tool path.

Parabola interpolation, applicable to tool center line via a standard form equation, is easy enough using a Fanuc style B Macro. Unfortunately, a standard CNC control does not possess the ability to apply cutter compensation to such a tool path. And, unlike a line or circle, a parallel path to a parabola is not simply an offset of the same geometric shape. Therefore y = a x² alone cannot be utilized by a macro to generate a compensated tool path. While a neat and tidy equation driven curve to define such an offset path would be ideal, the reality of such is illusive. Thus, a more practical approach may be to derive separate compensation equations for the X and Y components.

Alternatively, any CAM software will approximate a compensated tool path at a defined chordal deviation − no macro required. However, should you need to produce a high-resolution curve to the very limits of machine tool capability, employing a mathematical formula via a macro may offer a better solution. An example follows.

The few lines of macro code* shown below are equivalent to more than a half million lines of discrete XYZ locations for a parabolic optical surface with 10” radius. It generates a 3-axis compensated tool path for an axis symmetric concave paraboloid in the form y = a x² (i.e. a surface of a revolution for a parabola about its axis of symmetry). Simple changes to the focus variable allow for paraboloid shape manipulation and changing the sign of the “a” coefficient can produce a convex tool path if required. Compensation calculations are made in the XZ plane using the form z = a x2 with the vertex as origin and rotational transformation is performed in the XY plane via appropriate trigonometric functions for the required angular displacement.

Please see these prior posts for graphic representations: OFFSET or PARALLEL PATH to the PARABOLA – (2d) THREE-DIMENSIONAL COMPENSATION to the PARABOLOID – (3d)

A .00007” ( .0018 mm ) cusp height is established for a 2” ( 50.8 mm ) diameter ball end mill. Thus, a spiraling step over per revolution of .0236” ( .6mm ) is obtained. In order to achieve the smallest possible chordal deviation along the spiraling tool path, the machine least input increment must be used.

The least input increment in inch mode ( G20 ) is .0001” ( .00254 mm ) while the least input increment in metric ( G21 ) is .0005 mm ( .000019685” ).

Using inch mode, the .0236” spiraling step over divided by the least input increment of .0001” produces 236 discrete XYZ locations per one revolution of the spiral path. One revolution or 360° divided by those 236 positions yields a 1.525° angular displacement increment for each discrete point.

However, in metric mode the same .0236” or .6 mm spiraling step over divided by a least input increment of .0005 mm produces 1,200 discrete XYZ locations per revolution. Dividing one revolution by 1,200 gives an angular increment of .300°. The smaller chordal deviation results in a smoother finish, therefore G21 or metric mode is chosen.

Within the macro, Z values are calculated from the incrementing X values ( .6 mm ) in the XZ plane. Compensation for tool diameter ( 50.8 mm ) is calculated from the normal vector to the tangent parabola slope also in the XZ plane. The final discrete XY position values are arrived at by the rotational transformation about the origin or paraboloid vertex from the incrementing ( .3° ) angular displacement in the XY plane. The macro is looped, and the angular displacement is reset to every time 360° is reached. Incremental looping continues until terminated at pre-defined radial displacement.

The tool path starts at the bottom center or vertex of the paraboloid and spirals outward and up. This machining strategy allows chips to fall inward and down, away from the active cutting interface minimizing the possibility of chip re-cutting. A zero surface footage cutting condition at tool center producing unwanted tool/part deflection also is avoided in this scenario. This finishing pass program is designed to provide the best surface finish based on machine tool capability, machining strategy, tool diameter and step over value or chord length. Sample program with macro as follows:

%
O01491(PARABOLIC, METRIC)
N8T8M6(50.8mm 2FL HSS B EM)
G21G40G80G90T2
G187P3
(/M1)
(M8)
/M88
G54M11
G0X0.Y0.M3S3750
G43H1Z50.8M31
G1Z25.4F1.
G65P1492D50.8K312.369(PASS VARIABLES TO MACRO)
G0G28G91Z0.M89
G90Y101.6M9
M30
%

%
O01492 (AXIS SYMMETRIC, CONCAVE PARABOLOID, INTERPOLATION MACRO)
#1=1/[4*#6] (A, COEFFICIENT)
#3=0. (INITIALIZE RADIAL DISPLACEMENT OF PARABOLA X COORDINATE IN XZ PLANE)
#4=.0005 (RADIAL INCREMENT OF X COORDINATE)
#5=0. (INITIALIZE ANGULAR DISPLACMENT OF THETA IN XY PLANE)
#8=.3 (ANGULAR INCREMENT OF THETA IN XY PLANE)
N1#3=#3+#4 (NEXT RADIAL DISPLACEMENT OF X COORDINATE IN XZ PLANE)
#5=#5+#8 (NEXT ANGULAR DISPLACEMENT OF THETA IN XY PLANE)
#23=#1*[#3*#3] (PARABOLA Z COORDINATE IN XZ PLANE)
#24=[COS[#5]]*[#3-[[[#3*#7]*SQRT[[[4*[#6*#6]]+[#3*#3]]]]/[[8*[#6*#6]]+[2*[#3*#3]]]]](COMPENSATED AND ROTATIONALLY TRANSFORMED VALUE OF X – BALL CENTER)
#25=[SIN[#5]]*[#3-[[[#3*#7]*SQRT[[[4*[#6*#6]]+[#3*#3]]]]/[[8*[#6*#6]]+[2*[#3*#3]]]]](COMPENSATED AND ROTATIONALLY TRANSFORMED VALUE OF Y – BALL CENTER)
#26=#23+[[[#6*#7]*SQRT[[[4*[#6*#6]]+[#3*#3]]]]/[[4*[#6*#6]]+[#3*#3]]] (COMPENSATED VALUE OF Z – BALL CENTER)
IF[#5EQ360.]THEN#5=0. (RESET OF THETA IN XY PLANE – ANGULAR DISPLACEMENT TO 0 WHEN 360)
IF[#3GT235.585]GOTO2 (PROG STOP AT MACHINE Y LIMIT)
G1X#24Y#25Z#26 (MACHINE MOVEMENT)
GOTO1 (LOOP)
N2M99 (END PROG)
%

Below are the paraboloid three-dimensional compensation equations used in macro above.

z    = ax2 (xz plane)

a    = coefficient
F    = .25a = focus (focus to vertex)
D    = ball diameter
x    = x coordinate on parabola (in xz plane)
Xc = x compensated, rotationally transformed value (ball center)
Yc = y compensated, rotationally transformed value (ball center)
z    = z coordinate on parabola (in xz plane)
Zc = z compensated, (ball center)
θ    = angular displacement (in xy plane)

Xc = cos θ (x ± (xD / (2√(4F2+x2))

Yc = sin θ (x ± (xD / (2√(4F2+x2))

Zc = z ± (FD / √(4F2+x2))

*For clarity, I chose to remove the following from my original macro: A calculation to compute the ever-changing effective cutter diameter at tangency allowing for continual rpm and feed rate changes in order to achieve a constant surface footage and chip load across the entire surface; A constant for an axis displaced paraboloid; Conditional boundary testing to establish a hexagonal exclusion zone.

Additionally, not used in the macro above but shown here for reference, are the 2D Parabola Offset / Parallel Path Compensation Equations.

y    = ax2 (xy plane)

a    = coefficient
k    = .25a = focus (focus to vertex)
d    = twice the desired parallel or offset amount
x    = x coordinate on parabola
Xc = x offset value
y    = y coordinate on parabola
Yc = y offset value

Xc = x ± (xd / (2√(4k2+x2)))

Yc = y ± (kd / √(4k2+x2))