5.2
METHODS OF PART PROGRAMMING
There are two methods of part programming, namely
1, Manual part programming
2. Computer Aided Part Programming
eee
MANUAL PART PROGRAMMING
The process of generating part programs manually by a part programmer is
known as Manual Part Programming.
This technique is widely used for work pieces of simple geometry. To prepare a part
programme using manual method, the programmer writes machining instructions
on a special form called Manuscript. The manuscript is a listing of the relative tool
and workpiece locations. It also includes other data, such as, preparatory commands,
miscellaneous functions, and speed ‘feed specifications. These will be written by him
ina coded form called Program Manuscript. This would be punched on a paper
tape and the tape will be fed into the tape reader of the machine controller.
Steps involved in manual part programming are shown in Fig 5.3
Programmer
Fig $.3 ; Manual Part Programming
T
+ The organisation of words within a block is called Program
but collection of words. There are three types of program
Scanned with CamScannerScanned with CamScannerunit to execute the instructions that are
represented by two digits preceded by G ie, Goo.
used to prepare the controller for linear §
functions (G-Codes) are given in the follo
Code
G00
Go
Go
Go
Goa
Gos
G7
Gis
to follow. The preparatory function is
G99. For example GOI is
Interpolation, some of the preparatory
wing table.
_ Table 8.1: Preparatory Functions (G Codes)
_____Punetion
i lit iis ke a
lockwise) 4
2 ee
Circular interpolation (Anti clockwise)
Dwell £57 i= ¥en
eee,
4
Tal
XY plane designation +
__ Thread cutting
_ Cutter compensation-control
Cutter compensation-left
Cutter compensation-right
Thread cutting eycle
Dimensioning in inch units
Dimensioning in nietric units
Canned cycle-cancel
Canned cycles
Scanned with CamScannerScanned with CamScannercutting tools available for use on CNC machining centers, it is unlikely that any two
tools used in a program will be exactly the same length. And you will not know
precisely how long each tool will be when you write the program. The figure below
shows three different types of cutting tools to illustrate this point. Tool length
» compensation will allow you to write programs even though you don't know how
long the cutting tools will be at production time.
When a tool is fixed in the spindle, its coordinate values are programmed according
to its length. If the tool is replaced by another tool, say 20 mm shorter in length,
and then the tool movement would be 20 mm less along the Z-axis if same
programmed values are used. So, the alternative is to modify the program every
time the tool is changed. In NC practice, all tools being used are measured and the
difference in length with respect to previous tool is stored with the associated tool
number, whenever these tools are called into action by programmed instruction,
the respective compensation values are activated and automatically taken into
account in tool motion. This phenomenon is called Tool Length Compensation.
Fig, 5.5 illustrates the tool length compensation.
[
Scanned with CamScanner1. If the actual tool length is more than the assumed tool (during programming), the
difference should be mentioned as follows
G43 TO1
Where G43 - specifies code for tool length compensation
TO1- Specifies code for tool selection in which 01 specifies the address where the
difference of tool length will be mentioned
iS
. If the actual length is less than the assumed tool, the difference should be mentioned
as follows
G44 TOL
Where G44 - Specifies code for tool length compensation
TO1 - Specifies code for tool selection in which 01 specifies the address
where the difference of tool length will be mentioned
The following program example explains how tool length compensation taken care
of for the tools shown in Fig.3.11. Tool number 2 is assumed tool during
programming. Tool numbers 1 and 3 are actual tools that are to be used after tool
number 2 during machining. Tool numbers 1 and 3 are shorter than assumed tool,
so, in the program G44 code is used.
ae E
Scanned with CamScannerTOOL NOSE RADIUS COMPENSATION
When programming a CNC machine with a turning tool that has a rounded tip,
errors in cutting can occur on tapered edges and circular contours. This is corrected
automatically by using a Tool Nose Radius (TNR) compensation command in a
CNC control. Too! nose radius compensation is required for generating accurate
profiles. The code G41 is used for tool nose radius compensation to the left of
programmed path. The code G42 is used for TNR to the right of the programmed
path. G40 is used for tool nose radius compensation cancel. Fig. 5.6 illustrates tool
nose radius compensation.
G41 (the workpicee
is on the left side)
Workpiece
G41 (the workpiece
is on the left side)
Fig 5.6 : Illustration of Tool Nose Radius Compensation
5.3
WRITING A PART PROGRAMME
first instruction in any part programme is to inform the control system about
set-up conditions for doing machining. The first block of instructions
the following :
Scanned with CamScannerThe first block of instruction will be as follows
"NOOO1 G90 G70 G94 M03 S800 EOB
Each block is terminated by typing end of block (EOB) character.
PART PROGRAM FOR CNC LATHE OPERATIONS
In case of CNC lathe operations, only two axes (x-axis and Z-axis) are involved
The Z-axis is the axis of the spindle and x-axis is the direction of transverse motion
of the tool post. To write CNC part programme for lathe operations the following
procedure is adopted.
(i) Move the cutting tool to a point near the job in a rapid mode (G00)
(ii) Set linear interpolation (G01) and move to the required depth of cut in
X-direction.
(ili) Move along Z-axis to the required length of the job as per drawing.
(iv) Set rapid mode (G00) and retract the tool along X-axis.
(v) Move to start point in GOO mode.
PART PROGRAM EXAMPLES:
EXAMPLE 5.1
Write the part program to make the component as shown in Fig. 5.7. The bar
stock available is 40 mm dia. rod.
omg S7:
no Th to matin o aCy
(i) Facing operatior
(i) To reduce the dia of the bar from 40 mm to 36
tO mm.
The part programme for the component shown in Fi 5.7
in Fig,
NOO10
N0020
N0030
N0040
0050
‘N0060
‘NO0070,
‘NO0080
NO090
NO100
GTi G90
TO! F200
GOO X22.00
GOO x0
Gol ZO
X40.00
Z~ 80.00
G00 X42.00
G94 EOB
M03 S800
Z1.00 EOB
EOB
EOB
EOB
EOB
EOB
EOB
EOB
Got0Z=20)
EOB (Tool No.1, feed rate 200 m/min speed 800 rpm)
(In rapid mode, move to X = 22, Z = 1)
(Move to X = 0, Z remaining constant)
(Go to Z = 0 in G01 mode)
(Move to X = 40 in G01 mode. This is facing
operation)
(Move to Z =~ 80 in GO1 mode. This is a dummy
cut parallel to the axis of the job)
(With draw the tool to X = 42. So that when the
tool is taken back to Z = 0, it does not leave a
scratch mark on the job)
(Move in rapid to Z = 0)
(Move to X=36 in GOI mode. It givesa depth of ut of
2mm)
(Move to Z =~ 80 to do turning operation)
(Withdraw the tool to x = 42 in rapid movement)
Scanned with CamScannerScanned with CamScannerIn CNC machines depth of cut is limited like conventional machines. So
the material is removed in number of cuts. Each time the tool is fed against
work piece 2 to 3 mm for rough cut and 0.75 mm to 1 mm for finished cut
and turning is done upto the desired length. The tool is taken back to the
starting position and the cycle is repeated.
Consider the job shown in Fig. 5.9 where the diameter is to be reduced to 30
mm from 40 mm, the maximum depth of cut being limited to 3 mm.
ANSWER :
The part of programme for the component shown in Fig. 5.9 is given below
NOL G9 G71 G94 FS00 $1000 TO! EOB
G00 X41.00 21.00 M03 EOB
GOI Z-30.00 EOB
Noz
NB GO! X37.00 EOB
NOt
G00 X41.00 21.00 BOBScanned with CamScannerCNC
ANSWER:
'N0060
‘NoO80
G71. G90G94 EOB
‘TO1 M03 S800 EOB
G00 X100.00Z1.0EOB
GO1 X80.00 Z0.00 EOB
G02.X100Z-30 150.00 J0.00 EOB
(I: Distance from are start point to arc centre point in X-axis
(J: Distance from are start point to arc centre point in Z-axis)
G01Z-120E0B
M02 EOB
CNC program example for Circular Interpolation (CW & CCW).
—
Scanned with CamScannerANSWER :
N0O10 G71 G90 G94 EOB
N0020 TOI M03 S800 EOB
N0030 G00 X35.00 21.00 EOB
N0040 G01 Z-20.00 EOB
N00S0 G02 X67.00 Z-36.00 116.00 J0.00 EOB
NO0060 G01 X68.00 EOB
N0070 G03 X100.00 Z-52,00 10.00 J0.00 EOB
NO0080 GOI Z-82,00 EOB
N0090 GOO X150.00 250.00 EOB
No100 M02 EOB
mms .4
SUBROUTINES
The subroutines which are also called as Sub Programmes, provide the capability
of programming certain fixed or frequently repeated operations. Subroutines are
stored in the memory under separate programme numbers. Whenever a particular
feature is required within the programme, the associated subroutine is called for
execution. The subroutines may be called anytime and repeated any number of
times. After execution of subroutine the control return to the main programme
Subroutine is represented in the form of codes and symbols.
Ex: L ~ 221 (Start of subroutine no. 221)
bi M — 17(End of subroutine)
‘subroutine can be called anywhere in the main Programme by just subroutine
eceded by letter L.which change are specified by symbols like * or num
ibers like #1, #2...
program, in the instruction to calll the required subroutine, the value of the parametres
are specified in the order in which they appear in the subroutine. The followin
example shows the use of macros. s
Examples :
- In the main
Main program Macro.
: 1010
NO10 G01 X60.00 F1000
N020 G91 X#1
N030 Y#2
N040 X# -3
N0S0 Y#-4
M98 P1010 L2; 40.00; 50.00
40.00; 50.00
In the main program M98 P1010 L2, M98 specifies miscellaneous function 98 call
for subroutine, the number after P refer macro (subroutine) being called L2 specifies
number of times called.
Here, the subroutine (Macro) 1010 is called twice and the values of the parametres
9m #1 to #4 would be 40.00, 50.00, 40.00, 50.00 mm respectively.
re of NC system is the facility of canned cycles. These are also called
cycle is defined as a set of instructions, in built or stored in the
m fixed sequence of operations. The canned cycles can be
si ‘command and as such reduce the programming time
for repetitive and commonly used machining
ored under G-code address. G81 to G89 are
d to cancel the canned cycle.
a my
Scanned with CamScanner| Computer Aided Manufacturing Siang,
(i) Canned cycle for turning.
(ii) ‘Canned cycle for threading
(iii) Canned cycle for rough turning
(iv) Canned cycle for finish turning.
Canned Cycle for Turning : In order to machine the component on CNC machine
the depth of cut is limitation, a number of cuts to be given one way of writing the
part program for achieving the required diametre on CNC lathe machine is by
repeating the same steps. Since the same steps are being repeated every time, the
part programme becomes unnecessary lengthy, occupies large computer memory
and the part programmer has to spend more time in writing the part program.
In order to save part programming time and computer memory, canned cycles for
turning are available in the control system, The programmer has to first write an
instruction block to position the cutting tool at the starting point and then call the
fixed cycle for turning as follows :
N5 G81 X-2.00 Z-30.00 F200 EOB
Where,
G81 is the code for the canned turning cycle.
X-2.00 denotes that the depth of cut is 2 mm.
2-30.00 denotes that the length to be machined is 30 mm.
_ 2, Canned Cycle for Thread Cutting : In order to call and use a fixed cycle for
- cutting ‘on a CNC lathe machine, the information is given as follows :Scanned with CamScannerCamp ite Aidee Mean aetna Tata,
5.5
COMPUTER AIDED PART PROGRAMMING
In computer aided part programming the computer generates the part programme
required to machine the component. The process of generating part program
partly by the part programmer and partly by the computer is known as
Computer Aided Part Programming. This is also called as Computer Assisteq
Part Programming. It is normally referred as CAPP.
The part programmer's job in the CAPP is to first define the geometry of the
component from the component drawing. The geometry or shape of the component
is split into simple elements like points, lines, arcs, full circles etc. The geometry of
elements of the component is defined using simple abbreviated English like terms
which are understood by the computer and control system.
From the geometry of the component, the system generates the data required to
machine the component. This data is called Cutter Location Data (CL). The data
does not contain G or M codes. The cutter location data is then post processed in
the computer to translate it into a form which a particular machine control system
can understand.
The post-processing involves addition of G codes, M codes and other machine
dependant information in the required format. The part programme at this stage is
machine dependent and can be used for a specific machine only Fig. 5.14 shows
the computer aided part programming system.
Scanned with CamScannerGMGEED CNC Programming ap
STEPS INVOLVED IN COMPUTER AIDED PART PROGRAMMING
The above mentioned computer aided part programming procedure can be resolved
into following steps :
1. Part Programmer's Responsibility :
(a) Defining the work part geometry.
(b) Stating the sequence of operations to be carried out along the tool path.
2. Computer's Job :
(a) Input Translation : The part programmer enters the program using the APT
or other language. The input translation component converts the coded
instructions contained in the program into computer usable form, preparatory
to further processing.
(b;
Arithmetic Calculations : The arithmetic calculations unit of the system consists
of a comprehensive set of subroutines for solving the mathematics required to
generate the part surface. The arithmetic unit is really the fundamental element
in the part programming package. This unit frees the programmer from the
time-consuming geometry and trigonometry calculations to concentrate on the
workpart processing.
(c) Cutter/tool Offset Computation : The purpose of the cutter offest computation
jis to offese the tool path from the desired part surface by the radius of the
cutter. This means that the part programmer can define the exact part outline
in his geometry statements.
ssor : The final task of the computer inc omputer assisted part
g is to take the general instructions and make them specific to a
fate computer program that has been written
§ machien tool. The output of the
rrect format for the machien on
Scanned with CamScannerADVANTAGES OF COMPUTER AIDED PART PROGRAMMING
The following are the advantages of using computer aided part programming
1. Part programming is considerably simplified.
2. The part programmes generated are accurate and efficient.
3. All arithmetic calculations are done by computer, resulting in saving time and
elimination of errors.
4. The part programming for different machines can be done by a single person,
which can then be post processed for specific machines.
5. If new machines are used, only a post processor may be needed to integrate
the new machines with the existing system.
COMPUTER AIDED PART PROGRAMMING LANGUAGE
In computer aided part programming the geometry of elements of the component
is defined using simple abbreviated english like terms. This is knows as Computer
Aided Part Programming Language. There are a large number of part
programming languages. The most widely used part programming languages are
APT and COMPACT Il.
TYPES OF PART PROGRAMMING LANGUAGES
APT (Automatically Programmed Tools) : APT stands for Automatically
Programmed Tools. This is most widely used programming language. In
n assumed that the work piece remains stationary and
Scanned with CamScanner& Sompeckt + This ts a package available from Manufacturing Data Systems, Inc
(MDSD. The NC language is similar to SPLIT in many of its features. MDSI leases
the Compact-Il system to its users on a time-sharing basis, The part programmer
uses a remote terminal to feed the program into. one ‘of the MDSI computers, which
in tum produces the NC tape,
|. ADAPT (Adaptation of APT) ; Several part programming languages are based
directly on the APT program One of these is ADAPT, which was developed by IBM
under Air Force contract. It was intended to provide many of the features of APT
but to utilize a significantly smaller computer, ADAPT is not as powerful as APT, but
can be used to program for both positioning and contouring jobs.
|. Exapt (Extended Subset of APT) : This was developed in Germany starting around
1964 and is based on the APT language. There are three versions: EXAPT | designed
for positioning (drilling and also straight-cut milling), EXAPT Il designed for turning,
and EXAPT Ill designed for limited contouring operations, One of the important
features of EXAPT is that it attempts to compute optimum feeds and speeds
automatically.
TYPES OF APT PROGRAMME STATEMENTS.
APT : APT stands for Automatically Programmed Tools. This is most widely used
programming language. In programming using APT, it is assumed that the work
Piece remains stationary and the cutting tool does all the moving.
The APT Programme Consists of Four Types of Statements :
(a) Geometric Statements : These are also called definition statements. These
are used to define the geometric elements like point, circle, arc, plane ete.
"Motion Statements: The motion statements are used to define the cutterScanned with CamScannerINTOL (Inside tolerance)
OUTTOL (Outside tolerance)
CLPRNT (Print cutter location data)
85.6
APT PROGRAM FOR A SIMPLE DRILLING JOB
Write the APT program for drilling 3 holes for the aluminium component given below.
k—— ns —_
|
|
Fig 5.15:
The drill will be operated at a feed of
0.05 mm/rev and a spindle speed of
1000 rev/min (corresponding to a
surface speed of about 0.37 m/sec,
which is slow for the aluminium work
material). At the beginning of the job,
the drill point will be positioned at a
target point located at x = 9, 9 = ~
50, and z = + 10 (axis units are
millimeters). The program begins with
ol positioned at this target point.
| SAMPLE PART DRILLING OPERATIONScanned with CamScannerEXAMPLE PART PROGRAMME FOR MILLING
Consider th i
ah eee shown in Fig. 5.17 (a). It is assumed that the component
pote e ra cut to rough shape and it is required to write a part programme
fi
ly is cut. The APT programme for this component is given below. The
cutter path is shown in Fig. 5.17 (b)
-— 109 —__
-— 0
a)
Fig 5.17:
PART NO/SAMPLE JOB 1
MACHINE/MILLING 1
CLPRNT
PO = POINT / 0, - 20.0, 0
P1=POINT/0, 0,0
P2 = POINT / 150.0, 0, 0
Scanned with CamScannerU3 = UNE / P3, P4
L4= UNE / Pa, PS
LS = LINE / PS, PG.
LS = UNE / P6, P7
U7 = LINE /P7, PB
U8 = LINE / P8, Ps
PL1 = PLANE / 0, 0, ~20.0, 150.0, 0, -20.0, 0, 100.0, -20.0
CUTTER / 10.0
SPINDLE / 580
FEDRAT/ 80
COOLNT/ON
FROM / PO
GO/TO, L4 TO, PL, TO, LB
GO RGT/L1, PAST, L2
GOUP / L2, PAST, L3
GOLFT/L3, TO, La
GODOWN / L6, TO, L7
GOLFT/L7, PAST, L8
GODOWN / L8, PAST, Lt
‘will be positioned so that its center tip
0, y = ~ 50, and z = + 10. The program
‘em ta
aie :Fig 5.1
PARTNO SAMPLE PART MILLING OPERATION
MACHIN/MILLING,OS
CLPRNT
UNITSIMM
CUTTER/20.0
REMARK Part geometry, Points and Lines
are defined 25 mm below part top surface
PTARG = POINT/O, -50.0, 10.0
P14 = POINT/O, 0, - 25.0
P2 = POINT/160.0, 0 - 25.0
_ P3 = POINT/160.0, 60.0, ~ 25.0
Scanned with CamScanner_.____ a ammeparaeraer a,
PL1 = PLANEIP1, P2, pq
REMARK Milling cutter motion statements
FROMIPTARG,
‘SPINDL/1000, CLw
FEEDRAT/50, IPM
GOTO, L1, TO PL1, ON, La
GORGTI/L1, PAST, L2
GOLFT/L2, TANTO, C1
GOFWDIC1, PAST, L3
GOFWD/L3, PAST, L4
GOLFTIL4, PAST. L1
RAPID
GOTOPTARG
‘SPINDUOFF
FINI
5.7
ADVANTAGES OF COMPUTER AIDED PART PROGRAMMING OVER MANUAL
PART PROGRAMMING
Scanned with CamScanneram
DIFFERENCES BETWEEN MANUAL PART PROGRAMMING AND COMPUTER
‘AIDED PART PROGRAMMING
‘The following are the differences between manual part programming and computer
aided part programming.
|'S.No. Manual Part Programming Computer Aided Part Programming
1, | Part programs are generated manually _| Part programs are generated partly by the
by a part programmer, part programmer and partly by the computer, |
2._| Itis time consuming process. It is less time consuming process.
3, | Itneeds an expert programmer, It does not need an expert programmer as |
some activities are done by the computer
system. |
4, | Ifa person is expert in programming ‘The part programming for different machines |
in one machine, he will not be able to can be done by a single person, which can
develop part programme for another then be post processed for specific machines.
machines, a |
5, | Arithmetic calculations are done by the | Arithmetic calculations are done by the
part programmer. So errors may be arised. | computer. So errors may be eliminated. |
6. | Part programming is written using Part programming is written using CAPP
Gendinctea ete languages like APT, COMPACT II.
7. | Part program is difficult to understand. | Part programming is simplified.
patents Part programs generated are accurate and
8. | The part programmes g*
- : efficient.
neither accurate nor efficient.
Difficult
program for the components
Programming easier for the components
having complicated features.
Scanned with CamScanner