3D printer G-code · Marlin
M303: PID autotune (Marlin)
PID autotune — Heats and cools the heater around the target a few times and calculates new PID values. Needed after a new heater cartridge, thermistor, hotend or silicone sock, and…
On this page
| Property | Value |
|---|---|
| Command | M303 |
| Function | PID autotune |
| Firmware | Marlin |
| Group | Temperature |
| Syntax | M303 E<heater> S<°C> C<cycles> [U1] |
What does M303 do?
Heats and cools the heater around the target a few times and calculates new PID values. Needed after a new heater cartridge, thermistor, hotend or silicone sock, and when the temperature swings.
Parameters
| Parameter | Meaning |
|---|---|
E | Heater: 0 = first hotend, -1 = bed |
S | Target temperature |
C | Number of cycles, 8 is a good value |
U1 | Use the result at once |
Example
M106 S255 ; part fan as when printing
M303 E0 S215 C8 U1 ; tune hotend
M500 ; saveTips from practice
- Tune with the part fan at the speed you print with.
- In Klipper the same is PID_CALIBRATE.
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 |
M301 | Set hotend PID values | Marlin |
M304 | Set bed 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 simulator