How to Program CNC Lathe from Drawing: Step-by-Step Guide
To program a CNC lathe from a drawing, first interpret the drawing dimensions and features, then write
G-code commands to control the lathe's tool movements and operations. Use G00 for rapid moves, G01 for cutting moves, and specify coordinates and speeds based on the drawing details.Syntax
The basic CNC lathe program uses G-code commands to control the machine. Key parts include:
G00: Rapid positioning (move quickly without cutting)G01: Linear interpolation (cutting move at set feed rate)X, Z: Coordinates for tool position on lathe axesF: Feed rate (speed of cutting)S: Spindle speed (rotation speed of the workpiece)M: Miscellaneous functions (start/stop spindle, coolant, program end)
Each line is a command telling the lathe what to do step-by-step.
gcode
N10 G00 X50 Z5 N20 G01 X20 Z0 F0.2 N30 G01 X10 Z-10 N40 M30
Example
This example programs a simple facing and turning operation based on a drawing showing a cylindrical part with a diameter of 40mm and length 50mm.
gcode
N10 G21 G40 G80 G90 ; Set units to mm, cancel offsets, absolute mode N20 T0101 ; Select tool 1 N30 S1200 M03 ; Spindle on clockwise at 1200 RPM N40 G00 X50 Z5 ; Rapid move to start position N50 G01 Z0 F0.15 ; Face the part at feed 0.15 mm/rev N60 G01 X40 F0.2 ; Turn diameter to 40mm N70 G01 Z-50 ; Move along length to 50mm N80 G00 X100 Z100 ; Retract tool N90 M05 ; Stop spindle N100 M30 ; End program
Common Pitfalls
Common mistakes when programming CNC lathes from drawings include:
- Misreading dimensions (confusing radius and diameter)
- Forgetting to set correct units (mm vs inches)
- Not setting spindle speed or feed rate properly, causing poor surface finish or tool damage
- Skipping safety moves like retracting the tool before rapid moves
- Using absolute vs incremental positioning incorrectly
Always double-check the drawing and simulate the program if possible.
gcode
N10 G00 X40 Z0 ; Wrong: moves tool into part without clearance N20 G00 X50 Z5 ; Right: safe rapid move before cutting
Quick Reference
Here is a quick cheat sheet for common CNC lathe G-code commands:
| Command | Description |
|---|---|
| G00 | Rapid positioning (move quickly without cutting) |
| G01 | Linear cutting move at set feed rate |
| G02 | Clockwise circular interpolation |
| G03 | Counterclockwise circular interpolation |
| G20 | Set units to inches |
| G21 | Set units to millimeters |
| M03 | Spindle on clockwise |
| M05 | Spindle stop |
| M30 | End program and rewind |
Key Takeaways
Read the drawing carefully to understand all dimensions and features before programming.
Use G00 for safe rapid moves and G01 for cutting moves with proper feed rates.
Always set spindle speed (S) and feed rate (F) according to material and tool specs.
Include safety moves to avoid collisions and tool damage.
Simulate or dry-run the program to catch errors before actual machining.