SPINDLE CONTROL (M03, M04, AND M05)
To start the spindle turning clockwise (forward) at the currently programmed speed, program: M03
To start the spindle turning counterclockwise at the currently programmed speed, program: M04
The speed is programmed by the S word.
To stop the spindle from turning, program: M05
It’s okay to use M03 or M04 if the spindle speed is set to 0; if this is done, the spindle won’t start turning. If later the spindle speed is set above 0, the spindle starts turning. It is permitted to use M03 or M04 when the spindle is already turning, or to use M05 when the spindle is already stopped.
PROGRAM STOP AND PROGRAM END (M00, M01, M02, AND M30)
To stop a running program temporarily, regardless of the optional stop switch setting, program: M00
To stop a running program temporarily, but only if the optional stop switch is on, program: M01
It’s okay to program M00 and M01 in MDI mode, but the effect probably won’t be noticeable because normal behavior in MDI mode is to stop after each line of input.
If a program is stopped by an M00, M01, selecting Cycle Start restarts the program at the following line of the G-code program.
To end a program, program: M02 or M30.
M02 leaves the next line to be executed as the M02 line. M30 rewinds the G-code file. These commands can have the following effects:
- Axis offsets are set to zero (like G92.2) and origin offsets are set to the default (like G54)
- Selected plane is set to XY (like G17)
- Distance mode is set to absolute (like G90)
- Feed rate mode is set to units per minute mode (like G94)
- Feed and speed overrides are set to on (like M48)
- Cutter Compensation is turned off (like G40)
- The spindle is stopped (like M05)
- The current motion mode is set to G01 (like G01)
- Coolant is turned off (like M09)
No more lines of code in the file are executed after the M02 or M30 command is executed. Selecting Cycle Start starts the program back at the beginning of the file.