Documente Academic
Documente Profesional
Documente Cultură
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
CONTENTS
Page No.
32
46
48
5. Exercise Problems
50
52
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
It is the acronym for Numerical Control. Numerical Control refers to the use of coded
numerical information in the automatic control of equipment. NC can be defined as a kind of
programmable automation in which the process is controlled by numbers, letters & symbols. The
numbers letters & symbols are arranged as a program of instructions for a particular job. Such a
program is called a part program.
NC can be applied to various operations in engineering, like drafting, machining, assembly,
inspection, etc. The main area of NC application is metal machining operations.
1.2 Basic Components of an NC System:
An NC system consists of three basic components.
1. Program of instructions
2. Machine control unit
3. Machine tool
PROGRAM OF
INSTRUCTIONS
MACHINE
CONTROL UNIT
MACHINE TOOL
Above Figure shows the block diagram of an NC machine. The program of instructions sends
commands to the Machine Control Unit, which in turn controls the machine tool.
1.3 NC Coordinate systems:
The relative movement of the machine tool spindle & worktable is due to the individual slides
being operated by instructions from the part program.
Normally, three slides are required in a NC machine tool.
Longitudinal
Vertical
Transverse
The position and direction of movement of each slide is given by the right hand coordinate
system. Here we have three axes X, Y & Z mutually perpendicular to each other.
Position of axes: Usually the Z axis is located (positioned) along the machine tool spindle. The
X axis is positioned parallel to the machine worktable and perpendicular to the Z axis. The Y
axis is perpendicular to both Z & X axis.
2
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
Direction of axes: If the movement of the slide is such that the tool moves away from the work
piece, the direction of that slide axis is positive (+ ve). Similarly, if the movement of the slide is
such that the tool moves nearer to or into the work piece, the direction of that slide axis is
negative ( - ve).
Zero points & Reference points:
The accurate position of the machine tool slides with the machine tool is established by the Zero
Point. The Zero Points may be (a) Machine Zero Point & (b) Work Zero Point.
Machine Zero Point is specified by the manufacturer of the machine. This is the zero point for
the coordinate systems and other reference points in the machine.
Workpiece Zero Point determines the workpiece coordinate system in relation to the machine
zero point. This point is chosen by the programmer, and input into the CNC system when setting
up the machine. The position of this point can be freely chosen by the programmer within the
workpiece envelope of the machine. Its position is chosen such that the dimensions in the
workpiece drawing can be conveniently converted into coordinate values and also to effectively
take care about the clamping/chucking, setting up, etc.
Reference Point or Home Position serves for calibrating and controlling the measuring systems
of the slides and tool traverses. The position of the reference point is accurately predetermined in
every traverse axis by the trip dogs and the limit switches. Therefore the reference point
coordinates always have the same precisely known numerical values 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.
Dimension System: Dimensional information in the work piece drawing can be stated in 2
methods Absolute Dimensioning & Incremental Dimensioning.
In Absolute dimensioning, the coordinate data are taken with respect to a fixed reference point on
the workpiece drawing (usually the workpiece zero).
In Incremental Dimensioning, the coordinate data are taken with respect to the previous
coordinate value. i.e., every coordinate programmed will be the origin for the next coordinate to
be programmed.
1.4 NC & CNC: During the early period of NC technology, most of the control activities in the
controller were performed by electronic hardware devices like diode valves. The electronics
consisted of many mechanical devices which frequently posed problems of non-contact. The
machine tools and processes then controlled by such controllers were called as NC Machines.
With the improvement of technology and with the evolution of integrated circuits mechanical3
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
problems with electronic devices were solved. Also with the very fast development of computers,
almost all the control activities, performed by the hardware of the controller unit, could then be
tackled by software (programs). The machine tools and processes presently being controlled by
powerful computers is termed as CNC Machines. CNC is the acronym for Computer Numerical
Control.
1.5 CNC Part Program:
It consists of a set of properly arranged sequence of instructions which when executed
initiates the controller to send various signals to different machine tool drives in accordance with
the program sequence so as to perform the desired work/job.
The CNC program (also called as the CNC part program) is made up of number of lines of
instructions. Each line of instruction is called a Block. Each Block in turn consists of a few
alpha-numeric words called as CNC Words
Figure here shows a sample part program depicting the Blocks and CNC Words.
Also, it may be noted that each CNC word starts
with a Word Address (upper-case alphabet) followed
by a numeric data.
Such a CNC program format is called Word
Address Format.
MANUAL
CIM & AUTOMATION LAB:
10MEL78
DSCE
Bangalore 78
Department of Mechanical
Engineering
e) Feed Rate (F-word): These words specify the feed rate of the tool in a machining
operation. It is usually expressed in mm/min. E.g. F30
f) Cutting Speed (S-word): These words specify the cutting speed of the tool/spindle
rotation in RPM. E.g. S1200
g) Tool Selection (T-word): This command is used to access a required tool from a tool
turret or an automatic tool changer. This command is usually used in CNC machines with
Automatic Tool Changing facility. E.g. T10 may specify that a 10 mm drill must be
selected from position number 10 of a tool magazine (holder).
h) Miscellaneous Functions (M-code): These are used to specify certain miscellaneous or
auxiliary functions (coolant on, coolant off, spindle on CW/CCW, spindle stop, etc)
available on the given machine.
NC LATHE
Chuck
(0,0)
Z
Dia
Face
Z+
Length
P5
30
P4
P3
25
P2
P1
20
25
30
25
MANUAL
CIM & AUTOMATION LAB:
10MEL78
DSCE
Bangalore 78
Point
P1
P2
P3
P4
P5
P6
ABSOLUTE
X
20
20
25
25
30
30
Z
0
-25
-25
-55
-55
-80
Department of Mechanical
Engineering
INCREMENTAL
U
W
20
0
0
-25
5
0
0
-30
5
0
0
-25
Note: Incremental program is easy to program but tedious to change values in between. Error
committed in any block is carried over to the consecutive blocks. Whereas, absolute
programming is a bit inconvenient as all coordinates are measured from a fixed point. Error
committed in any block will affect only that block. Consecutive blocks are not affected.
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
Max
X
R
X
W
(0,0
)
Max
Z
M: Machine Zero Point
W:
Workpiece(Program) Zero Point
Above figure
the location
and Home
the relationship
R: shows
Reference
point OR
Position between Zero Points & Reference Point on
a CNC lathe.
1.8 Commonly used G-codes on the XLTURN machine:
G00
G01
G02
G03
G04
G17
G18
G19
G20
G21
G28
G70
G71
G72
G74
G75
G76
G90
G92
G94
G98
G99
Positioning(Rapid Feed)
Linear Interpolation(Cutting Feed)
Circular Interpolation CW
Circular Interpolation CCW
Dwell
XY Plane
ZX Plane
YZ Plane
Inch Mode Input
Metric Mode Input
Return To Reference Point(Homing)
Finishing Cycle
Profile Turning Cycle
Profile Facing Cycle
Drilling Cycle
Grooving Cycle
Threading cycle
Turning Cycle
Treading Cycle
Facing Cycle
Feed per Minute
Feed per Revolution
Program Stop
DSCE
Bangalore 78
M01
M02
M03
M04
M05
M06
M08
M09
M13
M14
M98
M99
M30
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
Optional Stop
Program Reset
Spindle Forward
Spindle Reverse
Spindle Stop
Auto Tool Change
Coolant ON
Coolant OFF
Spindle Forward and Coolant ON
Spindle Reverse and Coolant ON
Sub Program Call
Sub Program Exit
Program Reset and Rewind
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
Format
N__ G02/03 X__ Z__ I__ K__ F__ using the arc center
OR
N__ G02/03 X__ Z__ R__ F__ using the arc radius
G02 moves along a CW arc
G03 moves along a CCW arc
Arc center
The arc center is specified by addresses I and K. I and K are the X and Z co-ordinates of the arc
center with reference to the arc start point.
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
Format
G71 U (d) R (e)
G71 P(n) Q(n) U(u) W(w) F(f)
N (n) _ _ _ _
_______
_______
N (n) _ _ _ _
d = Depth of cut
e = Retract amount
n = Number of the first block of the shape
n = Number of the last block of the shape
u = Finishing allowance in X
w =Finishing allowance in Z
f = Feed rate
II.
10
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
X is the diameter to which the movement is being made OR U is the incremental distance from
the current tool position to the required final diameter.
Z is the Z axis coordinate to which the movement is being made OR W is the incremental
distance from the current tool position to the required Z axis position.
F is the feed rate.
TP-1. Write a program to perform the step facing of the component as shown in the figure:
O1001
2.5 2.5
R Tool Entry
point
M06 T0101
M03 S1200
G00 X31 Z0
30
20
10
Z-1
Z-1.5
Z-2
Z-2.5
X20 Z-3
Z-3.5
Z-4
Z-4.5
Z-5
G28 U0 W0
M05
M30
11
MANUAL
CIM & AUTOMATION LAB:
10MEL78
DSCE
Bangalore 78
III.
Department of Mechanical
Engineering
The Step Turning Operation can be performed by using the Box Turning Cycle G90 Cycle as
below.
SYNTAX:
Point
R
G90 X..ZF.
Tool Entry
Where,
Tool Entry
point
X29
X28
X27
X26
X25
30
25
3
0
20
2
5
G00 X25 Z1
G90 X25 Z-25 F30
X24
X23
X22
X21
X20
G28 U0 W0
M05
M30
12
DSCE
Bangalore 78
IV.
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
The above taper turning operation can be performed by the standard G90 Taper Turning Cycle.
Its syntax is:
G90 X.Z.R..F..
Where,
X is the diameter to which the movement is being made.
Z is the Z axis coordinate to which the movement is being made.
R is the difference in incremental of the cut start radius value and the cut finish radius value.
TP-3 Write a part program to perform the taper turning operation using the G90 Taper Turning
Cycle (R ve) for the work part shown in figure.
O1004
G21 G98
30
G28 U0 W0
M06 T0101
M03 S1200
G00 X30 Z1
G90 X30 Z-10 R0 F50
10
25
Tool Entry
point
[(30-30)/2 = 0]
X30 R-0.5
[(29-30)/2 = -0.5]
X30 R-1
[(28-30)/2 = -1]
X30 R-1.5
[(27-30)/2 = -1.5]
X30 R-2
[(26-30)/2 = -2]
X30 R-2.5
[(25-30)/2 = -2.5]
G28 U0 W0
M05
M30
13
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
TP-4. Write a part program to perform the taper turning operation using the G90 Taper Turning
Cycle (R +ve) for the work part shown in figure.
30
O1005
G21 G98
G28 U0 W0
25
M06 T0101
M03 S1200
10
G00 X30 Z1
G90 X30 Z-10 R0 F50
Tool Entry
point
[(30-30)/2 = 0]
X29 R0.5
[(30-29)/2 = 0.5]
X28 R1
[(30-28)/2 = 1]
X27 R1.5
[(30-27)/2 = 1.5]
X26 R2
[(30-26)/2 = 2]
X25 R2.5
[(30-25)/2 = 2.5]
Tool
Entry
Point
X2
9
X2
8
Tool
Entry
Point
X2
7
X2
6
X2
5
G28 U0 W0
M05
M30
V.
The Multiple Turning Cycle is used when the major direction of cut is along the Z axis. This
cycle causes the profile to be roughed out by turning. Two G71 blocks are needed to specify all
the values.
Syntax:
G71 UR
G71 P..QU..W..F
VI.
Finishing Cycle (G70 Cycle): U is the finishing allowance for the X axis
On completion of any roughing operation, the material left as finishing allowance is removed
F is the feed rate
using the Finishing Cycle. The same tool path used in the roughing operation is used in the G7014
MANUAL
CIM & AUTOMATION LAB:
10MEL78
DSCE
Bangalore 78
Department of Mechanical
Engineering
cycle. The G70 Cycle causes a range of specified blocks to be executed, then control passes on to
the block after the G70 Cycle.
Syntax:
G70 P.Q.F..
Where,
TP-5 Write a part program for Multiple Turning operation for the component shown in the
figure.
P10
P9
O1006
G21 G98
30
28
P8
G28 U0 W0
M06 T0101
24
P7
R8
P6
22
M03 S1200
G00 X30 Z1
G71 U0.5 R1
P5
17
Tool Entry
point
R8
P4
14
P3
P2
9
13
P1
27
N2 X9 Z-2
N3 Z-15
N4 G02 X14 Z-22 R8
N5 G01 X17 Z-27
N6 Z-32
N7 G03 X22 Z-39 R8
N8 G01 X24
N9 X28 Z-44
N10 X30
POINT
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10
X
7
9
9
14
17
17
22
24
28
30
Z
0
-2
-15
-22
-27
-32
-39
-39
-44
-44
15
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
TP-6 Write a part program for Multiple Turning operation for the component shown in the
figure. Use a finishing tool for the finishing cycle.
O1007
[BILLET X30 Z70
G21 G98
30
G28 U0 W0
R
10
20
G71 U0.5 R1
G71 P10 Q20 U0.5 W0.5 F50
N10 G01 X8
10
1
0
10
1
2 8
X10 Z-2
Z-15
G03 X20 Z-25 R10
N20 G01 X30 Z-35
G28 U0 W0
M06 T0303
M03 S1450
Select Finishing
Tool
G00 X30 Z1
G70 P10 Q20 F40
G28 U0 W0
M05
M30
Note: Whenever a tool change is to be made, current tool must be sent to Home Position by
using the G28 command, so as to ensure that turret indexing will not interfere with workpiece or
machine tool parts (work table).
16
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
TP-7 Write a part program for Multiple Turning operation for the component shown in the
figure. Note that it is the same component as shown above except that there is an extra taper
before the circular interpolation.
It should be noted that the G71 cycle works only for continuously increasing (for external
operation) or decreasing (for internal operations) dimensions only. Hence the shaded portion in
the figure must be removed separately (by using the G90 R +ve cycle) after using the G71 cycle.
O1008
G21 G98
G28 U0 W0
M06 T0101
M03 S1200
G00 X30 Z1
G71 U0.5 R1
Tool Entry
point
X6 R2
X5 R2.5
G28 U0 W0
M05
M30
17
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
1.12 Subprogram:
A CNC program is divided into a main program & a subprogram. Normally the CNC operates
according to the main program but when a command calling a subprogram is encountered in the
main program, control is passed to the subprogram. When a command indicating a return to the
main program is encountered in the subprogram, control is returned to the main program. The
first block of the main program & sub program must contain a program number starting with
letter O.
Use of subprogram: When a program contains certain fixed sequences or frequently repeated
patterns, these sequences or patterns can be entered into the memory as a subprogram to simplify
programming. If a subprogram can call another subprogram, it is regarded as a one loop sub
program call.
Syntax:
M98 P0000000
Subprogram
No.
No. of
repetitions
Subprogram call
Command used in
Subprogram
M99
Main
O0001
Program
Subprogra
m
O2222
Subprogram
O3333
..
..
..
..
..
..
M980012222
M980013333
..
..
..
..
..
..
..
..
..
..
M30
M99
M99
Note: If the Number of repetition is omitted, the called subprogram is executed only once.
18
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
TP-8. Write a part program to machine the component shown in the figure making use of a sub
program.
1
0
O1009
[BILLET X22 Z70
G21 G98
22
20
G28 U0 W0
15
M06 T0101
M03 S1200
G00 X22 Z1
Tool Entry
point
O2000
G90 X20 W-5 R0 F30
X20 R-0.5
X20 R-1
X20 R-1.5
X20 R-2
X20 R-2.5
G00 X20 W-5
G90 X20 W-5 R0 F30
X19 R0.5
X18 R1
X17 R1.5
X16 R2
X15 R2.5
G00 X20 W-5
M99
G28 U0 W0
M05
M30
Note: (1) While writing the subprogram, incremental dimensioning is normally used.
Dimensions which remain constant in every pass can be programmed as absolute dimensions.
(2) Main program and sub-programs are written in separate files
Subprogram Nesting: When one subprogram calls for another subprogram, subprogram nesting
is said to be done.
19
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
TP-9 Write a part program for the component shown in figure making use of the Subprogram
Nesting.
O1010
[BILLET X22 Z70
G21 G98
G28 U0 W0
M06 T0101
M03 S1200
G00 X22 Z1
Tool Entry
point
M98 P0012020
M98 P0012020
22
20
M98 P0012020
G28 U0 W0
M05
15
M30
O2020
G90 X20 W-5 R0 F30
O2030
G90 X20 W-5 F50
X20 R-0.5
X19
X20 R-1
X18
X20 R-1.5
X17
X20 R-2
X16
X20 R-2.5
X15
X18 R1
X17 R1.5
20
MANUAL
CIM & AUTOMATION LAB:
10MEL78
DSCE
Bangalore 78
Department of Mechanical
Engineering
X16 R2
X15 R2.5
G00 X20 W-5
M98 P0012030
M99
VII. External Grooving (G81 Cycle):
Syntax:
G81 X.Z..F..
Where,
X is the diameter up to which the grooving must be done.
Z is the Z-axis coordinate where the grooving must be done.
F is the feed rate.
TP-10 Write a part program for performing the external grooving operation for the component
5
shown in figure.
22
O1011
[BILLET X22 Z70
G21 G98
R
7
15
8
G28 U0 W0
18
1
0
10
1
3
12
2
10
M06 T0101
M03 S1200
G00 X22 Z1
G71 U0.5 R1
Tool Entry
point
X12 Z-20
G02 X18 Z-27
G01 X18 Z-37
N20
X22 Z-45
G28 U0 W0
M06 T0303
Call
tool
21
DSCE
Bangalore 78
MANUAL
CIM & AUTOMATION LAB:
10MEL78
Department of Mechanical
Engineering
M03 S800
G00 X12 Z-15
G81 X11.5 Z-15 F30
X11
X10.5
X10
G00 X13 Z-15
G00 X19
Z-36
G81 X18.5 Z-36 F30
X10.5
X18
X10
X17.5
G00 X19
X17
Z-37
X16.5
X16
X18
X15.5
X17.5
X15
X17
G00 X19
X16.5
G28 U0 W0
X16
M05
X15.5
M30
X15
22
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering
VIII. External Threading: The threading operation can be performed by using the Box
Threading Cycle-G92 Cycle.
Syntax:
G92 X..Z..F..
Where,
For Metric
angle), given the major diameter and pitch, the thread height can be given by:
h = (pitch) 0.61343
Then the Core (Minor) Diameter can be given as:
Core Diameter = (Major diameter) 2(h)
Commonly used thread parameters for ISO metric thread:
Major Diameter
Pitch
Major Diameter
Pitch
(mm)
(mm)
0.45
0.5
0.7
0.8
1
1.25
1.5
(mm)
(mm)
1.75
2
2.5
3
3.5
3.5
4
M 2.5
M3
M4
M5
M6
M8
M 10
M 12
M 16
M 20
M 24
M 30
M 33
M 36
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
TP-11 Write a part program to perform the threading operation on the component as shown
in the figure.
O1012
[BILLET X22 Z70
22
G21 G98
M10
1.5
2
G28 U0 W0
10
M06 T0101
M03 S1200
G00 X22 Z1
1
0
Tool Entry
point
G71 U0.5 R1
2
5
X10 Z-2
Z-25
Thread height = h = (pitch)
0.61343
= 1.5 0.61343
Call grooving
tool
= 0.920 mm
M98P0022040
O2040
G28 U0 W0
M06 T0505
M03 S800
Call threading
tool
G00 X15 Z2
X9
X8.5
X9.75
X8
X9.50
X9.25
X7.5
X9.00
X7
X8.75
X8.50
X8.25
G00 X11
W1
M99
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering
X8.159
G28 U0 W0
M05
M30
Exercise Programs:
EXTRA CLASS
Internal Operation: The motion commands G00, G01, G02 & G03 as well as some of the
cycles G90 (Linear & Taper), G71, G81, etc. can be performed as internal operations also.
Pilot Hole Drilling (G74 Cycle): The Pilot hole required to perform any other internal
operations can be performed by using the G74 Cycle.
Syntax:
G74 R
G74 X..Z..Q..F
Where,
TP-12 Write a part program to perform the Pilot Hole Drilling on the component as shown
8
in the figure.
30
O1013
[BILLET X30 Z70
G21 G98
G28 U0 W0
M06 T0505
M03 S1200
Call 8 mm center
drill
G00 X0 Z1
G74 R1
G74 X0 Z-8 Q500 F50
G28 U0 W0
Tool Entry
point
CENTER
DRILL
8
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
M05
M30
TP-13 Write a part program to perform the internal step turning operation (internal boring)
on the component as shown in the figure.
O1014
30
16
G28 U0 W0
M06 T0505
M03 S1200
Call 8 mm center
drill
G00 X0 Z1
Tool Entry
point
G74 R1
22
12
1
6
2
0
2
0
Call 12 mm center
drill
1
0
G00 X0 Z2
G74 R1
G74 X0 Z-75 Q500 F30
G28 U0 W0
M06 T0101
M03 S1200
G00 X12 Z2
G90 X12 Z-6 F50
X13
X14
X15
X16
X17 Z-40
X18
Call 10 mm boring
bar
28
10 mm boring
bar
2
0
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering
X19
X20
X21
X22
X23 Z-20
X24
X25
X26
X27
X28
G28 U0 W0
M05
M30
TP-14 Write a part program to perform the internal contouring operation on the component
as shown in the figure.
R5
R6
17
12
2
0
1
5
O1015
[BILLET X30 Z70
G21 G98
G28 U0 W0
M06 T0505
M03 S1200
G00 X0 Z1
G74 R1
22
Call 8 mm center
drill
Tool Entry
point
13
1
0
1
0
28
30
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
Call 12 mm center
drill
G00 X0 Z2
G74 X0 Z-75 Q500 F30
10 mm boring
bar
G28 U0 W0
M06 T0101
M03 S1200
Call 10 mm boring
bar
G00 X12 Z2
G71 U0.5 R1
G71 P10 Q20 U0.2 W0 F50
N10 G01 X30
X28 Z-5
G02 X22 W-7 R5
X17
W-10
G03 X13 W-8 R6
G01 W-10
N20 G01 X12 W-15
G70 P10 Q20 F50
G28 U0 W0
M05
M30
1
0
G74 R1
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
2.1 Automatic Tool Changer (ATC): It is a facility or device provided on the CNC Mill for
automatically indexing the tool magazine and making the required tool change as indicated in
the CNC program.
2.2 Automatic Pallet Changer (APC): It is a time saving facility provided on the CNC Mill
for automatically loading and unloading the pallets. Pallets are portable work holding
devices. While a loaded pallet is being used, a machined-component may be unloaded from
the pallet and a to-be-machined workpiece may be loaded on to the pallet.
2.3 Dimensional Notations used in CNC Mill are:
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering
2
0
ABSOLUTE (G90)
3
0
P
P
4
0
4
0
3
0
6
0
8
0
INCREMENTAL
(G91)
Point
P1
P2
P3
P4
P5
P6
P7
P8
P1
X
0
0
60
60
100
100
20
20
0
Y
0
100
100
70
70
30
30
0
0
X
0
0
60
0
40
0
-80
0
-20
Y
0
100
0
-30
0
-40
0
-30
0
Note: Incremental program is easy to program but tedious to change values in between. Error
committed in any block is carried over to the consecutive blocks. Whereas, absolute
programming is a bit inconvenient as all coordinates are measured from a fixed point. Error
committed in any block will affect only that block. Consecutive blocks are not affected.
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
G01
G20
G21
G28
G02
G03
G90
G91
G94
G95
word)
Inches programming
Metric programming
Return to reference point OR home position
Circular Interpolation CW
Circular Interpolation CCW
Absolute Programming
Incremental Programming
Feed programmed in mm/min
Feed programmed in mm/rev
Optional stop
Program end
Spindle ON CW
Spindle ON CCW
Spindle OFF
Tool change
Coolant ON
Coolant OFF
Program stop & rewind
X Mirror ON
Y Mirror ON
X Mirror OFF
Y Mirror OFF
Subprogram Call
Subprogram end
2.7 Subprogram:
A CNC program is divided into a main program & a subprogram. Normally the CNC operates
according to the main program but when a command calling a subprogram is encountered in
the main program, control is passed to the subprogram. When a command indicating a return
to the main program is encountered in the subprogram, control is returned to the main
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
program. The first block of the main program & sub program must contain a program number
starting with letter O.
Use of subprogram: When a program contains certain fixed sequences or frequently
repeated patterns, these sequences or patterns can be entered into the memory as a
subprogram to simplify programming. If a subprogram can call another subprogram, it is
regarded as a one loop sub program call.
Syntax:
M98 P0000000
Subprogram
No.
No. of
repetitions
Subprogram call
M99
Command used in
Subprogram
SubProgram
O3333
Main Program
O0001
SubProgram
O2222
..
..
..
..
..
..
M980012222
M980013333
..
..
..
..
..
..
..
..
..
..
M30
M99
M99
1
0
6
0
10
R
10
P5
10
P4
P6
P3
X
Y
P1
20
10
P2
10
20
P3
10
80
P4
20
90
P5
80
90
P6
90
80
P7 Size 100
90 x 100
10x
Billet
10 mmP1
20
10
80
0
60
0
MP 1. Write a part program to perform the contour slotting operation on the component as
shown in the figure. The slot should have a width of 8 mm and a depth
of 1 mm.
P2
R
10
P7
20
P1
2
0
7
0
1
0
Cutter Dia: 8 mm
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
O0003
([BILLET X100 Y100 Z10)
([TOOLDEF T01 D8)
([EDGEMOVE X0 Y0)
G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01
M03 S1200
G00 X20 Y10 Z5
G01 Z-1 F50
(P1)
(P2)
(P3)
X20 Y90
(P4)
X80 Y90
(P5)
(P6)
(P7)
X20 Y10
(P1)
G00 Z5
G91 G28 Z0
G28 X0 Y0
G90
M05
M30
Department of Mechanical
Engineering
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
MP 2. Write a part program to perform the contour slotting operation on the component as
shown in the figure for program MP 1. The slot should have a width of 8 mm and a depth of 5
mm. Use subprogram with a maximum depth of cut of 1 mm per pass.
O0004
G21 G94
G91 G28 Z0
G28 X0 Y0
O1155
G90
M06 T01
G90
M03 S1200
(P2)
(P3)
X20 Y90
(P4)
X80 Y90
(P5)
(P6)
(P7)
X20 Y10
(P1)
M99
(P1)
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
64
mm
G21 G94
6 mm
10 mm
G91 G28 Z0
G28 X0 Y0
64 mm
M06 T01
M03 S1000
G00 X0 Y0 Z5
G01 Z0 F30
M98 P0063456
G01 Z5
G91 G28 Z0
G28 X0 Y0
100
mm
G90
M05 M30
O3456
X5 Y5
X10 Y10
G90
X90 Y10
G01 X100 Y0
X90 Y90
X100 Y100
X0 Y100
X0 Y0
X5 Y5
X10 Y90
X10 Y10
G42 G01 X18 Y18
X82 Y18
X82 Y82
X95 Y5
X18 Y82
X95 Y95
X18 Y18
X5 Y95
X50 Y18
100
mm
G90
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
X50 Y10
G01 X0 Y0
G40
M99
Department of Mechanical
Engineering
G01 X15 Y0
G90
G01 X5 Y0
G03 X-5 Y0 R5
X20 Y0 R20
X5 Y0 R5
G01 X25 Y0
G01 X10 Y0
X25 Y0 R25
X10 Y0 R10
G01 X30 Y0
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
X0 Y37 R37
X30 Y0 R30
G01 X0 Y25
G40
G01 X0 Y0
X37 Y0 R37
M99
57 mm
8 mm
10
mm
G91 G28 Z0
57 mm
G90
M06 T01
M03 S1000
G00 X0 Y0 Z5
G01 Z0 F30
M98 P0087061
G01 Z5
100mm
G91 G28 Z0
G28 X0 Y0
G90
M05
M30
O7061
X-5 Y-5
X5 Y-5
G90
X5 Y0
G01 X5 Y0
X10 Y0
X5 Y5
X10 Y10
X-5 Y5
X-10 Y10
100
mm
G28 X0 Y0
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
X-10 Y-10
X21.5 Y21.5
X10 Y-10
X-21.5 Y21.5
X10 Y0
X-21.5 Y-21.5
X15 Y0
X21.5 Y-21.5
X15 Y15
X21.5 Y10
X-15 Y15
X15 Y10
X-15 Y-15
G40
X15 Y-15
G01 X0 Y0
X15 Y0
M99
of
dimensions
100mm100mm10
mm.
The
pockets
dimension
is
73mm61mm5mm and is located at the centre of the workpiece. Use a cutter diameter of 10
mm. Length of the pocket is parallel to X axis. Take program zero at the top face center of the
workpiece.
O9128
G21 G94
G91 G28 Z0
73
mm
G28 X0 Y0
G90
5 mm
10
mm
M06 T01
M03 S1000
61
mm
100
mm
G00 X0 Y0 Z5
G01 Z0 F30
M98 P0058753
G01 Z5
G91 G28 Z0
G28 X0 Y0
G90
M05
M30
100 Y (mm)
mm 4.1781
8.3561
12.5342
16.7123
20.8904
25.0685
30.5
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
O8753
G91 G01 Z-1 F30
G90
G01 X5 Y0
X5 Y4.1781
X-5 Y4.1781
X-5 Y-4.1781
X5 Y-4.1781
X5 Y0
X10 Y0
X10 Y8.3561
X-10 Y8.3561
X-10 Y-8.3561
X10 Y-8.3561
X10 Y0
X15 Y0
X15 Y12.5342
X-15 Y12.5342
X-15 Y-12.5342
X15 Y-12.5342
X15 Y0
X20 Y0
X25 Y20.8904
X-30 Y-25.0685
X20 Y16.7123
X-25 Y20.8904
X30 Y-25.0685
X-20 Y16.7123
X-25 Y-20.8904
X30 Y0
X-20 Y-16.7123
X25 Y-20.8904
X20 Y-16.7123
X25 Y0
X36.5 Y30.5
X20 Y0
X30 Y0
X-36.5 Y30.5
X30 Y25.0685
X-36.5 Y-30.5
X-30 Y25.0685
X36.5 Y-30.5
X25 Y0
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
X36.5 Y10
G40
X25 Y10
G01 X0 Y0
Department of Mechanical
Engineering
M99
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
2.12 Mirroring: If symmetrical contours (symmetry about X axis only, symmetry about Y
axis only OR simultaneous symmetry about both X & Y axes) are to be machined on a
component, the mirroring feature in CNC programming can be selected to ease the task of
programming. Here, part program (usually a sub-program) is written only for one of the
contours of the symmetric pair. Part program for the other part of the pair can be appended by
just selecting the Mirror On feature.
M codes that are used for selecting the Mirror On feature are:
M70
M71
X Mirror OFF
to cancle X Mirroring
M81
Y Mirror OFF
to cancle Y Mirroring
Note: (1) Simultaneous mirroring of X & Y values is possible by programming both M70 &
M71.
(2) Mirroring changes the CW arc tool movement to CCW and vice-versa. In other
words, G02 becomes G03 and G03 becomes G02
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
MP 7.Write a part program to perform the mirroring operation on the component as shown in
the figure. Take cutter dia = 8 mm. Let the depth of the slot be 1 mm.
G21 G94
X10 Y40
G90
X40 Y10
M06 T02
3
0
5
0
Z5
G00 X0 Y0 Z5
M98 P0017577
G00 X0 Y0
M70
M99
X Mirror ON
M98 P0017577
M80
X Mirror OFF
M71
Y Mirror ON
M98 P0017577
X Mirror ON
M98 P0017577
M80
X Mirror OFF
M81
Y Mirror ON
M05 M30
1
0
X10 Y10
M03 S1200
G28 X0 Y0
3
0
1
0
G28 X0 Y0
G91 G28 Z0
1
0
G91 G28 Z0
M70
5
0
1
0
O7577
O0006
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering
Sequence
number
1
2
3
4
5
6
All dimensions in mm
Operations
Facing
Contour pocketing
Rectangular pocketing
Drilling
Counter Sinking
Tapping
Tool
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering
All dimensions in
mm
Sequence
number
1
2
3
4
5
6
Operations
Plain Facing
Contour turning
Finish turning
Finish Facing
Pilot hole drilling
Peck drilling
Tool
External facing tool
External turning tool
External finishing tool
External facing tool
8 mm dia center drill
8.5 mm dia twist drill
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
5. Exercise Problems
Department of Mechanical
Engineering
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
DSCE
Bangalore 78
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
Department of Mechanical
Engineering
MANUAL
COMPUTER INTEGRATED
MANUFACTURING:
06MEL77
DSCE
Bangalore 78
Department of Mechanical
Engineering