|
|
Common GCodes For Milling MachinesG0 Rapid PositioningThe machine moves at maximum speed to the specified locations. G0 is a modal code, rapid motion stays in effect until another motion code is encountered. Rapid motion may be linear, shortest axis completes first, or shortest of X and Y complete first, then the Z motion is executed. G0 is usually followed by one or more positions specified by X, Y, and/or Z codes. G0 is used when the tool is not cutting material, to move between cutting different areas of the part. G1 Linear PositioningThe machine moves at the current feed rate in a straight line to the specified locations. G1 is a modal code, linear feed motion stays in effect until another motion code is encountered.G2 Arc ClockwiseThe machine moves at the current feed rate in a circular or helical arc to the specified locations. The arc motion begins at the current location and moves in a clockwise direction. G2 is a modal code, arc motion stays in effect until another motion code is encountered. Arc motion occurs in the plane specified by G17-XY, G-18-ZX, G19-YZ code (see below). Different machines can specify the center of arcs in several different ways. One way is to specify the absolute center of the arc, usually with I, J, K codes. Another way is to specify the center relative to the starting location or relative to the ending location. Another way is to specify the radius of the arc, usually with a R code. G3 Arc Counter-ClockwiseThe machine moves at the current feed rate in a circular or helical arc to the specified locations. The arc motion begins at the current location and moves in a counter-clockwise direction. G3 is a modal code, arc motion stays in effect until another motion code is encountered. Arc motion occurs in the plane specified by G17-XY, G-18-ZX, G19-YZ code (see below). G4 DwellThe machine remains in the current position for the specified length of time, or number of spindle revolutions. G6.2 NURB CurveThe machine follows the specified curve at the current feed rate. Unlike most G codes, a NURB curve takes more than one line. The first line has the curve order (P), first knot (K), starting control point (X Y Z and weight R). The next lines contain consecutive knot values and control points. The remaining knots follow, such as: G6.2 P4 K0.0 X0.0 Y0.0 Z0.0 R1.0 G17 XY-Plane SelectionSelects the XY-Plane of the current coordinate system for subsequent arc movement. G17 is a modal command which remains in effect until another plane is selected. G18 ZX-Plane SelectionSelects the ZX-Plane of the current coordinate system for subsequent arc movement. G18 is a modal command which remains in effect until another plane is selected. G19 YZ-Plane SelectionSelects the YZ-Plane of the current coordinate system for subsequent arc movement. G19 is a modal command which remains in effect until another plane is selected. G20 InchesSpecifies that the program units are in inches. G21 MillimetersSpecifies that the program units are in millimeters. G40 Cutter Compensation OffCutter compensation that was initialized by a G41 or G42 command is turned off. Cutter compensation is used to offset the tool path by the amount specified by the current diameter offset number. The diameter offset is usually specified with a tool change as a D followed by the offset. The offset can be the diameter of the tool, but it can also be used to specify a smaller offset to account for smaller tool size due to wear.G41 Cutter Compensation LeftCutter compensation is initialized by a linear move to the specified location. The material is to the left side of the tool as it follows the path. G42 Cutter Compensation RightCutter compensation is initialized by a linear move to the specified location. The material is to the right side of the tool as it follows the path. G43 Length Compensation PositiveTool length compensation in the Positive direction. G44 Length Compensation NegativeTool length compensation in the Negative Direction. G54 to G59 Work Coordinate System SelectSelects the work coordinate system, 1 through 6. G73 Peck Drilling CycleIndicates the start of a peck drilling canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G74 Left Tap CycleIndicates the start of a left handed tapping canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G80 Canned Cycle CancelIndicates the end of a canned/drilling cycle. Usually this is followed by a new motion command, for instance, G1 to return to the rapid plane. G81 Spot Drilling CycleIndicates the start of a spot drilling canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G82 Drill CycleIndicates the start of a drilling canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G83 Peck Drilling CycleIndicates the start of a peck drilling canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G84 Tap CycleIndicates the start of a tapping canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G85 Ream Drilling CycleIndicates the start of a ream drilling canned cycle. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G86, G88, G89 Bore Drilling CyclesIndicates the start of bore drilling canned cycles. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G87 Back Bore Drilling CyclesIndicates the start of back bore drilling canned cycles. Position commands, such as X, Y, indicate the locations of holes for drilling. The canned cycle is modal - it remains in effect until it is canceled by a G80 command. G90 Absolute PositioningThe coordinates specified by position commands, such as X, Y, Z, are absolute positions in the current work coordinate system. G91 Incremental PositioningThe coordinates specified by position commands, such as X, Y, Z, are positions relative to the current position in the current work coordinate system. G92 Set Current PositionChanges the current position to new values, so the machine thinks it is now in a different place. Maybe used in a program to machine multiple parts. G98 Cycle Full RetractIndicates a drilling canned cycle is to return to the initial rapid plane at the start of the cycle (as opposed to retracting to the cycle clearance plane).
Common Usage Of The Other LettersM CodesM stands for Machine, and thus the M codes are for machine specific commands. X (and/or Y and/or Z)X designates the coordinate position of the X-Axis in the current coordinate system. It may be the coordinate of a motion command, the location of the control point for a curve, or the location of a hole for drilling. It may be absolute or relative to the current position. I, J, KI, J, and/or K are used to locate the center of arcs. The center may be in absolute coordinates, or relative to the current position. K is also used to specify the Knot value for curves. R R can be used to specify the radius of an arc to locate
it's center. OO is used at the beginning of each program to specify the program number, or program name. P P is used for curves to specify the order of the curve.
The order of a curve is it's degree+1. LL is used with P to specify the number of times to repeat a sub-program. QQ is used in a drilling cycle to specify the peck increment. A, B, and/or CA, B, and/or C specify the angular position of rotary axes. DD is used to specify the diameter offset number. HH is used to specify the tool length offset number. TT is used to select the tool. FF is used to change the feed rate. SS is used to change the speed of the spindle EE is used to select a work coordinate system.
P.S. If I forgot anything, please let me know, I'll be glad
to add it. |