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 
(a) For rapid linear motion, program: G0 X~ Y~ Z~ A~ where all the axis words are optional, except that at least one must be used. The G00 is optional if the current motion mode is G0. This will produce coordinated linear motion to the destination point at the current traverse rate (or slower if the machine will not go that fast). It is expected that cutting will not take place when a G00 command is executing.
(b) If G16 has been executed to set a Polar Origin then for rapid linear motion to a point described by a radius and angle G0 X~ Y~ can be used. X~ is the radius of the line from the G16 polar origin and Y~ is the angle in degrees measured with increasing values counterclockwise from the 3 o'clock direction (i.e., the conventional four quadrant conventions). Coordinates of the current point at the time of executing the G16 are the polar origin.
If cutter radius compensation is active, the motion will differ from the above; see Cutter Compensation. If G53 is programmed on the same line, the motion will also differ.
Absolute Coordinates. Depending on where the tool is located, there are two basic rules to follow for safety's sake: If the Z value represents a cutting move in the negative direction, the X and Y axes should be executed first. If the Z value represents a move in the positive direction, the X and Y axes should be executed last.

* G00 Example

(Sample Program G00EX1:)
(Workpiece Size: X6,Y4,Z1)
(Tool: Tool #2, 1/4" Slot Drill)
(Tool Start Position: X0,Y0,Z1)

N2 G90 G80 G40 G54 G20 G17 G50 G94 G64 (safety block)
N5 G90 G20 (Absolute and inch programming)
N10 M06 T2 G43 H2 (Tool change, Tool #2)
N15 M03 S1200 (Spindle on CW, at 1200 rpm)
N20 G00 X1 Y1 (Rapid over to X1,Y1)
N25 Z0.1 (Rapid down to Z0.1)
N30 G01 Z-0.25 F5 (Feed move down to a depth of 0.25 in.)
N35 Y3 (Feed move to Y3)
N40 X5 (Feed to X5)
N45 X1 Y1 Z-0.125 (Feed to X1,Y1,Z–0.125)
N50 G00 Z1 (Rapid up to Z1)
N55 X0 Y0 (Rapid over to X0,Y0)
N60 M05 (Spindle off )
N65 M30 (End of program)


No comments:

Post a Comment