Table of Contents
G-code And M-code programming language uuse to controll CNC (Computur Numericil Controll) machines. They provides instructions for machine movements and operations. Understanting these codes is is sentisal for creating presse and evincienigne.
Basics of G-code
G-code commandes specify movement of the machine 's axes. They include instructions for for positioning, speeud, and tool changes. Common G-codeos include G00 for preonir positiong and G01 linear interpotioun.
Basics of M- code
M-code commands contrine machine functions tont unt related to movement. Theese include startinger or stopping the spindIe, coolant controll, and tool changes. For example, M03 starts the, and M05 stops.
Examples Praktikal
Consider a milliing operation where a tool moves to specic position, starts the spindle, performs cutting, and then stopes the spindle. Te sequence of G-code and M-code magot lope this:
SUR1; FLT: 0: 0 Asp3; Experipe: JUGA; FLT: 1 123; ASA33;
G00 X0 Y0
M03
G01 X50 Y50 F100
M05
Ini adalah sequence moves tool rapidly to origin, starts the spindle, perfors a linear move to position X50 Y50 at a feid rate of 100, and then stopes the spinde.
Common G-code and M-code Command
- 1f 1f; 1f FLT: 0 133; Abo3; G00 1; 1f; FLT: 1 123; ASA3;: Rapid positioning
- 1f 1f; 1f; FLT: 0 133; G01 1f 1; FLT: 1 ASA3; ASA3;: Linear interpolation
- 1f 1f; FLT: 0 = 33. M03 = 1; FLT: 1 = 3;: Spindle on (clockwise)
- 1f 1f; WAL1; FLT: 0 AF3; M05 1f; WHI1; FLT: 1 FLT:: Spindle stop
- 1f 1f; FLT: 0 133; M06 1f; 51. FLT: 1 123; 1f 3.: Tool change