📖 Scenario: You are programming a CNC lathe to perform a facing operation on a metal workpiece. Facing means cutting the front surface flat and smooth.The machine needs a simple program to move the cutting tool from the outer edge to the center of the workpiece, removing a thin layer of material.
🎯 Goal: Create a basic CNC program for a facing operation that moves the tool from the outer diameter to the center in a straight line.
📋 What You'll Learn
Create a variable outer_diameter with value 100 (mm)
Create a variable feed_rate with value 0.2 (mm/rev)
Write a G-code line to move the tool from X = outer_diameter / 2 to X = 0 at the feed_rate
Print the final CNC program lines
💡 Why This Matters
🌍 Real World
CNC programmers write scripts to generate precise machine instructions for operations like facing, saving time and reducing errors.
💼 Career
Understanding how to automate CNC code generation is valuable for manufacturing engineers and CNC operators to improve efficiency and consistency.
Progress0 / 4 steps
1
Set up the workpiece size
Create a variable called outer_diameter and set it to 100 to represent the diameter of the workpiece in millimeters.
CNC Programming
Hint
Use a simple assignment like outer_diameter = 100.
2
Set the feed rate
Create a variable called feed_rate and set it to 0.2 to represent the feed rate in millimeters per revolution.
CNC Programming
Hint
Use a simple assignment like feed_rate = 0.2.
3
Write the facing move command
Write a G-code command string called facing_move that moves the tool from X = outer_diameter / 2 to X = 0 at the feed rate feed_rate. Use the format G01 X0 F0.2 where 0.2 is the feed rate value. Use an f-string to insert the feed rate value.
CNC Programming
Hint
Use an f-string like f"G01 X0 F{feed_rate}".
4
Print the CNC program
Print the CNC program lines: G00 X{outer_diameter / 2} to move to start position, then print the facing_move command.
CNC Programming
Hint
Use two print statements: one for G00 X{outer_diameter / 2} and one for facing_move.
Practice
(1/5)
1. What is the main purpose of a facing operation in CNC machining?
easy
A. To polish the surface without removing material
B. To create a flat surface on the end of a workpiece
C. To cut threads on a cylindrical part
D. To drill holes into the workpiece
Solution
Step 1: Understand facing operation goal
Facing operation is designed to remove material from the end of a workpiece to make it flat.
Step 2: Compare options with facing definition
Only To create a flat surface on the end of a workpiece describes creating a flat surface, which matches facing operation.
Final Answer:
To create a flat surface on the end of a workpiece -> Option B
Quick Check:
Facing = flat surface creation [OK]
Hint: Facing always means making a flat end surface [OK]
Common Mistakes:
Confusing facing with drilling or threading
Thinking facing is polishing without cutting
Assuming facing removes material from the side
2. Which of the following is the correct G-code command to start a facing operation on a CNC lathe?
easy
A. G01
B. G02
C. G00
D. G03
Solution
Step 1: Identify G-code for controlled feed
G01 is the command for linear interpolation with controlled feed rate, used in facing.
Step 2: Understand other G-codes
G00 is rapid move (no cutting), G02 and G03 are circular interpolation (arcs), not typical for facing.
Final Answer:
G01 -> Option A
Quick Check:
Facing uses linear feed = G01 [OK]
Hint: Facing uses linear feed moves, so G01 is correct [OK]
Common Mistakes:
Using G00 which is rapid move without cutting
Confusing circular moves G02/G03 with facing
Not setting feed rate with G01
3. Given this CNC code snippet for facing:
G01 X0 Z0 F0.2
G01 X20
G01 Z-5
G01 X0
What is the final position of the tool?
medium
A. X20, Z0
B. X0, Z0
C. X0, Z-5
D. X20, Z-5
Solution
Step 1: Trace each move in order
Start at X0 Z0, move to X0 Z0 (initial), then move to X20 Z0, then move to X20 Z-5, then move to X0 Z-5.
Step 2: Identify final coordinates
Last command moves X to 0 while Z stays at -5, so final position is X0, Z-5.
Final Answer:
X0, Z-5 -> Option C
Quick Check:
Last move sets X=0, Z=-5 [OK]
Hint: Follow each G01 move step-by-step to find final position [OK]
Common Mistakes:
Ignoring Z coordinate changes
Assuming tool returns to start
Mixing up X and Z values
4. Identify the error in this facing operation code snippet:
G01 X0 Z0 F0.1
G01 X-10
G01 Z-5
G01 X0
medium
A. Negative X value may cause tool crash
B. Feed rate F0.1 is too high for facing
C. Missing spindle start command
D. Z axis should not move during facing
Solution
Step 1: Analyze X movement
X moves from 0 to -10, which may move tool into the chuck or fixture causing crash.
Step 2: Check other parameters
Feed rate is low (safe), spindle start may be elsewhere, Z moves are normal in facing.
Final Answer:
Negative X value may cause tool crash -> Option A
Quick Check:
Negative X can cause collision [OK]
Hint: Check coordinate directions to avoid tool crashes [OK]
Common Mistakes:
Ignoring negative coordinates risk
Assuming feed rate is always wrong
Thinking spindle start is always missing
Believing Z axis must stay fixed
5. You want to face a workpiece end 50 mm wide with a 10 mm diameter tool. Which approach best ensures even material removal?
hard
A. Make 1 pass moving 10 mm along X axis
B. Make 1 pass moving 50 mm along Z axis
C. Make 10 passes, each moving 5 mm along Z axis
D. Make 5 passes, each moving 10 mm along X axis
Solution
Step 1: Understand facing width and tool size
The workpiece end is 50 mm wide; tool diameter is 10 mm, so tool covers 10 mm per pass.
Step 2: Calculate passes needed for full coverage
50 mm / 10 mm = 5 passes needed to cover entire width evenly.
Step 3: Confirm direction of passes
Passes move along X axis (width), not Z axis (length), to face the end surface.
Final Answer:
Make 5 passes, each moving 10 mm along X axis -> Option D
Quick Check:
Width/tool diameter = passes = 5 [OK]
Hint: Divide width by tool diameter for pass count [OK]
Common Mistakes:
Confusing X and Z axis directions
Trying to face in one pass with small tool
Using too many passes causing overcut
Ignoring tool diameter in planning
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.