3D printer G-code · Marlin
M412: Filament runout sensor (Marlin)
Filament runout sensor — Turns the filament runout sensor on or off. When the sensor triggers, Marlin runs the runout script (usually M600).
On this page
| Property | Value |
|---|---|
| Command | M412 |
| Function | Filament runout sensor |
| Firmware | Marlin |
| Group | Print control |
| Syntax | M412 S<0|1> |
What does M412 do?
Turns the filament runout sensor on or off. When the sensor triggers, Marlin runs the runout script (usually M600).
Parameters
| Parameter | Meaning |
|---|---|
S | 1 on, 0 off |
D | Runout distance in mm before the change starts |
Example
M412 S1
M500Marlin. Many Marlin commands only exist when the feature is enabled in the firmware build. If the printer answers "Unknown command", the feature is missing. Klipper does not understand most of these settings codes; it uses printer.cfg instead.
Related commands
More print control commands
| Command | Function | Firmware |
|---|---|---|
M220 | Speed factor | Marlin and Klipper |
M600 | Filament change | Marlin |
M413 | Power-loss recovery | Marlin |
M84 | Disable motors (M84 / M18) | Marlin and Klipper |
M400 | Finish moves | Marlin and Klipper |
M112 | Emergency stop | Marlin and Klipper |
M25 | Pause SD print (M25 / M24) | Marlin |
EXCLUDE_OBJECT | Cancel one object | Klipper |
PAUSE | Pause, resume, cancel | Klipper |
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 simulatorFrequently asked questions
What does M412 do on a 3D printer?
M412 is filament runout sensor. Turns the filament runout sensor on or off. When the sensor triggers, Marlin runs the runout script (usually M600).
Does M412 work in Klipper and Marlin?
M412 is a Marlin command. Klipper uses its own commands and printer.cfg settings for this task.
Was this page helpful?