← All guides
CNC drill bit machining

G00 and G01: Rapid Traverse and Linear Interpolation

Tutorials

G00 and G01: Rapid Traverse and Linear Interpolation

G00 (rapid positioning) and G01 (linear interpolation) are the two most fundamental motion commands in CNC programming. G00 moves the tool at maximum machine speed to a position. G01 moves the tool at a controlled feed rate along a straight line. Every CNC program uses both of these commands. Understanding when to use each one is the first skill a CNC programmer learns.


The Core Difference

G00 (Rapid) G01 (Linear Feed)
Moves at maximum machine speed Moves at a controlled feed rate
NOT for cutting — positioning only For cutting moves only
Uses fastest route (not necessarily straight) Moves in a perfect straight line
G00 X100 Y50 G01 X100 Y50 F200
Does not respect the F-word Requires an active feed rate

Use G00 to get the tool close to the work quickly. Use G01 for every move that removes material. Mixing them up causes crashes.


G00 — Rapid Traverse

G00 moves the tool at the machine’s maximum speed. Individual axes move at their own maximum speeds, which means the tool path during G00 is not necessarily a straight line. Each axis starts moving at the same time and stops when it reaches its target, so the path depends on the relative speeds of the axes.

G00 X0 Y0 Z5    ; Move to X=0, Y=0, Z=5 (above the part)
G00 X100 Y50    ; Rapid to start position

Safety rule: Keep all G00 moves above the workpiece surface. Never use G00 when the tool is in contact with material.


G01 — Linear Interpolation

G01 moves the tool in a straight line at a controlled feed rate. This is the primary cutting command.

G01 X50 Y25 F200   ; Straight line to X50,Y25 at 200 mm/min
G01 X100           ; Continue to X100 (Y stays at 25)
G01 Y0             ; Continue to Y0 (X stays at 100)

The F-word is modal — once set it stays active until changed. Set it before the first G01 move.


Complete Program Example

%
O0001 (RECTANGLE CUT)
N10 G90 G94 G17 G54   ; Safety block
N20 G21               ; Metric mode
N30 M06 T1            ; 6mm end mill
N40 M03 S3000         ; Spindle on
N50 G00 X0 Y0 Z5      ; Rapid to start position
N60 G01 Z-1 F100      ; Feed into material
N70 G01 X100 F200     ; Cut to X=100
N80 G01 Y100          ; Cut to Y=100
N90 G01 X0            ; Cut to X=0
N100 G01 Y0           ; Cut to Y=0
N110 G00 Z5           ; Rapid retract
N120 M05              ; Spindle off
N130 M30              ; Program end
%

G00 Safety Considerations

Because G00 moves at maximum speed and follows a non-linear path, it requires careful planning. The tool can arc outward during diagonal moves, potentially striking clamps or fixtures. For moves near obstacles, use G01 with a high feed rate instead of G00. G01 produces a straight-line path that is predictable.


Common Mistakes

Cutting with G00. The most dangerous mistake. G00 ignores the feed rate and moves at maximum speed. Always verify you are in G01 before any cutting move.

No feed rate with G01. G01 without an active F-word triggers an alarm. Set F before the first G01 move.

Wrong feed rate for plunging. Vertical plunges need slower feeds than horizontal cuts. Use F50-F100 for plunging into metal, F200-F400 for horizontal cutting.


What’s Next?

Understanding G00 Toolpath Behavior

A common misunderstanding about G00 is that it moves in a straight line like G01. In reality, each axis moves at its own maximum acceleration and speed. The tool path during G00 is a curve determined by the axis dynamics. On some machines the path can arc outward significantly, which is dangerous near clamps or fixtures.

To see this effect, consider a G00 X100 Y100 move on a machine where the X axis has a maximum speed of 10 m/min and the Y axis has a maximum speed of 5 m/min. The X axis reaches its target in half the time of the Y axis. The resulting path is a curve, not a straight line.

For critical moves where the path must be predictable, use G01 with a high feed rate instead of G00. G01 produces a straight-line path that is completely predictable.

Feed Rate Selection Guide

Operation Material Feed Rate (6mm tool)
Plunging Aluminum 50-100 mm/min
Plunging Steel 30-60 mm/min
Plunging Wood 100-300 mm/min
Horizontal cut Aluminum 200-400 mm/min
Horizontal cut Steel 100-200 mm/min
Horizontal cut Wood 500-2000 mm/min

Programming Multiple Passes

For cuts deeper than 1mm, use multiple passes rather than one deep cut:

G01 Z-1 F100     ; Pass 1: 1mm deep
(cut the shape)
G00 Z2
G00 X0 Y0
G01 Z-2 F100     ; Pass 2: 2mm deep
(cut the shape)
G00 Z2
G00 X0 Y0
G01 Z-3 F100     ; Pass 3: 3mm deep
(cut the shape)
G00 Z5

Optimizing G00 Moves

Group consecutive G00 moves that are far apart. If you need to move from X0 Y0 Z0 to X100 Y100 Z10, a single G00 X100 Y100 Z10 is more efficient than separate X, Y, and Z moves.

G00 vs G01 for Non-Cutting Moves

For long rapid moves over open space, G00 is appropriate. For short moves near the workpiece where accuracy matters, use G01 at a fast feed rate.

G01 Feed Rate Optimization

The optimal feed rate produces chips of the same color as the base material, a smooth cutting sound, and no visible vibration. If chips are powdery, feed is too low. If the machine shakes, feed is too high.

Summary

  • G00 = fast positioning, not for cutting, unpredictable path
  • G01 = controlled straight-line cut, requires F-word
  • Never cut with G00
  • Set feed rate before the first G01 move
  • Use slower feed for plunging than horizontal cutting
  • Use multiple passes for deep cuts

Practical Applications of G00 and G01

Toolpath Planning

When planning a toolpath, the sequence of G00 and G01 moves determines the efficiency and safety of the program. A typical pattern is:

  1. G00 to a safe position above the part
  2. G01 to feed into the material
  3. G01 to cut the profile
  4. G00 to retract clear of the part
  5. G00 to the next start position

This sequence repeats for every tool and every operation.

Reducing Cycle Time

To reduce cycle time, minimize the distance traveled in G01 and maximize the distance traveled in G00. Use the shortest possible G01 paths to remove material and fast G00 moves between operations. However, never compromise safety for speed.

Using G00 with Tool Changes

When changing tools, use G00 to move to the tool change position. Most machines have a fixed tool change position that is safe for all tools:

G00 G53 Z0       ; Move Z to machine home
M06 T2           ; Change to tool 2

G53 temporarily overrides the work offset and uses machine coordinates, ensuring the tool moves to the same physical position regardless of the work offset.

G01 in Different Operations

Face Milling

Face milling uses multiple parallel G01 passes to create a flat surface:

G00 X-10 Y10 Z5
G01 Z0 F200
G01 X110 Y10 F400
G00 Y30
G01 Z0
G01 X-10 Y30 F400
G00 Y50
G01 Z0
G01 X110 Y50 F400
G00 Z5

Profile Cutting

Profile cutting follows the outline of a part using G01 for straight segments and G02/G03 for curved segments.

Pocketing

Pocketing removes material from inside a closed boundary using a series of G01 passes at increasing depths.

Advanced G01 Programming

Using G01 for Ramping

Ramping enters the material at an angle rather than plunging straight down. This reduces cutting forces and tool deflection:

G01 X10 Z-5 F100   ; Ramp into material at an angle
G01 X50 Z-5        ; Continue cutting at full depth

Using G01 for Chamfering

A chamfer can be cut using a G01 move that moves in both X and Z simultaneously:

G01 X45 Z-1 F100   ; 45-degree chamfer

Troubleshooting G00 and G01 Problems

Problem Cause Fix
Tool crashes on approach G00 path hits an obstacle Use G01 instead of G00 near clamps
Tool breaks on entry G00 used instead of G01 to plunge Change G00 to G01 for plunging
Machine alarms on G01 No feed rate set Add F-word before or on G01 line
Cut is not straight Excessive tool deflection Reduce depth of cut or feed rate
Surface finish is rough Feed rate too high Reduce feed rate by 20 percent

Best Practices

  1. Always include a safety block with G90, G94, G17, and G54 before any G00 or G01 moves
  2. Set the feed rate before the first G01 move
  3. Use G01 instead of G00 when near clamps or fixtures
  4. Use multiple shallow passes instead of one deep pass
  5. Verify G00 paths in simulation before running on the machine
  6. Keep G00 moves at least 5mm above the highest point of the workpiece

G00 and G01 in CAM Software

CAM software generates G00 for approach and retract moves and G01 for cutting moves. The post-processor handles the mode selection automatically. Understanding what the CAM software is doing helps you troubleshoot problems in generated code.

Most CAM-generated programs follow this pattern:

  1. Safety block (G90 G94 G17 G54)
  2. Tool change (M06 Tn)
  3. Spindle start (M03 Snnnn)
  4. Approach move (G00 to start position)
  5. Plunge move (G01 Z-depth)
  6. Cutting moves (G01, G02, G03)
  7. Retract move (G00 to safe height)
  8. Repeat for each tool
  9. Program end (M30)

Understanding this pattern helps you read and debug any CAM-generated program.

G00 Path Visualization

To better understand G00 path behavior, imagine moving from X0 Y0 to X100 Y100 on two different machines. Machine A has equal axis speeds. Machine B has X twice as fast as Y.

Machine A (balanced): The tool moves in a straight line at 45 degrees, arriving at X100 Y100 with both axes stopping simultaneously.

Machine B (unbalanced): The X axis arrives at X100 while Y is still at Y50. The tool path is a two-line path: first diagonal to X100 Y50, then straight to X100 Y100. This path is wider than the straight line and could strike something on the side.

This is why G00 near obstacles is dangerous. Use G01 for predictable paths when clearance is tight.

Feed Rate Calculations for G01

The feed rate for G01 depends on the material, tool diameter, spindle speed, and depth of cut. A general starting point:

Feed Rate = RPM x Number of Flutes x Chip Load

For a 6mm end mill in aluminum at 10000 RPM with a 0.03mm chip load: Feed Rate = 10000 x 2 x 0.03 = 600 mm/min

For steel at 4000 RPM with a 0.02mm chip load: Feed Rate = 4000 x 2 x 0.02 = 160 mm/min

These calculated feed rates assume optimal conditions. Reduce by 20-50 percent for less rigid machines.

Safety Practices

  1. Always run a new program in single-block mode for the first cycle
  2. Keep Z moves above the workpiece for all G00 positioning
  3. Use a dry run with Z raised to verify the toolpath before cutting
  4. Listen to the machine — unusual sounds indicate problems
  5. Check the first part carefully before running additional parts

G00 and G01 in Multi-Tool Programs

When using multiple tools, each tool needs its own approach and retract sequence:

; Tool 1: Roughing
M06 T1
M03 S3000
G00 X0 Y0 Z5
G01 Z-1 F100
(cutting operations)
G00 Z5
M05

; Tool 2: Finishing
M06 T2
M03 S5000
G00 X0 Y0 Z5
G01 Z-0.2 F150
(cutting operations)
G00 Z5
M05
M30

Each tool starts with G00 to position and G01 to cut. The pattern is the same for every tool in the program.

G00 and G01 Compared to Other Motion Codes

G00 and G01 are part of Group 01 (motion codes) along with G02, G03, and G04. Understanding how they relate helps you choose the right code:

  • G00: Maximum speed, non-linear path, not for cutting
  • G01: Controlled speed, straight line, for cutting
  • G02: Controlled speed, clockwise arc, for cutting curves
  • G03: Controlled speed, counterclockwise arc, for cutting curves
  • G04: Dwell (pause), no motion

Each code has a specific purpose. G00 and G01 handle the majority of moves in any CNC program.

Learning Progression

  1. First, master G00 and G01 with simple straight-line programs
  2. Add G02 and G03 for arcs and circles
  3. Add canned cycles (G81-G89) for drilling operations
  4. Add cutter compensation (G41-G42) for precise profile cutting
  5. Add subprograms (M98-M99) for repeated operations

Each step builds on the previous one. Start with G00 and G01 and add new codes as you need them.

The Role of G00 and G01 in CNC Education

Every CNC training program in the world starts with G00 and G01 because they are the simplest codes to understand and the most fundamental to all CNC programming. Understanding G00 and G01 gives you the foundation to learn every other code. Most CNC programs are composed primarily of G00 and G01 moves with occasional G02 and G03 arcs.

Practice writing programs that use only G00 and G01 to build confidence. When you can write a complete program using just G00 and G01 with confidence, you have mastered the most fundamental concepts of CNC machine control.

G00 and G01 are the building blocks of every CNC program. Spending time to understand them thoroughly pays dividends in every program you write afterward. Practice with simple shapes first, then add complexity as your skills grow. G00 is for getting there fast. G01 is for getting there right. Use them correctly and your CNC programs will be both efficient and safe.

The concepts you learn here apply to every CNC machine and every CNC program regardless of complexity.

Master G00 and G01 first, and everything else in CNC programming builds naturally from that foundation. It is the starting point for every CNC programmer. Take the time to learn them well. They will serve you in every program you write. Understanding them is non-negotiable. Master them first. They matter most. Start here. Right now. Do it. Now. !

SERIES

G-Code Fundamentals — Part 3 of 4

  1. G-Code Explained: How CNC Programming Works
  2. G-Code for Beginners: Learn to Write Your First CNC Program
  3. G00 and G01: Rapid Traverse and Linear Interpolation
  4. G90 vs G91: Absolute vs Incremental Positioning in CNC

FAQ

Frequently Asked Questions — G-Code Fundamentals

What is the difference between G00 and G01?

G00 moves at maximum speed for positioning only. G01 moves at a controlled feed rate for cutting.

Can I use G00 for cutting?

Never. G00 ignores the feed rate and moves at maximum speed. Using G00 while cutting will break the tool.

Tags:#g-code#programming#beginner