user29796: Right now, I'm working with Peltier module using PID algorithm. I search out on the Internet about this and so I found that there are three parameters Kp, Ki and Kd. And everyone uses the different value for that. So, they actually calibrate that value but I don't understand how?
I just use default value like Kp = 2, Ki = 5 and Kd = 1.
And here I take Input as Temperature. My normal temperature is around 25. And now I set my setpoint 20. So, according to the PID algorithm temperature must be reduced to around 20. But still, no change in temperature and my PWM is still 0.
Below is my code:
#include <PID_v1.h>
#include "Adafruit_MAX31855.h"

int thermoDO = 3;
int thermoCS = 4;
int thermoCLK = 5;
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

#define PIN_OUTPUT 6

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double Kp = 2, Ki = 5, Kd = 1;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

int IN1 = 8;
int IN2 = 9;

void setup()
{
  Serial.begin(9600);

  //initialize the variables we're linked to
  Input = thermocouple.readCelsius();
  Setpoint = 20;

  //turn the PID on
  myPID.SetMode(AUTOMATIC);

  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
}

void loop()
{
  Input = thermocouple.readCelsius();
  myPID.Compute();
  analogWrite(PIN_OUTPUT, Output);

  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);

  Serial.print("Setpoint: ");
  Serial.print(Setpoint);   
  Serial.print("\t");
  Serial.print("Input: ");
  Serial.print(Input);   
  Serial.print("\t");
  Serial.print("Output: ");
  Serial.print(Output);   
  Serial.print("\t");
  Serial.print("Kp: ");
  Serial.print(myPID.GetKp());   
  Serial.print("\t");
  Serial.print("Ki: ");
  Serial.print(myPID.GetKi());   
  Serial.print("\t");
  Serial.print("Kd: ");
  Serial.print(myPID.GetKd());   
  Serial.print("\n");
}

And my output is like:
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00

Now here I use MAX31855 module for measuring the temperature which takes as Input here.
MAX31855 Module:

I think that may be my Kp, Ki and Kd are not perfect for my system. So, maybe this cause problem means not the proper value of Kp, Ki, and Kd. Can anyone give some suggestion how to set this value of Kp, Ki, and Kd? Or there is something else which caused the problem for that. Suggest me.
And here I'm using DC motor driver(20A) for driving the Peltier Module. 

user10794: PID algorithms basically change the output to approach the setpoint. Now in your case you have a setpoint of 20 and an input of 24.5. Thus the algorithm thinks it needs to turn the output off so it can "cool down". This would work for a heater.
However since your output is a cooler you need to specify "REVERSE" rather than "DIRECT". This tells the PID module that the output needs to be higher if the input is higher than the setpoint.

29796: <p>Right now, I'm working with Peltier module using PID algorithm. I search out on the Internet about this and so I found that there are three parameters Kp, Ki and Kd. And everyone uses the different value for that. So, they actually calibrate that value but I don't understand how?</p>

<p>I just use default value like Kp = 2, Ki = 5 and Kd = 1.</p>

<p>And here I take Input as Temperature. My normal temperature is around 25. And now I set my setpoint 20. So, according to the PID algorithm temperature must be reduced to around 20. But still, no change in temperature and my PWM is still 0.</p>

<p>Below is my code:</p>

<pre><code>#include &lt;PID_v1.h&gt;
#include "Adafruit_MAX31855.h"

int thermoDO = 3;
int thermoCS = 4;
int thermoCLK = 5;
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

#define PIN_OUTPUT 6

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double Kp = 2, Ki = 5, Kd = 1;
PID myPID(&amp;Input, &amp;Output, &amp;Setpoint, Kp, Ki, Kd, DIRECT);

int IN1 = 8;
int IN2 = 9;

void setup()
{
  Serial.begin(9600);

  //initialize the variables we're linked to
  Input = thermocouple.readCelsius();
  Setpoint = 20;

  //turn the PID on
  myPID.SetMode(AUTOMATIC);

  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
}

void loop()
{
  Input = thermocouple.readCelsius();
  myPID.Compute();
  analogWrite(PIN_OUTPUT, Output);

  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);

  Serial.print("Setpoint: ");
  Serial.print(Setpoint);   
  Serial.print("\t");
  Serial.print("Input: ");
  Serial.print(Input);   
  Serial.print("\t");
  Serial.print("Output: ");
  Serial.print(Output);   
  Serial.print("\t");
  Serial.print("Kp: ");
  Serial.print(myPID.GetKp());   
  Serial.print("\t");
  Serial.print("Ki: ");
  Serial.print(myPID.GetKi());   
  Serial.print("\t");
  Serial.print("Kd: ");
  Serial.print(myPID.GetKd());   
  Serial.print("\n");
}
</code></pre>

<p>And my output is like:</p>

<pre><code>Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 24.75    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.00    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.50    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
Setpoint: 20.00 Input: 25.25    Output: 0.00    Kp: 2.00    Ki: 5.00    Kd: 1.00
</code></pre>

<p>Now here I use MAX31855 module for measuring the temperature which takes as Input here.</p>

<p><strong>MAX31855 Module:</strong></p>

<p><a href="https://i.stack.imgur.com/vpN1T.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vpN1T.jpg" alt="MAX31855"></a></p>

<p>I think that may be my Kp, Ki and Kd are not perfect for my system. So, maybe this cause problem means not the proper value of Kp, Ki, and Kd. Can anyone give some suggestion how to set this value of Kp, Ki, and Kd? Or there is something else which caused the problem for that. Suggest me.</p>

<p>And here I'm using DC motor driver(20A) for driving the Peltier Module. </p>
 10794: <p>PID algorithms basically change the output to approach the setpoint. Now in your case you have a setpoint of 20 and an input of 24.5. Thus the algorithm thinks it needs to turn the output off so it can "cool down". This would work for a heater.</p>

<p>However since your output is a cooler you need to specify "REVERSE" rather than "DIRECT". This tells the PID module that the output needs to be higher if the input is higher than the setpoint.</p>
