Computerized Numerical Control (CNC) System
Computerized Numerical Control (CNC) System
CNC LATHE
+X
CNC MILLING
+X
+Z
UCS
a b
+X d X- axis
c (0,0)
e f
g X
-X
PT. X Y PT. X Y
A A
B B
C C
D D
E -Y E
F Legend: F
G Scale division = 10mm G
CARTESIAN GRAPH FOR CNC MILLING
Measuring the distance to a location from a fixed origin is
referred to as the Absolute Coordinate System and
measuring the distance of a point relative to the last
point is referred to as Incremental /Relative Coordinate
system.
PT. X Y
A
SPINDLE /
M. Cutter B Y-axis
C
D G F
E D
E X- axis
F B
C
G
A
NUMERICAL CONTROL SYSTEM
REFERENCE POINT
There are two main reference points on CNC machine from
which to base all coordinates. The Machine Reference Zero
MRZ- a point on the actual machine and the Part Reference
Zero PRZ- a point of the actual work piece. All CNC machine
tool require a reference point from which to base all
coordinates.
MACH.
COLUMN
MRZ
Work piece
MACH. TABLE
THE RIGHT HAND RULE OF COORDINATES
The machine coordinate system is described by the right
hand rectangular coordinate system.
G –CODES are preparatory functions, which involves actual tool moves. These
include rapid moves, radial feed moves, dwells and roughing and profiling
cycles. Most G-codes are modal- meaning it remain active until cancelled by
another G-code.
XY then Z Z then XY
XY -Z
CNC PROGRAM (G01)
G01 LINEAR INTERPOLATION
Linear Interpolation is a straight line feed moves. A G01 command is
specifically for the linear removal of material from a workpiece,
The G01 is modal and is subject to a user variable to a user variable
feedrate.
The G01 is not limited to one plane, it can be used to cut different angle on
three axis at the same time ( simultaneous feed moves)
Format: N_ G01 X_ Y_ Z_ F_
MACH. TABLE
CNC PROGRAM(G02/G03)
G02/G03 CIRCULAR INTERPOLATION(CW/CWW)
Circular interpolation is a radial (or arc) feed moves. The G02
command is specifically for all clockwise radial feed moves,
whether they are quadratic arcs, partial arcs or complete circles as
long as they lie in any one plane.
Y Y
COUNTER CLOCKWISE
CLOCKWISE ROT. MOVEMENT
20
20
center End/
10 10
start center end start
X X
10 20 10 20
G02/ G03 command requires an endpoint and a
radius in order to cut the arc. To find the radius ,
simply measure the distance from the start point to
the center point. The radius is written in terms of I for
x-axis and J for Y- axis and K for Z axis.
R for radius maybe used for ARC to a maximum of
movement of 180 degrees.
Y Y
Start X1 Y2 end
start Center X1 Y1 2
2
Radius i0 J -1 G03
__________________
1 1
center G02 X2 Y1 i0 J-1 center start
end
Or
X
1 X G02 X2 Y1 R1 1 2
2
G02 End point
RADIUS FORMAT ARC
In the radius format, the coordinates of the end point of the arc
is the selected plane are specified along with the radius of the
arc. Program G02/G03 x _ y_ z_ r. R is the radius. A positive
radius indicates that the arc turns through 180 degrees or less,
while a negative radius indicates a turn of 180 deg to 359.999
degrees.
It is error if:
1.Both of the axis words for the axes of the selected plane are
omitted.
2.The end point of the arc is the same as the current point
CENTER FORMAT ARC
In the center format, the coordinates of the end point of the arc in the
selected plane are specified along with the offset of the center of the arc from
the current location. In this format, it is ok if the end point is the same as the
current point.
It is an error if:
When the arc is projected on the selected plane, the dist. From the current
point to the center differs from the distance from the end point to the
center by more than 0.0002 inch. Or 0.002mm.
The center is specified using the I and J words. There are two ways of
interpreting them. The usual way is that I and J are the center relative to the
current point at the start of the arc. This is called INCREMENTAL IJ MODE.
The second way is that I and J specify the center as actual coordinates in the
current system. This is called ABSOLUTE IJ MODE
G17 G02 X10 Y16 I3 J4 – incremental mode radius are specified
G17 G02 X10 Y16 I10 J11 – absolute mode radius not specified
Y- axis
y
20
10
end center start
X- axis START
10 20
20
10
END
0 30 40
CNC PROGRAM (G02)
%
O1002
N05 G17 G90 G20 -Use XY plane, absolute, inch unit programming
N10 M06 T3 -Stop for tool change, use tool # 3
N15 M03 S1250 -Turn the spindle on CW to 1250 rpm
N20 G00 X1 Y1 -Rapid to X1, Y1 from origin point
N25 Z 0.10 -Rapid down to Z .125
N30 G01 Z -0.10 F5 -Feed down to Z -0.125 at 5 inch per min.
N35 G02 X2 Y1 I0 J-1 F5 –Arc Feed CW, radius I0,J-1 at 5 ipm
N36 G01 X 3.5
N37 G02 X3 Y0.5 R2 f5 -Arc feed CW, radius 2
N38 X1 Y1 R2 - Arc feed CW, radius 2
N40 G00 Z 0.1 -Rapid up to Z
N45 X2 Y1.5 -Rapid to X, Y
G01 Z-.1 F5
N46 G02 X2 Y.5 I 0.25 J -0.25 - Full circle arc feed move CW
N47 G00 Z1 - Rapid move up to z1
N48 X0 Y0 - Rapid move to x0,y0
N50 M05 -Turn the spindle Off
N55 M30 -End of program
CNC PROGRAM (G03)
N05 G90 G20 -Use absolute units, and inch programming
N10 M06 T3 -Stop for tool change, use tool # 3
N15 M03 S1250 -Turn the spindle on CW to 1250 rpm
N20 G00 X2 Y0.5 -Rapid to X1, Y1 from origin point
N25 Z 0.125 -Rapid down to Z .125
N30 G01 Z -0.125 F5 -Feed down to Z -0.125 at 5 inch per min.
X3 Y0 F15
N35 G03 X3.5 Y1 R0.5 – G03 Arc using R value
N36 G01 X 3
N37 G03 X3 Y3.5 I-0.5 J 0 -G03 Arc using I and J
N38 G01 X2
G03 X2 Y1.5 I 0J -1 180 degrees arc using I and J
N40 G01 Y0.5 -
N45 G00 Z0.125
X1.5 Y2.5 -
G01 Z-.25 F5
N46 G03 X1.5 Y2.5 I 0.5 J - Full circle using I and J
N47 G00 Z1 - Rapid move up to z1
N48 X0 Y0 - Rapid move to x0,y0
N50 M05 -Turn the spindle Off
N55 M30 -End of program
CNC PROGRAM
G41/42 CUTTER COMPENSATION (LEFT/RIGHT)
G41/G42 Command compensates the cutter a specified distance to the LEFT-hand/
RIGHT hand side of the programmed tool path. It is used when compensating for
excessive tool wear or when profiling a part.
This command refers to the offset register to determine the correct compensation
distance. When you set the offset registers prior to program execution, the MCU is able
to refer to them when required. Each numbered register is accessed by the letter
address D for CNC milling.
PROG. PATH
NOTE:
1.When the POWER is turned ON G40 is effective
2.The XY plane (G17) is ineffective when the Power is turned ON
3.The direction of compensation (right/left) indicated above are
reversed when the sign of the tool radius value in the offset memory
designated by a “D” code is negative.
4.Make sure to designate a “D” code in the block containing G41/G42
or in the preceding block e.g. G17, G41. D20, (XY plane, left of centre)
5.If D_ is commanded, tool radius will be regarded as Zero.
6.Switching between G41 and G42 can be made in the compensation
mode.
7.When after the tool radius compensation is programmed by G41,G42
the tool moves along the offset path until the instruction G40 is given.
8.Give the instruction G40 before sending the machine to the home
position.
METHOD OF ENTRY INTO COMPENSATION MODE
When G41(G42) is programmed, the tool moves to an offset position equal
to the distance of the radius. The offset position is on the normal line at the
short point of the block immediately after G41(G42).
IF no co-ordinate instruction is program in the block of G41(G42),
TOOL movement is made by the offset value only. A G41/G42 must accompany a
G40 movement (GO1 or G00)
G41
PROGRAM PATH
EXAMPLE:
EXAMPLE: G42
G17 G01 F __
G17 G01 F __ G41 G41(G42) D_ X__ Y__
G41 (G42) D _ X__
X__ Y__
X_
PROGRAM PATH
G42
Sample program
N05 G90 G20 G40 -Use absolute, and inch units prog. Cutter comp. cancel
N10 M06 T3 -Stop for tool change, use tool # 3
N15 M03 S1250 -Turn the spindle on CW to 1250 rpm
N20 G00 X2 Y0.5 -Rapid to X1, Y1 from origin point
N25 Z 0.125 -Rapid down to Z .125
N30 G01 Z -0.125 F5 -Feed down to Z -0.125 at 5 inch per min.
N31 G01 G41 X3 Y0 F15 - Cutter compensation left
N35 G03 X3.5 Y1 R0.5 – Arc using R value
N36 G01 X 3
N37 G03 X3 Y3.5 I-0.5 J 0 - Arc using I and J
N38 G01 X2
N39G03 X2 Y1.5 I 0J -1 180 degrees arc using I and J
N40 G40 G01 Y0.5 - Cutter compensation cancel -
N45 G00 Z0.125
N46 X1.5 Y2.5 -
G01 Z-.25 F5
N46 G03 X1.5 Y2.5 I 0.5 J - Full circle using I and J
N47 G00 Z1 - Rapid move up to z1
N48 X0 Y0 - Rapid move to x0,y0
N50 G47 M05 -Repeat from first line,Turn the spindle Off
N55 M30 -End of program
CIRCULAR POCKET CW/CCW (G12/G13)
These circular pocket are a sort of canned cycle which can be used to
produce a circular hole larger than the tool in use or with a suitable tool (like
a woodruff key cutter) to cut internal groove for “O” ring.
G12 i_ for clockwise move
G13 i_ for counter clockwise move
The tool is moved in the X direction by the value if the I word and a circle cut
in the direction specified with the original X and Y coordinates as the center.
The tool is returned to the center.