PID tuning refers to a proportional-integral-derivative control algorithm used for hot ends of 3D printers ( and heated beds ). PID needs to have a P, I and D value defined to control the nozzle temperature. If the temperature ramps up quickly and slows as it approaches the target temperature, or if it swings by a few degrees either side of the target temperature, then the values are incorrect.
The PID values of your hot end are already set in Marlin for the recommended filament and extruded temperature of 210C and ambient temperature of 20-25C.
If you change the hot end model or your 3D printer environment is changed, like the ambient temperature, or if you change your thermistor or heating resistor or if you change filament type or if you are seeing large temperature fluctuations in your hot end, greater than five degrees in either direction, for better printing object you can calibrate PID value of your hot end.
To automatically tune your hot end PID parameters, start with your hot end at room temperature.
Before starting make sure all off your printer heaters are off or auto tune will fail!
To use this function, open Repetier host and select the "manual control" tab. There is a text box labeled "G-Code" in which you can send individual functions to your motherboard. To activate the PID auto tune, enter the following code into the text box and hit send: M303 S190 C5. Substitute 190 for your target temperature: e.g. For 200C your code would be: M303 S200. C5 is after reaching temperature 200C, do 5 cycles up and down the temperature.
You will get results from the log as below.
Kp: 32.20
Ki: 2.79
Kd: 92.90
Next, you need to tell Marlin to use the calculated Kp, Ki, Kd values. If you don't want to hassle with compiling/reloading Marlin, you can just use the M301 - Set PID parameters P I and D G-code. Using the values above, it looks like this:
M301 P32.20 I2.79 D92.90
You can add the line to start G-code in Slic3r. Setting the PID parameters in G-code allows you to change them on the fly for different profiles, for instance, if you like to switch back and forth between PLA and ABS. If you prefer to hardcode the values as defaults in the firmware, set them as follows in Configuration.h.
#define DEFAULT_Kp 32.20
#define DEFAULT_Ki 2.79
#define DEFAULT_Kd 92.90
then you must compiling and reloading Marlin as shown below: