---
tag: m0301
title: Set Hotend PID
brief: Set PID values for a hotend.
author: thinkyhead

group: thermal
requires: PIDTEMP
eeprom: true

codes: [ M301 ]

notes:
- Requires `PIDTEMP`.
- View current PID values with [`M503`](/docs/gcode/M503.html).
- If `EEPROM_SETTINGS` is enabled, all hotend PID values are saved with [`M500`](/docs/gcode/M500.html), loaded with [`M501`](/docs/gcode/M501.html), and reset with [`M502`](/docs/gcode/M502.html).

parameters:

- tag: E
  optional: true
  description: Extruder index to set. Default 0.
  values:
  - tag: index
    type: int

- tag: P
  optional: true
  description: Proportional value
  values:
  - tag: value
    type: float

- tag: I
  optional: true
  description: Integral value
  values:
  - tag: value
    type: float

- tag: D
  optional: true
  description: Derivative value
  values:
  - tag: value
    type: float

- tag: C
  optional: true
  description: C term (requires `PID_EXTRUSION_SCALING`)
  values:
  - tag: value
    type: float

- tag: L
  optional: true
  description: Extrusion scaling queue length (requires `PID_EXTRUSION_SCALING`)
  values:
  - tag: value
    type: float

- tag: F
  optional: true
  description: F term (requires `PID_FAN_SCALING`)
  values:
  - tag: value
    type: float

example:
- pre: 'Set PID parameters to KP:21.01 KI:1.73 KD:63.67'
  code: M301 P21.01 I1.73 D63.67

---

Set the values that control the PID loop for a hotend.
