M5 G-code

M5 stops the spindle’s rotation.

What is a Spindle?

A spindle is a controlled motor that turns a tool (such as an endmill) at a given speed to allow it to remove material from the workpiece.

This is commonly used in CNC milling operations.

M5’s counterpart is the M3 command which is used to start the spindle and specify its rotation speed.

Safety Note: Always use M5 to stop the spindle before changing tools or when the job is complete.

Format

The command is used as such:

M5

Which means: stop the spindle’s rotation.

Parameters

The M5 command requires no parameters.

It simply stops the spindle regardless of its current speed.

Configuration

The spindle functionality of Smoothie is configured via the Spindle module.

Required Setup

Before using M5, ensure you have:

  • Enabled the spindle module in your configuration
  • Configured the appropriate pin for spindle control
  • Tested that M3 works correctly (M5 uses the same configuration)

Further reading

These resources are used as references for Gcode: