Difference between revisions of "G01"

From CNC.xyz Wiki
Jump to: navigation, search
Line 1: Line 1:
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.
+
The '''Linear Interpolation''' G-code, known as G01 allows the machine to move with exact synchronization of all its axis. The machine will move relative to the absolute position set initially or through offsets.
  
 
  Standard Format:
 
  Standard Format:
 
  G1 X0.000 Y0.000 Z0.000 F100.0
 
  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.
+
  Where the numbers following the X, Y, Z and F can be changed for the designed amount. Additional commands can also be added for a 4-Axis or larger machine.
  
 
==Code Examples==
 
==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]].)
+
In this example, the machine will move from its current position to a position (1,1,0) units away at a federate of 100 units per minute. (The units can be set using [[G20]] and [[G21]].)
 +
G1 X0.000 Y0.000 Z0.000 F100.0
 
  G1 X1.000 Y1.000 Z0.000 F100.0
 
  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.
 
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 Z0.000 F100.0
 
  G1 Z1.000
 
  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.
+
This example shows that negative movements are also possible. We will move from the origin position of (0,0,0) to (-1,-1,-1).
 
+
  G1 X1.000 Y1.000 Z1.000
+
  G1 X0.000 Y0.000 Z0.000 F100.0
  G1 X-1.000 Y-1.000 Z-1.000
+
  G1 X1.000 Y1.000 Z1.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 mm, 1 inch, 1 inch). The change of units is done with [[G20]] and [[G21]], and an a M-code ([[M02]]) indicates the end of the cycle.
  
 
  G20
 
  G20
  G0 X0.000 Y0.000 Z0.000 F100
+
  G1 X0.000 Y0.000 Z0.000 F100
 
  G1 X1.000 Y1.000 Z1.000 F100
 
  G1 X1.000 Y1.000 Z1.000 F100
 
  G21
 
  G21

Revision as of 21:10, January 30, 2014

The Linear Interpolation G-code, known as G01 allows the machine to move with exact synchronization of all its axis. The machine will move relative to the absolute position set initially or through 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. Additional commands can also be added for a 4-Axis or larger machine.

Code Examples

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

G1 X0.000 Y0.000 Z0.000 F100.0
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 Z0.000 F100.0
G1 Z1.000

This example shows that negative movements are also possible. We will move from the origin position of (0,0,0) to (-1,-1,-1).

G1 X0.000 Y0.000 Z0.000 F100.0
G1 X1.000 Y1.000 Z1.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 mm, 1 inch, 1 inch). The change of units is done with G20 and G21, and an a M-code (M02) indicates the end of the cycle.

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