Auto Tune Library

Hi,

I am using Arduino auto tune library for my project. I have to control the temperature of a metal surface. The input is the reading from temperature sensor and out put is the PWM to control the current of the heater.
The problem is I get different tuned parameters for same environmental condition. Is this possible? I can not understand why?

I am new bee to this field and I know nothing about, how is the auto tuner working. Please help me.

Thanks in advance,
Duresh

How to use this forum

Read this before posting a programming question

Your code? A link to the device datasheet?

I'm guessing you're using Brett Beauregard's PID library? If so, you may want to try posting in the DIY PID google group. I've seen many questions about autotune.

https://groups.google.com/forum/?fromgroups#!forum/diy-pid-control

Have you tried tuning it manually? There's some ways to make it easier like using lower windowsize and outputlimits etc. I'm a noob as well but working on it. Hope you find what you're looking for. :slight_smile:

Moderator edit: link fixed.

Thank you all, very much for reply.

Here is the code,

            void loop(){
                  tempValue = getTemp(&tempSensor);
                  if (is_tuning){                                                             // Check whether tunner is turned on
                      LCD.setCursor(0, 0);                                                     // Set the cursor to the 16 - position to print 
                      LCD.print("TUNING");                                                        // TUNE
                      val = 0;
                      val = (aTune.Runtime());                                                // Run the Auto tunner and check whether it is finished the tuning
                      if(val != 0){                                                             // If tuning is done
                        is_tuning = 0;                                                          // Turn off the tunner
                        kp = aTune.GetKp();                                               // Get the constants from the auto tunner module
                        ki = aTune.GetKi();
                        kd = aTune.GetKd();
                        PID.SetTunings(kp,ki,kd);                         // Set the tunned constants to the PID
                        PID.SetMode(AUTOMATIC);
                     }
                  }else{
                     PID.Compute();
                  }
         }

I set the "is_tuning" variable through an interrupt subroutine. In there, I set the PID.SetMode(MANUAL).

I am using the PID library from Arduino and the lick to the auto tuner that I am using is Arduino-PID-AutoTune-Library/PID_AutoTune_v0 at master · br3ttb/Arduino-PID-AutoTune-Library · GitHub

Thanks in advance
Duresh

Hi,

Could any one please tell me whether the Arduino Auto Tuner function affects by the point where we start the tuning.

I am really fed up from getting different constants for tuning in same environmental condition. The only thing I changed is the starting temperature to enter the Auto tuning function. :frowning:

Please help me.

Thank you.
Duresh.

Hi,

After several hours, doing experiments with PID auto tuning function I found that the Auto tuning function is depend on where it is started to tune, but not depend on the actual system start time. So what I did is, I hard coded to check for a level whether it passes and begin auto tune. What it does is, although I tell to start the tuning, it does not enter to the tuning function until reaches the hard coded value. And also begin the auto tuning as much as possible to the set point value. I leave this information for any body who want this information, and please reply if you found any difference.

http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/