CNC lathe · M-code
M21 / M22: tailstock advance and retract
On a Haas lathe with the tailstock option, M21 brings the tailstock in to support the part and M22 sends it back. Format below from Haas, its maker.
On a Haas mill, M21–M25 are optional user M functions. Other lathe builders number their tailstock codes their own way: check your machine's M-code list.
Worked example
Support a long shaft while turning (Haas lathe). Written for this page in the Haas format.
M21 (tailstock in)G00 X1.6 Z0.1G01 Z-6. F0.008 (turn between centers)G00 X2. M22 (tailstock back)How each control writes it
Haas M21 / M22
One source: Haas Automation, the control's maker
- An option on Haas lathes.
- M21 moves to the advance distance in Settings 341 and 342; M22 retracts to the point in Setting 105.
Source: Haas Automation, lathe M21
No Fanuc row yet: that chapter of the 0i manual has not been read.
Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.