Difference between revisions of "G01"

From CNC.xyz Wiki
Jump to: navigation, search
Line 16: Line 16:
 
This example shows that negative movements are also possible. We will move to a relative position of (1,1,1) and then back (-1,-1,-1) to arrive back at the original position.
 
This example shows that negative movements are also possible. We will move to a relative position of (1,1,1) and then back (-1,-1,-1) to arrive back at the original position.
  
  G1 X1.000 Y1.000 Z1.000<br />
+
  G1 X1.000 Y1.000 Z1.000
 
  G1 X-1.000 Y-1.000 Z-1.000
 
  G1 X-1.000 Y-1.000 Z-1.000
  
 
As a final example we will take a system that is setup to run in inches, move to an absolute position of (1,1,1) convert to mm, move one millimeter to the side and then convert back to inches. The final position will be (1.039, 1, 1). There is a mix of [[G00]] (absolute positioning), a change of units with [[G20]] and [[G21]], as well as a M-code ([[M02]]) which indicates the end of the cycle.
 
As a final example we will take a system that is setup to run in inches, move to an absolute position of (1,1,1) convert to mm, move one millimeter to the side and then convert back to inches. The final position will be (1.039, 1, 1). There is a mix of [[G00]] (absolute positioning), a change of units with [[G20]] and [[G21]], as well as a M-code ([[M02]]) which indicates the end of the cycle.
  
  G20<br />
+
  G20
  G0 X0.000 Y0.000 Z0.000 F100<br />
+
  G0 X0.000 Y0.000 Z0.000 F100
  G1 X1.000 Y1.000 Z1.000 F100<br />
+
  G1 X1.000 Y1.000 Z1.000 F100
  G21<br />
+
  G21
  G1 X1.000<br />
+
  G1 X1.000
  G20<br />
+
  G20
 
  M2
 
  M2
 
  
 
[[Category: G-code]]
 
[[Category: G-code]]

Revision as of 21:02, January 30, 2014

The Linear Interpolation G-code, known as G01 allows the machine to move without the knowledge of its absolute position. The machine will move relative to the current position. This can be useful when replicating the same motion over and over, as well as in setting offsets.

Standard Format:
G1 X0.000 Y0.000 Z0.000 F100.0

Where the numbers following the X, Y, Z and F can be changed for the designed amount.

Code Examples

In this example, the machine will move from its current position to a relative position (1,1,0) units away at a federate of 100 units per minute. (The units can be set using G20 and G21.)

G1 X1.000 Y1.000 Z0.000 F100.0

This example will raise the height of the Z-Axis 1 unit higher at the current federate. Notice that units that are not changed, do not have to be entered.

G1 Z1.000

This example shows that negative movements are also possible. We will move to a relative position of (1,1,1) and then back (-1,-1,-1) to arrive back at the original position.

G1 X1.000 Y1.000 Z1.000
G1 X-1.000 Y-1.000 Z-1.000

As a final example we will take a system that is setup to run in inches, move to an absolute position of (1,1,1) convert to mm, move one millimeter to the side and then convert back to inches. The final position will be (1.039, 1, 1). There is a mix of G00 (absolute positioning), a change of units with G20 and G21, as well as a M-code (M02) which indicates the end of the cycle.

G20
G0 X0.000 Y0.000 Z0.000 F100
G1 X1.000 Y1.000 Z1.000 F100
G21
G1 X1.000
G20
M2