Home - Mechanical Engineering - Controls Codes for CNC machines

Controls Codes for CNC machines

In order to completely know how CNC machine work, there are some functional codes you need to know and memorize.  These codes include the M-code and the G-code

CNC machining codes

M-codes are miscellaneous machine commands that do not command axis motion. The format for an M-code is the letter M followed by two to three digits; for example:

  • [M02 End of Program]
  • [M03 Start Spindle – Clockwise]
  • [M04 Start Spindle – Counter Clockwise]
  • [M05 Stop Spindle]
  • [M06 Tool Change]
  • [M07 Coolant on mist coolant]
  • [M08 Flood coolant on]
  • [M09 Coolant off]
  • [M10 Chuck open]
  • [M11 Chuck close]
  • [M13 BOTH M03&M08 Spindle clockwise rotation & flood coolant]
  • [M14 BOTH M04&M08 Spindle counter clockwise rotation & flood coolant]
  • [M16 Special tool call]
  • [M19 Spindle orientate]
  • [M29 DNC mode]
  • [M30 Program reset & rewind]
  • [M38 Door open]
  • [M39 Door close]
  • [M40 Spindle gear at middle]
  • [M41 Low gear select]
  • [M42 High gear select]
  • [M53 Retract Spindle] (raises tool spindle above current position to allow operator to do whatever they would need to do)
  • [M68 Hydraulic chuck close]
  • [M69 Hydraulic chuck open]
  • [M78 Tailstock advancing]
  • [M79 Tailstock reversing]

Read: Everything you need to know about CNC machine

G-cold are used to command specific movements of the machine, such as machine moves or drilling functions. The format for a G-code is the letter G followed by two to three digits; for example, G01. G-codes differ slightly between a mill and lathe application, for example:

  • [G00 Rapid Motion Positioning]
  • [G01 Linear Interpolation Motion]
  • [G02 Circular Interpolation Motion-Clockwise]
  • [G03 Circular Interpolation Motion-Counter Clockwise]
  • [G04 Dwell (Group 00) Mill]
  • [G10 Set offsets (Group 00) Mill]
  • [G12 Circular Pocketing-Clockwise]
  • [G13 Circular Pocketing-Counter Clockwise]

Codes used in CNC programming

Leave a Reply

Your email address will not be published. Required fields are marked *