Home › M-codes › LinuxCNC Tormach › M19
M19 Spindle orient
LinuxCNC Tormach M-code · Mill and lathe
Turns the spindle to angle R and holds it. Used for boring bar shifts and tool changers.
Format
M19 R Q [P] [$]
Addresses
| Address | What it does |
|---|---|
R | Angle 0 to 360 degrees |
Q | Timeout in seconds |
P | Direction, 0 shortest, 1 clockwise, 2 counterclockwise |
$ | Spindle number |
How it works
Modal until M3, M4 or M5.
Example program
M5 (SPINDLE STOP)
M19 R90 Q5 P0 (ORIENT TO 90 DEG, 5 SEC TIMEOUT)
G0 X0.02 (SHIFT BORING BAR OFF THE WALL)
G0 Z1 (RETRACT)
M19 R90 Q5 P0 (ORIENT TO 90 DEG, 5 SEC TIMEOUT)
G0 X0.02 (SHIFT BORING BAR OFF THE WALL)
G0 Z1 (RETRACT)
Example is in inch. Check offsets and clearances first.
Watch out for
- Needs a spindle encoder and HAL orient setup.
- ORIENT_OFFSET in the INI file shifts the zero angle.
Related codes
M19 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Spindle orientation |
| Haas NGC | Orient spindle |
| Doosan (Fanuc) | Left spindle orientation |
| DMG Mori MAPPS (Fanuc) | Spindle orientation |
| Mazak (EIA) | Spindle orientation position (for the robot to insert a workpiece) |
| Okuma OSP | Spindle orientation (Lathes & Mills) |
| Mitsubishi M70 M80 | Spindle orientation |
| Brother Speedio | Spindle orientation |
| Siemens 840D 828D | Spindle positioning |
| Fagor 8055 8065 | Spindle orientation |
| Mach3 Mach4 | Spindle orient |
| Centroid CNC12 Acorn | Spindle orient, macro |
| Hurco WinMax (NC) | Spindle orient |
| Fadal | Spindle stop and orient |
Every M-code for LinuxCNC Tormach in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open M19 in the app All LinuxCNC Tormach M-codes