You are on page 1of 17

INSTITUSI TEKNIKAL JEPUN MALAYSIA

JABATAN TENAGA MANUSIA


KEMENTERIAN SUMBER MANUSIA
MALAYSIA

KERTAS PENERANGAN
INSTITUT TEKNIKAL JEPUN MALAYSIA
J14 DIPLOMA IN MANUFACTURING ENGINEERING TECHNOLOGY
KOD DAN NAMA
KURSUS
J15 DIPLOMA IN PRECISION MACHINING ENGINEERING TECHNOLOGY
KOD DAN NAMA
DPB1302 / DJB1302 NUMERICAL CONTROL PROGRAMMING
MODUL
PENGALAMAN
6.0 CNC MILLING PROGRAM
PEMBELAJARAN
NO. TUGASAN NONE
BERKAITAN

UPON COMPLETION OF THIS TOPIC, STUDENTS SHOULD BE ABLE TO:


1. Describe the function of Address O, N, T, S, and F.
2. Explain the function of Preparatory Function (G-Function)
3. Explain the function of Miscellaneous Function (M-Function)
TUJUAN
PEMBELAJARAN 4. Describe the Establishment of Work Coordinate System (G54 to G59)
5. Calculate Feed rate and Spindle speed

Upon completion of this course students should be able to :

Describe the history development, advantages and


CLO 1
disadvantages of CNC Machine

CLO 2 Describe the mechanism and controlled of CNC Machine


OBJEKTIF
PEMBELAJARAN Describe the various types and production system utilization of
CLO 3
CNC Machine

CLO 4 Write the CNC programming for Lathe and Milling

CLO 5 Write the CNC programming for Macro Program


In this topic, the programming for the machining centers or CNC Milling machine
explained. When making a program, it is important to try so that the program will be made
in the same configuration, no matter when and where it is made and no matter who makes
it. Fig. 6-1 shows an example of the program configuration. In this example, the program
configuration has been patternized so that the program can be made by just rewriting
underlined data depending on the machining condition.
In this topic, various functions and their commanding methods required for the program are
explained. It is necessary to be able to utilize them in the configuration of the whole
program as shown by the example in the figure.

Fig. 6-1 Example of program

6-1 Program Number


The program number is commanded at the head of the program so that the program registered
in the NC unit can be easily identified. As shown in Fig. 6-2, the program number is commanded
with a numerical value of 4 digits or less following the address 0 (0 can not be used.) in a
single block (Refer to the example of program1)

Following the command of the program number, it is possible to command the program name by
parenthesizing it like the example of program 2. When the program number is not commanded,
the first sequence number of the program is used as the program number. The program starts
with the program number and ends with the end of program (M02 or M30) as the example of
program 3.
Fig. 6-2 Commanding method of program number

6-2 Sequence Number


The sequence number is commanded at the head of a block in order to classify or identify the
block. As shown in Fig. 6-3, the sequence number is commanded with a numerical value of 5
digits or less following the address N. (0 can not be used.) (Refer to the example of program 1).

The sequence number can also be commanded for only a particular block, though it can be
commanded for each block. In addition, the number may not be in order. (Refer to the example
of program 2). In general, the sequence number is commanded with a consecutive number
according to the process sequence, the example of program 3. As in the case of the program
number, it is also possible to command the process name by parenthesizing if following the
sequence number.
Fig. 6-3 Commanding method of sequence number

6-3 Preparatory Function (G-Function)


The preparatory function is also called G-function (hereinafter referred to as Gfunction), and
commands functions shown in Table 6-1, such as linear and circular interpolation function, tool
length and tool diameter compensation function, and fixed cycle function, with a numerical value
of 2 digits following the address G.

The G-functions marked with in the table are functions which show the condition of their G
functions when the power source is switched on or after the machine is reset. This condition is
the initial condition of the NC unit. The block in the example of program configuration 3is for
presetting the initial condition of the NC unit on the program as shown in Fig. 6-4 when
executing the subsequent programs.
Fig. 6-4 Setting of initial condition

The G-functions can be classified into the following two types according to their operations.

1. One-shot G-function - G-function which is significant for only the commanded block

2. Modal 0-function - G-function which remains effective until another 0-function in the
same group is commanded.

In Table 6-1, the G-functions in the 00 group are the one-shot 0-functions, and those in groups
other than the 00 group are the modal G-functions. When a modal 0-function is commanded, the
command for the 0-function in every block can be omitted until another 0-function in the same
group is commanded.

In addition, multiple 0-functions can be commanded in the same block if they are from different
groups as shown in Fig. 6-4. If multiple 0-functions in the same group are commanded in the
same block, the 0-function which is commanded last becomes effective. Table 6-1 shows the
extracted major 0-functions (FANUC-1 IM). There are many 0-functions besides the above. For
the 0-functions which are not shown in the table, refer to the instruction manual of the machine
or the NC unit.
Table 6-1 Kinds and semantics of G-function

6-4 Miscellaneous Function (M-Function)


The miscellaneous function is also called M-function (hereinafter referred to as M-function), and
commands the start/stop of the main spindle rotation, the ON/OFF control of coolant, etc. shown
in Table 6-2, with a numerical value of 2 digits following the address M . The M-functions can
be classified into the following three types according to their operations.

1) M-function which starts to work simultaneously with the movement of the axis in the block
(Win the table)
(Example) M03 The main spindle starts to rotate in the forward direction simultaneously
with the movement of the axis.
2) M-function which starts to work after the movement of the axis in the block is completed (A
in the table)
(Example) M05 The rotation of the main spindle stops after the movement of the axis.
3) M-function which commands independently to the block (S in the table)
(Example) M57 The tool registration model is set. M57 remains effective until the
registration mode is cancelled by M02 or M30.

The M-function in the program generally commands with such a configuration as shown in Fig.
6-5. The M-function can only command one block. If the M-function commands two or more
blocks, the M function which is commanded latest becomes effective. Table 6-2 shows the
extracted major M functions. There are many M functions besides the above. For the M-
functions which are not shown in the table, refer to the instruction manual of the machine or the
NC unit.

Fig. 6-5 Commands of M-function

Table 6-2 Kinds and semantics of M-function


6-5 Plane Designation (G17, G18, G19)
The plane designation is a function which selects a surface to be machined. When circular
interpolation, drilling, tool diameter compensation, etc. are performed, it is necessary to select
either one of the planes which are formed by XY, ZX, and YZ.
In the plane designation, either one of the G-function shown below (G17, 018, and 019) is
commanded to select a surface to be machined.
1. G17 : Designation of XY-plane [Fig. 3-6 (a)]
2.G18 : Designation of ZX-plane [Fig. 3-6 (b)]
3.G19 : Designation of YZ-plane [Fig. 3-6 (c)]

Fig. 6-6 Formation of the surface to be machined

The XY-plane is a plane looking from the plus side of the Z-axis, the ZX-plane is a plane looking
from the plus side of the Y-axis, and the YZ-plane is a plane looking from the plus side of the X-
axis. In the case of the ZX-plane, workpieces are mounted / removed and the machine is
operated on the minus side of the Y-axis frequently. Therefore, it is necessary to take care not to
mistake the plus direction for the minus direction and vice versa. The movement command has
no relation to the plane designation. For example, when G17GO1Z; is commanded, the Z-axis
moves as commanded, irrespective of XY plane of G17.

6-6 Incremental Command (G91) and Absolute Command (G90)


As described in Chapter 2, there are two commanding method in the movement command; i.e.
incremental command and absolute command. The incremental command commands the
amount of movement from the start point (present tool position) to the end point (commanded
position) following G91 as shown in Fig. 6-7, and the direction of the movement. The absolute
command, on the other hand, commands the coordinate value at the end point (commanded
position) in the preset coordinate system, as shown in Fig. 6-8.

Fig. 6-7 Incremental command

Fig. 6-8 Absolute command

Fig. 6-9 Example of program of G91 Fig. 6-10 Example of program of G90

Fig. 6-11 Configuration of G90 and G91


Figs. 6-9 and 6-10 show examples of the program according to each commanding method. As
these examples of the program show, a commanding method of the movement command can be
freely selected by G91 or G90. However, compared with the incremental command, the
modification of the program due to a change of the tool path, etc. can more easily be made with
the absolute command. Therefore, an approach is take in which the principal movement
command is given by the absolute command and the absolute command is changed over to the
incremental command depending on the requirement.
Fig. 6-11 shows an example of the configuration on the 091 and G90 program.

6-7 Establishment of Work Coordinate System (G54 to G59)


The work coordinate system is a coordinate system which is established with the machining
reference of the workpiece as the origin. By the commands of G54 to G59, up to six coordinate
systems can be established.

Fig. 6-12 Establishment of work coordinate system

Fig. 6-13 Work coordinate system (G54) Fig. 6-14 Multiple coordinate systems
in work coordinate system

Generally, the work coordinate system is established by commanding G54 as shown in Fig. 6-
13. After the work coordinate system is established, the movement command is given by the
absolute command (G90) in the selected work coordinate system as shown in Fig. 6-13. In a
program which takes multiple coordinate systems, work coordinate systems are selected and
commanded as required, as shown in Figs. 6-14 and 6-15.
Fig. 6-15 Example of program configuration using work coordinate system

6-8 Tool Function (T-Function)


The tool function is also called T-function (hereinafter referred to as T-function), and is a function
which calls a tool to the tool change position of the ATC magazine. As Fig. 6-16 shows, the T-
function gives a command with a numerical value of 2 digits following the address T. A two-digit
numerical value following the address T is called tool number. The tool numbers from 01 to 99
can be used. The tool number is generally commanded from 01 in turn according to the using
sequence of the tools. Fig. 3-17 shows an example of the commands of the T-function in a
program. 00 is commanded when the tool function is cancelled. Tool calling work by the T-
function is made by registering the tool number, which corresponds to the pot number of the ATC
magazine where the tool is inserted, in the NC device.

Fig. 6-16 Commanding method of tool function


Fig. 6-17 Commands of T-function

6-9 Spindle Speed Function (S-Function)


The spindle speed function is also called S-function (hereinafter referred to as S-function), and is
a function which sets the main spindle speed (min). As shown in Fig. 6-18, the 5-funciton
directly commands the main spindle speed with a numerical value of 4 digits or less following the
address S.

Fig. 6-18 Commanding method of S-function

The lower limit (minimum speed of the spindle) and the upper limit (maximum speed of the main
spindle) of the main spindle speed that can be commanded by the 5-funciton vary with
machines. In this textbook, 10 to 3500 mm -1 is assumed to be the range of the main spindle
speed that can be set. In general, the main spindle speed has a low speed range and a high
speed range, and the changeover of the speed range is done automatically by a low speed
range and a high speed range, and the changeover of the speed range is done automatically by
a machine. In this case, in order to change the main spindle speed while the main spindle is
being turned in a different speed range, the rotation of the main spindle is stopped once, and
then the speed range is changed to set new main spindle speed. The main spindle (mm-1) is
determined by the following formula, using the cutting speed (m/mm) of the tool which cuts a
workpiece.

[Example of calculation]
When a workpiece is cut with a 125 mm dia. milling cutter at a cutting speed of 90 m/mm, the
main spindle speed can be determined as follows.

Consequently, the main spindle speed is 230 (mm -1 ) and the command of the S-function is
S230. The cutting speed depends on the material of a workpiece, type of tool, machining
accuracy, etc. For reference, the standards for the cutting conditions are shown in Appendix 1.

6-10 Feed Function (F-Function)


The feed function is also called F-function (hereinafter referred to as F-function), and is a
function which sets the feed speeds of the table, saddle, and spindle head when the workpiece
is cut. As Fig. 6-19 shows, the F-function commands the fees speed (mm/min) following the
address F.

Fig. 6-19 Commanding method of F-function


In addition to the F direct command which commands the feed speed directly as shown the
above, the F-function also has the F one-digit command. In the F one-digit command, when a
numerical value of one digit from 1 to 9 is commanded following the address F, the feed speed
corresponding to the number can be selected. The F one-digit command is used when the
material of a tool to be used or a workpiece is not known and the feed speed can not be
determined when making a program. In the F-function, the input of a decimal point for the feed
speed is required for a command which is e based on the unit of inch and for the lead command
for threading. However, numerical values below the decimal point are not required for ordinary
cutting feeds. For this reason, the F-function can give a command without using a decimal point,
as shown in the example of program.

(Example of calculation)
When a workpiece is cut with an eight-bladed face milling cutter at a feed per blade of 0.25 mm,
the feed speed is to be determined. In this case, the main spindle speed is assumed to be 300
mm -.

Consequently, the feed speed is 600 mm/mm and the command of the feed function is F600.
The feed per blade varies depending on the material of a workpiece, type of tool, machining
accuracy, etc. For reference, yardsticks of the feed per blade are shown in the Appendix 1.
Question:
1. Complete the following table by referring to the example of entry.
Table 6-3

2. Command the tool path shown in the figure with G90 and G91.

Fig. 3-20 Tool path Table 3-4

3. Determine the data of the S-function and the F-function of the tools shown below, by referring
to the table cutting conditions in Appendix 1 . In this case, the material of the workpiece is
assumed to be S35C.

a . Rough cutting with a 25 dia. end mill (High-speed steel, 2 blades)


S (Calculation formula)
F
b . Rough cutting with a 1 50 dia. face milling cutter (Cemented carbide, 6 blades)
S .(Calculation formula)
F
c. Drilling with a 12 dia. drill (High-speed steel)
S .(Calculation formula)
F .............
APPENDIXES
Appendix 1 Table of Cutting Conditions

Annexed table 1 Table of Cutting Conditions

(Note) Cutting conditions vary according to various kinds of factors such as the
size of the tool diameter, the rigidity and setting method of a workpiece and
machining accuracy. Values in the above table can be used as yardsticks of cutting
conditions.

You might also like