CNC Programming

CNC | C | C++ | Assembly | Python | R | Rust | Arduino | Solidworks | Embedded Systems


Table Of Contents:
  1. G-code Table
  2. G00 - Rapid Linear Motion
  3. G01 - Linear Motion at Feed Rate
  4. G02 and G03 - Arc at Feed Rate
  5. G04 - Dwell
  6. G10 - Coordinate System Data Tool and Work Offset Tables
  7. G17, G18 and G19 - Plane Selection
  8. G20 and G21 - Length Units
  9. G28 and G30 - Return to Home
  10. G28.1 - Reference Axes
  11. G40, G41 and G42 - Cutter Radius Compensation
  12. G43, G44 and G49 - Tool Length Offsets
  13. G47 - Engrave Sequential Serial Number
  14. G53 - Move in Absolute Coordinates
  15. G54 to G59 and G59 P~ - Select Work Offset Coordinate System
  16. G61 and G64 - Set Path Control Mode
  17. G73 - Canned Cycle - High Speed Peck Drill
  18. G80 - Cancel Modal Motion
  19. G81 to G89 - Canned Cycles
  20. G90 and G91 - Distance Mode
  21. G92, G92.1, G92.2 and G92.3 - G92 Offsets
  22. G93, G94 and G95 - Set Path Control Mode
  23. G98 and G99 - Canned Cycle Return Level 
To select work offset #1, program: G54 and similarly for the first six offsets. The system-number-G-code pairs are: (1-G54), (2-G55), (3-G56), (4-G57), (5-G58), (6-G59).
To access any of the 254 work offsets (1 - 254) program: G59 P~ where the P word gives the required offset number. Thus G59 P5 is identical in effect to G58.
It is an error if one of these G-codes is used while cutter radius compensation is on.
See relevant chapter for an overview of coordinate systems.
  • G54 Example
    (Sample Program G54EX19:)
    (Workpiece Size: X8, Y5, Z2)
    (Tool: Tool #6, 3/4" HSS Drill)
    (Tool Start Position: X0, Y0, Z1)
    (Workpiece Coordinate system 2: X1, Y1, Z0)
    (Workpiece Coordinate system 3: X5, Y1, Z0)

    N2 G90 G80 G40 G54 G20 G17 G50 G94 G64 (safety block)
    N5 G90 G80 G20
    N10 M06 T6 G43 H6
    N15 M03 S1300
    N20 G55 G00 X1.0 Y1.0 (Rapid to X1, Y1 of work coordinate system 2)
    N25 Z0.5
    N30 G82 Z-0.25 R0.125 P1 F5
    N35 Y2
    N40 X2
    N45 Y1
    N50 X1.5 Y1.5
    N60 G80 G00 Z1
    N65 G56 G00 X1.0 Y1.0 (Rapid to X1, Y1 of work coordinate system 3)
    N70 Z0.5
    N75 G82 Z-0.25 R0.125 P1 F5
    N80 Y2
    N85 X2
    N90 Y1
    N95 X1.5 Y1.5
    N100 G80 G00 Z1
    N105 X0 Y0
    N110 M05
    N115 M30


No comments:

Post a Comment