3D printer G-code · Marlin and Klipper

M140: Set bed temperature (no wait) (Marlin & Klipper)

Set bed temperature (no wait) — Sets the bed target temperature and continues. S0 turns the bed off.

By cnccode · Updated
On this page
  1. What does M140 do?
  2. Parameters
  3. Example
  4. Tips from practice
  5. Related commands
  6. More temperature commands
  7. Frequently asked questions
PropertyValue
CommandM140
FunctionSet bed temperature (no wait)
FirmwareMarlin and Klipper
GroupTemperature
SyntaxM140 S<°C>

What does M140 do?

Sets the bed target temperature and continues. S0 turns the bed off.

Parameters

ParameterMeaning
STarget temperature in °C

Example

G-code
M140 S60

Tips from practice

  • PLA 55–65 °C, PETG 70–85 °C, ABS/ASA 95–110 °C are common starting values.
  • Always turn the bed off at the end with M140 S0.

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 temperature commands

CommandFunctionFirmware
M104Set hotend temperature (no wait)Marlin and Klipper
M109Set hotend temperature and waitMarlin and Klipper
M190Set bed temperature and waitMarlin and Klipper
M141Set chamber temperatureMarlin
M303PID autotuneMarlin
M301Set hotend PID valuesMarlin
M304Set bed PID valuesMarlin
PID_CALIBRATEPID tuning (Klipper)Klipper
TEMPERATURE_WAITWait for a temperature rangeKlipper
SET_HEATER_TEMPERATURESet a heaterKlipper

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 M140 do on a 3D printer?
M140 is set bed temperature (no wait). Sets the bed target temperature and continues. S0 turns the bed off.
Does M140 work in Klipper and Marlin?
Yes, both firmwares understand M140.
Was this page helpful?