CNC PART
PROGRAMMING
G-CODE PROGRAMS
The goal of every G-code program is to produce parts in the safest and most efficient
way possible. To achieve this, you will typically find G-code blocks arranged in a
particular order like this:
1. Start the CNC program
2. Load the required tool
3. Turn the spindle on
4. Turn the coolant on
5. Move to position above a part
6. Start the machining process
7. Turn the coolant off
8. Tun the spindle off
9. Move away from the part to a safe location
10. End the CNC program
Preparatory Commands
G00
G00
G01
G02 and G03
G02 and G03
G03 X 1 Y 1 Z 0 I 2 J 1 K 0 F 5 S 3000 ABSOLUTE
G03 X -1 Y -1 Z 0 R 1 F 5 S 3000 RELATIVE
G02 X 2 Y 1 Z 0 I 1 J 1 K 0 F 5 S 3000 ABSOLUTE
G02 X 1 Y -1 Z 0 R 1 F 5 S 3000 RELATIVE
G02 and G03
FEED (F)
AND
SPINDLE (S)
M Commands
M Commands
M08 COOLANT ON (FLOOD ON)
G-CODE PROGRAMS
The goal of every G-code program is to produce parts in the safest and most efficient
way possible. To achieve this, you will typically find G-code blocks arranged in a
particular order like this:
1. Start the CNC program
2. Load the required tool T
3. Turn the spindle on M03 or M04
4. Turn the coolant on M08
5. Move to position above a part G00
6. Start the machining process G01 or G02 or G03
7. Turn the coolant off M09
8. Turn the spindle off M05
9. Move away from the part to a safe location G00
10. End the CNC program M30
G-CODES
MISCELANEOUS CODES
COMMAND DESCRIPTION
G00 Linear Rapid COMMAND DESCRIPTION
G01 Linear Feed
M03 Spindle on CW
G02 CW Arc
G03 CCW Arc M04 Spindle on CCW
G20 English units M05 Spindle OFF
G21 Metric units
G24 Circular Pocket Clear M06 Tool Change
G34 Rectangular Pocket Clear M08 Coolant ON (Flood)
G42 Right CutterComp On
G54 Worksystem 1 M09 Coolant OFF (Flood)
G81 Drilling Cycle M30 Spindle OFF, End of Program
G82 Drill / Dwell Cycel
G83 Peck / Drill Feed Rate. The linear speed at which a
G90 Absolute system F (FEED) tool advances through material.
G91 Incremental system Spindle Speed. Part of CNC machine
G98 Return to initial level S (SPINDLE) that grips and spins the cutting tool.
G99 Return to R-point (plane)
G AND M CODES
https://www.youtube.com/watch?v=5XihF05K4yM
Feed Rate = 8 ipm
Spindle Speed = 4500 rpm
Tool start position = (0,0,0)
Dimensions = mm
Cutting depth = 1 mm
Rapid Feed = 14 ipm
Tool Size = ¼” Diam.
Software programs can automatically generate CNC data
LINEAR/CIRCULAR FEEDING VS POCKET
G24 CIRCULAR POCKET COMMAND
G24 CIRCULAR POCKET COMMAND
G24 CIRCULAR POCKET COMMAND
G24 CIRCULAR POCKET COMMAND
G24 CIRCULAR POCKET COMMAND
G24 CIRCULAR POCKET COMMAND
G24 CIRCULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
G34 RECTANGULAR POCKET COMMAND
POCKET COMMANDS
https://www.youtube.com/watch?v=RhDYsSiVEcM