If you’ve worked with 3D printers before, you’ll be familiar with the heating components on your machine. If you have a heated bed, you probably have two heating components: one for the nozzle and one for the bed.
These components use algorithms to keep the temperatures stable by using three variables: the proportion of the actual temperature to the requested temperature; the integral, which is a measurement of the historical error of the heating process; and the derivative, which is a measurement of how quickly the temperature changes from above and below the requested temperature.
Together, these are typically called PID settings, and they can be used for a wide variety of applications. Essentially, PID is all about maintaining a proper balance. In this article, we’ll go through all the ins and outs of PID tuning, including how to do it on your printer!
So how does PID heating work on a 3D printer? In simple terms, the machine’s firmware accepts three values – P, I, and D – and an algorithm calculates how to maintain the proportion of heat, integrating the recorded error, using a derivative to modulate speed.
PID heating is more commonly used on 3D printers than the alternative heating method: “bang-bang” heating. “Bang bang” heating is typically used by ovens and heaters in the home, involving a basic process of activating the heating element when the temperature is below the requested value and turning it off when the temperature is reached. “Bang bang” heating is ineffective for 3D printers because, if the true temperature fluctuates too wildly above and below the target, print quality can worsen.
While PID values may seem insignificant, their impact should not be underestimated when it comes to 3D printing. If your nozzle or print bed has a lot of temperature variation, this can create lines on your prints (not the normal layer lines), significantly worsening a printed part’s appearance. That’s because varying temperatures can cause inconsistent extrusion, especially if the nozzle has a heating problem. (The bed can cause its own set of problems, too.)
PID tuning allows you to tweak the P, I, and D values on your printer to minimize any heating element temperature fluctuations. In this article, we’ll be going over how to auto-tune the PID settings for the hot end or heated bed. We’ll outline the process for Marlin 1, Marlin 2, and Smoothieware. Still, the processes are very similar for other firmware, too, with the only real differences depending on the G-code syntax. Usually, if the firmware is open source, you should see which G-code commands are used for PID tuning on the firmware developer’s website.
As we said, PID tuning works by adjusting the P, I, and D values on your printer’s firmware. These changes are kept in the printer’s onboard memory and are used for every print and action that involves heating.
When you get a new hot end or heated bed or switch to a significantly new printing temperature, you should perform a PID tune to get the best results with your new gear or settings. The easiest way to PID tune your printer’s heating elements is by sending G-code commands through a G-code terminal like Pronterface or OctoPrint‘s integrated terminal.
The P, I, and D values are auto-generated by your printer during PID tuning, which is performed by your printer heating up a specified element a certain amount of times. During this testing process, your printer takes automatic measurements and then, through the G-code terminal, returns the calculated values.
When you start a PID tune, first set which heating element you want to tune and then the target temperature at which you want to tune the heating element. This temperature should be the same temperature you plan to use for printing. Finally, set the number of repetitions that the printer should heat the specified element up and down, let the PID tuning commence, and then re-input your newly calculated P, I, and D values into your G-code terminal.
Now, let’s move on to the instructions for auto-tuning PID on machines running Marlin 1, Marlin 2, or Smoothieware firmware!
For this process, we’ll take you through tuning your printer’s PID settings if it is running on Marlin (or Marlin-based firmware like TH3D Unified) or Smoothieware firmware. We’ll go over how to tune your first hot end (“E0”) and your heated bed, and because the processes are slightly different for the two, we’ll split the procedure into two parts.
Before doing anything, if your printer is running Marlin, check to see which version of Marlin your printer’s firmware is based on (Marlin 1.X or 2.X). Also, make sure you have a G-code terminal. Pronterface is a compatible with many printers and is easy to use, and OctoPrint‘s terminal is another commonly-used option.
If you’re not running Marlin or Smoothieware firmware, the process will be very similar, if not the same, on other firmware programs. Check your firmware company’s website for their G-code syntax to find the right commands for PID tuning, and if you can’t find that, use the following process as a starting point.
Follow the steps below to PID tune your printer’s hot end if your machine is running Marlin firmware:
M303 E0 S230 C7
” will PID tune the first heater to 230 °C using 7 cycles.M301 P70 I3 D65
” will input new hot end PID values of P = 70, I = 3, D = 65.PID tuning your bed is very important, and it can prevent unnecessary extra layer lines on your 3D prints (like the ones seen on the left side of the image above). Follow the steps below to PID tune your printer’s heated bed if your machine is running Marlin firmware:
M303EBED S100 C6
” will PID tune the printer’s heated bed (on Marlin 2.X) to 100 °C using 6 cycles.M304 P70 I3 D65
” will input new bed PID values of P = 70, I = 3, D = 65.Below is a guide to PID tuning the hot end or bed on a 3D printer running Smoothieware firmware:
M303 E1 S60
” will PID tune the printer’s heated bed using 3-8 cycles to 60 °C. The exact number is not specified by Smoothieware.And that’s all it takes to PID tune your printer!
License: The text of "3D Printer PID Tuning: Simply Explained" by All3DP is licensed under a Creative Commons Attribution 4.0 International License.