3D printer G-code · Marlin

M301: Set hotend PID values (Marlin)

Set hotend PID values — Sets the PID values of the hotend by hand. M304 does the same for the bed. Normally you let M303 find them.

By cnccode · Updated
On this page
  1. What does M301 do?
  2. Parameters
  3. Example
  4. Tips from practice
  5. Related commands
  6. More temperature commands
  7. Frequently asked questions
PropertyValue
CommandM301
FunctionSet hotend PID values
FirmwareMarlin
GroupTemperature
SyntaxM301 P<Kp> I<Ki> D<Kd>

What does M301 do?

Sets the PID values of the hotend by hand. M304 does the same for the bed. Normally you let M303 find them.

Parameters

ParameterMeaning
P I DProportional, integral and derivative values

Example

G-code
M301 P22.2 I1.08 D114
M500

Tips from practice

  • M503 shows the active values.

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.

More temperature commands

CommandFunctionFirmware
M104Set hotend temperature (no wait)Marlin and Klipper
M109Set hotend temperature and waitMarlin and Klipper
M140Set bed temperature (no wait)Marlin and Klipper
M190Set bed temperature and waitMarlin and Klipper
M141Set chamber temperatureMarlin
M303PID autotuneMarlin
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 M301 do on a 3D printer?
M301 is set hotend PID values. Sets the PID values of the hotend by hand. M304 does the same for the bed. Normally you let M303 find them.
Does M301 work in Klipper and Marlin?
M301 is a Marlin command. Klipper uses its own commands and printer.cfg settings for this task.
Was this page helpful?