# Calibrate PID Settings

This section explains how to calibrate the Proportional, Integral, and Derivative (PID) for the Extruder and Heater Bed. I am using a target temperature of 200C for the Extruder and 60C for the Heater Bed as I only print with PLA filament and those are the temperatures I set to print with.

If you use a mixture of filaments like PLA/PETG etc., you may want to use the average temperatures between the two (If you print with PLA at 200/60 and PETG at 240/70 you could PID calibrate with an average of 220/65 etc.).

* PID Calibrate Extruder:
  * From the MainsailOS web interface;
  * Send a <mark style="color:red;">`PID_CALIBRATE HEATER=extruder TARGET=200`</mark> command in the <mark style="color:red;">`Console`</mark>;
  * Watch the <mark style="color:red;">`Temperature`</mark> chart and you will see that the <mark style="color:red;">`Extruder`</mark> is heated to 200C and cooled a series of times;

![PID Extruder](/files/1AvxV7tgUqUHBIDuJqBP)

* At the completion of the calibration, the PID parameters for your printer will be displayed in the <mark style="color:red;">`Console`</mark> area;
* Send a <mark style="color:red;">`SAVE_CONFIG`</mark> command in the <mark style="color:red;">`Console`</mark>;
  * This will update the <mark style="color:red;">`printer.cfg`</mark> file with the new PID settings and restart Klipper;

![SAVE\_CONFIG](/files/rOHrDhgCXeTQIsoCVIRX)

* PID Calibrate Heater Bed:
  * From the MainsailOS web interface;
  * Send a <mark style="color:red;">`PID_CALIBRATE HEATER=heater_bed TARGET=60`</mark> command in the <mark style="color:red;">`Console`</mark>;
  * Watch the <mark style="color:red;">`Temperature`</mark> chart and you will see that the <mark style="color:red;">`Heater Bed`</mark> is heated to 60C and cooled a series of times;

![PID Heater Bed](/files/kjWUmtAyPleqAzJJdHkx)

* At the completion of the calibration, the PID parameters for your printer will be displayed in the <mark style="color:red;">`Console`</mark> area;
* Send a <mark style="color:red;">`SAVE_CONFIG`</mark> command in the <mark style="color:red;">`Console`</mark>;
  * This will update the <mark style="color:red;">`printer.cfg`</mark> file with the new PID settings and restart Klipper;

![SAVE\_CONFIG](/files/AXqFKa73ZRQclxe7yh7I)

* Checking the <mark style="color:red;">`printer.cfg`</mark> file to ensure the new PID settings are updated:
  * From the MainsailOS web interface, click <mark style="color:red;">`Machine`</mark>, then click on <mark style="color:red;">`printer.cfg`</mark>;

{% hint style="info" %}
As you continue to fine tune your printer settings, every time you send a <mark style="color:red;">`SAVE_CONFIG`</mark> command in the <mark style="color:red;">`Console`</mark>, it will make a backup copy of your current <mark style="color:red;">`printer.cfg`</mark> file (adding a date/time).

You may have to click on page 2 in the <mark style="color:red;">`Machine`</mark> menu to find your <mark style="color:red;">`printer.cfg`</mark> file, as the backup take up space on page 1.
{% endhint %}

![Machine > printer.cfg](/files/HADqqW7oy4ABCX5yEdmL)

* The <mark style="color:red;">`printer.cfg`</mark> file should load into an editor window;

{% hint style="info" %}
You should not be making any changes at this point, we are just confirming that the PID tuning settings have been updated;
{% endhint %}

![printer.cfg](/files/Rf7qbRn8LgbRDlCskUWs)

* Scroll down in the <mark style="color:red;">`printer.cfg`</mark> file until you get to the sections <mark style="color:red;">`[extruder]`</mark> and <mark style="color:red;">`[heater_bed]`</mark>;
  * You will notice that the previous default PID settings have been commented out and will not be used;

![Old PID Settings](/files/UcZHsfhv3e4ErBTV8FMh)

* Continue scrolling down to the very bottom of the <mark style="color:red;">`printer.cfg`</mark> file until you reach the;
  * <mark style="color:red;">`#*# <---------------------- SAVE_CONFIG ---------------------->`</mark> section;
  * A new <mark style="color:red;">`[extruder]`</mark> and <mark style="color:red;">`[heater bed]`</mark> section should be present, along with their corresponding calibrated PID values;

{% hint style="info" %}
Any of the settings added to the <mark style="color:red;">`printer.cfg`</mark> file in the <mark style="color:red;">`SAVE_CONFIG`</mark> section will automatically load when Klipper is started.  You do not have to edit or touch the settings in this area.  If you ever re-do a PID calibration or any of the calibrations, the values will be updated in this section.
{% endhint %}

![Extruder and Heater Bed PID Tuning Values](/files/KkCZziNLRUaQGb4ZDaMl)

* Once you have confirmed these settings;
  * Close the <mark style="color:red;">`printer.cfg`</mark> file by clicking the <mark style="color:red;">`X`</mark> near the top right of editor;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sean-dearing.gitbook.io/klipper-installation-for-anycubic-vyper/initial-tuning/calibrate-pid-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
