PID Controllers - Everything You Wanted to Know, But Were Afraid to Ask

Given what I just posted, lets play with the value of Kp a little:

Keeping everything the same, but setting Kp = 0.5 – we would expect that the rise to temperature is faster, and that the offset is smaller: (and that is exactly what you see happen).
upload_2020-3-12_12-40-52.png

Unfortunately, you can continue to make Kp larger and reduce the offset, but only to a point. In this case, when Kp = 1.0, things look good:
upload_2020-3-12_12-41-30.png

(by the way, if you look at the bars on the bottom of the screenshots above, you can see how the proportional band becomes smaller and smaller by way of how fast the height of the bars (controller ouput) drops off faster as Kp gets bigger.)

BUT, at Kp=10, the oven temperature is rising so fast, and the heating element shuts off so close to the setpoint that it can not shed its residual heat fast enough – and you get an overshoot of temperature (and you start getting an oscillation above and below the set point):
upload_2020-3-12_12-42-4.png

This is NOT a good place to be. I have an understandable example, I think, to justify the following statement – but for now I will just state it: You ALWAYS want to be operating in the proportional band, because it is within that band that the controller has the ability to “correct” the current situation (it can increase or decrease power to the heating elements somewhat). Outside of the proportional band (i.e. above the setpoint), it has no such power (the elements are already off, and unless you have cooling built into the oven controlled by another PID, you have no control over the situation.

Oscillations like the above are “unstable” and not controllable – AND when you add additional controls like the integral term (which is really sensitive), things can get really unstable really fast.

So – to close out this part, I will make the following recommendation:

Try first “tuning” your PID by turning off both integral and differential terms. Then set the proportional band (see below re. actual controllers) to a very very wide value. Fire the thing up, and see where you land in terms of temperature rise time and offset. Then continue making the proportional band smaller and smaller until you JUST see an overshot like the one above. THEN back off to the last value of Kp that did not give you an overshot, and take note of the offset. Then increase the setpoint higher by the the value of the offset – and you should then have an oven that settles in pretty cleanly at the temperature you want it to be at.

(if you can not get it to do this, then you have some really bad mis-match in the system – like a really, really strong heating element and a huge amount of insulation (this situation looks like this:
upload_2020-3-12_12-42-44.png

Or really bad insulation, and the heating element just can not put enough heat into the oven to overcome the loss, which looks like this:

upload_2020-3-12_12-43-6.png

Unfortunately, different controllers implement slightly the algorithm in slightly different ways. The Inkbird ITC-106 calls for you to specify a proportional band in the range of 0-9999. It does not give units, so Sitting here, I have no idea if that is degrees, or is actually meant to be the value of Kp (which does not have units and can effectively take on any value). If it is degrees (as in it is implicitly using the equation Proportional band (in degrees) = 100/Kp, then setting this to a larger value should increase the proportional band. However, if it is actually meant to be the value of Kp itself, then (as in the above discussion) setting it to a larger value will decrease the proportional band. Like I said, the Inkbird manual is pretty bad. Hopefully someone out there can clarify the behavior they see with their Inkbird?


On the other hand, the Auber SYL-2362A2 has a nice understandable manual (but you need to do a little math). For the proportional band, it has you input the actual band (temperature range) you want, but as a percentage of the control range (which is defined by the thermocouple type). The example they give is that for a K-type thermocouple, which controls up to 1500C, if you set this value to 5 (i.e. 5%), then the proportional band is 1500 * 5 = 75 degrees C.


ON the other hand – once you understand how your controller uses this input parameter, all you need to do is somewhat arbitrarily adjust the parameter up (or down) to alter the proportional band until you get the response you want……
 
Ok folks ... at this point i could use some feedback on whether this is still worth continuing? I still have not talked about integral control. Can do if people want ... but not worth it if the above is confusing (or seems not pertinent...)
 
Ok folks ... at this point i could use some feedback on whether this is still worth continuing? I still have not talked about integral control. Can do if people want ... but not worth it if the above is confusing (or seems not pertinent...)
It's been a long time since I learned PID tuning (Large process controls like you've mentioned), but I can say without a doubt that you are doing a much better job of explaining the concepts in a way that people should be able to understand than the engineer that taught me;) :thumbsup:
 
Keep going - I'm going to put a question about my PID controller, not to hi-jack thread, but for you to use as an example for teaching (sneaky huh?)

I've got a couple of the Auber SYL-2362 that work pretty good, but would like to do a manual program with them. One is on a toaster oven with 350F to 400F as controlling temp, other is on a lead pot for casting bullets that controls around 725F, but doesn't do as good as I'd like. Perhaps I should set the "P" to "X"?

1500 * X = 385 degrees C (edited to correct F to C)
X = 385/1500
X = .267* 100 = 26.7 for P? With "I" and "D" set to zero? What about the Damp Constant, Cycle Rate, and Digital Filter Strength? Should they be set to zero?

Thanks for taking the time to write this
 
Last edited:
Ken... making dinner now. Will take a look at the manual tomorrow and see what i can interpret from that...
 
Perhaps I should set the "P" to "X"?
1500 * X = 725 degrees C
X = 725/1500
X = .48 * 100 = 48 for P? With "I" and "D" set to zero? What about the Damp Constant, Cycle Rate, and Digital Filter Strength? Should they be set to zero?
Hey Ken. Seems like you are doing the math right to set the value of P for the Auber .... but a proportional band of 725 seems awfully wide for this application (this is just a gut feel - but proportional bands are usually much smaller than that in general - and my guess is that a lead melting pot is not so well insulated? IF so, my guess is that with this proportional band, you will get a really slow rise to temp, and the equilibrium temp will give a really big offset from your setpoint.

There is absolutely no harm it at least trying it though! Give it a go, then if the offset is in fact really large, try a value of P of maybe 30, and see how much the offset changes - then use that to inform your next guess at P. If you do it, post the results???

On your other questions, - on the cycle rate, if your system is using a SSR to drive a heating element - then the smaller the value of the cycle rate the better (larger ones are really needed for mechanical relays to avoid burning them out, but the SSR wont have any trouble with rapid (<< 1 second) on/off cycles.

I have not talked yet about the outputs of PID (true proportional and pulse width modulation, as JT mentioned) and how the relate to the Cycle Rate versus what you are doing with them (driving a SSR, a mechanical relay, a solenoid activated valve, etc) - maybe I should do that before I talk about bringing integral control into the picture?

Re. the Damp Constant - it seems a rather arbitrary parameter that they are using to "soften" the response of the system. currently my feeling is that if you correctly set the P (and perhaps the I) constant so you know how the system is behaving, I would not use the damp constant (I would set it as low as you can - looks like 0.1)

The digital filter I would just disable (set to 0). Seems like they are using this to "stabilize" the display readout - but at the cost of decreasing the ability of the system to respond more quickly (seems to me like this is almost equivalent to setting the Cycle Rate to a larger value - and I already said above that for driving a heating element the smaller the cycle rate the better.

Hopefully that helps and makes sense?
 
OOops, I forgot to convert the 725F to C before the calculation (edited to correct OP). Now it would read
1500 * X = 385; X = 385/1500 = .266; so, P = 26.6

Hey Ken. Seems like you are doing the math right to set the value of P for the Auber .... but a proportional band of 725 seems awfully wide for this application
Cushing, is the above a typo? You say "proportional band of 725", but I was trying to say a P of 48, the temperature desired is 725F, and I should have kept that in C (All units MUST be the same).

I follow what you're saying and am setting values to P - 26, I = 2 (2 is minimum available), D = 0;
Damp Constant (SouF) = 0.1;
Cycle Rate (ot) = 2 (2 is minimum available)
Digital Filter (FiLe) = 0

I'll be back in a hour or so after checking how the pot does.

Thanks for your help
Ken H>
 
Last edited:
Ken - that was not a typo. The auber, as iunderstand it, has you input the proportional band as a percentage of the total control range. So, with your unit corrected values, your proportional band will be 0.266 * 1500 = 399 degrees (though i think you dropped a digit in your result - 385/1500= 0.256, not 0.266
 
OK, but if I want the post to controlled at 725F (385C), then wouldn't the calculation be 385/1500 = .256; or the number to use for P would be 25.6?

I used 26 as P, I = 2; D = 0 and it overshot big time. Heated to 785F, then dropped to 705 before starting up. I changed to P = 16, and range closed up some, then P- 6, closed up a tad more, then finally P = .6 and it's "pretty close". But, it seems Auto Tune actually works better. I'll be following to learn more, and will try manual tuning again.
 
It kind of sounds like you are confusing the proportional band (set by P) with the setpoint (In the manual, set by "SV" on the main display). The value of SV defines the target temperature, whereas the value of P defines the width of the temperature range below that set value where proportional behavior is in play. What value for SV did you use in these tests?

Another question - I am kind of wondering if the overshoot behavior you saw with P = 26 is due to the action of the residual integral term.

OH My God. sorry (because I have not discussed integral terms yet .... with the way this controller defines the integral term - to minimize its effect you need to set the value of I to the largest value. Set I = 1999 and D = 399. What you just witnessed is something that I am planning to warn people about re. the integral term - drastic overshoot and big oscillations around the setpoint.

The reason your value of p=.6 worked better is because your proportional band was so small that the thing blasted up to temperature so fast that the integral term did not add up to much ... whereas when the value p = 25.6 the thing took a lot of time to come up to temp, right??? During that time the integral term accumulated a large value, and caused the thing to continue blasting heat way past your setpoint. (I will clarify that soon.....)
 
That makes sense, when setting "I" and "D" to "zero", you actually use the numbers of 1999 and 399 - is that what I'm hearing? NOT the "zero" (actually "2" for I). As I mentioned before the target temp of the post is 725F (385C), so the SV (value set in bottom window of the Auber controller) is 725. It was my understanding that "P" was calculated by 385/1500 to get the percentage of TC range.

I won't be able to do anything tonight, and not sure about tomorrow. The wife is INSISTING we take a drive in car, she's going stir crazy sitting here in house after her foot surgery and can't drive for another 2 oe 3 weeks. Just last week got so she could get around without wheelchair. I might get back in time to try.

Thanks again for all the help.

Ken H>
 
Unfortunately the problem arises from a mathematical something i kind of mentioned, but skipped over, which i mentioned, w hich really rears its head with the integral term. There is another way the equations are used called the “standard form”, where the coefficients used are posed in a way that inverts them (larger values imply LESS influence ofthe terms). Sorry about that. :-(.

gotta take care of the wife! Tomorrow is another day...
 
I hope to try PID again later today, should I start from scratch with P set to 385/1500 = .25.6 * 100 = 25.6 for P? Of course "I" would be set to 1999 to act as "zero" and D to 399.
 
I hope to try PID again later today, should I start from scratch with P set to 385/1500 = .25.6 * 100 = 25.6 for P? Of course "I" would be set to 1999 to act as "zero" and D to 399.
Yes, set the I and D to the larger values. If you have the timebto goback to P=25.6 it might be instructive to demonstrate that you should get a slow rise and big offset...

(Hey, you are the one who offered this as a teaching opportunity! :-)
 
OK, it's heating now - I set P = 25.6 and other values at max. Remember, set point desired is 730F (385C) and pot heated right on up to 790 and didn't seem to be slowing at all. The heat ON - OFF cycles were about the same at 1 sec each. I went drastic and changed P to 5 and we'll see what happens. Pot is cooling now. It'll take a while for pot to cool, then heat back up again. Need to go thru a couple (or 3) cycles to give time to settle down.
 
that is weird - really weird. This is the Auber syl-2362, right? right from the manual (ignoring the specific math) "the smaller the P value is, the stronger action will be for the same temperature difference between SV (setpoint) and PV (current temperature)" so ... if when you set the P value to a small value, and the thing starts to look like it is behaving better - then something else must be going on.

You are not running autotune somehow by mistake are you?

What value of "outy" do you have set? it should be set to 2 .......
 
also - is the SSR connected to the correct pins on the back of the PID (pins 6 and 7 i believe......) ?
 
First to answer all the questions above, Yes, I'm sure the SSR is connected properly, it was actually working pretty good after running auto tune last year. Been using it for a while. I was trying manual setting of parameters more to learn rather than an attempt to make it better. Yes, it's got a type K TC and the parameter is set correctly. With the TC in ice water it reads right at 32F, and in boiling water around 212F as it should. Yes, outy is set to "2" for SSR PID control output. Yes, it is a SYL-2362 made by Auber.

Do I understand that perhaps from the original calculated value for P of 25.6, since the overshoot was so bad, I should have used a larger number? Say 30? or 40? to reduce the overshoot?

The overshoot is so bad with the manual settings I'm not totally prepared to say for sure it did get better with smaller settings - it did seem to with final setting for P = 0.6 and leaving I & D at max numbers of 1999 and 399. I've been playing with the pot for the last couple of hours, which I know isn't long for tuning a heating control PID. With I & D set to max settings it just didn't do good at all. The old altotune settings before fooling with the manual stuff was P=2.8; I=152; & D=38; Damp Constant 0.2; Cycle rate = 2; Digital Filter = 0 and I've left those at that point thru all this because that seems to be good.

Now I've ran autotune one time and the values were not exactly the same but close, and it didn't seem to be holding as good as before. With set point at 730 it had overshoot to 736 before starting to drop again. I manually put valves back to the original autotune settings of P=2.8; I=152; & D=38 and it seems to be settling down holding 730 ±1. I did an upset to cause the temp (process variable) drop to 720, and it heated to 735, then dropping to 726 before starting move back up. Now 10 minutes later it seems to be settled at 730±1

Boy does tuning a controller NEED a record so you can tell exactly what the temperature is doing. It's so easy to miss something when the eye NEEDS to be watching constantly - VERY hard for me to do.

Understand, today is the ideal setup with a steady 8 lb of lead in pot and not draining any lead out due to casting bullets, then replacing the molten lead with a cold 2 lb chunk to fill pot again. That action puts a real strain on any process trying to hold a steady temp. Normal operation would be perhaps 15 lb of lead in pot, bring lead to 730F, start casting bullets until there's perhaps 3 or 4 lb of lead in pot, then add 4 or 5 more lb. All depending on size of bullets and how many desired to cast.

Ken H>
 
Back
Top