Common Codes

8:36 pm / Posted by tech data /

G-codes are also called preparatory codes, and are any word in a CNC program that begins with the letter 'G'. Generally it is a code telling the machine tool what type of action to perform, such as:

  • rapid move
  • controlled feed move in a straight line or arc
  • series of controlled feed moves that would result in a hole being bored, a workpiece cut (routed) to a specific dimension, or a decorative profile shape added to the edge of a workpiece.
  • change a pallet
  • set tool information such as offset.

There are other codes; the type codes can be thought of like registers in a computer

X absolute position
Y absolute position
Z absolute position
A position (rotary around X)
B position (rotary around Y)
C position (rotary around Z)
U Relative axis parallel to X
V Relative axis parallel to Y
W Relative axis parallel to Z
M code (another "action" register or Machine code(*)) (otherwise referred to as a "Miscellaneous" function")
F feed rate
spindle speed
N line number
R Arc radius or optional word passed to a subprogram/canned cycle
P Dwell time or optional word passed to a subprogram/canned cycle
T Tool selection
I Arc data X axis
J Arc data Y axis.
K Arc data Z axis, or optional word passed to a subprogram/canned cycle
D Cutter diameter/radius offset
H Tool length offset

(*) M codes control the overall machine, causing it to stop, start, turn on coolant, etc., whereas other codes pertain to the path traversed by cutting tools. Different machine tools may use the same code to perform different functions; even machines that use the same CNC control.

  • Partial list of M-Codes
M0=Program Stop (non-optional)
M1=Optional Stop, machine will only stop if operator selects this option
M2=End of Program
M3=Spindle on (CW rotation)
M4=Spindle on (CCW rotation)
M5=Spindle off
M6=Tool Change
M7=Coolant on (flood)
M8=Coolant on (mist)
M9=Coolant off
M10=Pallet clamp
M11=Pallet un-clamp
M30=End of program/rewind tape (may still be required for older CNC machines)


Common FANUC G Codes for Mill
CodeDescription
G00Rapid positioning
G01Linear interpolation
G02CW circular interpolation
G03CCW circular interpolation
G04Dwell
G05.1 Q1.Ai Nano contour control
G05 P10000HPCC
G10/G11Programmable Data input/Data write cancel
G17X-Y plane selection
G18X-Z plane selection
G19Y-Z plane selection
G20Programming in inches
G21Programming in mm
G28Return to home position
G302nd reference point return
G31Skip function (used for probes and tool length measurement systems)
G33Constant pitch threading
G34Variable pitch threading
G40Tool radius compensation off
G41Tool radius compensation left
G42Tool radius compensation right
G43Tool offset compensation positive
G44Tool offset compensation negative
G45Axis offset single increase
G46Axis offset single decrease
G47Axis offset double increase
G48Axis offset double decrease
G49Tool offset compensation cancel
G53Machine coordinate system
G54 to G59Work coordinate systems
G54.1 P1 to P48Extended work coordinate systems
G73High speed drilling canned cycle
G74Left hand tapping canned cycle
G76Fine boring canned cycle
G80Cancel canned cycle
G81Simple drilling cycle
G82Drilling cycle with dwell
G83Peck drilling cycle
G84Tapping cycle
G84.2Direct right hand tapping canned cycle
G90Absolute programming (type B and C systems)
G91Incremental programming (type B and C systems)
G92Programming of absolute zero point
G94/G95Inch per minute/Inch per revolution feed (type A system)
G98/G99Inch per minute/Inch per revolution feed (type B and C systems)
G96/G97Constant cutting speed (Constant surface speed)/Constant rotation speed (constant RPM)

A standardized version of G-code known as BCL is used, but only on very few machines.

G-code files may be generated by CAM software. Those applications typically use translators called post-processors to output code optimized for a particular machine type or family. Post-processors are often user-editable to enable further customization, if necessary. G-code is also output by specialized CAD systems used to design printed circuit boards. Such software must be customized for each type of machine tool that it will be used to program. Some G-code is written by hand for volume production jobs. In this environment, the inherent inefficiency of CAM-generated G-code is unacceptable.

Some CNC machines use "conversational" programming, which is a wizard-like programming mode that either hides G-code or completely bypasses the use of G-code. Some popular examples are Southwestern Industries' ProtoTRAK, Mazak's Mazatrol, Hurco's Ultimax and Mori Seiki's CAPS conversational software.

0 comments:

Post a Comment