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?
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
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
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
Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
RE: PID temperature control
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
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
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
otherwise known as On-Off with very narrow deadband.
RE: PID temperature control
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
RE: PID temperature control
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
Google will provide a few good hand tuning procedures.
Z
RE: PID temperature control
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
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
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
RE: PID temperature control
Sure there will be a little overshoot, but how hot does it get when the engine is running?
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
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
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
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
Dan - Owner
http://www.Hi-TecDesigns.com
RE: PID temperature control
RE: PID temperature control
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
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
"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
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
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
(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
RE: PID temperature control
Keith Cress
kcress - http://www.flaminsystems.com
RE: PID temperature control
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