Tune a PID for heavens sake.
Bits
Posts: 414
So I read this and it mentions
My question is at what "set point" do I begin to make it oscillate.
Iwant to control temperature and can span a wide range of temperatures so what temp do I use to get KU?
The "P" (proportional) gain, Kp is then increased (from zero) until it reaches the ultimate gain Ku, at which the output of the control loop oscillates with a constant amplitude. Ku and the oscillation period Tu are used to set the P, I, and D gains depending on the type of controller used:
My question is at what "set point" do I begin to make it oscillate.
Iwant to control temperature and can span a wide range of temperatures so what temp do I use to get KU?
Comments
http://www.omega.com/temperature/z/pdf/z115-117.pdf
http://en.wikipedia.org/wiki/PID_controller
Executive summary: Start with all three coefficients at zero, run P up until it oscillates, drop P to about half that value, run I up to improve response time, if it gets unstable run D up to compensate but beware too much D causes overshoot. That's basically how it was done between discovery of the math and all these cheap newfangled computers capable of doing simulations and optimization.
Temp controls are interesting in that they generally can't cool, or actively go down like they can heat, or actively go up, meaning that the response parameters may need to be different if your new set point is below the current measurement or above it. PIDs in general are a kind of fiddly black magic.
http://www.lakeshore.com/Documents/LSTC_appendixF_l.pdf
http://www.gnu.org/software/octave/
http://en.wikipedia.org/wiki/PID_controller
Read and learn.....very useful.
Implementing a PID loop is a lot easier than understanding all the highfalutin math that explains why they work so well; with the right constants they can track a moving target closely and recover quickly without overshoot when there is a sudden change. What Bits is asking is where do you start figuring out what those three multipliers are for the P, I, and D terms. It can be done theoretically if you know stuff like how fast your heater adds energy, how fast heat is lost through insulation, and if there are any delays or other factors. But for many years this "PID tuning" has also been done by seat of the pants estimation, which works even if you don't have a computer and don't understand Calculus.
'
It will come to you.
'
Be patient.
Cranking Kp till the system oscillates is a good starting point, but you can likely further double Kp if you add enough Kd. (with mechanical positioning systems often Kp can be quadrupled or more this way) What's the cost of high Kp and Kd? System noise and idle power consumption. I.e. the derivative term acts as a high-pass filter so it has it's largest effect at high frequencies where the signal to noise ratio is often low. Note: to use a large Kp you NEED a similarly large Kd term otherwise the system will have a high frequency resonance where it's easy to disturb the system. (in the case of a thermal system, the physics provides a lot of Kd on it's own, so this term can often be dropped) What's the gain with high values of Kp? Rejection of external disturbance at middle frequencies and the ability to use larger values of Ki for enhanced DC and low frequency disturbance rejection. Indirectly, a large Kp also accelerates command response. (with just Kp and the system model it's also pretty easy to calculate how much an external heat source will effect the temperature of the system, aka disturbance rejection) Also, Ki gain does NOT like infeasible commands. If you give the thermal system a step temperature command, Ki WILL cause overshoot. If you instead use a smooth ramp command, Ki won't cause overshoot but will reduce tracking error during and after the ramp. After all this, you're pretty free to choose Kp, Ki, and Kd. It's common for useful stable values of these gains to cover several orders of magnitude and because of this, changes to gains smaller than 2x are rarely worth the trouble.
If command response is your goal it's better to use a system model to construct a FeedForward controller. (aka an open-loop controller run in parallel with the PID loop) Something as simple as multiplying the rate of command temperature change by the heat capacity of the thermal system can really speed up command response. A FeedForward controller does requires feasible commands, aka commands that stay within the physically limited capabilities of your system. I.e. no temperature steps, as these require many Joules of energy to be added instantly, something not physically practical.
Lawson
P.S. The accumulation and difference terms used by computers to approximate integration and differentiation are approximations. When operating near the sample frequency of the the servo loop, the error in these approximations becomes significant, and will show up in the dynamics of the system.