Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 8

G-codes and M-codes

CAD/CAM Presentation
G-codes and M-codes
• What Is CNC G Code?
G stands for geometry, and it's the alphanumeric format the system uses to tell the parts
what to do. It indicates where to start, how to move and when to stop.

• What Is CNC M Code?


M code is a part of the overall program, often called G code. While G commands describe
positions, M code directs the machine's actions. While M represents miscellaneous
codes, some refer to it as machine code because it controls particular operations of the
equipment.
The Functions of different letters in CNC Machining G Code
Code letter Function

N The N value gives the line number


G The G number tells when the tool to move and stop.
X, Y, Z These values indicate the position of the tool in three dimensions — X for horizontal, Y for vertical and Z for depth.

F F relates to how quickly the machine feeds the piece.


S S tells the machine how quickly to move the spindle.
T The T tells the machine which tool to use.
M M values give miscellaneous functions or machine functions, telling the device how to act by giving on and off
directions.
I and J These values indicate the incremental center of any arcs the machine makes.
R R gives the radius of arcs made by the machine.
P The program jumps in time or a delayed time with the P command.

*only some important ones are shown here


Some Important G-codes and their functions
Some Important M-codes
Simple Example

Program can create G-code tool path for milling (cutting) of the rectangle.

*Sequence numbering may be given to each line using N(number)


References
• CAD/CAM P N Rao book
• http://www.intuwiz.com/rectangle.html#.Xes5LugzZPY
• https://www.americanmicroinc.com/difference-g-code-m-code.html
• http://cncsimulator.info/OnlineHelp2/g_codes.htm?ms=AAAAAA%3D%3D&st=
MA%3D%3D&sct=MTA5Ny41OTk5NzU1ODU5Mzc1&mw=MjQw

You might also like