Sie sind auf Seite 1von 92

MTAB

CNC
MILLING

By

MTAB TECHNOLOGY CENTER PVT (LTD)


# 133, DEVELOPED PLOTS, ELECTRICAL & ELECTRONICS INDUSTRIAL ESTATE, CHENNAI - 600096.
Ph.: ++91-44-43111114, Fax: ++91-44-2434 4826, email: enquiry@mtabtraining.com
Website: www.mtabtraining.com

Page | I

Published by:
MTAB TRAINING CENTRE
Chennai 600 096

4th Edition: 2005


5th Edition: 2007
6th Edition: 2008
7th Edition: 2009
8th Edition: 2011
9th Edition: 2012

Copyright
No part of this publication may be reproduced in any form (including photocopying or
storing in any medium by electronic and whether or not to brief or incidentally to some other
use of this publication), without the prior permission of MTAB, MTAB holds the right to
modify or change any part of the document without notification. The authorized user of this
manual shall acquire no rights in respect of trademarks of other intellectual property rights
referred to herein which are shall remain the property of the owner thereof.

Page | II

Table of Content
PART PROGRAMMING FUNDAMENTALS
1

PART PROGRAMMING GEOMETRY

Pg. No
1

1.1

Coordinate System for a CNC Milling

1.2

Zero points and reference points

1.3

CNC Related Dimensioning

CNC MILLING- PROGRAMMING BUILD-UP

11

2.1

CNC Program Build-up

11

2.2

Part Program Format

12

2.3

Miscellaneous and Preparatory function

13

2.4

Structure of a CNC program

46

PROGRAMMING EXAMPLES

48

3.1

Example # 01: Programming using linear and circular


interpolation

48

3.2

Example # 02: Programming using Sub-Program

50

3.3

Example # 03: Programming for Mirroring Operation

52

3.4

Example # 04: Programming for Circular Pocket Milling


Operation

54

3.5

Example # 05: Programming for Rectangular Pocket Milling


Operation

56

3.6

Example # 06: Programming for Drilling Operation

58

3.7

Example # 07: Programming for Drilling Operation on PCD

60

3.8

Example # 08: Programming for Datum Shift Operation using


G54

62

3.9

Example # 09: Programming for Drilling Operation using


Rotation Command ( G68 )

64

3.10

Example # 10: Programming using Scaling Command ( G51 )

66

Page | III

3.11

Example # 11: Programming for Profile Milling Operation


using ATC option

68

3.12

Example # 12: Programming for Profile Milling Operation using


G41

70

3.13

Example # 13: Programming for Profile Milling Operation using


G42

72

CNC MILLING - MACHINE ROOM EXERCISES

74

4.1

Ex 01: Study of XL MILL CNC Vertical Machining Centre

75

4.2

Ex 02: Study of tool offset procedures for XL MILL CNC


Vertical Machining Centre

77

4.3

Ex 03: Write a manual part program for machining the


component

82

4.4

Ex 04: Write a manual part program for machining the


component

83

4.5

Ex 05: Write a manual part program for machining the


component

84

4.6

Ex 06: Write a manual part program for machining the


component

85

DOS AND DONTS FOR CNC MACHINES

86

Page | IV

CNC Milling
Part Programming Geometry

MTAB

1. Part Programming Geometry


1.1 Coordinate System for a CNC Milling
Machining of a workpiece by a CNC program requires a coordinate system to be
applied to the machine tool. As all machine tools have more than one slide, it is important
that each slide is identified individually. There are three planes in which movement can take
place.
Longitudinal
Vertical
Transverse
Each plane is assigned a letter and is referred to as an axis, i.e.
Axis X
Axis Y
Axis Z
The three axes are identified by upper case X, Y and Z and the direction of movement along
each axis is specified as either PLUS (+) or MINUS (-). The Z axis is always parallel to the
main spindle of the machine. The X axis is always parallel to the work holding surface, and
always at right angles to the Z axis. The Y axis is at right angles to both Z and X axis FIG. 1
shows the Coordinate System for milling work.

FIG. 1 Co-ordinate System for Milling Work


Coordinate system for a CNC Milling

Page | 1

CNC Milling
Part Programming Geometry

MTAB

The coordinate system for designating the axes is the conventional Right Hand Coordinate
System as shown in F1G.2. A labeling of the axes is a Right Hand Coordinate system
whenever the fingers of the right hand are aligned with the positive X axis and are then
rotated (through the smaller angle) toward the positive Y axis, then the thumb of the right
hand points in the direction of the positive Z axis. Otherwise, the orientation is a 'Left Hand
Coordinate System'.

FIG.2 & 3 Right Hand Co-ordinate Systems


The Right hand coordinate system is also known as 'Clockwise Rotating Coordinate System'.
The reason for this is the sequence of the axis definitions: If the X axis is rotating in the
direction of the Y axis, the movement is the name as if a screw is turned in the Z direction as
shown in FIG. 3

FIG. 4 Clockwise Rotating Co-ordinate System


One could use this right hand to get these alternative relative positions of the same right hand
coordinate system as shown in FIG.4.
Coordinate system for a CNC Milling

Page | 2

CNC Milling
Part Programming Geometry

MTAB

FIG. 5 Co-ordinate System


In programming it must be assumed that the workpiece is stationary and the tools move in the
coordinate system. The workpiece is positioned within the coordinate system so that the Z
axis coincides with the work spindle axis or runs parallel to it.
Some machining operations require programming angles of rotation about one or several
coordinate axes. Rotations about the coordinate axes are identified by the angles of rotation
A, B and C as shown in FIG.5.

FIG. 6 Angles of Rotation and Direction of Rotation

Coordinate system for a CNC Milling

Page | 3

CNC Milling
Part Programming Geometry

MTAB

The direction is positive (+) when the direction of rotation is clockwise as seen from the
Coordinate zero point looking in the direction of the positive axis as shown in the FIG.6

FIG. 7 Examples of Angle of Rotation (swivel angles) on


Machine tool
An example of machine tools with swivel movement of either the workpiece or the tools is
shown in the FIG. 7.
1.2 Zero points and Reference points
On CNC machines, tool traverses are controlled by coordinating systems. Their
accurate position within the machine tool is established by Zero Points.
Machine Zero point (M)
This is specified by the Manufacturer of the Machine. This is the zero point for the
coordinate systems and reference points in the machine. The Machine zero point can be the
center of the table or a point along the edge of the traverse range as shown in F1G.8.
The position of the Machine zero point generally varies from Manufacturer to Manufacturer.
The precise position of the machine zero point as well as the axis direction must therefore be
taken from the operating instructions provided for each individual machine.

Zero points and Reference points

Page | 4

CNC Milling
Part Programming Geometry

MTAB

FIG.8 Position of the Machine Zero Point


Reference point (R)
This point serves for calibrating and for controlling the measuring system of the
slides and tool traverses. The position of the reference point as shown in FIG.9 is accurately
predetermined in every traverse axis by the trip dogs and limit switches.

FIG. 9 Position of Reference Point on a Milling Machine


Therefore, the reference point coordinates always have the same, precisely known numerical
value in relation to the machine zero point. After initiating the control system, the reference
point must always be approached from all axes to calibrate the traverse measuring system. If
Zero points and Reference points

Page | 5

CNC Milling
Part Programming Geometry

MTAB

current slide and tool position data should be lost in the control system as, for example,
through an electrical failure, the machine must again be positioned to the reference point to
re-establish the proper positioning values.
Workpiece Zero Point (W)
This point determines the workpiece coordinate system in relation to the machine
zero point. The workpiece zero point is chosen by the programmer and input into the CNC
system when setting up the machine. The position of the workpiece zero point can be freely
chosen by the programmer within the workpiece envelope of the machine. It is, however,
advisable to place the workpiece zero point in such a manner that the dimensions in the
workpiece drawing can be conveniently converted into coordinate values and orientation
when clamping / chucking, setting up and checking, the traverse measuring system can be
affected easily. For milled parts, it is generally advisable to use an extreme corner point as the
"WorkPiece Zero Point" as shown in FIG.10. Occasionally, the workpiece zero point is also
called the Program zero point.

FIG.10 Position of Workpiece Zero Point for a Milling Part.


Tool Reference Points
When machining a workpiece, it is essential to able to control the tool point or the
tool cutting edges in precise relationship to the workpiece along the machining path. Since
tools have different shapes and dimensions, precise tool dimensions have to be established
beforehand and input into the control system. The tool dimensions are related to a fixed tool
Zero points and Reference points

Page | 6

CNC Milling
Part Programming Geometry

MTAB

setting point during pre-setting. The tool setting point E is located at a certain point on the
tool holder as shown in FIG.11. This setting point permits measuring of tools away from the
CNC machine. The data thus measured such as tool length, tool point offset or tool radius are
input into the tool data storage (memory) of the control system. The mate of the tool setting
point is the Socket point N on the tool carrier. When the tool or tool holder is inserted into
the tool carrier (e.g., turret), the setting point and the tool socket point coincide.
When programming a workpiece contour, it is always the traverse of the tool cutting
edge that is of significance. The tool carrier, e.g., the main spindle on a milling machine,
must then move in a way that the tool cutting edge follows precisely in the desired contour.

FIG.11 Tool Reference Point

Zero points and Reference points

Page | 7

CNC Milling
Part Programming Geometry

MTAB

1.3 CNC Related Dimensioning


Dimensioning information in a workpiece drawing can be stated in two ways.
Absolute Dimensioning System
Incremental Dimensioning System
1. Absolute Dimensioning System

FIG.12 Absolute System and Incremental System


Absolute dimension system always refers to a fixed reference point in the drawing as
shown in FIG.12. This point has the function of a coordinate zero point as shown in FIG.12.
CNC Related Dimensioning

Page | 8

CNC Milling
Part Programming Geometry

MTAB

The dimension lines run parallel to the coordinate axes and always start at the reference
point. Absolute dimensions are also called as Reference Dimensioning System.
Advantages of Absolute Dimensioning System
In case of interruptions that force the operator to stop the machine, the cutting toot
automatically returns to previous position, since it always moves to the absolute
coordinate called for, and the machining proceeds from the same block where it was
interrupted.
Possibility of easily changing the dimensional data in the part program whenever
required.
When describing contours and positions, it is always preferable to employ absolute
dimensions, because the first incorrect dimensioning of an individual point has no
effect on the remaining dimensions and the absolute system is easier to check for
errors.
2. Incremental Dimensioning System
When using incremental dimension system, every measurement refers to a previously
dimensioned position. Incremental dimensions are distance between adjacent points. These
distances are converted into incremental coordinates by accepting the last dimension point as
the coordinate origin for the new point. This may be compared to a small coordinate system,
i.e., shifted consequently form point to point (P1...P2... through P9) as shown in FIG.12.
Incremental dimensions are also called as Relative Dimensioning System or Chain
Dimensioning System.
Advantages of Incremental Dimensioning System
If manual programming is used, with incremental systems the inspection of the part
program, before punching the tape, is easy. Since the endpoint, when machining a
part, is identical to the starting point, the sum of the position commands (for each axis
separately) must be zero.
The performance of the incremental system can be checked by a closed-loop tape.
The last position command on the tape causes the table to return to the initial position.
CNC Related Dimensioning

Page | 9

CNC Milling
Part Programming Geometry

MTAB

Mirror image programming is facilitated with incremental systems.


Incremental dimension programming is advantageous for certain individual partial
contours in a workpiece are repeated several times and the associated program section
can be employed several without a coordinate shift.

CNC Related Dimensioning

Page | 10

CNC Milling
CNC Milling Programming

MTAB

2. CNC Milling Programming


2.1 CNC Program Build up
In a CNC program, the machining steps (operations) for producing a part on the
machine tool are laid down in a form that the control system can understand. A program is
composed of several blocks. A block is a collection of CNC words. A CNC word is a
collection of address letter and a sequence of numbers. Table.1 shows the address letters
according to DIN 66025.
Table.1 Address Characters As Per DIN 66025
Character

Meaning

Rotation about, X- axis

Rotation about, Y- axis

Rotation about, Z axis

D&E

Rotation about additional axes

Feed

Preparatory function, identifying the action to be executed

Unassigned

Interpolation Parameter / Thread pitch parallel to X-axis

Interpolation Parameter / Thread pitch parallel to Y-axis

Interpolation Parameter / Thread pitch parallel to Z-axis

Unassigned

Machine function / Auxiliary function

Block number

Program Number

P,Q,R

Parameters are used in cycles

Spindle speed

Tool Function
Second movement parallel to X, Y, Z axes respectively

U,V,W
X

Movement in X-axis

Movement in Y-axis

Movement in Z -axis

CNC Program Built up

Page | 11

CNC Milling
CNC Milling Programming

MTAB

All the CNC words may not be used on every CNC machine. Using these words, as an
example, the composition of a block is assembled as follows:

In the programming language of a CNC control system, the manufacturer specifies


What instructions can be programmed
What supplementary functions are possible in conjunction with the individual
instruction
What letters and number sequences the instructions and supplementary functions are
formed
When a CNC program is input, the control system checks whether the formal rules of the
programming language have been kept to an instruction. However input of wrong coordinate
values by the programmer can only be found during the program run.
2.2 Part Program Formats
The order in which these words appear in a block of instructions is called the format.
Basically there are two types of format:
Fixed Block Format
Fixed Sequential Format (Fixed block)
Tab Sequential Format (Fixed block)

Word Address Format (Variable block)

Fixed Block Format


a.

Fixed Sequential Format

Every instruction contains all the words in the same sequence irrespective of the words being
the same as in the previous blocks. Hence, the identifying address letter need not be
provided. For example, if some coordinate values (i.e., x, y and z coordinates) remain
constant from one block to next block these values have to be specified in the next block
also. The data must be input in a specified sequence and characters within each word must be
of the same length.
Part Program Formats

Page | 12

CNC Milling
CNC Milling Programming
Example:

MTAB

N010 G00 X10 Y5 Z0 F60 S1200 EOB


N020 G01 X10 Y5 Z-0.5 F60 S1200 EOB

b. Tab Sequential Format


The words in each instruction / block are always provided in the same sequence but
each word is preceded by the TAB character. If instructions remain unchanged in succeeding
blocks, the instructions need not be repeated but TAB character must be repeated. Here also,
the identifying letter address need not be employed.
Example:

N010 G00 X10 TAB Y5 TAB Z0 TAB F60 TAB S800 EOB
N020 G01 X20 TAB Z-0.5 EOB

2. Word Address Format


Each word is preceded and identified by its letter address. This format enables
instructions which remain unchanged from the preceding block, to be omitted from
succeeding blocks. This system reduces programming length, therefore it occupies less
storage space / file size. This is the format adopted by most CNC machine control units.
Detailed format classification is provided by the control system manufacturer.
Example:

N010 G00 X10 Y5 Z0 TAB F60 S800 EOB


N020 G01 X20 Z-0.5 EOB

2.3 Miscellaneous and Preparatory Functions


a. Miscellaneous Function (M Codes)
When a 3-digit figure is specified following address M, a 3-digit BCD code signal
and a strobe signal are transmitted. These Signals are used for ON/OFF control of a machine
function such as tool change, spindle rotation change, coolant ON/OFF. One M code can be
specified in one block. Selection of M codes for functions varies with the machine tool
builder.

Part Program Formats

Page | 13

CNC Milling
CNC Milling Programming

M Codes
M00
M01
M02
M03
M04
M05
M06
M08
M09
M10
M11
M13
M14
M19
M20
M21
M22
M23
M24
M25
M27
M30
M70
M71
M80
M81
M98
M99
M00

MTAB

Miscellaneous Functions (M Codes)


Description
Program Stop
Optional Stop
Program End
Spindle Rotation Clockwise
Spindle Rotation Counter Clockwise
Spindle Stop
Tool Change
Coolant On
Coolant Off
Vice Open
Vice Close
Spindle Rotation Clockwise, Coolant On
Spindle Rotation Counter Clockwise, Coolant On
Spindle Orientation
ATC Arm in
ATC Arm out
ATC Arm down
ATC Arm up
ATC draw bar clamping (Manual)
ATC draw bar releasing (Manual)
ATC Reset
Program Stop and Rewind
X Mirror ON
Y Mirror ON
X Mirror OFF
Y Mirror OFF
Sub-Program Call
Sub-Program Exit

Program Stop
By inserting M00 in a program, the cutting cycle is stopped after the block
containing M00 code. This facility is useful if an inspection check is necessary during
an operation. The cycle is then continued by a cycle start.
Example: M00

Miscellaneous and Preparatory Functions

Page | 14

CNC Milling
CNC Milling Programming
M01

MTAB

Optional Stop
Cycle operation is stopped after a block containing M01 is executed. This
code is only effective when the optional stop switch on the machine control panel has
been pressed.
Example: M01

M02

Program End
M02 halts program execution. The spindle is turned off and the tool moves to
the most positive position on the Z axis.
Example: M02

M03

Spindle Rotation Clockwise


An M03 instruction starts spindle rotation clockwise. It requires a speed
within the range 100 to 3000 RPM
Example: M03 S2200

M04

Spindle Rotation Counter Clockwise


An M04 instruction starts spindle rotation counter clockwise. It requires a
speed within the range 100 to 3000 RPM
Example: M04 S2200

M05

Spindle Stop
M05 commands instruction stop spindle rotation. It is good programming
practice to issue an M05 before a tool change, and at the end of a program.
Example: M05

M06

Tool Change
The M06 instruction causes the FANUC to change to a different tool.
Example: M06 T01

M08
M09
M10
M11

Coolant On
M08 turns the coolant on
Coolant Off
M09 turns the coolant off
Vice Open
M10 commands vice open
Vice Close
M11 commands vice close

Miscellaneous and Preparatory Functions

Page | 15

CNC Milling
CNC Milling Programming
M13

MTAB

Spindle Rotation Clockwise, Coolant On


M13 turns the coolant on and starts spindle rotate clockwise
Example: M13 S1000

M14

Spindle Rotation Counter Clockwise, Coolant On


M14 turns the coolant on and starts spindle rotate counter clockwise
Example: M14 S1000

M19
M20
M21
M22
M23
M24
M25
M27
M30

Spindle Orientation
Ml9 orientates the spindle.
ATC Arm in
M20 moves the ATC arm in. It moves the arm towards the spindle.
ATC Arm out
M21 moves the ATC arm out. It retracts the arm from the spindle.
ATC Arm down
M22 moves the ATC arm down.
ATC Arm up
M23 moves the ATC arm up.
ATC draw bar clamping (Manual)
M24 clamps the ATC draw bar
ATC draw bar releasing (Manual)
M25 releases the draw bar.
Reset ATC
M27 command used for ATC reset position.
Program Stop and Rewind
This command is used to stop the spindle, turns the coolant off, terminates and
reset the CNC program.

M32
M33
M38
M38
M62

ATC Rotates Clockwise


M32 command is used to rotate the ATC clockwise
ATC Rotates Counter Clockwise
M33 command is used to rotate the ATC counter clockwise
Door Open
M38 command is used to open the door automatically.
Door Close
M39 command is used to close the door automatically.
Auxiliary output 1 on
M62 sets auxiliary output 1 on. This command mainly used in Flexible
Manufacturing System (FMS) / Computer Integrated Manufacturing (CIM) System.

Miscellaneous and Preparatory Functions

Page | 16

CNC Milling
CNC Milling Programming
M63

MTAB

Auxiliary output 2 on
M63 sets auxiliary output 2 on. This command mainly used in Flexible
Manufacturing System (FMS) / Computer Integrated Manufacturing (CIM) System.

M64

Auxiliary output 1 off


M64 sets auxiliary output 1 off. This command mainly used in Flexible
Manufacturing System (FMS) / Computer Integrated Manufacturing (CIM) System.

M65

Auxiliary output 2 on
M65 sets auxiliary output 2 off. This command mainly used in Flexible
Manufacturing System (FMS) / Computer Integrated Manufacturing (CIM) System.

M70

X Mirror On
M70 command is used for X axis mirroring about the current X axis position
M71 Y Mirror On
M70 command is used for Y axis mirroring about the current Y axis position
M80 X Mirror Off
M80 command is used for X axis mirroring off.
M81 Y Mirror On
M81 command is used for Y axis mirroring off.
M98 Sub-Program Call
Format: M98 P1112222

Subprogram
Call

M99

Number of
repetition (3 Digit
shown in red color)

Subprogram
Number (Four
Digit shown in
blue color)

Sub-Program Exit

Miscellaneous and Preparatory Functions

Page | 17

CNC Milling
CNC Milling Programming

MTAB

b. Preparatory Functions (G Codes)


A number following address G determines the meaning of the command for the
concerned block. G codes are divided into the following two types.
One shot G code: The G code is effective only in the block in which it is specified.
Modal G code: The G code is effective until another G code of the same group is specified.
Notes on G codes:
G codes marked with * are initial G codes when turning program on. For G20 and
G21, the G code before turning power off remains.
G codes of group 00 are not modal. They are only effective in the block in which they
are specified.
If any G code of group 01 is specified in a canned cycle mode, the canned cycle is
automatically cancelled and the G80 condition is entered. However a G code of group
01 is not affected by any of the canned cycle G codes.

G CODE

Group

Function

G00*

Positioning (Rapid traverse)

G0l*

Linear interpolation (Cutting feed)

G02

01

G03
G04

Circular interpolation ( Counter Clockwise)


00

G17*
G18

02

06

G42

Input in inch
Input in mm

00

G40*
G41

ZX plane selection
YZ plane selection

G21
G28

Dwell, Exact stop


XY plane selection

G19
G20

Circular interpolation (Clockwise)

Return to reference point


Cutter radius compensation cancel

07

Cutter radius compensation left


Cutter radius compensation right

G43
Tool length compensation + direction
Miscellaneous and Preparatory Functions

Page | 18

CNC Milling
CNC Milling Programming
G44

MTAB
08

G49*
G50

Tool length compensation - direction


Tool length compensation cancel

11

G51

Scaling Off
Scaling On

G54

14

Datum Shift

G68

16

Rotation On

G69

Rotation Off

G73

High speed peck drilling cycle

G74

L.H. Tapping cycle

G76

Fine boring

G80*

Canned cycle cancel

G81

Continuous drilling cycle, spot drilling

G82

Continuous drilling cycle, drilling with


dwell

09
G83

Peck drilling cycle

G84

R.H.Tapping cycle

G85

Boring cycle with feed retraction

G86

Boring cycle with rapid retraction

G87

Back Boring cycle

G88

Boring cycle

G89

Boring cycle with dwell and feed retraction

G90*

03

G91
G94

Incremental coordinate system


05

G95
G98*
G99

Absolute coordinate system


Feed per minute
Feed per revolution

10

Return to initial point in a canned cycle


Return to R point in a canned cycle

Miscellaneous and Preparatory Functions

Page | 19

CNC Milling
CNC Milling Programming

MTAB

G00: Fast Traverse

A G00 moves the tool to a certain position in the work coordinate system with an absolute
command or to a position specified distance from the current position with an incremental
command at a rapid traverse rate.
Format: G00 X_ _ Y _ _ Z _ _
Example: G00 X20 Y30 Z10
Here the tool is moved to X30mm, Y30mm and Z10mm
Notes on G00:
The rapid traverse rate in the G00 command is set for each axis independently by the
machine tool builder. Accordingly, the rapid traverse rate cannot be specified in the
address F.
In the positioning mode actuated by G00, the tool is accelerated to a predetermined
speed at the start of a block and is decelerated at the end of block. Execution proceeds
to the next block after confirming the in-position.

Miscellaneous and Preparatory Functions

Page | 20

CNC Milling
CNC Milling Programming

MTAB

G01: Linear Traverse

This command actuates the linear interpolation mode. The values of X, Y, and Z define the
distance of tool travel which will be conducted in absolute or incremental mode, according to
the current status of G90 / G91. The feed rate is set to a cutting feed speed commanded by F
code and is a modal data. The feed rate commanded by the F code is measured along the tool
path. If it is not commanded, the feed rate of each axis direction is as follows.
Format: G01 X_ _ Y _ _ Z _ _ F _ _
Example: G01 X20 Y30 Z-1 F80
Circular Interpolation
The tool traverses from a starting point to a given target point along a circular path,
and then it is called circular interpolation. This can be specified by either clockwise or
anticlockwise direction. The following data are required to make a circular interpolation.

Miscellaneous and Preparatory Functions

Page | 21

CNC Milling
CNC Milling Programming
Sl.No:

Data to be
given

MTAB
Command

Command

Meaning

G17

Arc specification
on XY Plane
Arc specification
on ZX Plane
Arc specification
on YZ Plane
Clockwise (CW)
Counter
Clockwise(CCW)
End point position
in the Work
Coordinate system
Distance from start
point to end point
The signed
distance from start
point to centre
Arc radius
Velocity along arc

G18
01.

Plane Selection
G19
G02

02.
03.

Direction of
Rotation
End Point
G90 Mode

Position
04.

05.

G91 Mode

G03
Two of the X, Y and
Z axes

Distance from start point to


centre

Two of the X, Y and


Z axes
Two of the I, J and K
axes

ARC Radius
Feed Rate

R
F

The view is from the positive direction of the Z axis (Y axis or X axis) to the negative
direction on XY plane (ZX plane or YZ plane) in the right hand cartesian coordinate system.
Fig. shows the CW and CCW directions in different plane. The end of an arc is specified by
address X, Y or Z and is expressed as an absolute or incremental value according to G90 or
G91. For the incremental value, the coordinate of the end point which is viewed from the
start point of the arc is specified.
The arc centre are specified by addresses I, J and K for the X, Y and Z axes
respectively. The numerical value following I, J and K however is a vector component in
which the arc centre is seen from the start point, and is always specified as an incremental
value irrespective of G90 and G91, as shown in fig. I, J and K must be signed according to
the direction. The radius can be specified with address R instead of specifying the centre by I,
J and K. when an arc is exceeding 180 is commanded, the radius must be negative value.

Miscellaneous and Preparatory Functions

Page | 22

CNC Milling
CNC Milling Programming

MTAB

G04 Dwell
The command G04 causes the program to wait for a specified amount of time. The
time can be specified in seconds with the X prefixes or in milliseconds with the P prefix.
One of the uses of this code is to get a sharp corner on the profile of the workpiece in cutting
feed. It is also used at the end of drilling cycle. During cutter motion, a deceleration at the
end of the motion specified by one statement and acceleration at the start of the motion
specified by the next statement are usually applied automatically by the controller.
Example:

G04

X1.5

G04

P1500

G20 Inch mode input


All input parameters will be taken as imperial values. That is, they will specify
inches.
G21 metric mode input
All input parameters will be taken as metric values. That is, they will specify
millimeters.
G28 Go to Reference point
This command specifies automatic return to the reference point for the specified axes.
The coordinates defined in this command is an intermediate coordinate and is commanded by
absolute or incremental value. The G28 block is used to position the tool at the intermediate
point of all specified axes at the rapid traverse speed, and then move to the reference point at
the rapid traverse rate. In general this command is used for automatic tool changing. For
Miscellaneous and Preparatory Functions

Page | 23

CNC Milling
CNC Milling Programming

MTAB

safety reasons the cutter radius compensation, and tool length compensation should be
canceled before executing this command.
Example: G91 G28 X0 Y0 Z0 Makes the cutting tool to move to Reference point directly.
G40 Cutter radius Compensation Cancel
The commands G40 deactivate the cutter radius compensation.
G41 Cutter radius Compensation Left
The command G41 activate tool radius compensation left, tool operates in machining
operation to the left side of the profile or contour (Fig.a)
G42 Cutter radius Compensation Right
The command G42 activate tool radius compensation right, tool operates in
machining operation to the right side of the profile or contour (Fig.b)

G50 Scaling Off: This command enables cancel the scaling command.
G51 Scaling On: This command enables the size of the profile size to be increased or
decreased.
G54 Datum Shift: This command is used to shift the profile along X axis or Y axis.
G68 Rotation On: This command can rotate a programmed shape at a specified angle.
G69 Rotation Off: This command enables cancel the coordinate system rotation.
Miscellaneous and Preparatory Functions

Page | 24

CNC Milling
CNC Milling Programming

MTAB

Canned Cycles
To simplify programming, the canned cycle command can execute the specific
operation using one G code, instead of several separated G code commands in the program.

Operation

Description

1.

Positioning of X & Y axes (Initial point)

2.

Rapid traverse to R point

3.

Hole machining

4.

Operation at the bottom of hole

5.

Retraction to R point

6.

Retraction to the initial point

The G codes from G73 to G89 are reserved for various canned cycles. It may be
drilling, boring, tapping etc.
In general, canned cycle consists of six operations as shown below.

Miscellaneous and Preparatory Functions

Page | 25

CNC Milling
CNC Milling Programming

MTAB

Return to initial point / R point in a canned cycle (G98 / G99)


Programming Format for canned cycle:
G98
G

_X_Y_Z_R_Q_P_F_K_

G99
Explanation of the parameters
G98 - Return to initial point in a canned cycle
G99 - Return to R point in a canned cycle
The other parameters would be explained in the specific canned cycle.
Function:

Miscellaneous and Preparatory Functions

Page | 26

CNC Milling
CNC Milling Programming

MTAB

G73 High speed peck Drilling cycle


Programming Format:
G98
G73 _ X _ Y _ Z _ R _ Q _ P _ F _ K _
G99

Explanation of the parameters


XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Depth of cut for each peck (always incremental value)

Dwell time at the bottom of the drilling

Feed rate

Number of drill positions

Miscellaneous and Preparatory Functions

Page | 27

CNC Milling
CNC Milling Programming

MTAB

Function
When drilling a deep hole, the drill should be retracted occasionally to avoid
congestion of chips between the hole and the drill. Since the Z axis direction intermittent feed
simplifies chip disposal and permits a very small retraction value to be set in deep whole
drilling, efficient machining is performed. Here the retraction is performed at the rapid rate.
Example:

M03 S1200
G90 G00 X10 Y10 Z10
G99 G73 X10 Y10 Z-2 R1 P500 Q1 F80 K1
G80

G74 L.H. Tapping cycle


Programming Format:
G98
G74 _ X _ Y _ Z _ R _ P _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Dwell time at the bottom of the drilling

Thread lead

Number of tapping positions

Miscellaneous and Preparatory Functions

Page | 28

CNC Milling
CNC Milling Programming

MTAB

Operation Sequence
1) Rapid position to X, Y and Z (the Initial level).
2) Rapid traverse to R point level.
3) Feed to Z depth.
4) Dwell P (time for spindle stop and start CW direction).
5) Feed to R point level.
6) Dwell P (time for spindle stop and start CCW direction).
Note: During G74, the feed rate override is ignored and the cycle does not stop until the end
of the return operation, even if a feed hold is applied.
Example:

M04 S200
G90 G00 X10 Y10 Z10
G99 G74 X10 Y10 Z-12 R1 P500 F80
G80

Miscellaneous and Preparatory Functions

Page | 29

CNC Milling
CNC Milling Programming

MTAB

G76 Fine boring


Programming Format:
G98
G76 _ X _ Y _ Z _ R _ F _ P _ I _ J _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Dwell time at the bottom of the drilling

Shift amount along X axis at the bottom of a hole

Shift amount along Y axis at the bottom of a hole

Thread lead

Number of boring positions

Miscellaneous and Preparatory Functions

Page | 30

CNC Milling
CNC Milling Programming

MTAB

Function:
This cycle is commanded in single block. Since a spindle oriented stop is performed
at the bottom of the hole and the spindle retracts after shifting in the direction opposite to the
cutter-direction, high precision and efficient boring is performed without scratching the work
piece.
Note: the shift value is specified by Q. the Q value is always a positive value. If a negative
value is specified, the sign is ignored. The Q value is modal in the canned cycle.
Example:

M03 S200
G90 G00 X0 Y20 Z10
G99 G76 X20 Y20 Z-16 Q0.5 R-10 F60

G80 canned cycle cancel


G80 is canned cycle cancelled. Meanwhile, the point R and the point Z are all
cancelled.
G81 Continuous drilling cycle, Spot drilling cycle
Programming Format:
G98
G81 _ X _ Y _ Z _ R _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Feed rate

Number of drill positions

Miscellaneous and Preparatory Functions

Page | 31

CNC Milling
CNC Milling Programming

MTAB

Function
G81 command can be used to drill a hole. The tool is moved with feed rate when it is
drilling a hole. Then, the tool is moved at the rapid rate when it is retracting from the bottom
of the hole.
Example:

M03 S1200
G90 G00 X0 Y20 Z10
G99 G81 X20 Y20 Z-8 R1 F60 K1

G82 Continuous drilling cycle with dwell


Programming Format:
G98
G82 _ X _ Y _ Z _ R _ P _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Dwell time at the bottom of the drilling

F
Feed rate
Miscellaneous and Preparatory Functions

Page | 32

CNC Milling
CNC Milling Programming
K

MTAB

Number of drill positions

Function
G82 command can be used to drill a counter bore.
Example:
M03 S1200
G90 G00 X0 Y20 Z10
G99 G82 X20 Y20 Z-8 P500 R1 F60 K1

G83 Peck drilling cycle


Programming Format:
G98
G83 _ X _ Y _ Z _ R _ Q _ P _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Depth of cut for each peck (always incremental value)

Dwell time at the bottom of the drilling

Miscellaneous and Preparatory Functions

Page | 33

CNC Milling
CNC Milling Programming
F

Feed rate

Number of drill positions

MTAB

Function
G83 command can perform a peck drilling. The intermittent feed allows the operator
to remove the chips from the drill.
Example:

M03 S1200
G90 G00 X10 Y10 Z10
G99 G83 X10 Y10 Z-2 R1 P500 Q1 F80 K1
G80

G84 R.H.Tapping cycle


Programming Format:
G98
G84 _ X _ Y _ Z _ R _ P _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

R
Z coordinates of the R point
Miscellaneous and Preparatory Functions

Page | 34

CNC Milling
CNC Milling Programming
P

Dwell time at the bottom of the drilling

Thread lead

Number of tapping positions

MTAB

Function
R.H Tapping is performed by spindle rotation clockwise. Then the spindle turns
counter clockwise for retraction when the tool reaches the bottom of the hole.
Note: During G84, the feed rate override is ignored and the cycle does not stop until the end
of the return operation, even if a feed hold is applied.
Example:

M03 S200
G90 G00 X10 Y10 Z10
G99 G84 X10 Y10 Z-12 R1 P500 F80
G80

Miscellaneous and Preparatory Functions

Page | 35

CNC Milling
CNC Milling Programming

MTAB

G85 Boring cycle with feed retraction


Programming Format:
G98
G85 _ X _ Y _ Z _ R _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Feed Rate

Number of boring positions

Function
G85 command is used to increase diameter of the previous drilling.

Miscellaneous and Preparatory Functions

Page | 36

CNC Milling
CNC Milling Programming

MTAB

G86 Boring cycle with rapid retraction


Programming Format:
G98
G86 _ X _ Y _ Z _ R _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Feed Rate

Number of boring positions

Function
G86 command is used to increase diameter of the previous drilling.

Miscellaneous and Preparatory Functions

Page | 37

CNC Milling
CNC Milling Programming

MTAB

G87 Back Boring cycle


Programming Format:
G98
G87 _ X _ Y _ Z _ R _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Feed Rate

Number of boring positions

Function
G87 command is used to bore a pervious drill hole.

Miscellaneous and Preparatory Functions

Page | 38

CNC Milling
CNC Milling Programming

MTAB

G88 Manual Back Boring cycle


Programming Format:
G98
G87 _ X _ Y _ Z _ R _ P _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Dwell time at the bottom of the hole

Feed Rate

Number of boring positions

Function:
G88 command can be used to bore a hole precisely. The main difference is that the
tool is returned to the initial point or the point R in the manual mode key (On the machine
control panel).

Miscellaneous and Preparatory Functions

Page | 39

CNC Milling
CNC Milling Programming

MTAB

G89 Boring cycle with dwell and feed retraction


Programming Format:
G98
G89 _ X _ Y _ Z _ R _ P _ F _ K _
G99
Explanation of the parameters
XY

Drilling position of the X & Y axes

Depth of the drilling

Z coordinates of the R point

Dwell time at the bottom of the hole

Feed Rate

Number of boring positions

Function
G89 command is used to bore a pervious drill hole.

Miscellaneous and Preparatory Functions

Page | 40

CNC Milling
CNC Milling Programming

MTAB

G90 Absolute coordinate system


The coordinate values of the point with reference to the origin of the drawing.
G91 Incremental coordinate system
The coordinate values of the point with reference to the previous position of the
drawing.
G94 Feed per minute
This G code defines Feed per Minute. The unit is mm / min.
G95 Feed per revolution
This G code defines Feed per Revolution. The unit is mm / rev.
G98 Return to initial level & G99 Return to R point level in Canned Cycle

Miscellaneous and Preparatory Functions

Page | 41

CNC Milling
CNC Milling Programming

MTAB
Canned Cycles

G code

G73

Drilling

Operation at the

Retraction

(-Z direction)

bottom of a hole

(+Z direction)

Intermittent

Rapid traverse

feed
G74

Feed

Feed

High speed peck


drilling cycle

Dwell

Spindle

Feed

CW
G76

Application

Left hand
tapping

Oriented spindle

Rapid traverse

Fine boring cycle

stop
G80

Cancel

G81

Feed

Rapid traverse

Drilling cycle,
spot drilling
cycle

G82

Feed

Dwell

Rapid traverse

Drilling cycle,
counter drilling
cycle

G83

Intermittent

Rapid traverse

feed
G84

Feed

Peck drilling
cycle

Dwell

Spindle

Feed

Tapping cycle

CW
G85

Feed

Feed

Boring cycle

G86

Feed

Spindle stop

Rapid traverse

Boring cycle

G87

Feed

Spindle CW

Rapid traverse

Back boring
cycle

G88

Feed

Dwell

Spindle

Manual

Boring cycle

Feed

Boring cycle

Stop
G89

Feed

Dwell

Miscellaneous and Preparatory Functions

Page | 42

CNC Milling
CNC Milling Programming

MTAB

Machining Cycles
Circular Pocket Milling Cycle - Format
G170

P Q R X Y Z I J K

G171

P S R F B J

P0 -

ROUGHING OPERATION

P1 -

FINISHING OPERATION

Q-

DEPTH OF CUT FOR EACH PASS

R-

REFERENCE POINT

X-

POSITION OF TOOL IN X AXIS

Y-

POSITION OF TOOL IN Y AXIS

Z-

TOTAL DEPTH

I-

SIDE FINISHING ALLOWENCE

J-

BASE FINISHING ALLOWENCE

K-

RADIUS OF THE POCKET

P-

CUTTER MOVEMENT IN %, i.e., 50% OF THE CUTTER Dia.

S-

ROUHING OPERATION SPINDLE SPEED

R-

ROUGHING OPERATION FEED IN Z AXIS

F-

ROUGHING OPERATION FEED IN X & Y AXES

B-

FINISHING OPERATION SPINDLE SPEED

J-

FINISHING OPERATION FEED IN X, Y & Z AXES

Miscellaneous and Preparatory Functions

Page | 43

CNC Milling
CNC Milling Programming

MTAB

Rectangular Pocket Milling Operation - Format


G172 P Q R X Y Z I J K
G173 I K P S T R F B J Z
P0 -

ROUGHING OPERATION

P1-

FINISHING OPERATION

Q-

DEPTH OF CUT FOR EACH PASS

R-

REFERENCE POINT

X-

RECTANGULAR POCKET X AXIS LEFT CORNER

Y-

RECTANGULAR POCKET Y AXIS LEFT CORNER

Z-

TOTAL DEPTH

I-

TOTAL LENGTH IN X AXIS

J-

TOTAL LENGTH IN Y AXIS

K-

CORNER RADIUS OF THE POCKET

I-

SIDE FINISHING ALLOWENCE

K-

BASE FINISHING ALLOWENCE

P-

CUTTER MOVEMENT IN %, i.e., 50% OF THE CUTTER Dia.

S-

ROUGHING OPERATION SPINDLE SPEED

T-

TOOL NUMBER

R-

ROUGHING OPERATION FEED IN Z AXIS

F-

ROUGHING OPERATION FEED IN X & Y AXES

B-

FINISHING OPERATION SPINDLE SPEED

J-

FINISHING OPERATION FEED IN X, Y & Z AXES

Z-

SAFETY POSITION

Miscellaneous and Preparatory Functions

Page | 44

CNC Milling
CNC Milling Programming

MTAB

2.4 Structure of a CNC program


CNC Program can be divided into three parts.
1. Start-up Program
2. Profile Program
3. End of the Program
1. Start-up Program
O1000
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G00 X0 Y0 Z5
Explanation:

O1000

While writing a program on FANUC controller first line has to


be started with letter O followed by four digit number which
specifies the program number.

G21 G94

G21 - specifies that program is done in metric units


G94

gives the unit of feed in mm / min

G91 G28 Z0

Makes the tool to go to home position in incrementally

G28 X0 Y0

Makes the tool to go to home position. U & W are secondary


movements about x and z axes.

M06 T1
M03 S1500

Tool Change with tool position No: 1


Makes the spindle rotation in clockwise with spindle rotates at
1500 RPM

G00 X0 Y0

G00 gives rapid position of the tool to a point X0 Y0 Z5. This is

Z5

just above the billet. This point is called as the Tool entry Point.

Structure of a CNC Program

Page | 46

CNC Milling
CNC Milling Programming

MTAB

2. Profile Program: Profile program is based on the given part drawing.


3. End of the Program
G91 G28 Z0
G28 X0 Y0
M05
M30

G91 G28 Z0

Makes the tool to go to home position in incrementally

G28 X0 Y0

Makes the tool to go to home position in incrementally along X


and Y axes

M05

Stop the Spindle

M30

Program Stop and Rewind

Structure of a CNC Program

Page | 47

CNC Milling
Programming Examples

MTAB

3. Programming Examples
3.1 Example # 01: Programming using linear and circular interpolation
Write a manual part program for Profile Milling Operation for the component shown
in DWG.NO: 01.

DWG.NO: 01

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1001

DWG. NO: 01

Sl.No:

Operation Tool Type Tool


Dia.,
mm
Profile
Milling

Example Program

Slot Drill
Cutter

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

100

Page | 48

CNC Milling
Programming Examples

MTAB

O1001
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X-30 Y-20 Z5
G01 Z-1 F100
G01 X-30 Y20
G02 X-20 Y30 R10
G01 X20 Y30
G03 X30 Y20 R10
G01 X30 Y-20
G01 X20 Y-30
G01 X-20 Y-30
G03 X-30 Y-20 R10
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 49

CNC Milling
Programming Examples

MTAB

3.2 Example # 02: Programming using Sub-Program


Write a manual part program for Profile Milling Operation using Sub-Program for the
component shown in DWG.NO: 02.

DWG.NO: 02

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminum

PROGRAM NO: O1002

DWG. NO: 02

Sl.No:

Tool
Tool
Spindle Feed,
Station Length Speed, mm/min
No.1
Offset RPM
No.1

Operation

Tool Type Tool


Dia.,
mm

Profile
Slot Drill
Milling using Cutter
Sub-Program

Example Program

1500

100

Page | 50

CNC Milling
Programming Examples

MTAB

O1002
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X-30 Y-20 Z5
G01 Z0 F100
M98 P52233
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30
O2233
G91 G01 Z-1 F100
G90 G01 X-30 Y20
G02 X-20 Y30 R10
G01 X20 Y30
G03 X30 Y20 R10
G01 X30 Y-20
G01 X20 Y-30
G01 X-20 Y-30
G03 X-30 Y-20 R10
M99

Example Program

Page | 51

CNC Milling
Programming Examples

MTAB

3.3 example # 03: Programming for mirroring operation


Write a manual part program for Mirroring Operation for the component shown in
DWG.NO: 03.

DWG.NO: 03

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1003

DWG. NO: 03

Sl.No:

Operation Tool Type Tool


Dia.,
mm
Mirroring
Operation

Example Program

Slot Drill
Cutter

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

100

Page | 52

CNC Milling
Programming Examples

MTAB

O1003
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
M98 P2244
M70
M98 P2244
M80
M71
M98 P2244
M81
M70
M71
M98 P2244
M80
M81
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30
O2244
G90 G00 X15 Y15 Z5
G01 Z-1 F100
G01 X15 Y25
G01 X25 Y25
G01 X25 Y15
G01 X15 Y15
G00 Z5
G00 X0 Y0
M99

Example Program

Page | 53

CNC Milling
Programming Examples

MTAB

3.4 Example # 04: Programming for Circular Pocket Milling operation


Write a manual part program for Circular Pocket Milling Operation for the
component shown in DWG.NO: 04.

DWG.NO: 04

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1004

DWG. NO: 04

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Circular
Pocket
Milling
Operation

Example Program

Slot Drill
Cutter

100

Page | 54

CNC Milling
Programming Examples

MTAB

O1004
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X0 Y0 Z5
G170 P0 Q1 R0.5 X0 Y0 Z-4 I0.1 J0.1 K25
G171 P50 S1200 R60 F100 B1500 J60
G170 P1 Q1 R0.5 X0 Y0 Z-4 I0 J0 K25
G171 P50 S1200 R60 F100 B1500 J60
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 55

CNC Milling
Programming Examples

MTAB

3.5 Example # 05: Programming for Rectangular Pocket Milling operation


Write a manual part program for Rectangular Pocket Milling Operation for the
component shown in DWG.NO: 05.

DWG.NO: 05

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1005

DWG. NO: 05

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Rectangular
Pocket
Milling
Operation

Example Program

Slot Drill
Cutter

100

Page | 56

CNC Milling
Programming Examples

MTAB

O1005
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X0 Y0 Z5
G172 P0 Q1 R0.5 X-25 Y-17.5 Z-4 I50 J35 K0
G173 P50 S1200 T1 R60 F100 B1500 J60 Z5 I0.1 K0.1
G172 P1 Q1 R0.5 X-25 Y-17.5 Z-4 I50 J35 K0
G173 P50 S1200 T1 R60 F100 B1500 J60 Z5 I0 K0
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 57

CNC Milling
Programming Examples

MTAB

3.6 Example # 06: Programming for Drilling operation


Write a manual part program for Drilling Operation for the component shown in
DWG.NO: 06.

DWG.NO: 06

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1006

DWG. NO: 06

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Drilling
Operation

Example Program

Slot Drill
Cutter

100

Page | 58

CNC Milling
Programming Examples

MTAB

O1006
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X25 Y25 Z5
G01 Z2 F100
G73 G99 X25 Y25 Z-5 Q1 R0.5 F80 K1
X-25 Y25
X-25 Y-25
X25 Y-25
G00 Z5
G80
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 59

CNC Milling
Programming Examples

MTAB

3.7 example # 07: Programming for Drilling Operation on PCD


Write a manual part program for Drilling Operation on PCD Operation for the
component shown in DWG.NO: 07.

DWG.NO: 07

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1007

DWG. NO: 07

Sl.No: Operation

Tool
Type

Slot Drill 6
Cutter

Drilling on
PCD

Example Program

Tool
Dia.,
mm

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

100

Page | 60

CNC Milling
Programming Examples

MTAB

O1007
G21 G94
G91 G28 Z0
G28 X0 Y0

= PCD / 2 SIN45
= 70 / 2 SIN45
= 24.748

= PCD / 2 COS45
= 70 / 2 COS45
= 24.748

M06 T1
M03 S1500
G90 G00 X35 Y0 Z5
G73 G99 X35 Y0 Z-5 Q1 R0.5 F80 K1
X24.748 Y24.748
X0 Y35
X-24.748 Y24.748
X-35 Y0
X-24.748 Y-24.748
X0 Y-35
X24.748 Y-24.748
G00 Z5
G80
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 61

CNC Milling
Programming Examples

MTAB

3.8 Example # 08: Programming for Datum Shift Operation using G54
Write a manual part program for Datum Shift Operation for the component shown in
DWG.NO: 08.

DWG.NO: 08

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1008

DWG. NO: 08

Sl.No:

Operation Tool Type Tool


Dia.,
mm
Program
Slot Drill
using
Cutter
Datum Shift

Example Program

Tool
Tool
Spindle Feed,
Station Length Speed, mm/min
No.1
Offset RPM
No.1
1

1500

100

Page | 62

CNC Milling
Programming Examples

MTAB

O1008
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X10 Y10 Z5
G54 X10 Y10
M98 P5566
G00 Z5
G90 G00 X-30 Y10
G54 X-30 Y10
M98 P5566
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30
O5566
G90 G00 Z-1 F100
G01 X0 Y10
G01 X10 Y10
G01 X10 Y0
G01 X0 Y0
G00 Z5
G54 X0 Y0
M99

Example Program

Page | 63

CNC Milling
Programming Examples

MTAB

3.9 Example # 09: Programming for Drilling operation using Rotation Command (G68)
Write a manual part program for Drilling Operation using Rotation command for the
component shown in DWG.NO: 09.

DWG.NO: 09
PLANNING AND OPERATIONS SHEET
BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1009

DWG. NO: 09

Sl.No:

Tool
Tool
Spindle Feed,
Station Length Speed, mm/min
No.1
Offset RPM
No.1

Operation Tool Type Tool


Dia.,
mm
Drilling
using G68
Command

Example Program

Slot Drill
Cutter

1500

100

Page | 64

CNC Milling
Programming Examples

MTAB

O1009
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X35 Y0 Z5
G68 R0
M98 P6677
G68 R45
M98 P6677
G68 R90
M98 P6677
G68 R135
M98 P6677
G68 R180
M98 P6677
G68 R225
M98 P6677
G68 R270
M98 P6677
G68 R315
M98 P6677
G00 Z5
G69
G91 G28 Z0
G28 X0 Y0
M05
M30
O6677
G73 G99 X35 Y0 Z-5 Q1 R0.5 F80 K1
G00 Z5
G80
M99

Example Program

Page | 65

CNC Milling
Programming Examples

MTAB

3.10 Example # 10: Programming using Scaling Command


Write a manual part program for Scaling Command for the component shown in
DWG.NO: 10.

DWG.NO: 10

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1010

DWG. NO: 10

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Scaling
Operation

Example Program

Slot Drill
Cutter

100

Page | 66

CNC Milling
Programming Examples

MTAB

O1010
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
M98 P7777
G90 G00 Z5
M98 P8888
G90 G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30
O7777
G90 G00 X-30 Y-20 Z5
G01 Z-1 F100
G01 X-30 Y20
G02 X-20 Y30 R10
G01 X20 Y30
G03 X30 Y20 R10
G01 X30 Y-20
G01 X20 Y-30
G01 X-20 Y-30
G03 X-30 Y-20 R10
M99
O8888
G51 P0.5
M98 P7777
G00 Z5
G50
M99

Example Program

Page | 67

CNC Milling
Programming Examples

MTAB

3.11 example # 11: Programming for Profile Milling using ATC option
Write a manual part program for Scaling Command for the component shown in
DWG.NO: 11.

DWG.NO: 11
PLANNING AND OPERATIONS SHEET
BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1011

DWG. NO: 11

Sl.No:

Operation Tool Type Tool


Dia.,
mm

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

Profile
Milling
Operation

Slot Drill
Cutter

1500

100

Profile
Milling
Operation

Slot Drill
Cutter

10

1200

80

Example Program

Page | 68

CNC Milling
Programming Examples

MTAB

O1011
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 X-30 Y-20 Z5
G01 Z-1 F100
G01 X-30 Y20
G02 X-20 Y30 R10
G01 X20 Y30
G03 X30 Y20 R10
G01 X30 Y-20
G01 X20 Y-30
G01 X-20 Y-30
G03 X-30 Y-20 R10
G00 Z5
G91 G28 Z0
G28 X0 Y0
M06 T2
M03 S1200
G90 G00 X-20 Y0 Z5
G01 Z-1 F100
G02 X20 Y0 R10
G02 X-20 Y0 R10
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30
Example Program

Page | 69

CNC Milling
Programming Examples

MTAB

3.12 Example # 12 Programming for Profile Milling Operation using G41


Write a manual part program for Profile Milling Operation with cutter radius
compensation left (G41) for the component shown in DWG.NO: 12

DWG.NO: 12
PLANNING AND OPERATIONS SHEET
BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1012

DWG. NO: 12

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Profile
Milling
Operation
Using G41

Example Program

Slot Drill
Cutter

100

Page | 70

CNC Milling
Programming Examples

MTAB

O1012
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 G41 X0 Y0 Z10
G01 X-30 Y-20 F100
G01 Z5 F100
G01 Z-1 F100
G01 X-30 Y20
G02 X-20 Y30 R10
G01 X20 Y30
G03 X30 Y20 R10
G01 X30 Y-20
G01 X20 Y-30
G01 X-20 Y-30
G03 X-30 Y-20 R10
G01 X-30 Y0
G40
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 71

CNC Milling
Programming Examples

MTAB

3.13 example # 13: Programming for Profile Milling Operation using G42
Write a manual part program for Profile Milling Operation with cutter radius
compensation right (G42) for the component shown in DWG.NO: 13.

DWG.NO: 13

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: O1013

DWG. NO: 13

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Profile
Milling
Operation
Using G42

Example Program

Slot Drill
Cutter

100

Page | 72

CNC Milling
Programming Examples

MTAB

O1013
G21 G94
G91 G28 Z0
G28 X0 Y0
M06 T1
M03 S1500
G90 G00 G42 X0 Y0 Z10
G01 X30 Y-20 F100
G01 Z-1 F100
G01 X30 Y20
G02 X20 Y30 R10
G01 X-20 Y30
G03 X-30 Y20 R10
G01 X-30 Y-20
G02 X-20 Y-30 R10
G01 X20 Y-30
G01 X30 Y-20
G01 X30 Y0
G40
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30

Example Program

Page | 73

CNC Milling
Machine Room Exercises

MTAB

CNC Milling
Machine Room Exercises

Page | 74

CNC Milling
Machine Room Exercises

MTAB

Ex # 01: Study of XL MILL CNC Vertical Machining Centre


Write down the Specifications of the XLMILL
Specifications

Units

XLMILL

X Axis Travel

mm

225

Y Axis Travel

mm

150

Z Axis Travel

mm

115

Travels

Distance Between Table Top

70 - 185

and Spindle Nose


Table
Table Size

mm

360 x 132

Spindle Motor Capacity

HP

0.5

Programmable Spindle

rpm

150 - 4000

BT 30

Positional Accuracy

mm

0.01

Repeatability

mm

0.005

m / min

1.2

mm / min

0 - 1200

Tool Storage Capacity

Pcs

Maximum Tool Diameter

mm

16

Maximum Tool Length

mm

40

Spindle

Speed
Spindle Nose Taper
Accuracy

Feed Rate
Rapid Traverse X x Y x Z
axes
Programmable Feed Rate on
X x Y x Z axes
ATC

Page | 75

CNC Milling
Machine Room Exercises
ATC Direction

MTAB
-

Bi-Directional

Slides
Slides
Ball Screws X, Y and Z axes

Hardened Ground Guide ways


Dia. & Pitch

16mm x 5mm

PC Based 3 Axes Continuous

CNC
Control System

Path

Lubrication
Lubrication System

Centralized Lubrication System

Power Source
Main Supply

230v, Single Phase, 50Hz

Machine Dimensions
Height x Length x Depth

mm

1000 x 575 x 650

Machine Weight

kg

170

Optional Accessories
CAM Software, Offline Programming Software, Auto Door, Hydro Pneumatic
Vise, Work Bench, 3 axis Loading / Unloading Arm, 6 station ATC, Stabilizer,
Air Compressor
Features
Compatible / Upgradable

FMS / CIM System

Page | 76

CNC Milling
Machine Room Exercises

MTAB

Ex # 02: Study of Tool Offset Procedures for XL MILL CNC Vertical Machining
Centre
Tool offset procedures:
Select Tool Offsets from Job/Tooling Main Menu.

After Selecting Tool offsets the following window appears. Choose required tool
position and Double Click on it. The following window appears on the screen.
Manually enter TOOL RAD and ACTUAL DIAM.

Then Add Tool To Library. The following window appears and Click OK on CNC
TRAINER SETTINGS.

The Selected Tool should be brought either rapidly or manually Nearer to the left
edge of the billet using all the three axes.
Page | 77

CNC Milling
Machine Room Exercises

MTAB

Then Click on the SPDL CW with S 1500 RPM

Move the Tool in JOG Mode with Appropriate Displacement until tool touches the
edge of the billet as shown below.

Now Select DATUM and then Click X axis on the CNC DISPLAY which will turn
into ZERO indicating the point has been made Zero in X axis.

Page | 78

CNC Milling
Machine Room Exercises

MTAB

Lift the Tool away from the billet by using Manual mode equal to the radius of the cutter in
X + direction and Select Datum and Click on X axis on the CNC DISPLAY which will turn
into ZERO indicating the point has been made Zero in X axis.
Repeat the Procedure for taking the Offset in Y axis also.
For taking Z axis offset, bring the cutter to the surface of the billet by using JOG Mode. As
the cutter touches the billet Select Datum and Click on Z axis on the CNC DISPLAY which
will show Zero.

Offset for all the subsequent tools in Z axis are to be taken based on the Length of first tool.
Procedures:

Select Tool Offsets from Job/Tooling Main Menu.

Page | 79

CNC Milling
Machine Room Exercises

MTAB

Select Tool Type as per the Program and Select Tooling form CNC TRAINER
SETTINGS; choose required tool and Double Click on it. The following window
appears on the screen.

For taking Z axis offset, bring the cutter to the surface of the billet by using JOG Mode. As
the cutter touches the billet lick on Z LENGTH on the CNC TRAINER SETTING which will
show offset value with respect to first tool.

Page | 80

CNC Milling
Machine Room Exercises

MTAB

NOTE:
X and Y offsets remains same for all the tool

Page | 81

CNC Milling
Machine Room Exercises

MTAB

Ex # 03: Write a manual part program for machining the component shown in
DWG.NO: 03.
Profile Depth: 5 mm

Depth of cut for each pass: 1 mm

DWG.NO: 03

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: 03

DWG. NO: 03

Sl.No:

Operation Tool Type Tool


Dia.,
mm
Profile
Milling
Operation

Slot Cutter 6

Tool
Tool
Spindle Feed,
Station Length Speed, mm/min
No.1
Offset RPM
No.1
1

1500

100

Page | 82

CNC Milling
Machine Room Exercises

MTAB

Ex # 04: Write a manual part program for machining the component shown in
DWG.NO: 04.
Profile Depth: 5 mm

Depth of cut for each pass: 1 mm

DWG.NO: 04

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: 04

DWG. NO: 04

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

1500

Operation Tool Type Tool


Dia.,
mm
Profile
Milling
Operation

Slot Cutter 6

100

Page | 83

CNC Milling
Machine Room Exercises

MTAB

Ex # 05: Write a manual part program for machining the component shown in
DWG.NO: 05.
Profile Depth: 5 mm

Depth of cut for each pass: 1 mm

DWG.NO: 05
PLANNING AND OPERATIONS SHEET
BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: 05

DWG. NO: 05

Sl.No:

Tool
Tool
Station Length
No.1
Offset
No.1

Spindle Feed,
Speed, mm/min
RPM

Operation Tool Type Tool


Dia.,
mm

Drilling
Operation

Slot Cutter 6

1500

100

Drilling
Operation

Slot Cutter 10

1200

80

Page | 84

CNC Milling
Machine Room Exercises

MTAB

Ex # 06: Write a manual part program for machining the component shown in
DWG.NO: 06.

DWG.NO: 06

PLANNING AND OPERATIONS SHEET


BILLET SIZE: 90 x 90 x 10

MATERIAL: Aluminium

PROGRAM NO: 06

DWG. NO: 06

Sl.No:

Operation

Circular
Pocket
Milling
Operation

Tool Type Tool Tool


Tool
Spindle Feed,
Dia., Station Length Speed, mm/min
mm No.1
Offset RPM
No.1
Slot Cutter 12

1500

100

Page | 85

CNC Milling
MTAB

DOS AND DONTS FOR CNC MACHINES


DONTS
Never Open Guard Doors While Machine is in Running
Never Attempt to Bypass Guard Interlock, Safety Devices etc.
Never Leave Machine Unattended While in Running
Never Adjust Tooling or Coolant While Machine is Running
Never Use Broken or Worn Tooling
Never Remove any Warning or Instruction Tags from Machine
Never Operate any Equipment if unusual or Excessive Noise Vibration Occurs
Never Remove Chips with the Hands
Never Remove or load Work pieces While Machine is in Motion
Never Allow the Operation or Repair of Equipment by Untrained Personnel
Never Leave Tools or other items on the Machine
Never Touch Electrical Equipment When Hands are Wet

Page | 86

CNC Milling
MTAB

DOS
Always make sure all Tools are Securely Clamped in Position
Always Consult your Authority when in Doubt
Always make sure all Tool Mounting Surfaces are clean before Mounting Tools
Always Replace Blown Fuses with Fuses of the Same Capacity
Switch off Power during Maintenance / Repair work
Negligence on the above points can cause Personal Injury and Machine Damage

Page | 87

MTAB TECHNOLOGYCENTER PVT(


LTD)
#133,Devel
opedPl
ot
,E & E I
ndust
r
i
alEst
at
eChennai600096,
Ph:++914443111114,Fax:
++914424344826
emai
l:enqui
r
y@mt
abt
r
ai
ni
ng.
com
Websi
t
e:www.
mt
abt
r
ai
ni
ng.
com

Das könnte Ihnen auch gefallen