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

Library for Arduino PID can be downloaded here. After you download folder PID_v1 put in the folder “libraries” where the Arduino installed. 

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
  Input = analogRead(feedBackPin);
  Setpoint = 500;

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

void loop()
{
  Input = analogRead(feedBackPin);
  myPID.Compute();

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

 }

Posted in Arduino, Control system applications | Tagged | Leave a comment