CNC lathe simple g code example for CNC machinists/CNC programmers who just started their journey to learn CNC programming.
Simple G Code Example CNC Lathe
O0001 N5 M12 N10 T0101 N15 G0 X100 Z50 N20 M3 S600 N25 M8 N30 G1 X50 Z0 F600 N40 W-30 F200 N50 X80 W-20 F150 N60 G0 X100 Z50 N70 T0100 N80 M5 N90 M9 N100 M13 N110 M30 N120 %
Code Explanation
N5 Clamping workpiece
N10 Changing No.1 tool and executing its offset
N15 Rapidly positioning to A point
N20 Starting the spindle with 600 r/min
N25 Cooling ON
N30 Approaching B point with 600mm/min
N40 Cutting from B point to C point
N50 Cutting from C point to D point
N60 Rapidly retracting to A point
N70 Canceling the tool offset
N80 Stopping the spindle
N90 Cooling OFF
N100 Releasing workpiece
N110 End of program, spindle stopping and Cooling OFF