3D printer G-code · Marlin and Klipper

M84: Disable motors (M84 / M18) (Marlin & Klipper)

Disable motors (M84 / M18) — Turns the stepper motors off so the axes can be moved by hand. Used at the end of every print. After M84 the position is lost and the next print must home again.

By cnccode · Updated
On this page
  1. What does M84 do?
  2. Parameters
  3. Example
  4. Tips from practice
  5. Related commands
  6. More print control commands
  7. Frequently asked questions
PropertyValue
CommandM84
FunctionDisable motors (M84 / M18)
FirmwareMarlin and Klipper
GroupPrint control
SyntaxM84 [X Y Z E]

What does M84 do?

Turns the stepper motors off so the axes can be moved by hand. Used at the end of every print. After M84 the position is lost and the next print must home again.

Parameters

ParameterMeaning
X Y Z EOnly these motors

Example

G-code
M84 X Y E ; keep Z on so the gantry does not drop

Tips from practice

  • On printers where Z can fall by its own weight, keep Z on.

The command works in Marlin and Klipper. Options can differ: Klipper accepts fewer parameters for some M-codes and ignores codes it does not know with an "Unknown command" error.

More print control commands

CommandFunctionFirmware
M220Speed factorMarlin and Klipper
M600Filament changeMarlin
M412Filament runout sensorMarlin
M413Power-loss recoveryMarlin
M400Finish movesMarlin and Klipper
M112Emergency stopMarlin and Klipper
M25Pause SD print (M25 / M24)Marlin
EXCLUDE_OBJECTCancel one objectKlipper
PAUSEPause, resume, cancelKlipper

Test it before you print

Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.

Open the simulator

Frequently asked questions

What does M84 do on a 3D printer?
M84 is disable motors (M84 / M18). Turns the stepper motors off so the axes can be moved by hand. Used at the end of every print. After M84 the position is lost and the next print must home again.
Does M84 work in Klipper and Marlin?
Yes, both firmwares understand M84.
Was this page helpful?