Computer Aided Manufacturing-II
Computer Aided Manufacturing-II
CIM
ATILIM
UNIVERSITY
G00 X_
Y_
Z_
The G00 command is a rapid tool move. A rapid tool move is used to move the toll linearly from position to position without cutting any material. This command is not to be used for cutting any material
On most CNC machine tools, it is standard to program a G00 rapid for XY move only and the Z moves separately
1. If the Z value represents a cutting move in the negative direction, the X and Y axes should be executed first 2. If the Z value represents a move in the positive direction, the X and Y should be executed last. Example N25 N30 G00 Z0.1 X2.5 Y4.75
Rapid to X2.5 Y4.75 Rapid down to Z0.1
G01 X_
Y_
Z_
F_
G01 command is specifically for the linear removal of material from a workpiece, in any combination of the X, Y, or Z axes. This G code provides for straight line point to point. Motion can occur in 1, specified will start at the same time destination and arrive simultaneously rate. (linear) motion from 2 or 3 axes. All axis and proceed to their at the specified feed
Because there is contact between the cutting tool and the workpiece, it is imperative that the proper spindle speeds and feed rates be used.
N_ N_
G02 X_ G02 X_
Y_ Y_
Z_ Z_
I_ R_
J_ F_
K_
F_
The G02 command is used specifically for all clockwise radial moves, whether they are quadratic arcs, partial arcs, or complete circles, as long as long they lie in any one plane
Example
N35 N45 G02 G02 X2 X3 Y2 Y0.5 I1 R2 J0 F20 F20
X1 X1 I0
Y1 Y2 J-1
__________________________
G02 CW CIRCULAR INTERPOLATION USING "I", &"J" FOR THE X & Y AXIS
N_ N_
G03 X_ G03 X_
Y_ Y_
Z_ Z_
I_ R_
J_ F_
K_
F_
The G03 command is specifically for all counterclockwise radial feed moves, whether they are quadratic arcs, partial arcs, or complete circles, as long as they lie in any plane.
Example
N40 N60 G03 G03 X3 X3.5 Y3.5 Y1 I-0.5 R0.5 J0 F20 F20
X2 X2 I0
Y1 Y2 J-1
__________________________
G03 CCW CIRCULAR INTERPOLATION USING "I", &"J" FOR THE X & Y AXIS
G04 Dwell N_
G04 P_
The G04 command is a Dwell command that halts all axis movement for a specified time, while the spindle continuous revolving at the specified rpm.
A Dwell is used largely in drilling operations, which allows for the clearance of chips
This command requires a specified duration, denoted by the letter P, and followed by the time in seconds.
Example
N30 G04 P2
(Dwell for 2 seconds)
The top view (XY Plane) is selected by G17. The front view (XZ plane) is selected by G18. The right side vide (YZ plane) is selected by G19.
Any plane selection change is programmed as desired, prior to actual tool path change. Plane can be changed as often as necessary in a program, but only one plane can be active at any time. Selection of one plane cancels any other plane, so the G17/G18/G19 commands cancel each other.
G17 XY Plane
N_
G17
G17 commands sets the system to default to the XY plane as the main machining plane for specifying circular interpolation moves and/or cutter compensation. Here the Z-axis is secondary and works perpendicular to the XY plane
G18 XZ Plane
N_
G18
G18 command sets the system to the XZ plane as the main machining plane for specifying circular interpolation moves and/or cutter compensation. This command changes the default machining plane to the XZ plane, where the Y axis is secondary, and works perpendicular to the XZ plane. In this plane, it is possible to cut convex and concave arcs using G02 and G03 circular interpolation commands.
G19 YZ Plane
N_
G19
G19 command sets the system to the YZ plane as the main machining plane for specifying circular interpolation moves and/or cutter compensation. This command changes the default machining plane to the YZ plane, where the X axis is secondary, and works perpendicular to the YZ plane. In this plane, it is possible to cut convex and concave arcs using G02 and G03 circular interpolation commands.
G20
G20 command defaults the system to inch data units. When you are running a program and encounter the G20 command, all coordinates are stated in inch units
G21
G21 command defaults the system to metric data units (Millimeters). When you are running a program and encounter the G21 command, all coordinates are stated in metric (mm) units
G90
The G90 command defaults the system to accept all coordinates as absolute coordinates. Remember that absolute coordinates are those measured from a fixed origin (X0, Y0, Z0) and are expressed in terms of X, Y, and Z distances. This command is found at the beginning of most programs to default the system to absolute coordinates. On some machines it is possible to change between absolute and incremental coordinates within a program
G91
The G91 command defaults the system to accept all coordinates as incremental coordinates. Remember that incremental coordinates are those measured from the previous point and are expressed in terms of X, Y, and Z distances. This command is found at the beginning of some programs to default the system to incremental coordinates. On some machines it is possible to change between incremental and absolute coordinates within a program
Cutter Compensation
Cutter compensation is used to offset the center of the cutter, and shift it the distance of the radius, to the specified side of the programmed path. Complex part geometries having angled lines, lines tangent to arcs, and lines intersecting arcs involve substantial trigonometric computations to determine the center of the cutter. Cutter compensation involves programming the part geometry directly instead of the tool center. The cutter compensation commands are:
Cutter Compensation Left (G41), Cutter Compensation Right (G42), and Cutter Compensation Cancel (G40).
A tool using cutter compensation will change compensated position to an uncompensated position.
from
Be sure to cancel cutter compensation, when you're done with each milling cut series that's using compensation.
Cutter Compensation
Understanding cutter compensation can be simplified if one has a basic understanding of manual machining. There are two common types of cutting conditions associated with milling machines. They are CLIMB and CONVENTIONAL cutting.
You cannot turn ON or OFF cutter compensation in a G02 or G03 circular move, it must be in a linear G00 or G01 straight line move.
G43 H_
This code selects tool length compensation in a positive direction. That is; the tool length offsets are added to the commanded axis positions. An Hnn must be programmed to select the correct offset register from the offset display for that tool being used.
G44 H_
This code selects tool length compensation in a negative direction. That is; the tool length offsets are subtracted from the commanded axis positions. A Hnn must be programmed to select the correct entry from offsets memory.
G49
M-Codes
M-codes are miscellaneous functions that include actions necessary for machining but not those that are actual tool movements. That is, they are auxiliary functions Only one M code may be programmed per block of a program. All M codes are effective or cause an action to occur at the end of the block.
M00
The M00 code is used to stop a program. It also stops the spindle and turns off the coolant and stops interpretation lookahead processing. The program pointer will advance to the next block and stop. A cycle start will continue program operation from the next block.
M01
The M01 code is identical to M00 except that it only stops if OPTIONAL STOP is turned on from the front panel. A cycle start will continue program operation from the next block.
M02
The M01 code is identical to M00 except that it only stops if OPTIONAL STOP is turned on from the front panel. A cycle start will continue program operation from the next block. This command appears on the last line of the program.
M03
The M03 code will start the spindle moving is a clockwise direction at whatever speed was previously set.
M04
The M04 code will start the spindle moving is a counterclockwise direction at whatever speed was previously set.
M05
The M05 command turns the spindle off. Although other Mcods turn off all functions (for example, M00 and M01), this command is dedicated to shutting the spindle off directly. The M05 command appears at the end of a program.
Example % :1010 N5 N10 N65 G90 M06 M05 G20 T12 (Spindle stop)
N_
M06 T_
The M06 code is used to initiate a tool change. The previously selected tool (T_) is put into the spindle. If the spindle was running, it will be stopped. The Z-axis will automatically move up to the machine zero position and the selected tool will be put into the spindle. The Zaxis is left at machine zero. The T_ must be in the same block or in a previous block. The coolant pump will be turned off during a tool change.
Example % :1010 N5 N10 N65 G90 M06 M05 G20 T12 (Tool change to tool #12)
M07/M08
M09
The M09 command shuts off the coolant flow. The coolant should be shut off prior to tool changes or when you are rapiding the tool over long distances.
M10 Clamps On
N_
M10
The M10 command turns on the automatic clamps to secure the workpiece. Not all CNC machines have automatic clamps, but the option exists and the actual code will vary by the machine tool make and model. This command is normally in the program setup section of a CNC Program.
Example % :1010 N5 N10 N15 N20 G90 M06 M10 M03 S1000 G20 T12
(clamp workpiece)
M11
The M11 command releases the automatic clamps so that the workpiece may be removed and the next blank inserted. This command is normally in the system shutdown section of a CNC Program.
Example % :1010 N5 N80 N85 N90 G90 M05 M11 M30 G20
(Unclamp workpiece)
M30
The M30 code is used to stop a program. It also stops the spindle and turns off the coolant. The program pointer will be reset to the first block of the program and stop.
Example % :1012 N5 N65 N85 N90 G90 X0 M05 M30 G20 Y0
M98 P_
The M98 function is used to call a subroutine or subprogram. Execution is halted in the main program and started on the program referenced by The letter P_ address value.
For example, N15 M98 P1003 would call program:1003
M99
The M99 function is used to end or terminate the subprogram and return to the main calling program. Execution is continued at the line immediately following the subprogram call. It is used only at the end of the subprogram.
Block Skip /
N_
If turned on, upon execution of a CNC program and encountering a block skip /, the program will ignore and CNC code on that block.
Example % :1012 N5 /N10 /N20 N85 N90 G90 M06 G00 M05 M30 G20 T03 X0 Y0
..
Comments N_
(Comment statement)
Comments help the CNC machine operator to set up and run a job. Comments are defined by the use of round brackets. Anything between them is ignored by the controller. Remember that comments are just aids to help in reading and understanding a program. Their text is totally ignored even it contains valid CNC code.
Example N 10 G00 Z0.5 (Rapid to Z0.5)
Example
% :1087 N5 G90 G20 G40 N10 M06 T04 N15 M03 S2000 N20 G00 X2 Y-0.375 M08 N25 Z-0.25 N30 G01 Y0 F15 N35 X0.5 Y0.5 N40 Y3.0 N45 G02 X2 I0.75 J0 N50 G01 X3.5 N55 G01 Y0.5 N60 G02 X3 Y0 I-0.5 J0 N65 G01 X2 N70 G00 Z1 N75 X0 M09 N80 M05 N85 M30
(program start flag) (program number) (Absolute, Inches, and compensation canceled) (Tool change to toll #4) (Spindle on clockwise at 2000 rpm) (Rapid to X2, Y-0.375), coolant 2 on) (Rapid down to Z-0.25) (Feed move to point #1 at 15 ipm) (Feed move to point #2) (Feed move to point #3)
(Circular feed move to point #4)
(Feed move to point #5) (Feed move to point #6) (Circular feed move to point #7) (Feed move to point #1) (Rapid to Z1) (Rapid to X0, coolant off) (Spindle off) (End of program)