Bird
Raised Fist0
CNC Programmingscripting~10 mins

Approach and retract moves in CNC Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Approach and retract moves
Start at safe position
↓
Approach move: move tool close to workpiece
↓
Perform machining operation
↓
Retract move: move tool away from workpiece
↓
Return to safe position or next step
The tool starts safely away, moves close to the workpiece (approach), performs machining, then moves away (retract) to avoid collisions.
Execution Sample
CNC Programming
G00 Z5.0 ; Retract to safe height
G01 X10 Y10 Z-1.0 F100 ; Approach and cut
G00 Z5.0 ; Retract after cut
Moves tool up to safe height, then approaches workpiece to cut, then retracts back up.
Execution Table
StepCommandPosition (X,Y,Z)Feed RateAction
1G00 Z5.0(current X, current Y, 5.0)RapidRetract to safe height
2G01 X10 Y10 Z-1.0 F100(10, 10, -1.0)100Approach and cut at workpiece
3G00 Z5.0(10, 10, 5.0)RapidRetract after cut
💡 Program ends after retracting to safe height at step 3
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3
Xcurrentcurrent1010
Ycurrentcurrent1010
Zcurrent5.0-1.05.0
Feed RateN/ARapid100Rapid
Key Moments - 3 Insights
Why do we move the tool up to Z5.0 before and after cutting?
Moving to Z5.0 is a retract move to keep the tool safely away from the workpiece and avoid collisions, as shown in steps 1 and 3 of the execution_table.
What is the difference between G00 and G01 commands here?
G00 is a rapid move used for quick positioning without cutting (steps 1 and 3), while G01 is a controlled feed move used for cutting (step 2), as seen in the execution_table.
Why do we specify feed rate only in the approach move?
Feed rate controls cutting speed and is needed only during machining moves like step 2; rapid moves (steps 1 and 3) do not require feed rate.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the Z position after step 2?
A-1.0
B5.0
C0.0
D10.0
💡 Hint
Check the Position column in row for step 2 in execution_table.
At which step does the tool perform the cutting operation?
AStep 1
BStep 2
CStep 3
DNone
💡 Hint
Look at the Action column in execution_table for the cutting move.
If the retract height changed from Z5.0 to Z10.0, what would change in the variable_tracker after step 1?
AX would change to 10
BFeed Rate would change to 100
CZ would be 10.0 instead of 5.0
DY would change to 5.0
💡 Hint
Check the Z variable values after step 1 in variable_tracker.
Concept Snapshot
Approach and retract moves:
- Retract moves (G00) move tool safely away (e.g., Z5.0)
- Approach moves (G01) move tool close to workpiece for cutting
- Feed rate applies only during cutting moves
- Retract after cutting to avoid collisions
- Always start and end at safe positions
Full Transcript
This lesson shows how CNC tools move safely before and after cutting. First, the tool retracts up to a safe height (Z5.0) using a rapid move (G00). Then it approaches the workpiece at controlled speed (G01) to cut at position X10 Y10 Z-1.0 with feed rate 100. After cutting, it retracts back up to Z5.0 rapidly to avoid hitting the workpiece. Variables X, Y, Z, and feed rate change step by step. Retract moves keep the tool safe, approach moves perform cutting, and feed rate is only needed during cutting. Understanding these moves prevents crashes and ensures smooth machining.

Practice

(1/5)
1. What is the main purpose of an approach move in CNC programming?
easy
A. To change the tool automatically
B. To lift the tool away from the workpiece after cutting
C. To speed up the cutting process
D. To bring the tool safely close to the workpiece before cutting

Solution

  1. Step 1: Understand approach move function

    Approach moves bring the tool safely close to the workpiece before starting the cut.
  2. Step 2: Differentiate from retract move

    Retract moves lift the tool away after cutting, so they are not approach moves.
  3. Final Answer:

    To bring the tool safely close to the workpiece before cutting -> Option D
  4. Quick Check:

    Approach move = safe tool approach [OK]
Hint: Approach = move close before cutting [OK]
Common Mistakes:
  • Confusing approach with retract moves
  • Thinking approach moves lift the tool
  • Assuming approach moves speed up cutting
2. Which G-code is typically used for a fast approach move in CNC programming?
easy
A. G00
B. G02
C. G01
D. G03

Solution

  1. Step 1: Identify G-code for fast moves

    G00 is used for rapid, fast moves to position the tool quickly.
  2. Step 2: Differentiate from controlled moves

    G01 is for slow, controlled cutting moves, not fast approach moves.
  3. Final Answer:

    G00 -> Option A
  4. Quick Check:

    Fast move = G00 [OK]
Hint: Fast moves use G00, slow moves use G01 [OK]
Common Mistakes:
  • Using G01 for fast moves
  • Confusing G02/G03 (arc moves) with approach moves
  • Mixing up G00 and G01
3. Given this CNC code snippet:
G00 X10 Y10 Z5
G01 Z-1 F100
G01 X20 Y20 F200
G00 Z5

What is the purpose of the last line G00 Z5?
medium
A. It moves the tool slowly down into the workpiece
B. It moves the tool quickly away from the workpiece (retract move)
C. It sets the feed rate for cutting
D. It changes the tool position to X5 Y5

Solution

  1. Step 1: Analyze the last line command

    G00 Z5 moves the tool rapidly to Z=5, lifting it away from the workpiece.
  2. Step 2: Understand retract move meaning

    Retract moves lift the tool safely away after cutting, which matches this command.
  3. Final Answer:

    It moves the tool quickly away from the workpiece (retract move) -> Option B
  4. Quick Check:

    G00 Z5 = retract move [OK]
Hint: Retract moves lift tool fast with G00 Z positive [OK]
Common Mistakes:
  • Thinking G00 Z5 moves tool down
  • Confusing feed rate with position commands
  • Assuming last line changes XY position
4. Identify the error in this CNC code for approach and retract moves:
G01 X10 Y10 Z5 F300
G00 Z-2
G01 X20 Y20 F150
G00 Z5
medium
A. Using G00 to move down into the workpiece
B. Using G01 for initial move instead of G00
C. Feed rate missing on retract move
D. No error, code is correct

Solution

  1. Step 1: Check move types and directions

    G00 is for fast moves and should not be used to move down into the workpiece (Z negative).
  2. Step 2: Identify incorrect use of G00

    Line G00 Z-2 moves tool down fast, which is unsafe and incorrect for approach.
  3. Final Answer:

    Using G00 to move down into the workpiece -> Option A
  4. Quick Check:

    Fast moves (G00) should not move tool down into material [OK]
Hint: Never use G00 to move tool down into workpiece [OK]
Common Mistakes:
  • Using G00 for cutting moves
  • Ignoring safe approach/retract rules
  • Assuming feed rate needed on retract moves
5. You want to safely approach a workpiece at X=50, Y=50, then cut down to Z=-3 slowly, and finally retract quickly. Which sequence of commands is correct?
hard
A. G01 Z-3 F100
G00 X50 Y50
G01 Z5 F100
B. G01 X50 Y50 F200
G00 Z-3
G01 Z5 F100
C. G00 X50 Y50
G01 Z-3 F100
G00 Z5
D. G00 Z-3
G01 X50 Y50 F150
G00 Z5

Solution

  1. Step 1: Approach move with fast positioning

    Use G00 to move quickly to X50 Y50 before cutting.
  2. Step 2: Slow controlled cut down

    Use G01 with feed rate to move down to Z=-3 slowly and safely.
  3. Step 3: Retract move with fast lift

    Use G00 to quickly lift tool away to Z=5 after cutting.
  4. Final Answer:

    G00 X50 Y50
    G01 Z-3 F100
    G00 Z5
    -> Option C
  5. Quick Check:

    Fast approach, slow cut, fast retract = G00 X50 Y50
    G01 Z-3 F100
    G00 Z5 [OK]
Hint: Fast XY move (G00), slow Z down (G01), fast Z up (G00) [OK]
Common Mistakes:
  • Using G01 for fast XY moves
  • Using G00 to move tool down into material
  • Mixing feed rates on retract moves
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard