# Category Archives: Control system applications

Last updated by at .

## PID applications on arduino to control the temperature of the heat exchanger plant.

Arduino library for PID controller algorithm has been made and can be applied with ease. By using the arduino PID library can be applied to various fields of control systems, here applied to regulate the temperature of the heat exchanger plant.

Plant made using nylon with 600 Watt electric heater. To know the LM35 temperature sensor plant used as it has been posted here. While signal conditioners circuit for temperature sensor has been posted here as well.

As an actuator, I use a method of switching pwm IGBT components. The pwm switching circuit I have described in posting here. As a controller, I’m using a microcontroller ATmega328 with Noano Arduino bootloader.

## PID library

To test the response of the PID used a simple program as follows:

#include

//Define Variables we'll be connecting to
double Setpoint, Input, Output;
int pwmOutput = 9;
int feedBackPin = A0;
int ComputeOk;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,1.25,4,0.5, DIRECT);

void setup()
{
//initialize the variables we're linked to
Setpoint = 500;

//turn the PID on
myPID.SetMode(AUTOMATIC);
Serial.begin(115200);
}

void loop()
{
myPID.Compute();

analogWrite(pwmOutput,Output);

double curErr = Setpoint-Input;
Serial.print(curErr);
Serial.print(" - ");
Serial.println(Output);
delay(50);

}