You are on page 1of 81

DIRECT NUMERICAL

CONTROL

Dept. of Aero & Auto Engg, M.I.T 1


DIRECT NUMERICAL CONTROL

A manufacturing system in which a number of machines are controlled

by a computer through direct connection in real time.

It consists of,
1. Central computer
2. Memory
3. Telecommunication lines
4. Machine tools

Dept. of Aero & Auto Engg, M.I.T 2


Direct Numerical Control

Central Bulk memory


computer NC program

Telecommunication
lines

Machine
tools

Figure : DNC system

Dept. of Aero & Auto Engg, M.I.T 3


Direct Numerical Control (DNC)
Advantages:
1. Time sharing

– Control of more than one machine by the computer

2. Greater computational capability

3. Remote computer location

4. Improved reliability

5. Programs stored as cutter location data

Dept. of Aero & Auto Engg, M.I.T 4


DNC CNC
1. Controls many machines 1. Controls only one machine

2. Occupy remote locations 2. Located near the machine tools

3. Acts as a many tool 3. For one machine tool

Dept. of Aero & Auto Engg, M.I.T 5


ISO MACHINE TOOL AXIS DEFINITION

Dept. of Aero & Auto Engg, M.I.T 6


Basic CNC Principles
All computer controlled machines are able to accurately and repeatedly
control motion in various directions. Each of these directions of motion is
called an axis. Depending on the machine type there are commonly two to
five axes.
Additionally, a CNC axis may be either a linear axis in which movement is in
a straight line, or a rotary axis with motion following a circular path.

Dept. of Aero & Auto Engg, M.I.T 7


NC Coordinate Systems
 To program the NC processing equipment, a standard axis system must be
defined by which the position of the work head relative to the work part can be
specified.

 There are two axis systems used in NC, one for flat and prismatic parts and the
other for rotational parts.

 Both axis systems are based on the Cartesian Coordinate System.

Dept. of Aero & Auto Engg, M.I.T 8


NC Coordinate Systems

The axis system for flat and prismatic parts consists of:
1. Three linear axes (X, Y, Z) in Cartesian coordinate system.
2. Three rotational axes (A, B, C)

In most machine tool applications, the x-axes and y-axes are used to move and position the
worktable to which the part is attached, and the z-axis is used to control the vertical position
of the cutting tool 9
RIGHT HAND RULE
Vertical Machine & Horizontal Machine

Dept. of Aero & Auto Engg, M.I.T 10


Dept. of Aero & Auto Engg, M.I.T 11
Example of CNC Programming

What Must Be Done To Drill A Hole On A


CNC Vertical Milling Machine

Dept. of Aero & Auto Engg, M.I.T 12


Tool At Home

Top
View

Front
View

Dept. of Aero & Auto Engg, M.I.T 13


Top
View

Front
View

Dept. of Aero & Auto Engg, M.I.T 14


Top
View

Front
View

Dept. of Aero & Auto Engg, M.I.T 15


Top
View

Front
View

Dept. of Aero & Auto Engg, M.I.T 16


Top
View

Front
View

Dept. of Aero & Auto Engg, M.I.T 17


LETTER ADDRESS LISTING
Letter addresses are variables used in G- and M-codes. Most G-codes contain a variable,
defined by the programmer, for each specific function. Each letter used in CNC
programming is called an address, or word. The words used for programming are as follows.
F Assigns a feed-rate
G Preparatory function
I X-axis location of ARC center
K Z-axis location of ARC center
M Miscellaneous function
N Block number (specifies the start of a block)
P Start block
D Dwell time
Q Block end
D Depth
R Radius
S Sets the spindle speed
T Specifies the tool to be used
A Tool angle
U X stock or incremental value
W Z stock or incremental value
X X coordinate
Z Z coordinate
Dept. of Aero & Auto Engg, M.I.T 18
NC Words
N, G, X, Y , Z, A, B, C, I, J, K, F, S, T, R, M

 F: feed rate of the tool motion


 S: cutting-speed
 T: tool number

Dept. of Aero & Auto Engg, M.I.T 19


NC Words
N, G, X, Y , Z, A, B, C, I, J, K, F, S, T, R, M

 X, Y, Z, A, B, C: provide the coordinate positions of the


tool. X, Y, and Z define the three translational (Cartesian)
axes of a machine. A, B and C are used for the three
rotational axes about the X, Y, and Z axes.
 I, J, K: specify the center for circular motion

Dept. of Aero & Auto Engg, M.I.T 20


N, G, X, Y, Z, A, B, C, I, J, K, F, S, T, R, M
 R: specify the clearance height in
canned-cycle
N0010 G81 X1.000 Y2.000 Z0.000 R1.300
Operations in drill cycle G81 :
1. Rapid to location (1,2,2).
2. Rapid down to the R plane:(1,2,1.3)
3. Feed to the Z point, the bottom of the hole:(1,2,0)
4. Operation at the bottom of the hole (dwelling).
5. Rapid or feed to either the R plane or the initial height.

Dept. of Aero & Auto Engg, M.I.T 21


G-codes
G 00: rapid traverse
G 01:inear interpolation
G 02:circluar interpolation(clockwise)
G 03:circular interpolation(counter-clockwise)
G 04:dwell cycle
G 20:data is in inches
G 21:metric data input
G 28:return to reference point

Dept. of Aero & Auto Engg, M.I.T 22


Dept. of Aero & Auto Engg, M.I.T 23
G01 LINEAR INTERPOLATION
Format: N_ G01 X_ Z_ F_
The G01 command executes all movement along a straight
line at a particular feedrate. These straight-line feed moves
may cut in one or two axes simultaneously. This command can
be used for turning, facing, and tapering. It is specified by the
G01 command, followed by the endpoint of the move, and
then a specified feedrate.

Dept. of Aero & Auto Engg, M.I.T 24


EXAMPLE: G01 Z-2.5 F0.01
In this example, the tool cuts a straight line from its present
location to a point at Z–2.5 at a rate of 0.01

Dept. of Aero & Auto Engg, M.I.T 25


G03 CIRCULAR INTERPOLATION (CCW)
Format: N_ G03 X_ Z_ I_ K_ F_
or N_ G03 X_ Z_ R_ F_
The G03 command executes all radial cuts in a counterclockwise motion. It is specified
by the G03 command, followed by the endpoint for the move, the radius (the distance
from the start point to the center point), and a feedrate.
The radius is specified by defining the incremental distance from the arc’s start-point to
its center-point in both the X and Z directions. These values are identified by I and K
variables, respectively. The R word, the value of the radius of the arc, can also be used.

Dept. of Aero & Auto Engg, M.I.T 26


27
G20 Inch Units
Format: N_ G20

G21 Metric or SI Units


Format: N_ G2

Dept. of Aero & Auto Engg, M.I.T 28


G32 Simple Thread Cycle
Format: N_ G32 X_ Z_ F_
The G32 command invokes a simple or basic thread
cycle. It automatically synchronizes spindle and axis
movements to achieve the desired thread pitch defined by
the F word address.

Dept. of Aero & Auto Engg, M.I.T 29


G32 Simple Thread Cycle
Format: N_ G32 X_ Z_ F_

Dept. of Aero & Auto Engg, M.I.T 30


External curves
in Tool-Radius Compensation
Use of M96 and M97
If a step is to be cut using a cutting tool that is larger than the height of the
step, M97 must be used. If M96 is used, the cutter will roll over the corner
and into the material
N0010 G41 N0010 G41
N0020 G01 X1.000 Y1.000 N0020 G01 X1.000 Y1.000
N0030 G01 Y0.800 M96 N0030 G01 Y0.800 M97
N0040 G01 X2.000 N0040 G01 X2.000

M96 M97

Dept. of Aero & Auto Engg, M.I.T 31


G74 PECK DRILLING CYCLE
Format: N_ G74 X0 Z_ K_ F_
The G74 command executes a peck drilling cycle with automatic retracts and
incremental depths of cut. The G74 command is specified by several letter
addresses:
X0 X always 0
Z Total depth
K Peck depth
F Feed rate
EXAMPLE: N20 G74 X0 Z-1.0 K0.125 F0.015
In this example, a hole is peck
drilled to a total depth of 1 in.,
using 0.125 in. for the depth
of each peck

Dept. of Aero & Auto Engg, M.I.T 32


G76 THREADING CYCLE
Format: N_ G76 X_ Z_ D_ K_ A_ F_
The G76 command performs all threading operations in a cycle, with
automatic depth change and tool path calculation. The G76 command is
specified by several letter addresses:
X Minor diameter of thread
Z Position at end of thread
D Depth of first pass in thousandths (the control uses the first depth
of cut to determine the number of passes)
K Depth of thread
F Pitch of thread (thread pitch = 1/thread/in.)
A Tool angle (If the tool angle is given, the tool will continue to cut
on the leading edge of the tool; if no tool angle is given, the tool will cut on
both sides.)

EXAMPLE: N25 G76 X0.5 Z-1.0 D625 K0.25 A55 F0.1


In this example, the tool cuts a thread, starting at its present location and
ending at the specified XZ endpoint. The D value specifies each cut depth,
and the K value defines the overall depth. The A value defines the tool
angle, and the F value defines the pitch
Dept. of Aero & Auto Engg, M.I.T 33
G76 THREADING CYCLE

Dept. of Aero & Auto Engg, M.I.T 34


G90 Absolute Positioning
Format: N_ G90
The G90 command defaults the system to accept all coordinates as
absolute coordinates. These coordinates are measured from a fixed
origin (X0, Y0, Z0) and expressed in terms of X, Y, and Z
distances.

G91 Incremental Positioning


Format: N_ G91
Incremental coordinates are measured from the previous
point and are expressed in terms of the relative X and Z
distances from the previous point

Dept. of Aero & Auto Engg, M.I.T 35


G97 Constant Spindle Speed Setting
Format: N_ G97 S_

The G97 command is used to cancel the G96


setting and set the spindle speed in revolutions
per minute. The tool position does not affect
the spindle speed.

NOTE: Always use the G97 command when


programming any threading cycles.

Dept. of Aero & Auto Engg, M.I.T 36


M-code list
M-codes are miscellaneous functions that include actions necessary for machining
but not those that are actual tool movements (for example, auxiliary functions). They
include spindle on and off, tool changes, coolant on and off, program stops, and
similar, related functions. The following codes are described in detail in the following
sections.
Block Skip “/” used to bypass CNC blocks
Comments “(” and “)” used to help operator comments
Note: Two or more M-codes cannot be included on the same line.

Dept. of Aero & Auto Engg, M.I.T 37


Dept. of Aero & Auto Engg, M.I.T 38
M00 Program Stop
Format: N_ M00
The M00 command is a temporary program stop
function. When it is executed, all functions are
temporarily stopped and will not restart until
prompted by user input. This command is very useful
in lengthy programs as a way to stop the machine in
order to clear chips, take measurements, or adjust
clamps, coolant hoses, and so on.

Dept. of Aero & Auto Engg, M.I.T 39


M01 Optional Program Stop
Format: N_ M01

The M01 command is an optional stop


command that also halts program execution,
but only if the Optional Stop switch is set to
ON. If the Optional Stop switch is set to OFF,
the program will ignore any M01 commands
it encounters in a program and no optional
stops will be executed.

Dept. of Aero & Auto Engg, M.I.T 40


M02 Program End
Format: N_ M02
The M02 command indicates the end of the
main program. This command, instructs the
MCU to switch off all machine operations (for
example, spindle, coolant, all axes, and any
auxiliaries) and terminates the program. This
command appears on the last line of the
program.

Dept. of Aero & Auto Engg, M.I.T 41


M03 Spindle on Clockwise
Format: N_ M03 S_

The M03 command switches the spindle on so that it


rotates clockwise. The spindle speed is designated by
the letter address S followed by the spindle speed in
revolutions per minute. The image shown illustrates
clockwise operation. Dept. of Aero & Auto Engg, M.I.T 42
M04 Spindle on Counterclockwise
Format: N_ M04 S_

The M04 command switches the spindle on so that it rotates


counterclockwise. It is programmed as with the M03 command.
The spindle speed is designated by the letter address S, followed
by the spindle speed in revolutions per minute. The image shown
illustrates counterclockwise operation.
Dept. of Aero & Auto Engg, M.I.T 43
M05 Spindle Stop
Format: N_ M05
The M05 command turns off the spindle. Although
other M-codes turn off all functions (for example,
M00 and M01 ), this command is dedicated to
shutting off the spindle. The M05 command appears
most often at the end of a program, but it can also be
used prior to a tool change command.

Dept. of Aero & Auto Engg, M.I.T 44


M10 Chuck Open or M11 Chuck Close
Format: N_ M10 or N_ M11

The M10 and M11 commands control the automatic chuck.


M10 opens the chuck, and M11 closes it. In the simulator, the
automatic chuck status is shown in the Machine Status area.
These commands are normally used in conjunction with
automatic bar feeders. The actual M codes used will vary
according to machine tool manufacturer.
Dept. of Aero & Auto Engg, M.I.T 45
M30 Program End, Reset to Start
Format: N_ M30

The M30 command indicates the end of the


program. In other words, no more program
commands follow. This is a remnant of the
older NC machines, which utilized paper tape
and could not differentiate between one
program and the next, so an End of Data
command was developed. Now the M30 is
used to end the program and reset it to the
start.
Dept. of Aero & Auto Engg, M.I.T 46
1. Write a part program to perform the linear slotting operation on the
component as shown in the figure.

Dept. of Aero & Auto Engg, M.I.T 47


O0001
G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01
M03 S1000
G00 X10 Y10 Z2
G01 Z-1 F50
X10 Y90
X90 Y90
X90 Y10
X10 Y10
G00 Z5
G91 G28 X0
G28 Y0 Z0
M05
M30
Dept. of Aero & Auto Engg, M.I.T 48
Slot milling
Slot milling
3) Write a part program to obtain the model shown below from the workpiece
of given size.

 49

75
37.5

50
100

2
15

Mill circular slot using end mill of  4 mm


100

 49

75
37.5

50

Tool
5
2
15
100

 49

75
37.5

50

Tool
5
2
15
100

 49

75
37.5

50

Tool
5
2
15
100

 49

75
37.5

50

Tool
5
2
15
100

 49

75
37.5

50

Tool
5
2
15
100
CIRCULAR INTERPOLATION
 49
G 00 G 91 G 28 Z 0

75
G 28 X 0 Y 0
37.5
M06 T01
M 03 S 1300 50
G 90 Z 5 M 08 2
15
G0 X 50 Y 13

G 94 G01 Z -2 F 20

G 02 X50 Y13 R 24.5


G00 Z 5
G 91 G 28 X 0 Y 0 Z 0
M 05
M 30
Dept. of Aero & Auto Engg, M.I.T 58
Dept. of Aero & Auto Engg, M.I.T 59
Sub Programming

Dept. of Aero & Auto Engg, M.I.T 60


M98 Subprogram call
Format: N_ M98 P_

The M98 command is used to call a subprogram. The


subprogram is referenced by the P letter address followed by the
program number. This is useful when similar operations are
required for a particular program. An example of using sub-
programming is with bolt hole patterns where each hole must
have several canned cycle operations performed on it. If there
are many holes to be drilled these can reside in the subprogram
which is called after each canned cycle is invoked.

Dept. of Aero & Auto Engg, M.I.T 61


M99 Return from Subprogram
Format: N_ M99

The M99 command is used to return from within a


subprogram. The machine control unit continues
execution from the block number immediately after the
M98 subprogram call.

Dept. of Aero & Auto Engg, M.I.T 62


Dept. of Aero & Auto Engg, M.I.T 65
O4000 O9000
G21 G94 G91 G01 Z-1 F50
G90
G90 G28 Z0
G01 X5 Y0
G28 X0 Y0 G03 X-5 Y0 R5
M06 T01 X5 Y0 R5
M03 S1000 G01 X10 Y0
G00 X0 Y0 Z5 G03 X-10 Y0 R10
G01 Z0 F50 X10 Y0 R10
M98 P0059000 G01 X15 Y0
G01 Z5 G03 X-15 Y0 R15
G28 X0 Y0 Z0 X15 Y0 R15
G01 X20 Y0
M05
G03 X-20 Y0 R20
M30 X20 Y0 R20
G01 X25 Y0
G03 X-25 Y0 R25
X25 Y0 R25
M99

Dept. of Aero & Auto Engg, M.I.T 66


Dept. of Aero & Auto Engg, M.I.T 67
Dept. of Aero & Auto Engg, M.I.T 68
Dept. of Aero & Auto Engg, M.I.T 69
Dept. of Aero & Auto Engg,
70
M.I.T
Dept. of Aero & Auto Engg, M.I.T 71
O0011
G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01 (8 mm twist drill)
M03 S1000
G00 X25 Y25 Z10
G98 G90 G73 Z-20 R1 P100 Q5 F100
X25 Y75
X75 Y75
X75 Y25
X50 Y50
G80
G00 G91 G28 X0 Y0 Z0
M05
M30

Dept. of Aero & Auto Engg, M.I.T 72


Dept. of Aero & Auto Engg, M.I.T 73
N10 G21 G94 G41
N20 G91 G28 Z0
N30 G28 X0 Y0
N40 M06 T0101
N50 M03 S1000
N60 G90 G00 X15 Y80 Z5
N70 G01 F100 Z0
N80 G91 G73 X10 Y0 Z-5 Q0.5 R0.0 K5 F35
N90G90
N100 G00 X25 Y80 Z0
N110 G91 G73 X15 Y-15 Z-5 Q0.5 R0.0 K4 F35
N120 G91 G28 Z0
N130 G28 X0 Y0
N140 M05
N150 M30

Dept. of Aero & Auto Engg, M.I.T 74


Mirroring

Dept. of Aero & Auto Engg, M.I.T 75


Mirroring
The codes used are:

M70 - X Mirror ON, All future Y coordinates programmed are taken with –ve values

M71 - Y Mirror ON, All future X coordinates programmed are taken with –ve values.

M80 - X Mirror OFF

M81 - Y Mirror OFF

Dept. of Aero & Auto Engg, M.I.T 76


Dept. of Aero & Auto Engg, M.I.T 77
G21 G94 G91 G28 Z0
G91 G28 Z0 G28 X0 Y0
G28 X0 Y0 M05
M06 T1 M30
M03 S2000 O5000
G90 G0 X0 Y0 Z5 G00 X10 Y10 Z5
M98 P5000 G01 Z-1 F20
M70 X40 F50
M81 X10 Y40
M98 P5000 Y10
G01 Z5
M70
M99
M71
M98 P5000
M80
M71
M98 P005000
M80
M81

Dept. of Aero & Auto Engg, M.I.T 78


Dept. of Aero & Auto Engg, M.I.T 79
Dept. of Aero & Auto Engg, M.I.T 80
Dept. of Aero & Auto Engg, M.I.T 81

You might also like