--- tag: m0303 title: "M303: PID autotune" short_title: PID autotune brief: Auto-tune the PID system to find stable values. author: thinkyhead parent: G-code Commands group: thermal requires: PIDTEMP|PIDTEMPBED codes: [ M303 ] notes: - View current PID values with [`M503`](/docs/gcode/M503.html). - If `EEPROM_SETTINGS` is enabled, all 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: Hotend index (-1 for heated bed). Default 0. values: - tag: index type: int - tag: C optional: true description: Cycles. At least 3 cycles are required. Default 5. values: - tag: count type: int - tag: S optional: true description: Target temperature values: - tag: temp type: float - tag: U optional: true description: Use PID result. (Otherwise just print it out.) values: - type: bool - tag: D optional: true requires: PID_DEBUG description: Toggle PID debug output on / off (and take no further action). values: - type: flag examples: - pre: 'Auto-tune hotend at 210 °C for 8 cycles:' code: M303 E0 C8 S210 - pre: 'Auto-tune bed at 60 °C for 8 cycles:' code: M303 E-1 C8 S60 - pre: 'Auto-tune hotend at 210 °C for 6 cycles and use the parameters:' code: M303 E0 C6 S210 U1 --- This command initiates a process of heating and cooling to determine the proper PID values for the specified hotend or the heated bed. See [PID Temperature Control](/docs/features/pid_tuning.html) for test conditions and how to judge the result.