← Open Viewer
GCodexG-Code Guide › M109 Command
M109

M109 — Set Hotend Temperature and Wait

Category: Temperature  ·  Applies to: 3D Printer, Marlin, Klipper  ·  Updated: May 2026

What is M109?

M109 sets the target hotend temperature and blocks all further G-Code execution until the temperature is reached and stable. It is the safe way to ensure the hotend is ready before printing begins.

Syntax

M109 [S] [R] [T]

Parameters

ParameterDescription
STarget temperature — waits until temperature reaches or exceeds this value
RTarget temperature — waits until temperature is within ±TEMP_WINDOW of this value (both heating and cooling)
TTool index for multi-extruder printers

Examples

M109 S210
↑ Heat to 210°C and WAIT — printer pauses here until ready
M109 R210
↑ Wait until temperature stabilizes at exactly 210°C ± window (heats or cools)
M109 S0
↑ Cool down and wait until heater is off (used in end scripts for safety)

Important Notes

  • M109 is blocking — no other G-Code executes until temperature is stable.
  • Use M104 first to start heating, do setup moves, then use M109 to wait just before printing.
  • If THERMAL_PROTECTION_HOTEND is enabled (recommended), M109 will trigger thermal runaway protection if temperature drops unexpectedly.
  • The S parameter only waits for heating up. The R parameter waits for exact stabilization (useful when cooling down to a lower temperature).
  • Typical wait time from cold: 2–4 minutes for a 24V system, 4–8 minutes for 12V.

Common Mistakes

  • Using M109 before the bed has started heating — wastes time. Set M140 first, then M104, then M109 and M190.
  • Using M109 in a loop or macro that runs repeatedly — blocks the entire printer during wait.
  • Setting S0 with M109 to 'wait for cooldown' — use R25 or similar to wait for cool-down, as S only waits for heating.

Frequently Asked Questions

Q: Why does M109 sometimes take very long?
If TEMP_RESIDENCY_TIME is set in Marlin, the printer waits not just until it reaches temperature, but until it has been stable within TEMP_WINDOW for TEMP_RESIDENCY_TIME seconds. This ensures the temperature is genuinely stable, not just momentarily at target. Default is typically 10 seconds.
Q: What is the difference between M109 S and M109 R?
M109 S only waits for the temperature to reach the target when heating. M109 R waits until the temperature stabilizes at the target in both directions — useful if you want to wait for the hotend to cool down to a specific temperature, not just heat up.