Pages

Showing posts with label CNC Code. Show all posts
Showing posts with label CNC Code. Show all posts

Saturday 2 January 2016

Standard NC Programming Codes

 NC Programming Code


G00                       Rapid traverse
G01                       Linear interpolation
G02/G03               Circular interpolation
G04                       Dwell
G07                       Tangential circle interpolation
G08/G09               Path control mode (ramp at block transitions) and "Adaptive Look ahead" function
G10/G11               Block per-processing control
G12/G13               Circular interpolation with radius input
G17-G20               Plane selection
G33                       Thread cutting/rigid tapping
G36/G37               Programmable feed rate limitation
G38/G39               Mirror image
G40-G44               Tool radius compensation
G50                       Scaling
G51/G52               Part rotation
G53-G59               Zero offsets
G63/G66               Programmable feed rate/spindle speed override
G70/G71               Inch/metric dimension
G72/G73               Interpolation with in position stop
G74                       Home position
G80-G89               Canned cycles
G90/G91               Absolute/incremental programming
G92                       Position register preset
G94/G95               Feed rate
G160-G164           ART learning function
G186                     Programmable tolerance band

M00                       Program stop
M01                       Optional stop
M02/M30               End of program
M03/M04/M05       Spindle control (cw/ccw/stop)
M06                       Tool change (M-code depends on PLC)
M19                       Spindle orientation
M40-M46               Spindle gear transmission steps

All of the machine-specific functions have the M-code value configured in the PLC application.  Some of the M-codes, like M06 for a tool change and M07-M09 for coolant control, have typical assignments in many controls.  However this control does not require specific assignments.  Therefore, a machine function like the tool change does not have to be M06. The spindle control M-codes (3-5, 19, 40-46) also have configurable assignments.

Monday 17 June 2013

CNC G Code

G-Codes Simple Definition

G00     Rapid traverse
G01     Linear interpolation with feedrate
G02     Circular interpolation (clockwise)
G03     Circular interpolation (counter clockwise)
G2/G3   Helical interpolation
G04     Dwell time in milliseconds
G05     Spline definition
G06     Spline interpolation

G07     Tangential circular interpolation / Helix interpolation / Polygon interpolation /             Feedrate
interpolation
G08     Ramping function at block transition / Look ahead "off"
G09     No ramping function at block transition / Look ahead "on"
G10     Stop dynamic block preprocessing
G11     Stop interpolation during block preprocessing
G12     Circular interpolation (cw) with radius
G13     Circular interpolation (ccw) with radius
G14     Polar coordinate programming, absolute
G15     Polar coordinate programming, relative
G16     Definition of the pole point of the polar coordinate system
G17     Selection of the X, Y plane
G18     Selection of the Z, X plane
G19     Selection of the Y, Z plane
G20     Selection of a freely definable plane
G21     Parallel axes "on"
G22     Parallel axes "off"
G24     Safe zone programming; lower limit values
G25     Safe zone programming; upper limit values
G26     Safe zone programming "off"
G27     Safe zone programming "on"
G33     Thread cutting with constant pitch
G34     Thread cutting with dynamic pitch
G35     Oscillation configuration
G38     Mirror imaging "on"
G39     Mirror imaging "off"
G40     Path compensations "off"
G41     Path compensation left of the work piece contour
G42     Path compensation right of the work piece contour
G43     Path compensation left of the work piece contour with altered approach
G44     Path compensation right of the work piece contour with altered approach
G50     Scaling
G51     Part rotation; programming in degrees
G52     Part rotation; programming in radians
G53     Zero offset off
G54     Zero offset #1
G55     Zero offset #2
G56     Zero offset #3
G57     Zero offset #4
G58     Zero offset #5
G59     Zero offset #6
G63     Feed / spindle override not active
G66     Feed / spindle override active
G70     Inch format active
G71     Metric format active
G72     Interpolation with precision stop "off"
G73     Interpolation with precision stop "on"
G74     Move to home position
G75     Curvature function activation
G76     Curvature acceleration limit
G78     Normalcy function "on" (rotational axis orientation)
G79     Normalcy function "off"

G80 - G89 for milling applications:
G80     Canned cycle "off"
G81     Drilling to final depth canned cycle
G82     Spot facing with dwell time canned cycle
G83     Deep hole drilling canned cycle
G84     Tapping or Thread cutting with balanced chuck canned cycle
G85     Reaming canned cycle
G86     Boring canned cycle
G87     Reaming with measuring stop canned cycle
G88     Boring with spindle stop canned cycle
G89     Boring with intermediate stop canned cycle
G81 - G88 for cylindrical grinding applications:
G81     Reciprocation without plunge
G82     Incremental face grinding
G83     Incremental plunge grinding
G84     Multi-pass face grinding
G85     Multi-pass diameter grinding
G86     Shoulder grinding
G87     Shoulder grinding with face plunge
G88     Shoulder grinding with diameter plunge
G90     Absolute programming
G91     Incremental programming
G92     Position preset
G93     Constant tool circumference velocity "on" (grinding wheel)
G94     Feed in mm / min (or inch / min)
G95     Feed per revolution (mm / rev or inch / rev)
G96     Constant cutting speed "on"
G97     Constant cutting speed "off"
G98     Positioning axis signal to PLC
G99     Axis offset
G100   Polar transformation "off"
G101   Polar transformation "on"
G102   Cylinder barrel transformation "on"; cartesian coordinate system
G103   Cylinder barrel transformation "on," with real-time-radius compensation         (RRC)
G104   Cylinder barrel transformation with center line migration (CLM) and RRC
G105   Polar transformation "on" with polar axis selections
G106   Cylinder barrel transformation "on" polar-/cylinder-coordinates
G107   Cylinder barrel transformation "on" polar-/cylinder-coordinates with RRC
G108   Cylinder barrel transformation polar-/cylinder-coordinates with CLM and         RRC
G109   Axis transformation programming of the tool depth
G110   Power control axis selection/channel 1
G111   Power control pre-selection V1, F1, T1/channel 1 (Voltage, Frequency, Time)
G112   Power control pre-selection V2, F2, T2/channel 1
G113   Power control pre-selection V3, F3, T3/channel 1
G114   Power control pre-selection T4/channel 1
G115   Power control pre-selection T5/channel 1
G116   Power control pre-selection T6/pulsing output
G117   Power control pre-selection T7/pulsing output
G120   Axis transformation; orientation changing of the linear interpolation rotary     axis
G121   Axis transformation; orientation change in a plane
G125   Electronic gear box; plain teeth
G126   Electronic gear box; helical gearing, axial
G127   Electronic gear box; helical gearing, tangential
G128   Electronic gear box; helical gearing, diagonal
G130   Axis transformation; programming of the type of the orientation change
G131   Axis transformation; programming of the type of the orientation change
G132   Axis transformation; programming of the type of the orientation change
G133   Zero lag thread cutting "on"
G134   Zero lag thread cutting "off"
G140   Axis transformation; orientation designation work piece fixed coordinates
G141   Axis transformation; orientation designation active coordinates
G160   ART activation
G161   ART learning function for velocity factors "on"
G162   ART learning function deactivation
G163   ART learning function for acceleration factors
G164   ART learning function for acceleration changing
G165   Command filter "on"
G166   Command filter "off"
G170   Digital measuring signals; block transfer with hard stop
G171   Digital measuring signals; block transfer without hard stop
G172   Digital measuring signals; block transfer with smooth stop
G175   SERCOS-identification number "write"
G176   SERCOS-identification number "read"
G180   Axis transformation "off"
G181   Axis transformation "on" with not rotated coordinate system
G182   Axis transformation "on" with rotated / displaced coordinate system
G183   Axis transformation; definition of the coordinate system
G184   Axis transformation; programming tool dimensions
G186   Look ahead; corner acceleration; circle tolerance
G188   Activation of the positioning axes
G190   Diameter programming deactivation
G191   Diameter programming "on" and display of the contact point
G192   Diameter programming; only display contact point diameter
G193   Diameter programming; only display contact point actual axes center point
G200   Corner smoothing "off"
G201   Corner smoothing "on" with defined radius
G202   Corner smoothing "on" with defined corner tolerance
G203   Corner smoothing with defined radius up to maximum tolerance
G210   Power control axis selection/Channel 2
G211   Power control pre-selection V1, F1, T1/Channel 2
G212   Power control pre-selection V2, F2, T2/Channel 2
G213   Power control pre-selection V3, F3, T3/Channel 2
G214   Power control pre-selection T4/Channel 2
G215   Power control pre-selection T5/Channel 2
G216   Power control pre-selection T6/pulsing output/Channel 2
G217   Power control pre-selection T7/pulsing output/Channel 2
G220   Angled wheel transformation "off"
G221   Angled wheel transformation "on"
G222   Angled wheel transformation "on" but angled wheel moves before others
G223   Angled wheel transformation "on" but angled wheel moves after others
G265   Distance regulation – axis selection
G270   Turning finishing cycle
G271   Stock removal in turning
G272   Stock removal in facing
G274   Peck finishing cycle
G275   Outer diameter / internal diameter turning cycle
G276   Multiple pass threading cycle
G310   Power control axes selection /channel 3
G311   Power control pre-selection V1, F1, T1/channel 3
G312   Power control pre-selection V2, F2, T2/channel 3
G313   Power control pre-selection V3, F3, T3/channel 3
G314   Power control pre-selection T4/channel 3
G315   Power control pre-selection T5/channel 3
G316   Power control pre-selection T6/pulsing output/Channel 3
G317   Power control pre-selection T7/pulsing output/Channel 3


Note that some of the above G-codes are not standard. Specific control features, such as laser power control, enable those optional codes. 

CNC Alphabet

CNC ALPHABET

  • A

Absolute or incremental position of A axis (rotational axis around X axis)
  • B

Absolute or incremental position of B axis (rotational axis around Y axis)
  • C

Absolute or incremental position of C axis (rotational axis around Z axis)
  • D

Defines diameter or radial offset used for cutter compensation. D is used for depth of cut on lathes.
  • E

Precision feedrate for threading on lathes
  • F

Defines feed rate Common units are distance per time for mills (inches per minute, IPM, or millimetres per minute, mm/min) and distance per revolution for lathes (inches per revolution, IPR, or millimetres per revolution, mm/rev)
  • G

Address for preparatory commands G commands often tell the control what kind of motion is wanted (e.g., rapid positioning, linear feed, circular feed, fixed cycle) or what offset value to use.
  • H

Defines tool length offset; Incremental axis corresponding to C axis (e.g., on a turn-mill)
  • I

Defines arc center in X axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles.
  • J

Defines arc center in Y axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles.
  • K

Defines arc center in Z axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles, equal to L address.
  • L

Fixed cycle loop count; Specification of what register to edit using G10 Fixed cycle loop count: Defines number of repetitions ("loops") of a fixed cycle at each position. Assumed to be 1 unless programmed with another integer. Sometimes the K address is used instead of L. With incremental positioning ( G91), a series of equally spaced holes can be programmed as a loop rather than as individual positions. G10 use: Specification of what register to edit (work offsets, tool radius offsets, tool length offsets, etc.).
  • M

Miscellaneous function Action code, auxiliary command; descriptions vary. Many M-codes call for machine functions, which is why people often say that the "M" stands for "machine", although it was not intended to.
  • N

Line (block) number in program; System parameter number to be changed using G10 Line (block) numbers: Optional, so often omitted. Necessary for certain tasks, such as M99 P address (to tell the control which block of the program to return to if not the default one) or G.T. statements (if the control supports those). N numbering need not increment by 1 (for example, it can increment by 10, 20, or 1000) and can be used on every block or only in certain spots throughout a program. System parameter number: G10 allows changing of system parameters under program control.
  • O

Program name For example, O4501. For many years it was common for CNC control displays to use slashed zero glyphs to ensure effortless distinction of letter "O" from digit "0". Today's GUI controls often have a choice of fonts, like a PC does.
  • P

Serves as parameter address for various G and M codes With G04, defines dwell time value. Also serves as a parameter in some canned cycles, representing dwell times or other variables. Also used in the calling and termination of subprograms. (With M98 , it specifies which subprogram to call; with M99, it specifies which block number of the main program to return to.)
  • Q

Peck increment in canned cycles. For example, G73 , G83 (peck drilling cycles)
  • R

Defines size of arc radius, or defines retract height in milling canned cycles For radiuses, not all controls support the R address for G02 and G03, in which case IJK vectors are used. For retract height, the "R level", as it's called, is returned to if G99 is programmed.
  • S

Defines speed , either spindle speed or surface speed depending on mode Data type = integer. In G97 mode (which is usually the default), an integer after S is interpreted as a number of rev/min (rpm). In G96 mode (CSS), an integer after S is interpreted as surface speed —sfm ( G20 ) or m/min (G21 ). See also Speeds and feeds . On multifunction (turn-mill or mill-turn) machines, which spindle gets the input (main spindle or subspindles) is determined by other M codes.
  • T

Tool selection To understand how the T address works and how it interacts (or not) with M06 , one must study the various methods, such as lathe turret programming, ATC fixed tool selection, ATC random memory tool selection, the concept of "next tool waiting", and empty tools. Programming on any particular machine tool requires knowing which method that machine uses. Ways of obtaining this training are mentioned in the comments for M06.
  • U

Incremental axis corresponding to X axis (typically only lathe group A controls) Also defines dwell time on some machines (instead of " P " or " X "). In these controls, X and U obviate G90 and G91 , respectively. On these lathes, G90 is instead a fixed cycle address for roughing .
  • V

Incremental axis corresponding to Y axis Until the 2000s, the V address was very rarely used, because most lathes that used U and W didn't have a Y- axis, so they didn't use V. (Green et al. 1996 did not even list V in their table of addresses.) That is still often the case, although the proliferation of live lathe tooling and turn-mill machining has made V address usage less rare than it used to be. See also G18 .
  • W

Incremental axis corresponding to Z axis (typically only lathe group A controls) In these controls, Z and W obviate G90 and G91 , respectively. On these lathes, G90 is instead a fixed cycle address for roughing .
  • X

Absolute or incremental position of X axis. Also defines dwell time on some machines (instead of " P " or " U ").
  • Y

Absolute or incremental position of Y axis
  • Z

Absolute or incremental position of Z axis The main spindle's axis of rotation often determines which axis of a machine tool is labeled as Z.