Bird
Raised Fist0
CNC Programmingscripting~20 mins

Pocket milling (rectangular) in CNC Programming - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Pocket Milling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of a simple rectangular pocket milling G-code
What is the final position of the tool after executing this G-code snippet for a rectangular pocket milling?
G90 G00 X0 Y0 Z5
G01 Z-2 F100
G01 X50 Y0 F200
G01 X50 Y30
G01 X0 Y30
G01 X0 Y0
G00 Z5
CNC Programming
G90 G00 X0 Y0 Z5
G01 Z-2 F100
G01 X50 Y0 F200
G01 X50 Y30
G01 X0 Y30
G01 X0 Y0
G00 Z5
AX50 Y30 Z-2
BX0 Y0 Z-2
CX0 Y0 Z5
DX50 Y30 Z5
Attempts:
2 left
💡 Hint
Look at the last move command and the Z height it sets.
🧠 Conceptual
intermediate
1:30remaining
Understanding step-over in rectangular pocket milling
In rectangular pocket milling, what does the term step-over refer to?
AThe distance the tool moves down in Z-axis after each pass
BThe lateral distance the tool moves sideways between passes to cover the pocket area
CThe speed at which the tool moves along the pocket edges
DThe diameter of the cutting tool used
Attempts:
2 left
💡 Hint
Think about how the tool covers the entire rectangular area.
🔧 Debug
advanced
2:30remaining
Identify the error in this rectangular pocket milling G-code
This G-code is intended to mill a rectangular pocket 40mm wide and 20mm deep. What error will occur when running it?
G90 G00 X0 Y0 Z5
G01 Z-20 F100
G01 X40 Y0 F200
G01 X40 Y20
G01 X0 Y20
G01 X0 Y0
G00 Z5
CNC Programming
G90 G00 X0 Y0 Z5
G01 Z-20 F100
G01 X40 Y0 F200
G01 X40 Y20
G01 X0 Y20
G01 X0 Y0
G00 Z5
AThe tool will crash because Z-20 is too deep without incremental steps
BThe feed rate F200 is too slow for XY moves
CThe toolpath is missing a command to start spindle rotation
DNo error, the code will run correctly
Attempts:
2 left
💡 Hint
Consider typical machining practice for depth of cut.
🚀 Application
advanced
2:00remaining
Calculate number of passes for rectangular pocket milling
You want to mill a rectangular pocket 48mm wide using a 10mm diameter tool with a 40% step-over. How many passes are needed to cover the width?
A12 passes
B15 passes
C8 passes
D10 passes
Attempts:
2 left
💡 Hint
Calculate step-over distance and divide pocket width by it, then round up.
📝 Syntax
expert
1:30remaining
Identify the syntax error in this rectangular pocket milling G-code snippet
Which option contains a syntax error that will cause the CNC machine to reject the program?
G90 G00 X0 Y0 Z5
G01 Z-5 F100
G01 X40 Y0 F200
G01 X40 Y20
G01 X0 Y20
G01 X0 Y0
G00 Z5
AG01 X40 Y20
BG01 Z-5 F100
CG00 Z5
DG01 X40 Y0 F
Attempts:
2 left
💡 Hint
Check if all commands have correct syntax and parameters.

Practice

(1/5)
1. What is the main purpose of pocket milling in CNC programming?
easy
A. To drill holes in a workpiece
B. To cut the outer shape of a part
C. To remove material inside a rectangular area
D. To polish the surface of a workpiece

Solution

  1. Step 1: Understand pocket milling definition

    Pocket milling is used to clear out material inside a defined area, usually rectangular.
  2. Step 2: Compare with other machining operations

    Drilling makes holes, contouring cuts outer edges, polishing smooths surfaces, so they differ from pocket milling.
  3. Final Answer:

    To remove material inside a rectangular area -> Option C
  4. Quick Check:

    Pocket milling = remove inside rectangle [OK]
Hint: Pocket milling clears inside areas, not edges or holes [OK]
Common Mistakes:
  • Confusing pocket milling with drilling
  • Thinking pocket milling cuts outer edges
  • Assuming pocket milling polishes surfaces
2. Which G-code command is used to move the tool quickly without cutting during pocket milling?
easy
A. G1
B. G3
C. G2
D. G0

Solution

  1. Step 1: Identify G-code commands for movement

    G0 moves the tool rapidly without cutting; G1 moves with controlled feed for cutting.
  2. Step 2: Differentiate G2 and G3

    G2 and G3 are used for circular interpolation, not rapid moves.
  3. Final Answer:

    G0 -> Option D
  4. Quick Check:

    Rapid move = G0 [OK]
Hint: G0 is rapid move; G1 is cutting move [OK]
Common Mistakes:
  • Using G1 for rapid moves
  • Confusing G2/G3 with rapid moves
  • Mixing up G0 and G1 commands
3. Given this CNC code snippet for pocket milling, what is the tool's final position?
G0 Z5
G0 X0 Y0
G1 Z-2 F100
G1 X50 Y0 F200
G1 X50 Y30
G1 X0 Y30
G1 X0 Y0
G0 Z5
medium
A. X0 Y0 Z5
B. X0 Y0 Z-2
C. X50 Y30 Z-2
D. X50 Y30 Z5

Solution

  1. Step 1: Trace the tool movements

    The tool starts at Z5 (safe height), moves to X0 Y0, then lowers to Z-2 to cut the pocket edges in sequence.
  2. Step 2: Identify final move

    After completing the rectangle, the tool moves back up to Z5 (safe height) at the last position X0 Y0.
  3. Final Answer:

    X0 Y0 Z5 -> Option A
  4. Quick Check:

    Ends at start point with safe height Z5 [OK]
Hint: Final move is rapid up at start point [OK]
Common Mistakes:
  • Ignoring the final Z5 move
  • Assuming tool stays lowered after cutting
  • Confusing last XY position with intermediate points
4. Identify the error in this pocket milling code snippet:
G0 Z5
G0 X0 Y0
G1 Z-2 F100
G1 X50 Y0 F200
G1 X50 Y30
G1 X0 Y30
G1 X0 Y0
G1 Z5
medium
A. Starting at Z5 instead of Z0
B. Using G1 to move up to Z5 instead of G0
C. Missing feed rate on last move
D. No error, code is correct

Solution

  1. Step 1: Check movement commands for safe height

    Raising the tool to safe height (Z5) should use rapid move G0, not cutting move G1.
  2. Step 2: Understand feed rate relevance

    Feed rate missing on last move is acceptable for G1 if previous feed rate applies; starting at Z5 is correct.
  3. Final Answer:

    Using G1 to move up to Z5 instead of G0 -> Option B
  4. Quick Check:

    Safe height moves use G0, not G1 [OK]
Hint: Use G0 for rapid moves up/down [OK]
Common Mistakes:
  • Using G1 for rapid moves
  • Ignoring feed rate importance
  • Confusing start height with error
5. You want to program a rectangular pocket 40mm wide and 25mm tall. The tool diameter is 10mm, and you want to mill in two passes to reach a depth of 4mm. Which approach correctly plans the passes?
hard
A. Cut 2mm depth in first pass, then 2mm in second pass along same path
B. Cut full depth 4mm in one pass along the rectangle edges
C. Cut 1mm depth in first pass, then 3mm in second pass along same path
D. Cut 4mm depth in first pass, then retract and cut again at 2mm

Solution

  1. Step 1: Understand depth per pass for tool safety

    Cutting full 4mm depth at once risks tool damage; splitting into equal passes is safer.
  2. Step 2: Plan passes to reach total depth

    Two passes of 2mm each sum to 4mm total depth, following same rectangular path for pocket milling.
  3. Final Answer:

    Cut 2mm depth in first pass, then 2mm in second pass along same path -> Option A
  4. Quick Check:

    Equal depth passes sum to total depth safely [OK]
Hint: Split total depth evenly for multiple passes [OK]
Common Mistakes:
  • Cutting full depth in one pass
  • Unequal depth passes causing tool stress
  • Retracting unnecessarily between passes
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