Académique Documents
Professionnel Documents
Culture Documents
A Thesis
to be submitted by
Masters of Technology
Month Year
Contour machining of free-form surfaces with G-code in real time tool path of computed-
numerical control milling system
Abstruction
Computer numerical control (CNC) technology is a key technology in machine
tools and is also the base of industrial unit computerization. In modern CAM–
based CNC machining work, a part with free–form surfaces is typically generated
as a spline or curve–based solid model in a CAD system, and then passed to a
CAM system (separate from or integrated with the CAD system). G–code
command (G05) is introduced, to concisely communicate the precise surface
geometry and all necessary process parameters to the controller.The PH curve with
G code interpolator offers profound accuracy and efficiency advantages over the
modify to voluminous piecewise–linear/circular tool path approximations as a
preprocessing step. The methodology is verified by machining a variety of free-
forms and using a 3–axis milling machine with the PH curve as G code interpolator
incorporated into an open–architecture CNC controller.
Keywords: CNC machine, CAD 2017/CAM, PH curve, G-code
1.0 Introduction
Computer-Assisted NC part programming is rather tedious and unproductive to
generative NC part programs manually, as demonstrated in the previous section. In
computer automatically generates the codes. The philosophy behind the computer-
assisted programming is rather straightforward to describe.(Altintas, 2012) If a part
geometry can be parametrically defined in a computer code, the tool path can also
be generated for given dimensions of a tool according to the desired sequences of
machining. The programmer must, of course, select tools, feeds, and speeds and
generate the tool paths according to the process planning strategy for the
machining operation.
Since development, CNC machines are operated by International Standards
Organization (ISO) 6983 standard formally known as G codes.(Sinha, 2010) This
ISO standard is based on the representation of the tool path digitized with respect
to a tool size and machine command status. The programs for CNC machines are
generated by computer-aided manufacturing systems that utilize CAD information.
The G codes language is defined by numerical codes such as G, T, M, F, S, etc.,
indicating the movement of a machine and an axis to the controller. CNC machines
are composed of many parts. The controller is one of them and has inside two
modules: hardware module and software module. (Shin, Suh, & Stroud, 2007)The
function of the software module is to translate the input code to the internal
structure of the machine. CNC controllers read G code (ISO 6983) instructions,
interpret them, and perform numerically direct interpolation of the cutting tool in
the work piece. Designers generate G code file by using CAD/computer-aided
manufacturing (CAM) applications on computers and transfer the code to machine
controller for interpretation to execute tool motion control operations.(Li, Wang, &
Zhang, 2013) In the G code programming language, machining commands are
composed of characters and numerical values built up into words and blocks. A
‘word’ comprises an address character followed by a numerical value, and a
‘block’ is a collection of words on a single line. A part program contains an
ordered sequence of blocks that describe in detail the motions and ancillary
functions a CNC machine must execute for fabricate a specified part. The part
program is often generated ‘automatically’ by a CAD/CAM system, once the part
geometry has been completely defined.
Freeform surfaces, also called sculptured surfaces, have been widely used in
various engineering applications.(Lasemi, Xue, & Gu, 2010) Freeform surfaces are
primarily manufactured by CNC machining, especially 5-axis CNC machining.
Various methodologies and computer tools have been developed in the past to
improve efficiency and quality of freeform surface machining.
𝑣2 (𝑡)
Are three polynomials satisfying the pythagorean hodograph condition
𝑥 2 (𝑡) + 𝑦 2 (𝑡) = 𝜎 2 (𝑡)
Thus, for example, bernstein-form complex quadratic
𝑊(𝑡) = 𝑊0(1 − 𝑡)2 + 𝑊1 ∗ 2(1 − 𝑡)𝑡+𝑊2𝑡 2
Yields, upon integrating 𝑟(𝑡) = 𝑊 2 (𝑡), the Bezier representation
𝑟(𝑡) = ∑𝑛𝑖=0 𝑝𝑖 𝑏𝑖𝑛 (𝑡) 𝑏𝑖𝑛 (𝑡) = (𝑛 , 𝑖)(1 − 𝑡)𝑛−𝑖 𝑡 𝑖
A planar of PH quintic, with control points
𝑊02
𝑃1 = 𝑃0 +
𝑛
𝑊0 𝑊1
𝑃2 = 𝑃1 +
𝑛
(2𝑊12 +𝑊2 𝑊0 )
𝑃3 = 𝑃2 +
𝑛
𝑊1 𝑊2
𝑃4 = 𝑃3 +
𝑛
𝑊22
𝑃5 = 𝑃4 +
𝑛
Data exchange happens not only between CAD systems, but also between CAD
and CAM packages. A standard data exchange format (intermediate data format)
will reduce the need for multiple translators. When such a data file is used,each
CAD system needs only one preprocessor and one postprocessor (one set of
translators). The preprocessor imports the data into the system, and the
postprocessor outputs the file into standard format. Many CAD data- exchange
formats have been developed by various countries and organizations.the most
widely accepted formats are IGES and STEP both are international standards.
𝐶𝐴𝐷1 ⇒ (𝑝𝑜𝑠𝑡 − 𝑝𝑟𝑜𝑐𝑒𝑠𝑠𝑜𝑟) 𝐼𝐺𝐸𝑆 𝑜𝑟 𝑆𝑇𝐸𝑃 𝑓𝑖𝑙𝑒 ⇒ (𝑝𝑟𝑒 −
𝑝𝑟𝑜𝑐𝑒𝑠𝑠𝑜𝑟) 𝐶𝐴𝐷2
The CAD application interacts with the user through a Graphics User Interface
(GUI), a software package that handles both event -driven activities associated
with input devices and display functions as windows, menus, dialogs, and 2-D and
3-D graphics . the CAD application calls functions in the GUI to accomplish the
I/O and graphics interactions. At the same time, the CAD application handles the
creation,modification, and manipulation of geometric models and the database that
stores the model. Certain basic geometric functions are used in both GUI and CAD
applications. Such functions include, but are not limited to, coordinate
transformations. In the interests of providing a clear understanding of a CAD
system, the basic geometric functions will be discussed first.(“Knowledge
Integration in CAD-CAM Process Chain,” 2015)
All design models are set in a coordinate system. 3-D Cartesian coordinate
system is represented by three axes -X,Y, and Z -arranged in the manner of a right-
hand coordinate system. Any point in the Cartesian coordinate system is
represented by its coordinates (x,y,z). The origin of the coordinate system has
coordinates (0,0,0). A polar coordinate system, by contrast, represents a point by
an angle and a distance.
𝑃𝑖 = [𝑋𝑖 , 𝑌𝑖 , 𝑍𝑖 ]
𝑋 = 𝑙 ∗ 𝑐𝑜𝑠𝛼
𝑌 = 𝑙 ∗ 𝑠𝑖𝑛𝛼
𝑍=𝑧
𝑟(0) = 𝑃0
𝑟(1) = 𝑃3
𝑟(0) = 3(𝑃1 − 𝑃0 )
𝑟(1) = 3(𝑃3 − 𝑃2 )
The PH curve can be plotted with the following MATLAB commands:
example:
t=0:0.02:1;
p=[0 4 1 1;0 0 4 -4;0 0 0 ];
A=[2 -3 0 1;-2 3 0 0;1 -2 1 0;1 -1 0 0];
tt=[t.^3;t.^2;t;;ones(size(t))];
r=p*A*tt;
plot(r(1,:),r(2,:));
3.4 Real-time swept surface interpolator
The real–time interpolator in a CNC system computes a reference point (
commanded position) in each controller sampling interval, from a given path
geometry and feed rate. (Nittler & Farouki, 2015; Wang, Liu, & Yu, 2012)The
position error (difference between commanded and actual position, measured by
encoders on the machine axes) is the basic input to the controller. Traditionally,
real–time interpolators were restricted to simple linear (G01) or circular (G02/03)
path segments, but interpolator algorithms for free–from parametric curves are now
more widely available.
A surface interpolator extends this function to a two–dimensional surface.
Consequently, it entails a path planning function, to guarantee a tool path coverage
of the surface that suffices for a desired machined surface accuracy. outlines the
proposed surface interpolator. Compared to traditional CNC machining work flow
it streamlines the overall process, performing most required computations directly
in the controller using the exact surface description. It can also utilize real–time (
position encoder) data, that is not available to off–line path planning
strategies.(Wang et al., 2012) The G05 code has previously been adopted to
communicate PH curve data to a CNC system. In the present context, it is
generalized to incorporate all the information required for a surface interpolator to
machine a rational swept surface generated by PH curves. It employs a specific
path–planning strategy, starting at the surface point (u,v) = (0,0) and following
isoparametric curves in the v direction, with a step–over in the u direction at the
end of each tool path. The entire surface is machined from just a single G05
command, based on a set of machining parameters specified within the G05 block.
The interpolator has been implemented in the Open CNC open–architecture
controller.
( Proposed workflow for the real–time surface interpolator)
G preparatory function
F feedrate type
U, V, W feedrate parameters
RD tool radius
The addresses defining PH curves are carried over from [6], but with S and P
prefixes to identify sweep and profile curves: these curves are defined by their end
points and the polynomials α(ξ),β(ξ) in (2). This data allows all relevant curve
information, such as the parametric speed and arc length polynomials, to be
determined [3]. All the non–PH curve data is consolidated in a single block,
followed by the sweep curve and profile curve blocks. This yields a compact data
structure defining the exact swept surface and relevant machining instructions. As
an example, the following G05 command6 is for a generalized conical sweep
(which requires the additional CI, CF parameters).(Lin, Fu, Shen, & Gan, 2014)
example:
G05, SF05,CI1.0,CF0.5,U30.0,RD0.25,OF0,US0.0005,SH5,SX-1.5,SY-
1.5,SZ0,SA0,SB-0.53 SC-
1.190,SP1.684,SQ1.291,SR1.190,PH5,PX0,PY3.0,PZ1.5,PA-1.190,PB-1.291,PC-
1.684,PP-1.190,PQ-0.534,PR0;
4.0 Conclusion
Despite great advances in machine tool, controller, and CAM technology, the
prevailing methodology for translating precise parametric surface geometry into
motion commands remains primitive and cumbersome. Although data– intensive
G–code tool path approximations have the advantage of universal applicability,
and efforts have been made to mitigate their shortcomings in both CAM and
controller algorithms, they continue to impose fundamental accuracy and efficiency
limitations in precision machining of complex shapes. A methodology was
proposed to circumvent the shortcomings of G–code part programs, in the context
of a versatile family of rational swept surfaces. Using Pythagorean–hodograph
sweep curves, the variety of sweep operations ensuring a swept surface exactly
compatible with prevailing CAD geometry representations is vastly expanded. The
method is based on passing the exact surface geometry to the controller,
encapsulated in a high–level procedural sweep definition. The controller can then
efficiently perform all the required geometrical calculations in real time, including
tool path generation subject to a prescribed scallop height. The methodology has
been codified in a novel G05 command format, and its feasibility has been
demonstrated through the machining of a representative family of swept surfaces
using an open– architecture controller. Whereas a typical G05 part program uses
just a few lines to exactly specify a machining operation, the equivalent
approximate G01 part program may require tens or hundreds of thousands of
blocks. Many advantageous aspects of the swept surface machining methodology
deserve further study. These include the exploitation of tool paths specified by
cutter contact (CC) rather than cutter location (CL) data, the use of exact real–time
surface normal data to accommodate CC–CL offset compensations for different
tool geometries, suppression of material removal rate fluctuations through variable
feed rates, and the utilization of multi–patch rational swept surfaces as a basic tool
in mold and die design applications.
References
Vision System and a Coordinate Measuring Machine for the Reverse Engineering of
263–271.
Farouki, R. T., Manjunathaiah, J., & Jee, S. (1998). DESIGN OF RATIONAL CAM PROFILES
33(6), 669–682.
Farouki, R. T., Manjunathaiah, J., & Yuan, G.-F. (1999). G codes for the specification of
CNC machines. International Journal of Machine Tools & Manufacture, 39(1), 123–142.
Farouki, R. T., & Shah, S. (1996). Real-time CNC interpolators for Pythagorean-hodograph
Guo, X., Liu, Y., Du, D., Yamazaki, K., & Fujishima, M. (2011). A universal NC program
processor design and prototype implementation for CNC systems. International Journal of
Jee, S., & Lee, J. (2012). Real-time inertia compensation for multi-axis CNC machine tools.
https://doi.org/10.14733/cadconfp.2015.449-454
Konishi, K., Fukuda, Y., & Iwata, K. (2001). Development of CAM System for 5-Axis
Controlled Machine Tool Using NURBS Interpolation. Transactions of the Japan Society of
Koren, Y. (1976). Interpolator for a Computer Numerical Control System. IEEE Transactions on
Lasemi, A., Xue, D., & Gu, P. (2010). Recent development in CNC machining of freeform
654.
Li, J., Wang, F., & Zhang, H. (2013). Design and Implementation of Programmable Sequence
Applications. https://doi.org/10.1109/csa.2013.181
Lin, Z., Fu, J., Shen, H., & Gan, W. (2014). A generic uniform scallop tool path generation
Nittler, K. M., & Farouki, R. T. (2015). A real-time surface interpolator methodology for
Norton, R. L. (2009). Cam Design and Manufacturing Handbook. Industrial Press Inc.
Sata, T., Kimura, F., Okada, N., & Hosaka, M. (1981). A New Method of NC Interpolation for
Shin, S.-J., Suh, S.-H., & Stroud, I. (2007). Reincarnation of G-code based part programs into
STEP-NC for turning applications. Computer-Aided Design and Applications, 39(1), 1–16.
Shpitalni, M., Koren, Y., & Lo, C. C. (1994). Realtime curve interpolators. Computer-Aided
Design and Applications, 26(11), 832–838.
Sinha, S. K. (2010). CNC Programming Using Fanuc Custom Macro B. McGraw Hill
Professional.
Šír, Z., & Jüttler, B. (2007). C^2 Hermite interpolation by Pythagorean Hodograph space curves.
Takizawa, K., & Beaucamp, A. (2017). Comparison of tool feed influence in CNC polishing
between a novel circular-random path and other pseudo-random paths. Optics Express,
25(19), 22411–22424.
Wang, Y., Liu, H., & Yu, S. (2012). Curvature-Based Real-Time NURBS Surface Interpolator
Yang, D. C. H., & Kong, T. (1994). Parametric interpolator versus linear interpolator for
Yue, C. X., Yan, F. G., Li, L. B., You, H. Y., & Yu, Q. J. (2014). Parametric Design of Ball-End
Milling Tools for High Speed Milling. Materials Science Forum, 800-801, 484–488.
Yusof, Y., & Latif, K. (2015). A novel ISO 6983 interpreter for open architecture CNC systems.
Zhang, K., Yuan, C.-M., Gao, X.-S., & Li, H. (2012). A greedy algorithm for feedrate planning
of CNC machines along curved tool paths with confined jerk. Robotics and Computer-
Zhao, H., Zhu, L., & Ding, H. (2013). A parametric interpolator with minimal feed fluctuation
for CNC machine tools using arc-length compensation and feedback correction.