Download presentation
Presentation is loading. Please wait.
Published byRose Carpenter Modified over 8 years ago
1
G Code Basics
2
G Code Myths
3
G Code is obsolete. G Code is the most widely used CNC programming language in the world. CAD/CAM programs generate G Code.
4
You need to go back to college to learn G Code. G Code is a simple program language that you can teach yourself by looking at a program and studying the G Code definitions.
5
You need to learn G Code to operate a CNC machine. It is not necessary to know G Code to operate your CNC machine. CAM software will automatically generate the G Code for your CNC.
6
Why learn G Code?
7
Faster to edit a line than to recreate an entire program using the CAM software.
8
Easier to write a simple program.
9
Faster to edit a line than to recreate an entire program using the CAM software. Easier to write a simple program. Allows you to combine programs.
10
Faster to edit a line than to recreate an entire program using the CAM software. Easier to write a simple program. Allows you to combine programs. Expands your capabilities.
11
Sample G Code Program G61 G90 M6 T1 (T1: Bit No 2704) G0 X2.0 Y0.0 M3 S18000 G1 Z-0.25 F40 G1 X4.0 F60 G53 G0 Z0.0 M5 M30 %
12
Definitions
13
Word A letter followed by a real value. Example 1: G1 Example 2: M3 S18000 or m3s18000
14
Line of Code (Block) An optional Line Number, any number of words and an end of line marker. Example 1: N10 G1 X10.0 F60 Example 2: n10g1x10.0f60
15
Preamble A line of code found at the beginning of a program that cancels or applies offsets and sets machine modes. Example: G61 G90
16
Program A collection of lines of code usually starting with a preamble and ending with M30 (end program and rewind)
17
Message Text enclosed in a set of parentheses. Message is displayed in Status Window. Example 1: (T1: Bit No 2704) Example 2: (Set the bed a 1.2 degrees)
18
Comment Text preceded by the % symbol. Does not execute a command or display a message. Example 1: % Turn the blank round. Example 2: %
19
Sample G Code Program G61 G90 M6 T1 (T1: Bit No 2704) G0 X2.0 Y0.0 M3 S18000 G1 Z-0.25 F40 G1 X4.0 F60 G53 G0 Z0.0 M5 M30 %
20
Modal Code A code that places the machine in a mode or state. The machine will remain in this state until it is changed by another modal code.
21
Sample G Code Program G61 G90 M6 T1 (T1: Bit No 2704) G0 X2.0 Y0.0 M3 S18000 G1 Z-0.25 F40 G1 X4.0 F60 G53 G0 Z0.0 M5 M30 %
22
G90 G0 X0.0 Y0.0 G90 G1 X5.0 Y1.5 F60 G90 G1 X0.0 Y0.0 F60 G90 G0 X0.0 Y0.0 G1 X5.0 Y1.5 F60 X0.0 Y0.0
23
Types of Code G Codes: General Codes M Codes: Miscellaneous Codes Example 1: G90 Example 2: M30
24
G0 – Rapid Positioning Mode Move to a location as fast as possible. Used to position the tool or part. Not used for cutting. Example: G0 X0.0 Y0.0
25
G1 – Move With Feed Rate Mode Move to a location at a specified feed rate. Used when cutting. Not used for positioning. Example: G1 X10.0 Y2.0 F60
26
G90 – Exact Positioning Mode Move to an exact location. Example: G90 G0 X0.0 Y0.0
27
G91 – Relative Positioning Mode Move from the current location a specified distance. Example: G91 G0 A90.0 CAUTION: Place a G90 in the next line of code to return to exact stop mode.
28
G53 – Machine Coordinates Move using the Machine Coordinates instead of the Offset or Fixture Coordinates. Example: G53 G0 Z0.0
29
G61 – Exact Stop Mode Move to the end of the tool path, stop, and then start the next tool path. Example: G61
30
G61 – Exact Stop Mode Carving programs have thousands of very short lines causing the machine to start and stop very quickly. When using G61 the machine will move in a very jerky motion.
31
G64 – Constant Velocity Mode Adds a small radius between two tool paths. The machine does not come to a complete stop between tool paths. Example: G64
32
G64 – Constant Velocity Mode CAM software will break an arc or ellipse into small lines causing the machine to cut in a jerky motion. G64 will smooth the motion resulting in a cleaner cut. Always use G64 when carving.
33
M3 – Turn On The Spindle Turns on the spindle at a specified RPM. When using a router this code will start the router but the RPM will be set manually. Example: M3 S18000
34
M5 – Turn Off The Spindle Turns off the spindle or router. Example: M5
35
M6 – Change the Tool M6 calls for tool change and is always accompanied by a T_ to specify the new tool no. Example 1: M6 T1 Example 2: T2M6
36
M6 – Change the Tool For Machines equipped with Auto Tool Change (ATC), the T_ word specifies the Tool Station. When the program executes an M6 T2, the machine will put the original tool back in its station and pick up the tool in station 2.
37
M6 – Change the Tool For Machines not equipped with Auto Tool Change (ATC), the machine will position the Spindle for a manual tool change and then display the message to Press Cycle Start after Tool Change.
38
M30 – End the Program M30 ends the program and then rewinds the program to the first line. Example: M30
39
Sample G Code Program G61 G90 M6 T1 (T1: Bit No 2704) G0 X2.0 Y0.0 M3 S18000 G1 Z-0.25 F40 G1 X4.0 F60 G53 G0 Z0.0 M5 M30 %
40
G Code Basics
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.