O0406 (ROSCA M30X1.5 CON G32) | ( Program header. ) |
G21 G18 G40 G99 | ( Millimeters, lathe XZ plane and feed per revolution. ) |
T0707 | ( External threading tool with its offset. ) |
G97 S700 M03 | ( Fixed rpm, mandatory for threading. With G96 the pitch would come out variable. ) |
G00 X32. Z5. M08 | ( Approach outside the diameter with a lead-in stroke: the 5 mm ahead of the part are what the carriage needs to synchronize. ) |
G00 X29.6 | ( First pass: goes in 0.4 mm in diameter from the nominal 30, that is, 0.2 mm on the radius. ) |
G32 Z-27. F1.5 | ( Threading pass to Z-27, two millimeters past the end of the thread to give it a lead-out. F1.5 is the pitch, not the feed. ) |
G00 X32. | ( Retract in X, with the carriage already past the thread. ) |
G00 Z5. | ( Returns to the start point for the next pass. ) |
G00 X29.0 | ( Second pass: 0.3 mm more depth on the radius. ) |
G32 Z-27. F1.5 | ( Second threading pass, same pitch and same end point. ) |
G00 X32. | ( Retract. ) |
G00 Z5. | ( Back to the start. ) |
G00 X28.6 | ( Third pass, less depth each time so the cutting load stays similar. ) |
G32 Z-27. F1.5 | ( Third pass. ) |
G00 X32. / G00 Z5. / G00 X28.3 | ( Retract, return and start of the fourth pass. ) |
G32 Z-27. F1.5 | ( Fourth pass. ) |
G00 X32. / G00 Z5. / G00 X28.16 | ( Retract, return and fifth pass, now at the final thread diameter. ) |
G32 Z-27. F1.5 | ( Final pass. ) |
G00 X32. / G00 Z5. | ( Retract and return. ) |
G00 X28.16 | ( Back to the final diameter, with no added depth, for the spring pass. ) |
G32 Z-27. F1.5 | ( Spring pass with no added depth, which cleans up the thread and makes up for tool deflection. ) |
G00 X32. | ( Retract in X, with the carriage already past the thread. ) |
G00 X200. Z100. M09 M05 | ( Retract to the tool change position, coolant off and spindle stopped. ) |
M30 | ( End of program. ) |