PID tuning feedback..graph included;)

Paullys50

Lifetime Supporting Member
Join Date
Jan 2006
Location
WI
Posts
2,188
Hey guys, wondering if you could give me some direction with PID tuning. This is my first real attempt at tuning so please bare with me. I've read a lot about PID tuning and the concepts, I'm now trying to put that knowledge to use!

I've attached a graph of my SP, PV, CV values over a 3 hour period of time. I'm controlling the temp of an oven using the PID function of a Controllogix 1756-L62.

PID is Dependent, triggered every 1 sec, loop update 1 sec.

SP-PV
Derivative of PV
Kc = 3
Ti = 3
Td = 0


I used the WAG method to get to these PID values based on the data I've collected during previous test runs.

The response of the system to a set point change isn't that important, stabilization is. Process limits of +/- .5 deg C needs to be maintained through the process (SP does not change during a process run).


As you can see by my graph, I've got some overshoot and undershoot of PV going on but the integral squashes that pretty quickly. After about 25 min it stabilizes (would be great to get this under 20 min, but again not that critical).

As is, it will achieve what we need, but I'd like to fine tune it to eliminate the overshoot, and to just gain experience.

Looking at my graph, what tips you off? I see my CV oscillate a little after the initial ramp, which tells me it could be improved. Do I need more gain, less gain, more integral, less integral...by looking at the graph what stands out that tips you off (besides the overshoot)? What do you see that indicates P or the I or the D need to be changed?

My thoughts by looking at the graph:

Kc: Possibly lower a little to stretch out the initial ramp
Ti: No change
Td: Add in to eliminate the overshoot but I have no clue where to start for a value.....

Hopefully this is a good example…
SP steps are 105, 75, 105
 
In general, the problem with heating/cooling loops is that there is usually a fairly large lag time from when you make an output change to when it actually effects the process. And once it does, you then have to worry about over/under shoot. Adding some derivative is supposed to take care of that problem. You might try something in the 0.2 and 0.5 second time frame. Be careful, with derivative as it can produce erratic results.You might add some deadband in the configuration tab. This will basically hold the output until the difference between the PV/SP is outside the deadband area. This keeps the valve from oscillating when you are close to SP.
Lowering the integral will make it take longer to get to SP but will result in less overshoot.
 
Overshoot can be reduced by decreasing your Kc, Td will decrease you oscillations. Since stabilization is key you will want some integral control on the loop.

Not sure how practical this is, but you could try Ziegler-Nichols tuning.

Basically make the loop P-only (turn off I and D).
Increase Kc until you get sustained oscillations for relatively small setpoint changes.
The gain at this point is your ultimate gain, Ku
Note the period at this point, your ultimate period, Pu.

Then use the following to start with for PID control, based on a dampening factor of 0.22 and 50% overshoot, quarter amplitute dampening:
Kc: 0.6*Ku
Ti: Pu / 2
Td: Pu / 8

If you have a way of measuring the deadtime / lagtime of your process and the time constant (time it takes for the system to reach 63.2% of its final value/setpoint) of the system accurately, as well as calculating the procees gain, you can do some calculations for your PID coefficients based on a dead-time model (first order system with dead time).
 
Last edited:
Generally, look here.

Specifically look at the 'Graphical Modeling of Process Dynamics: Heat Exchanger Case Study' items. They discuss how to determine process attributes and how to set gains based on those attributes.

Keith
 
Greetings Paully’s5.0 ...



your graph looks good ... why do you want to eliminate the overshoot anyway? ... as you said:



The response of the system to a set point change isn't that important, stabilization is. (SP does not change during a process run).



if you’re not going to change the SP, then the overshoot isn’t a “bad” thing ... in fact, it might actually be a “good” thing ... a certain amount of overshoot (and yours ain’t bad) is often a sign of an “aggressively” tuned (some say “tightly tuned”) system ... the idea is that the controller will react “aggressively” to correct a LOAD CHANGE ...



you might want to read this post about “tuning goals” ... I’ll repost the picture here for convenience ...



wall_of_fame.jpg





the common objective when most people try to tune a loop is to shoot for a response like the one shown in Figure 1 ... no overshoot ... no oscillation ... who could ask for anything more? ... but then the system is put in operation - and eventually a LOAD CHANGE comes along ... the same tuning values shown in Figure 1 give the sort of “lazy - sluggish” response shown in Figure 2 ...



on the other hand, if we can accept a certain amount of overshoot and oscillation (to a SP change that’s NEVER going to occur anyway!) then the tuning values in Figure 3 might be better in the long run ... notice how “aggressively” the system responds to “get back on target” in Figure 4 ...



going further ... suppose - just for discussion - that you wanted the best of both worlds ... why compromise? ... find the PERFECT values for a SP change ... and the PERFECT values for a LOAD change ... now figure out a way to program the PLC to shift those sets of values into the PID at the proper time ...



just for kicks ... it sure would be nice to have an “open-loop characteristics” test (done in the manual mode) like the one in this post ... if you could post something like that, I’d like to take a shot at calculating some tuning values for your system ...

and if you could “snapshot” the data as in this post then my distinguished colleague Peter Nachtwey would probably also like to give it a shot ... (he likes numbers - I like graphs) ...


I'd like to fine tune it to eliminate the overshoot, and to just gain experience.



sorry I’ve got to run ... what you’ve done so far looks good ... experiment if you want to (definitely, yes) but keep good notes on what you’ve got so far ... many plants aren’t tuned anywhere near that good ...
 
Process limits of +/- .5 deg C needs to be maintained through the process

So how are you measuring the temperature?

FWIW, Ordinary thermocouples are not any where near accurate enough to achieve that.
 
Excellent

Paully's5.0, you have done extremely well for a first attempt.

msmassey said:
In general, the problem with heating/cooling loops is that there is usually a fairly large lag time from when you make an output change to when it actually effects the process. And once it does, you then have to worry about over/under shoot.
Did you look at the graph? The lag time in minimal in this case. One can tell by looking at the control output and the response at time 10:46:10. If there was a hair-line cursor I bet it would be only a few seconds at most.

kdcui said:
Overshoot can be reduced by decreasing your Kc,
At the expense of performance.

Td will decrease you oscillations.
Yes, adding Td is the key. The why is a good question for the Friday night Math Quiz.

kdcui said:
Since stabilization is key you will want some integral control on the loop.
The integrator has nothing to do with stability. It makes sure the closed loop transfer function has a steady state gain of 1 so the PV will reach the SP.

kdcui said:
Not sure how practical this is, but you could try Ziegler-Nichols tuning.
Why would Pauly's5.0 want to do that? His tuning is better that what ZN can provide. ZN provide very underdamp response which overshoot much worse than Pauly's5.0.

Pauly's50, you can probably get rid of the overshoot by trial and error. The system looks like it is well behaved. However, I would follow Keith's suggestion and study the controlguru site because the information there is MUCH more modern and exact than old fashioned ZN.

It would be good to have the actual data.
 
Last edited:
Thanks for all the replies! I'm feeling very good about my first attempt now! Ron/Peter I've read so many of your posts on PIDs, my results are direcly related to your knowledge and your willingness to TEACH! Thank you!

Ron -
I guess I wanted to see if I could achieve a response identical to your figure #1, not because the system neccesarily needs it, mainly just to see if I could do it and if the system could achieve it.

Alaric -
The system is using RTDs for feedback, the +/- .5 deg setpoint is the requirment of the process engineers, and I believe was called for in the original design spec. I have not checked the resolution of the RTDs, nor have we had our calibration guys come verify the accuracy of the RTD feedback (at least not in the last 6 - 12 months). It is something that needs to be considered, but at this point we are trusting the OEM provided the means to achieve the design spec.

Peter-
I've attached my data if you're interested.

Note that I am actually controlling 4 separate independent heating zones, so my charts and data are included for all four.

I'll checkout all the links you guys have provided! Thanks!

Side note: I'm involved with the startup of a new manufacturing process (60+ pieces of equipment and rising), all of the equipment is OEM, about half of it works great as delivered the other half needs a lot of work. I know this will be the first of many more PID challenges to come...good times:)
 
Last edited:
kamenges said:
Generally, look here.

Specifically look at the 'Graphical Modeling of Process Dynamics: Heat Exchanger Case Study' items. They discuss how to determine process attributes and how to set gains based on those attributes.

Keith

After going back and reading through the whole article..............it all makes sense! Well at least in determining a "starting" point, which is probably 75% of the battle?!?!

I feel accomplished for the week, I'm off for a drink!
 

Similar Topics

Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,155
so i have 4 25gpm wells feeding a 1000gal tank (T-1), with an additional 15gpm from a decant tank for 3hrs every 12hrs. P1 and P2 both controlled...
Replies
154
Views
35,846
Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a...
Replies
113
Views
27,857
A few months ago, I started to look into PID controllers and the tuning of first order processes. This has, partly thanks to you, resulted in a...
Replies
162
Views
62,006
I haven't had to tune a PID loop in a very long time. It's actually a PI loop for a pulse width modulation s.v. What was the name of that tuning...
Replies
16
Views
4,093
Back
Top Bottom