M3, M4, M5 - Spindle Control Commands
Description
The M3, M4, and M5 commands control spindle operation in CNC machines.
- M3 - Starts the spindle rotating clockwise at a specified speed
- M4 - Starts the spindle rotating counter-clockwise at a specified speed
- M5 - Stops the spindle completely
Important: Before using any spindle commands (M3, M4, M5), you must first call theConfigureSpindle()method to configure the DMC axis that controls the spindle and set the counts per revolution conversion factor.
Motor Direction: M3 will command a positive spindle jog and M4 will command a negative spindle jog. The direction the spindle motor moves when given a positive or negative jog is dependent on motor/encoder wiring, as well as motor parameters set. The motor must be configured so a positive jog causes clockwise rotation, and a negative jog causes counter-clockwise rotation.
The implementation of M3, M4, and M5 assumes that if using a servo motor, an encoder is being used and is wired to the controller. If the spindle is commanded with an open loop analog signal, contact Galil.
Syntax
Parameters
Parameter | Description | Example |
---|---|---|
S | Spindle speed in RPM (M3 and M4 only) | S1000 |
Note: If the S parameter is not provided with M3 or M4, the most recently specified S value will be used.