3D Printer CalibrationGuides

Hotend and Heatbed PID Tuning

Going from a finished print to a great print takes a lot of calibration steps. Besides having the heatbed leveled correctly, and the extruder perfectly calibrated to melt just enough filament, the temperature of the hotend and the heatbed is just as important.

Today I am going to show you how to perform a PID Tuning to have constant and accurate temperatures during your prints.

What is PID Tuning?

Before starting with the guide on how to do a PID tuning, we fist need to understand the concept. In just a few words, PID is an algorithm that makes sure the heaters for both hotend and heatbed supply just enough heat in order to have the difference between the highest and lowest temperature as small as possible.

If you are interested in learning more about what is PID, you can check this Wikipedia article where a PID controller is described

Prerequisites for 3D Printer PID Calibration

In order to perform a successful 3D printer PID tuning, you need to have the 3D printer connected to your computer via USB.

Next, you need to access the terminal for your printer firmware. Today I will use Pronterface but anything will do, as long as you are able to send G-Code commands to the printer.

Hotend PID Tuning

Kingrooon-KP3S-Hotend-with-Direct-Drive-Extruder-2

Now that we have the 3D Printer connected to the computer, we can start the Hotend PID Calibration.

  1. Get the current PID settings using the M503 command. Your printer will return the current PID settings.
  2. Run the M106 S255 command in order to set your cooling fan to 100%
  3. Run the M303 E0 S215 C8 command and wait for the process to finish.

The message “PID Autotune start” will appear in the terminal. Your hotend will start to gradually heat and get new readings.

Hotend PID Tuning Pronterface

While the hotend PID Calibration is underway, let’s understand the command we ran.

M303 – This command initiates a process of heating and cooling to determine the proper PID values for the specified hotend or the heated bed.
E0 – This argument selects the extruder we want to calibrate. I have only one extruder, so I will set it to 0.
S215 – This argument sets the temperature for the extruder PID Calibration to 215C.
C8 – This argument sets the number of cycles we want to run. I selected 8 because it’s the recommended value in Marlin firmware, but any value from 3 to 10 is great.

When the message “PID Autotune Finished” is displayed in the terminal window, the hotend PID Tuning is complete.

PID Autotune Finished

You will also see new Kp, Ki and Kd constants that need to be saved so let’s do that now. The previous values were so we need to adapt the command with the new values and save them.

  1. Run the M301 P24.36 I1.39 D106.76 command to add the new values
  2. Run M500 to save the values.
  3. Run M503 to check your current values. These should be the same as the values we just saved.
Save new Hotend PID settings

Heatbed PID Tuning

CR-5-Pro-Heatbed-2

If you managed to perform the hotend calibration, then the heatbed PID Calibration will be much easier.

  1. Get the current PID settings using the M503 command. Your printer will return the current PID settings for the heatbed.
  2. Run the M303 E-1 S60 C8 command and wait for the process to finish.

The message “PID Autotune start” will appear in the terminal. Your heatbed will start to gradually heat and get new readings. While the heatbed PID calibration is underway, let’s understand the command we ran.

M303 – This command initiates a process of heating and cooling to determine the proper PID values for the specified hotend or the heated bed.
E-1 – This argument selects the heatbed we want to calibrate. I have only one heatbed, so I will set it to 1.
S60 – This argument sets the temperature for the heatbed PID Calibration to 60C.
C8 – This argument sets the number of cycles we want to run. I selected 8 because it’s the recommended value in Marlin firmware, but any value from 3 to 10 is great.

When the message “PID Autotune Finished” is displayed in the terminal window, the hotend PID Tuning is complete.

Heatbed PID Autotune Finished

You will also see new Kp, Ki and Kd constants that need to be saved so let’s do that now. The previous values were so we need to adapt the command with the new values and save them.

  1. Run the M304 P824.78 I154.89 D1097.99 command to add the new values
  2. Run M500 to save the values.
  3. Run M503 to check your current values. These should be the same as the values we just saved.

More information about PID Tuning can be found on the RepRap wiki

Liked it?
Take a second to support 3DPrintBeginner on Patreon!

Subscribe
Notify of
guest
6 Comments
Inline Feedbacks
View all comments
Iain Williams
Iain Williams
7 months ago

Hi. Done a successful hotend autotune and saved into fimrware on my E3Pro. Trying to do a heatbed tune but can’t seem to make it work. When I enter: M303 E-1 S60 C8 (copied from Pronterface), I get the following message “PID Autotune failed! Bad extruder number”.
I thought I might have got the E-1 spacing incorrect so I tried a space either side of the – like this “M303 E – 1 S60 C8”, and Pronterface responded with:
>>> M303 E – 1 S60 C8
SENDING:M303 E – 1 S60 C8
PID Autotune start

However, it appears the extruder hotend if heating again and not the bed.
Can anyone help????

3dprintbeginner
3dprintbeginner
7 months ago
Reply to  Iain Williams

The bed is probably not defined in firmware to use PID instead of Bang-Bang

cmdcirdec
cmdcirdec
9 months ago

Hello
You can add a U1 at the end of the line M303 E0 S215 C8.
This sets the value of the PID, it only remains afterwards to make an M500 to save and this avoids having to make input errors during the M301 line.
So your order will be
M503
M303 E0 S215 C8 U1
M500
M503

Same thing for the bed

3dprintbeginner
3dprintbeginner
9 months ago
Reply to  cmdcirdec

Well, that’s a thing I didn’t know. Thanks for the comment!

Michael
Michael
1 year ago

Hey! On a machine where you cannot save to EEPROM (such as the Artillery Sidewinder X1 with stock firmware), is it alright to enter the commands into your G-Code directly, like this:

Cura 4.6.2: Manage Printers > Machine Settings > Start G-Code and enter it somewhere near the beginning:
M92 E440.1098901098901 ;Fix e steps (from a previous how to)
M301 P13.15 I0.97 D44.72 ; PID tune Hotend
M304 P82.83 I8.43 D203.56 ; PID tune Heatbed

Eventually want to upgrade the firmware but want to get to know the stock printer first 🙂

Ronski
Ronski
3 days ago
Reply to  Michael

For the benefit of others, yes perfectly fine to enter it in the Gcode as Michael asks, I have to do this as I haven’t changed the firmware yet either.