What Are G-Codes and M-Codes

  What Are G-Codes and M-Codes? A Simple Explanation for CNC Beginners

CNC Machine

When you have ever seen a CNC (Computer Numerical Control) machine in action, you have probably asked yourself, how does this machine know where, how fast and when to stop? The solution is in the form of what is called G-codes and M-codes.

I recall, when I was introduced to the concept of CNC machines, that I was utterly confused when I saw all those letters and numbers displayed on the screen. However, as soon as I figured out the rationale of G and M codes, it all became clear. In this article, therefore, I will simplify it to you in as simple a manner as possible, not a single piece of engineering jargon, but a plain old-fashioned explanation that every common person can easily understand.



What Are G-Codes?

They instruct the machine on the route where to reach and how to reach it.

The G can be translated as geometric since these codes are used to regulate the motion, and location of the tool used in cutting. Any time you look at a G-code, it is essentially the machine being directed to move in a given manner.

The commonly used G Codes:
  1. G00 - Rapid Movement
  2. G01 - Linear Movement
  3. G02 - Circular interpolation clockwise
  4. G03 - Circular interpolation counter clockwise
  5. G04 - Dwell time
  6. G28 - Home Reference
  7. G30 - Second Home Reference
  8. G40 - Cutter compensation cancel (Milling) / Tool nose radius cancel (turning)
  9. G41 - Cutter compensation left (milling) / Tool nose compensation left (turning)
  10. G42 - Cutter compensation Right (milling) / Tool nose compensation Right (turning)
  11. G43 - Cutter Height Compensation on + direction

What Are M-Codes?

Whereas, G-codes are involved in the movement, M-codes are concerned with the housekeeping.

M-codes indicate the M, which represents miscellaneous. These orders are what cause movements such as the spindle to start or stop, the coolant to be on or off or the program to be terminated.

If the CNC Machine is like a Car - The steering wheel, accelerator and brakes are similar to the G-codes; they determine the way you move. The M-codes resemble the headlights, wipers, and ignition, they manage all the support features.

The commonly used M Codes:
  1. M00 - Program Stop
  2. M01 - Optional Stop
  3. M02 - Program End
  4. M03 - Spindle rotate on clockwise
  5. M04 - Spindle rotate on counter clockwise
  6. M05 - Spindle stop
  7. M06 - Tool change
  8. M08 - Coolant On
  9. M09 - Coolant Off
  10. M30 - Program reset & Rewind

Comments

Popular posts from this blog

Simple Turning Program

How to Use GD & T in Drawing Study: A Simple Guide for Beginners