Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PID temperature control 1

Status
Not open for further replies.

OperaHouse

Electrical
Jun 15, 2003
1,379
0
0
US
A friends race car engine has a dry oil sump and he wanted me to built a "babysitter" temperature controller for the tank to keep the temperature up between runs. I bought a cheap PID controller to drive a SSR into two 500W heaters. Initial test was with 4 gallons of oil using factory settings on the controller just to see how long it took to warm up and if the heaters boiled the oil. It took about 40 minutes and temperature would overshoot about 9 degrees, P=3, I=240 D=off. Thermally it is complicated. Sensor measures skin of the tank which is 18 degrees colder than the 180F of the oil and it is located close to one of the two heaters. The tank is heavily baffled. The good part is it only has to compensate for thermal loss of the uninsulated tank, about 5 minutes per degree drop.

I was convinced the miracle software of auto tune would get this to a fraction of a degree. A few days later auto tune came up with P=.9 I=276 D=69. Don't remember exact overshoot, but it seemed large and it was clear it would never be stable. From what I had gleaned the numbers should be lower with a large thermal mass, D wasn't used that often and from first test that a large I seemed to be a problem. Better to deal with just two variables. Just plain ran out of time and final numbers were P=.8 I=36 D=off. It will drop 1 degree below set point and overshoot two degrees. Bothered that at 1 degree over set it is still proportionally pumping in some heat.

They are thrilled at how it works as their main concern is boiling the oil. This is my first experience with a PID temperature controller. For me auto tune was a great disappointment. Just playing with the numbers took hours and there appeared no obvious correlation between stability and overshoot. I probably only get one more shot at this till next November. If I could have charted it out, the numbers might have made some sense. From your experience, what would be the number to change the next time and are there general rules?

 
Replies continue below

Recommended for you

I don't deal with PIDs except as an abstract concept. However, what I've read is that hand-tuning is often better than autotuning. I would imagine that the issue is that there are potentially lots of settings that appear to be stable, but they need to be fully exercised over the range of possible conditions to weed out the poorer settings.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529


Of course I can. I can do anything. I can do absolutely anything. I'm an expert!
There is a homework forum hosted by engineering.com:
 
There's something about PID that makes otherwise perfectly sane people turn into unrealistic perfectionists. I don't know why that is so - but seen it so many times. I think it is the school system, where PID control seems to be the holy Grail and the Final Achievement in most courses.

You have a solution that works. Your friends are thrilled with the way it works. That is good enough for most guys and you could leave it there. But if you want to make it even better without being confused by theory (that is mostly because theory deals with a lot simpler first order systems than a Real World system is) then read on. I have used the procedures below for decades and I have always been successful.

I do not do much temperature control. But I do a lot of speed control with cascaded loops and I always start with the innermost loop (usually torque or armature current) and makes it quick an somewhat overshooting - say 30 - 40%. I then set the reference channel filter so the step response looks good (not too much overshoot) and then do the same thing with the outer loop, which mostly is the speed loop.

If I don't have any standard or known-good parameters, I set I rather high and P low to start with. I then increase P until response is crisp and reduce I to remove the "tail" error. For the speed loop, I usually run only P at first (usually not possible in the torque loop in analogue DC drives) and then reduce I also in the speed loop.

The low P that you have says that you do need the I part. So, if you want to get the best possible result, run pure P control first and set P as high as possible. You will then have a residual error. Activate I and adjust it so your error tail gets small enough to allow you to sleep well at nights [bigsmile]

Gunnar Englund
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
 
Thanks for the helpful advice. I would still like to hear from someone that uses these in heating applications to find out what can be really expected.

Many years ago when we bought our first electronic washing machine, I watched it through many loads thinking about the software and how I might improve it (like a little water spray in spin cycle to get rid of residual soap still in the pump). In electronics, thinking like an electron has always served me well. I try to envision software routines in the same way. Some of the duty cycle changes at points in the control cycle were hard to imagine. If I were making this with a $3 micro it would just have a fixed duty cycle based on the 200-300W of constant loss with a proportional add on in the last few degrees, but you can't beat China in cost. Figuring what the Chinglish manual intended to say is a stretch. One sentence says to set the control cycle at one second and the next says best results are 30-40 seconds. It seems like a very tricky setup to foist on the general public without better instructions. I will probably have to buy another unit to gain the experience I am looking for.

 
In my experience auto-tune is a marketing dream which is unworkable in anything other than the most benign systems.

If playing with any loop I'd first start with moderate P+I settings and avoid any derivative action at all. Most loops you can get to behave reasonably well with just P+I, and once you're there you can introduce D if the loop has nice stable feedback without noise. I've given up on auto-tunes, I just don't even bother any more. The worst one I can recall was a turbine lube oil cooler loop with a long transport delay due to a poorly-located feedback sensor, and that went wild until we hurriedly put the block into manual. The auto-tune figures were outrageous - massive gain, big integral, and loads of derivative. Totally unusable.
 
Lags and latencies are anathema for control loops, in general, since they tend to swamp out the programmed performance parameters. I would think that the limits are related to the natural frequencies in the control loop.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529


Of course I can. I can do anything. I can do absolutely anything. I'm an expert!
There is a homework forum hosted by engineering.com:
 
The cycle time... If it's too short you can get lots of non-sense looking results. I'd guess it should be something like 15 seconds based on the mechanicals you describe.

Think about it. The controller needs to make a change and watch what happens. Seeing what happens it adjusts and applies a new value. Step and repeat.

Now if it makes a change but can't actually thermodynamically see the results of that change before checking again to see how to make the next scheduled change it's going to have a problem...

Keith Cress
kcress -
 
Thermal lag times can drive you nuts, when using the canned PID controls available with cheap "smart relays" and the like. I find that the inability to set the loop timing (which if adjustable at all is typically limited to the fractional seconds range) to long periods (several seconds to a few minutes) makes using these controls for PID difficult. I've resorted to simple hysteresis trigger limits (i.e. a fixed deadband, heater "on" at low limit temperature, and off at the high limit) and ignored the fancy PID routines, but like Skogs suggests, I just don't fret over a few more degrees C.
 
Opera,

I am REALLY slammed at work right now (70-hour weeks), but hit me up in a couple of weeks and things should have slowed down by then (I sure as hell hope so!). I can give you a basic procedure to tune your PID that shouldn't take longer than a few hours and will get you about as close as you can hope for...

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
I've had good luck with one Auto-tune PID loop recently. It was a pretty small load though. Otherwise I've been happy with PI in the past and a bit of wobble in the temperature. I've usually maintained +-1C or better (laser diodes, optical compoennts, 12 cubic inch chunks of aluminum, etc.).

Google will provide a few good hand tuning procedures.

Z
 
When heating oil be keep the watts/sq inch low. about half what you would use for water or the oil will burn.
Make sure if your sensor fails it fails high or you will boil the oil.
I recall a oil tank on a crusher boiling the oil when someone turned off the instrument power supply, the PLC saw zero degrees and turned the heater on full. After that we always turned the heater off if the temperature indicated was less than ambient.
 
Like nailing jelly to a tree. I ran auto tune again, this time with longer 40 second cycle time.Pretty much the same numbers but with more decimal points and still pretty wild swings. I have to remind myself what precious few number of change bits this unit makes decisions on. The display range is 0-1200. Instructions have a menu to change this, but all efforts fail to bring up this screen. Leads me to believe any scalar hardware is not included in this unit. Currently have increased P=4, reduced I=60 and deleted D again. Takes a long time to settle down and it looks like temperature stays within a 1.4 degree swing. More than four hours just to run three tests.This will all make sense some day. Here is a picture so I can try out the new insertion method. They run this at Bonneville each year.

BABYSITTER1_mopxma.jpg


I think the heat density is a little high for oil but they can't run the engine till it is up to temperature. Speaking of oil, for a bunch that has $120 billet machined spark plugs, they buy re-refined ECO-LUBE that comes in generic 5 gallon buckets with a zerox paper label with the carbon print flaking off from a company you would never think sold oil. A lot of myths in this hobby.
 
Why do you keep turning off the derivative? I'm guessing it's because you don't understand the theory behind a PID. Adding the integrator to the proportional control makes the closed-loop system less stable; adding derivative helps to make it more stable. With a temperature system's slow change, derivative is usually used to reduce overshoot and help the system settle faster. Yes, derivative can amplify high frequency noise, but this is a temperature system, and they usually aren't noisy. I don't use the D term on flow or pressure loops due to noise, but almost always use it on temperature loops.

xnuke
"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand, Atlas Shrugged.
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
I would use 10% proportional band. Once it settled down I would use some offset to correct to the set point. how much technology do we need to heat a can of oil, and how accurate does the final temperature have to be? (That is how accurate does it have to be, not how accurate does someone think it should be.)
Sure there will be a little overshoot, but how hot does it get when the engine is running?
OP said:
temperature would overshoot about 9 degrees
Sensor measures skin of the tank which is 18 degrees colder than the 180F of the oil and it is located close to one of the two heaters.
Under the circumstances I think that 9 degrees overshoot is reasonable.
You can log the temperature at different locations in the heavily baffled tank and really confuse yourself if you want to.
You can use a thermostat if you want. The advantage of a thermostat is that it has no display and you don't see the overshoot on the first two cycles. An oven set to 200 degrees may reach closer to 300 degrees on the first heating cycle from cold. Any good cook waits until the third cycle before putting anything in the oven to cook.
I guess that the point that I am trying to make is that any of the settings that you have used will probably be adequate to avoid engine damage, and you really don't know the average temperature of the oil anyway.

Bill
--------------------
"Why not the best?"
Jimmy Carter
 
Well said, Bill! And true.
But you are a spoilsport.
There are weeks and months of interesting discussions to be had from this.
To quote myself: "There's something about PID that makes otherwise perfectly sane people turn into unrealistic perfectionists"
And you throw in a wet rag. Or a bi-metal strip. That is how engineering is, at times.
PLS for you.

Gunnar Englund
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
 
Not that I've ever worked with a PID control (with or without and of the three components), but I figured out years ago that the only path to maintaining sanity, and decent performance reviews, was knowing when I reached "good enough" and moving on. Rarely have I seen problems that can be engineered to the gnat's as$, either there's not enough time or enough budget; get close enough/good enough and move on.

Too many of the people I've worked with seem to fall into one of two other camps; those that don't get beyond "adequate" at best or those who suffer from paralysis by analysis. Not sure which is worse, but it seems that those that barely manage adequate wash out of the profession far earlier that the paralysis by analysis folks.

I haven't a clue as to what's good enough for this particular problem, but I'm reasonably certain it will be (has been?) arrived at long before the temperature rapidly comes nearly to the desired point and then gently settles in without ever exceeding the target.

On the other hand, if it's a hobby/free time project then maybe it really is that once in a career opportunity to actually do that gnat's as$ engineering that we never have the real world (work world) opportunity to attain. In that case, we need to figure out how to help OperaHouse obtain that perfect, critically damped, response.
 
Well, no problem if we wish to continue with the exercise. So let's step back and with the best trouble shooting techniques look at what the problem
is instead of treating the symptoms.
Part of the problem may be in the placement of heating elements, baffles, and the location of the sensor.
With small area sources of heat and baffles, it may not be realistic to try to maintain an arbitrary location on the surface at one degree precision.
I would expect more than one degree of temperature gradient between the different baffled areas of the tank.
Let's consider the problem of deciding what and where we want to measure the temperature.
With baffles, the heated compartments will heat up more quickly than the unheated compartments. The heating curve will be somewhat
complex as the outside surfaces of the tank will be losing heat at a more or less fixed rate (ignoring the added complication of convection cooling)
related to the temperature difference.
The heat loss across the baffles will be proportional to a decreasing temperature difference as the oil in the unheated compartments is heated through the baffles.
Achieving the illusion of one degree precision when the temperature gradient throughout the oil may be several degrees may be more of an exercise in self delusion
than an engineering solution.
I suggest that you determine the limits of the process.
ie: between Hot Enough and Too Hot.
Make allowances for overshoot and gradients/stratification and a safety factor.
If you are between the limits you have solved the problem.

Bill
--------------------
"Why not the best?"
Jimmy Carter
 
Status
Not open for further replies.
Back
Top