PART PROGRAMMING
IN CNC MACHINES
CNC PART PROGRAMMING
PART PROGRAMMING USING CAD/CAM
A CAD/CAM system is a computer interactive graphics system equipped
with software to accomplish certain tasks in design and manufacturing
functions. One of the important tasks performed on a CAD/CAM system
is NC part programming. In this method of part programming, portions
of the procedure usually done by the part programmer are instead
done by the computer. The two main tasks of a part programmer in a
computer assisted programming are (a) defining the part geometry and (b)
specifying the tool path. The proposed methodology is used to automate
both of these tasks.
Part geometry definition: The fundamental objective of CAD/CAM
system is to integrate the design engineering and manufacturing
engineering functions. Certainly one of the important design functions is to
design the individual components of the product. If a CAD/CAM system
is used, a computer graphics model of each part is developed by the
designer and stored in the CAD/CAM database. That model contains all of
the geometric, dimensional and material specifications for the part. When
the same CAD/CAM system, or a CAM system that has access to the same
CAD database in which the part model resides, is used to perform NC
part programming it makes little sense to recreate the
geometry of the part during the programming procedure. Instead, the
programmer has the capability to retrieve the part geometry model from
the storage and to use that model to construct the appropriate cutter
path. The significant advantage of using CAD/CAM in this way is that it
eliminates one of the time-consuming steps in computer-assisted part
programming geometry definition. After the part geometry has been
retrieved, the usual procedure is to label the geometric elements that will
be used during part programming. These labels are the variable names
(symbols) given to the lines circles and surfaces that comprise the part.
Most systems have the capacity to automatically label the geometry
elements of the part and to display the labels on the dias.
If the NC programmer does not have access to the data base, then the
NC Programming must be defined. This is done by using similar
interactive graphics techniques that the product designer would use to
design the part. Points are defined in a coordinate system using the
computer graphics system, lines and circles are defined from the points,
surfaces are defined, and so forth, to construct a geometric model of the
part. The advantage of using the interactive graphics system over
conventional computer-assisted part programming is that the
programmer receives immediate visual verification of the definitions being
created. This tends to improve the speed and accuracy of the geometry
definitionprocess.
Tool path generation using CAD/CAM: The second task of the NC
programmer in computer-assisted part programming is tool path
specification. The first step in specifying the tool path is to select the
cutting tool for the operation. Most CAD/CAM systems have tool libraries
that can be called by the programmer to identify what tools are available in
the tool crib. The programmer must decide which of the available tools is
most appropriate for the operation under consideration and specify it for
the tool path. This permits the tool diameter and other dimensions to be
entered automatically for tool offset calculations. If the desired cutting tool
is not available in the library, an appropriate tool can be specified by the
programmer. It then becomes part of the library for future use.
The next step is tool path definition. There are differences in
capabilities of the various CAD/CAM systems, which result in different
approaches for generating the tool path. The most basic approach
involves the use of the interactive graphics system to enter the motion
commands one-by-one, similar to computer-assisted part programming.
Individual statements in APT or other part programming language are
entered and the CAD/CAM system provides an immediate graphic display of
the action resulting from the command, thereby validating the
statement.
A more-advanced approach for generating tool path commands is to
use one of the automatic software modules available on the CAD/CAM
system. These modules have been developed to accomplish a number of
common machining cycles for milling, drilling and turning. They are
subroutines in the NC programming package that cane be called and the
required parameters given to execute the machining cycle.
Computer-Automated part programming:
In the CAD/CAM approach to NC part programming, several aspects of
the procedure are automated. In the future, it should be possible to
automate the complete NC part programming procedure. The proposed
system is an automated system where the input is a geometric model of a
part that bas been defined during product design and the output is a NC
part program. The system possesses sufficient logic and decision-making
capability to accomplish NC part programming for the entire part without
human assistance.
This can most readily be done for certain NC processes that involve
well-defined, relatively medium complex part geometries. Special
algorithms have been developed to process the design data and generate
the NC program.
INTRODUCTION
The proposed CNC module is based on the process sequence made in
the previous module and on the parameters of the features as derived
from the feature recognition module. The CNC code contains the geometry of
the tool path and the motion of the tool specified in a definite syntax as
demanded by the type of controller. The overall tool path generated for
the part is a union of the individual tool paths for each feature/ operation
and combined in a logical sequence. To avoid any collisions, a suitable tool
retraction plane is used.
Each type of operation or feature is associated with a particular
type of path and motion patterns and these are stored in parametric form
and are instanced whenever necessary. Once the tool path is defined it is
only a matter of issuing the motion statements to describe the motion.
These are also standard per feature/operation type and are stored with
the parametric tool path data. The user is also provided with a choice of
selecting process parameters.
The NC code generated in this module is suitable for the FANUC
controllers. Simulation runs are carried out on the CNC machine, for the
sequence of operations, for collision free tool paths and few components
are also produced, to validate the proposed system. The results were
found to be satisfactory.
FUNDAMENTALS OF PROGRAMMING
The CNC machine tool receives the directions for operation through a
CNC program. The program is generated as per the program
manuscript written for the job/operations to be carried out on the CNC
machine. The program is prepared by listing the coordinate values(x, y
and z) of the entire tool paths as suited to machine the complete
component. The coordinate values are prefixed with preparatory codes to
indicate the type of movement required like point-to-point, straight, and
circular, along with coordinate values for tool path generation. Also, the
co-ordinates are suffixed with miscellaneous codes for initiating
spontaneous machine tool functions like start/stop, spindle/coolant,
program/optional stops. In addition to these coded functions the
coordinate values are supplemented with feed rate figures, spindle speed
codes and tool codes, for proper selection of speeds, feeds and required
cutting tools, during a particular operation. All these elements in a line of
information form one meaningful command for the system/machine to
execute, and is called a block of information. A number of such blocks
sequentially written form a program for the particular component.
Part Program:
A part program contains all the information for machining a
component which is given as a input to the control unit. The control unit
provides the control signals at the correct time and in the correct
sequence to the various drive units of the machine.
The input information required is a series of blocks; one operation
requires one block. Within each block there may be different types of
data.
PREPARATION OF PROGRAM
During the preparation of program for any particular component,
some amount of data processing is required in making the mathematical
computations for achieving the dimensional accuracy of the component
produced and in making the logical decisions like coolant on or off,
spindle on CCW or CW etc.
While making the part program for a component, the programmer
first studies the drawing and decide upon the sequence of operations, the
cutting tools, the path of cutter/tool, speeds and feeds at various points,
other necessary information like starting and stopping of machine etc.
The information is entered in a program sheet in a particular format
acceptable by the machine tool-control unit combination. In the proposed
system the programming is done with the help of a computer which
replaces a programmer and performs the above tasks based on some
logics and instructions given to it in the form of a software program.
CODE GENERATION OF THE PART
After the recognition of manufacturing features/operations and
their sequence from the previous module i.e. the feature recognition
module, the output file of the previous module is taken as an input file for
this module. After mapping the features, the algorithms in the proposed
program initiate the corresponding CNC code. Each manufacturing
feature has a pre-structured CNC code. The proposed system reads the
strings in the feature recognition module and their corresponding
coordinate values to select an equivalent code. It is to be noted that the
initial and final commands of CNC code (called the Head and tail of the
program) remains same irrespective of the component to be produced
(commands like G21, G40, G28, M05, M30). Hence, the proposed system
generates the CNC code by taking this fact in to consideration. Thus, the
body of the code is part specific and changes as per the component. The
important feature of this module is that, the user can check the
generated CNC code and can make any alterations if required. The edited
output file can be given as an input to the CNC machine tool, the
simulations runs are to be made to assure an error free program. If the
simulations runs are satisfactory the component may be produced.
The main challenge in the process of CNC code generation is the
process of converting the coordinate values of the component (expressed
in terms of X and Y) to their equivalent terms in the CNC code. For
instance, in the feature recognition module the coordinate values of the
features are given in terms of X and Y. And the difference of any two
consecutive X ordinate values gives the value of length and that of Y
ordinates gives the value of diameter, where as in the CNC programming
the X ordinate values are to be expressed in terms of Z (length) and Y
ordinate values are to be expressed in terms of X (diameter). Therefore,
the system has to initially transfer all the coordinate values in to their
respective lengths and diameters, suitable for the generation of CNC code.
Thus each of the manufacturing feature details is to be transferred to
their respective points, lengths and diameters.
The coordinate values are rearranged as per the requirements of
the code. For instance, in the feature recognition module the coordinate
values of the features are given in terms of X and Y where as in the CNC
programming the X ordinate values are to be
Another important factor being considered in the generation of the
CNC code is the concept of Reference point. The reference point for
manufacturing feature module represents the right most point on the
outer profile of the component on the axis line or that could be present on
it in case if the component has internal features (for the TEST1
component it is (154.000000, 5.000000). In connection with CNC code
this reference point is to be taken as initial point (0.00000, 0.000000) and
the length and diameters are to be expressed in relation to this reference
point. Hence all the coordinate values from the feature recognition
module need to be expressed in relation to this reference point. And also,
the value of Z (length) is to be converted into negative values as the tool
moves away from this reference point.
And as per the sequence of the processes is considered the
individual codes are placed in an order, to form the final code with a
logical connectivity among them. In doing so the system takes in to
consideration, the initial position to which the tool is to be brought with
fast traverse, for each of the processes. The other basic variables in the
code are speed, feed and depth of cut which may be provided by the user
or they may be selected from the data provided in the system.
CNC SAMPLE CODES:
Given below are some of the CNC codes that are developed as part of
the proposed work. These are given to explain the methodology by which
the codes are generated.
CODE FOR STEP TURNING:
The essential data required for the code generation of step turning
operation, is the length of the step (C) and the reduction in the diameter
of the component (D) for that step whose values are obtained from the
manufacturing feature details provided in the output file of feature
recognition module. The value of the depth of the cut (d.o.c) may be given
by the user and is used to calculate the number of times through which
this operation is to be performed to complete the step. The machine
capabilities are to be taken in to consideration while giving the value of the
depth of cut. The proposed system reads the concerned data from the
output of the previous module and correlates it with process parameters
before it generate the CNC code for that operation.
ODR1 CD
C 154.000000 29.000000 100.000000 29.000000 ((x1, y1) (x2, y2)) D
100.000000 29.000000 100.000000 35.000000 ((x2, y2) (x3, y3))
Reference value 154.000000, 5.000000 (refx, refy)
Let the feed (F), speed (S) and depth of cut (doc) are given by the user.
For this operation CD the required calculations are made as following.
1) Number of cuts n = (y3-y1)/doc
If doc is 2 then, in this case n= (35.000000-29.000000)/2 = 3
2) Starting diameter (initial value of X)= (y3-refy)*2
In this case it is (35.000000-5.00000)*2= 60.000000
3) The length of cut = (x3-refx)
In this case it is (100.000000-154.00000)= -54.000000
4) Final diameter = (y2-refy)*2
In this case it is (29.000000-5.00000)*2= 48.000000
5) Initial position for the tool ((y3-refy)*2+1),((x1-refx)+1)
In this case it is (61.000000, 1.00000) i.e. the tool comes to this
position with fast traverse. And this value is followed by the G00
code.
6) As the number of cuts is three, the initial diameter (60) is
reduced to the final diameter (48) in three steps (56,52,48). And
the same is incorporated in to the CNC code.
The same logic is used to generate the code for the other step
turning operations of the component.
CODE FOR GROOVE ELEMENTS:
There may be different types of groove profiles on the outer
surface of a component. Let us consider the groove element BCD, that is
being present on the given component. In such case, the following data
will be obtained from feature extraction module.
B 112.0000000 29.0000000 112.0000000 27.0000000 ((x1, y1) (x 2, y 2)) C -
112.0000000 27.0000000 106.0000000 27.0000000 ((x2, y2) (x3, y 3)) D
106.0000000 27.0000000 106.0000000 29.0000000 ((x3, y3) (x 4, y 4))
Reference value 154.000000, 5.000000 (refx , refy)
Let the feed (F), speed (S) and depth of cut (doc) be the same as given by
the user.
For this operation BCD the required calculations are made as following.
1) Number of cuts n = (y2-y1)/doc
If doc is 2 then, in this case n= (29.000000-27.000000)/2 = 1
2) Starting diameter (initial value of X)= (y1-refy)*2
In this case it is (29.000000-5.00000)*2= 48.000000
3) The length of cut = (x3-x2)
In this case it is (106.000000-112.00000)= -6.000000
4) Final diameter = (y2-refy)*2
In this case it is (27.000000-5.00000)*2= 44.000000
5) Initial position for the tool ((y1-refy)*2+1),((x1-refx)+1)
Command for Facing operation
Command for plain turning
Command for internal hole
Code for STEP turning
operation (CD) with a
depth of cut of 1mm
Command for groove cutting
Figure1 Sample CNC Part Program
VARIOUS SCREENS GENERATED DURING SIMULATION RUN
Figure4 Screen showing the Step turning operation
Figure3 Screen showing the grooving operation
RESULTS & DISCUSSION
This module is used to generate the automated part program for
the rotary components. The part program for the TEST1 component is
presented in the Figure1 shown above. The same program is being given
as an input for the simulation package and tested for the process
sequence, process parameters and for tool collisions. Upon the
satisfactory results from the simulation runs the program is executed in a
real environment and the component was produced.
The proposed system thus, shows the integration of feature
recognition and CNC code generation for the axi-symmetric rotary parts.
REFERENCES
http://nptel.ac.in/courses/112102103/Module%20F/Module%20F(1)/p1.htm
https://en.wikipedia.org/wiki/Part_program
http://www.brainkart.com/article/Manual--Part-Programming_6402/
http://user.engineering.uiowa.edu/~mie032/support/labs/nc_machining/
https://rdmitnu.files.wordpress.com/2015/04/computer-assisted-part-programming/
https://www.researchgate.net/publication/297676937_Intelligent_CADCAM_system_
for_programming_of_CNC_machine_tools
https://www.researchgate.net/publication/303370721_Study_on_computer_numeric
al_control_CNC_machines
http://www.ijsimm.com/Full_Papers/Fulltext2016/text15-1_109-120.pdf