×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

PID temperature control

PID temperature control

PID temperature control

(OP)
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?

RE: PID temperature control

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: Eng-Tips.com Forum Policies
[IMG http://tinyurl.com/7ofakss]
Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers


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: http://www.engineering.com/AskForum/aff/32.aspx

RE: PID temperature control

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
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: PID temperature control

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

RE: PID temperature control

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.

RE: PID temperature control

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: Eng-Tips.com Forum Policies
[IMG http://tinyurl.com/7ofakss]
Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers


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: http://www.engineering.com/AskForum/aff/32.aspx

RE: PID temperature control

>massive gain, big integral, and loads of derivative

otherwise known as On-Off with very narrow deadband.

RE: PID temperature control

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 - http://www.flaminsystems.com

RE: PID temperature control

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.

RE: PID temperature control

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
http://www.Hi-TecDesigns.com

RE: PID temperature control

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

RE: PID temperature control

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.

RE: PID temperature control

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



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.

RE: PID temperature control

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: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.

RE: PID temperature control

Agree, but derivative is usually a means of improving a basically usable loop. I'm not sure he's at that point yet.

RE: PID temperature control

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?

Quote (OP)

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

RE: PID temperature control

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
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: PID temperature control

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.

RE: PID temperature control

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

RE: PID temperature control

That was weird. I had used a double $ in the two places where I now have a single $. That double $ was treated as some oddball control character. Looks like it's fixed now.

RE: PID temperature control

From a Mechy standpoint, there are two limits, one is "provide enough input heat to keep the oil at x degrees plus or minus y degrees", and a second limit is "keep the heat flux at the heater-oil interface low enough that boiling of the oil (or any decomposition) is minimized".

That second one hasn't been discussed yet, and may not be an issue. If I was worried, I'd run a bench test of the heater, immersed in oil, and perhaps with a good thermocouple spotwelded to its surface, to find out if the heat flux problem is a big one or not - if boiling/overtemp occurs, then I'd start using a fixed PWM to drive the heater, until the surface temperature was below my safe limit.

The first problem is what has been discussed already. Any chance of worming a few thermocouples (or other sensors) down into the pan, to better find the temperature distribution?

RE: PID temperature control

Looking back, one can read that the OP in his OP says: "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"

First, I still think that that is an excellent result. At least with the conditions given.
And second, there is no extra heat being pumped in. If you look at the duty cycle, you will probably notice that the OFF period is twice the ON period. So the net heat added to the sump when heat is ON corresponds exactly to the heat lost during the OFF period. Try to reduce heat from 500 W to 250 W and the duty cycle will probably be close to 50% and the temperature variation will be 1 degree down and one degree up from set-point.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: PID temperature control

I noticed that also.
"Bothered that at 1 degree over set it is still proportionally pumping in some heat" -- That's the P in PID.
A simple example of "P";
We are measuring temperature over a span of 100 degrees. (0 to 100). P is 3% setpoint is 50 degrees.
When the sensor sees 50 degrees the heat will be off.
When the sensor sees 47 degrees the heat input will be 100%
Proportional control.
With 1.5 degrees of offset, the temperature at 50% heat loss will be 50 degrees. There will be a decreasing amount of heat added until the temperature reaches 51.5 degrees.
Without offset, the steady state temperature may be between 47 degrees and 50 degrees depending on the heat loss.
But the I will be seeing some error and adding offset to correct the error.
The D will be seeing a rapid rate of change and adjusting the set point to compensate.
Remember that you are measuring the external surface temperature and so that is what you are controlling. You can control the surface temperature much easier if you attach strip heaters to the surface and heat it directly.
So when you have strip heaters on the outside of the tank and almost perfect control, what is the temperature of the oil?
Tough love may suggest that perfect control of the oil temperature with this setup is more an exercise in self delusion than an engineering solution.

Bill
--------------------
"Why not the best?"
Jimmy Carter

RE: PID temperature control

(OP)
My interest is almost purely academic. This tank will only operate only about minutes between races and will unlikely ever reach stability due to long thermal lag. I think it works quite well for an $18 controller, but I think it doesn't has enough bits to make really good decisions. It has an undocumented screen that displays duty cycle. When stable it is approximately 25% or a heat loss of about 250W.

I understand the theory, in practice it is quite a time waster. Just looking for a practical way to get to the values as quickly as possible. Data recording was inconsistent and changes weren't obvious. Without running something like a chart recorder it is hard to see changes when the thermal lag is so long. There have to be some tricks to get values faster. Saying turn up P as high as you can get it gives some insight, but what characteristic says too much. That can
only come with observing the system. I have a FUJI PXW series that will be bread-boarded with an aluminum bar with less thermal lag as a trainer when I get some time. I'm three weeks from leaving to my summer place for five months that is totally off grid, the wife has me painting the house now and I just cut down five trees yesterday that will take a week to dispose of. The oil heater is a done deal, at least till maybe they make the 4 inch deep aluminum pipe plug for the sensor this winter.

The center of the tank measures a fairly stable 180 degrees measured with a long probe. Their gold standard is a liquid filled water temperature gauge. Just knowing that others have a low opinion of auto tune has been helpful. Looking forward to playing around with the test fixture and gaining some experience. I have been unsuccessful in explaining my core thoughts. Honestly, the apparently good results were made with almost random values and I find that disturbing.

RE: PID temperature control

What kind of control is it exactly? I'm thinking PWM to the SSR giving either phase angle or cycle to cycle control. But, you never actually posted it.

I would crank up the P term until it oscillates and set P to about 1/2 of that. Then, add a little I to get it to reach the setpoint without overshoot. I'm thinking that the slow temperature change response mean you want very little integrator. Finally, add some D to the mix to get a better response time.

My guess would be that the continued adding of heat at 1 degree over setpoint is integrator wind-up.

Bill, I've never seen the P term of a PID described like that. A P only controller has an offset (it must have an offset to reach the setpoint) but it seems to me that a typical PID controller doesn't have an offset on the P term. In the PID controls I have seen, P is just a multiplier applied to the error that is added to the output. For example, P of .75 means an error of 100% adds 75% to the controller output.

Did the controller come with a diagram of the PID loop so you can determine what the PID loop is doing or what the terms mean? For example is a P of 3 multiplying by 3 or is there a fixed divider of some sort in P path of the controller.

RE: PID temperature control

I see Bill's interpretation all the time on stand-alone PID controllers. One can watch the output change just like the graph below shows with a controlled input
(with I and D turned off).

A 3% PB is a little tight to illustrate the Proportional band (PB), so the graph below shows a 10% PB with the modulating range, the range below the PB at 100% output (reverse action) and the range above the PB at 0 % output.


RE: PID temperature control

(OP)
Manual, you get one sheet of paper and that is for several models. These are not phase triggered, they stay on for a period of time (in my case up to 40 seconds). It does have the HYS set to 1. One setting had a very stable temperature at one degree over the set. I figured that was too much I. This is the unit http://www.ebay.com/itm/Universal-Digital-PID-Temp... As I said before it does not have the scale correction indicated in the instructions so the range is 0-1200. Even if it corrects for K input that is still 0-800. Not a lot of bits will change around 180. They had to strip something out to get it to that price. I've used the FUJI and seem to remember you could do something with the scale. I used them only for alarm limits on a welding gas mixer. Used they were a cheap way to go and used as a voltage monitor.

RE: PID temperature control

I'm curious as to what have you set the; "controlling period" and "digital filter period" to?

Keith Cress
kcress - http://www.flaminsystems.com

RE: PID temperature control

Thanks danw2. That is exactly what I was trying to explain.
An almost universal governor setting for the proportional controllers on virtually all diesel generators is 3% droop.
Think of that as 3% proportional band plus 3% offset.
At no load the frequency is 61.8 Hz. At full load the frequency is 60 Hz. At any frequency below 61.8 Hz the governor is supplying fuel to the engine. (In addition to the fuel needed to keep the generator turning at the correct speed with no load.)
If this was a simple proportional setting the governor would be set at 60 Hz and the frequency would drop to 58.2 Hz at full load.
Motors and transformers are much happier with a frequency range of 60 Hz to 61.8 Hz than they would be with a frequency range of 58.2 Hz to 60 Hz.
This is due to the Hertz per Volt ratios and magnetic saturation at below rated frequency.
Droop is a variation of proportional control.
Back to the original issue.
I suggest that our time may be better spent suggesting better locations for the placement of the temperature sensor so as to allow closer control.
As understand your arrangement you are controlling the temperature of the outside skin of the oil tank. If you are concerned with 1 and 2 degree errors in the outside skin temperature, you may be horrified to see a chart of the actual oil temperature in different locations in the baffled tank.
Suggestions:
Temperature sensor location.
Issues: The lowest temperature is important. You don't want a slug of oil below the desired temperature entering the lubrication stream from a section of the tank that has not reached the proper temperature due to the baffles.
Highest temperature. You don't want the oil boiling or fractionating off the lighter fractions.
Heat sources. You may consider adding more heaters.
A circulating pump, properly applied, may go far to mitigating uneven temperatures.
Any other suggestions as to how to arrange the system so that we are actually controlling the temperature of the oil directly and mitigating issues with uneven heating?

Bill
--------------------
"Why not the best?"
Jimmy Carter

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources