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.
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.
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.
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).
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.
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.