What Are G-Codes and M-Codes
What Are G-Codes and M-Codes? A Simple Explanation for CNC Beginners
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?
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.
- G00 - Rapid Movement
- G01 - Linear Movement
- G02 - Circular interpolation clockwise
- G03 - Circular interpolation counter clockwise
- G04 - Dwell time
- G28 - Home Reference
- G30 - Second Home Reference
- G40 - Cutter compensation cancel (Milling) / Tool nose radius cancel (turning)
- G41 - Cutter compensation left (milling) / Tool nose compensation left (turning)
- G42 - Cutter compensation Right (milling) / Tool nose compensation Right (turning)
- G43 - Cutter Height Compensation on + direction
What Are M-Codes?
- M00 - Program Stop
- M01 - Optional Stop
- M02 - Program End
- M03 - Spindle rotate on clockwise
- M04 - Spindle rotate on counter clockwise
- M05 - Spindle stop
- M06 - Tool change
- M08 - Coolant On
- M09 - Coolant Off
- M30 - Program reset & Rewind

Comments
Post a Comment