3D printer G-code · Marlin
M304: Set bed PID values (Marlin)
Set bed PID values — Sets the PID values of the heated bed. The bed needs PIDTEMPBED enabled in Marlin; otherwise it works with simple on/off control.
On this page
| Property | Value |
|---|---|
| Command | M304 |
| Function | Set bed PID values |
| Firmware | Marlin |
| Group | Temperature |
| Syntax | M304 P I D |
What does M304 do?
Sets the PID values of the heated bed. The bed needs PIDTEMPBED enabled in Marlin; otherwise it works with simple on/off control.
Parameters
| Parameter | Meaning |
|---|---|
P I D | PID values of the bed |
Example
M303 E-1 S60 C8 U1
M500Tips from practice
- Bed PID gives a steadier temperature and less pulsing of lights on the same power supply.
Marlin. 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 temperature commands
| Command | Function | Firmware |
|---|---|---|
M104 | Set hotend temperature (no wait) | Marlin and Klipper |
M109 | Set hotend temperature and wait | Marlin and Klipper |
M140 | Set bed temperature (no wait) | Marlin and Klipper |
M190 | Set bed temperature and wait | Marlin and Klipper |
M141 | Set chamber temperature | Marlin |
M303 | PID autotune | Marlin |
M301 | Set hotend PID values | Marlin |
PID_CALIBRATE | PID tuning (Klipper) | Klipper |
TEMPERATURE_WAIT | Wait for a temperature range | Klipper |
SET_HEATER_TEMPERATURE | Set a heater | 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 M304 do on a 3D printer?
M304 is set bed PID values. Sets the PID values of the heated bed. The bed needs PIDTEMPBED enabled in Marlin; otherwise it works with simple on/off control.
Does M304 work in Klipper and Marlin?
M304 is a Marlin command. Klipper uses its own commands and printer.cfg settings for this task.
Was this page helpful?