CheeseForum.org ยป Forum

GENERAL CHEESE MAKING BOARDS (Specific Cheese Making in Boards above) => EQUIPMENT - Making Cheese => Topic started by: klschnepp on August 30, 2012, 07:34:17 AM

Title: PID controller settings?
Post by: klschnepp on August 30, 2012, 07:34:17 AM
I am wondering if anyone would be willing to share their process settings for using a PID for heat?  I have my controller hooked to a bain marie/heating table and am getting a large overshoot (even with a two-step heating process) that simply tuning the factory settings has not helped.   No surprises there given what I have been reading on the topic.  I am by no means an engineer :o --I understand the basic concepts, but not much beyond that.  I have found this intel on settings (iratherfly, thank you):

Programming:
It seems that the following programming instructions would  give you the best results for bot sous vide and cheesemaking. It's as accurate as 0.2 of 1 degree Celsius! (Thanks for coming up with this one, Abe).  Here is the sequence:
 - Press set, enter 0036. Scroll so p is blinking
 - Press set, set the value to 000.2
 - Press set again, scroll to I
 - Press set,  use 1999
 - Press set again, scroll to d
 - Press set, change the value to 0000.
 - Press set, scroll to end.
 - Press set

 However, the units of measurement on my system do not seem to correlate (unless I am missing something, which is entirely possible). My unit has P= engineering units, I=seconds and D=seconds.   I am operating in C as well.

If anyone could help me narrow the test range on this, it would really be appreciated.   
Title: Re: PID controller settings?
Post by: Wolfy on August 30, 2012, 04:26:51 PM
Assuming your PID has an 'auto tune' setting, have you tried running that?  From what I understand the machine will then tune itself to your 'system' and the 'system parameters' and you should not need to enter the values manually.

When mine was brand new new, it overshot the set-temperatures (usually by 1-2degC), but after running the auto-tune it hits (and stops at) the set temperature within 0.1-0.2degC every time.

(I use mine for a different but almost identical concept application).
Title: Re: PID controller settings?
Post by: klschnepp on August 30, 2012, 06:51:53 PM
Wolfy, thanks for your reply.  I ran the auto tune and it has not had the desired result.  However, I am running it again as I type (after a day of experimentation).   Out of the box, mine was over running about 8 degrees C (eek).   It was not much better after tuning.   If you have a moment, it might be interesting to know what your P-I-D settings are??
Title: Re: PID controller settings?
Post by: mjr522 on August 31, 2012, 03:25:46 AM
Unfortunately, I have almost no practical experience with PIDs.  I've a decent understanding of how they work, and if I were about 10 years younger, I could probably analyze the system and suggest good P, I, and D values for you.  For a class project, I once designed a built a controller to cause water from a faucet to follow a certain temperature profile (80 degrees for 10 seconds, 72 for 8 seconds, 95 for 4 seconds, etc) by controlling the hot water valve.  If I recall correctly, though, even after doing all the system modelling and getting good numbers to run with, it was understood that you'd still need to tweak things.

When you do the autotune, does it output (or can you assertain) the values for P, I, and D?  Recall from what I wrote elsewhere, that P moves you towards your target relative to how far you are from it (faster for further away, really slow or non-existent motion when close), I keeps track of how long and far you are and adds up the product of those two to move you closer, and D watches how fast things are changing to try to reduce overshoot.

Depending on how you have the system set up, it seems to me that you would only need P to heat things.  There's no such thing as thermal inertia--you can't overshoot with temperature...I was about to go into a long explanation of this, but decided I'd better wait to see if anyone actually wants to hear about it.  Since you said you are overshooting, it means either the element you are using (are you using an element to heat?) has a good deal of excess energy once the desired temperature is reached, or the I value is high enough to cause continued energy contribution even after the temperature is reached.

I think I'd be inclined to play with the controller--set everything to 0, then turn P up a little and watch what happens.  Does it ever get to the desired temperature, or is it always a little cooler than it should be?  If it gets there, is it fast enough?  If it's not fast enough, turn up P.  If it never gets there, add some I.  If it gets there fast enough, but overshoots, turn down P and add some I (you could try D, but i'm not sure how it will work in a thermal system...).  Etc.
Title: Re: PID controller settings?
Post by: Wolfy on August 31, 2012, 07:22:04 PM
I've never needed to view/set/change the P,I,D settings, the only changes I made were to adjust for the type of probe (I use a PT-100 rather than the k-thermocouple that was default) and then (after a few uses when I worked out how) run the auto-tune and it automatically determined the required settings.
(I guess you know that the auto-tune needs to be run while the system is in as realistic state as possible, likely while you are making a batch of cheese?)

It might depend on the brand/type of PID controller and the temperature probe used (since some are much more accurate in the temperature range used for cheese making), what brand/model is yours and how is it setup?
Title: Re: PID controller settings?
Post by: klschnepp on September 03, 2012, 01:19:36 PM
Thanks to you both and Mike, your knowledge is much appreciated (and, can I just say "wow" --fantastic that you know this stuff!).  Okay, so I have run the auto tune twice and we are still off the mark, but getting closer.  I am really optimistic this is going to be a fantastic solution.  I am now, to use an extremely technical term, "fiddling" with the settings to see if I can get a bit closer to the desired state.  THANK YOU to all and I will post results once I have them.
Title: Re: PID controller settings?
Post by: kdttocs on January 04, 2013, 09:32:36 PM
Digging up older threat.

Have the PID settings / autotune been resolved? PID settings are almost never set manually in the DIY world. The settings are 100% dependent and impacted by the equipment and environment variables.

Couple things I may add. As already noted, an RTD prode (the PT-100 that was mentioned earlier) is better at handling temperature fluctuations providing a more consistent and buffered temp signal to the PID.

It hasn't been mentioned yet how the autotune was executed. In the beer world which is where I came from, the common method to autotune is to have the liquid at a lower temperature, ~10 degrees, when autotune is run. The goal is to have a good sample size so the PID can apply heat and monitor how the liquid reacts to it. As I said, the variables that detemin the PID settings are so varying that autotune is pretty much the only method to calibrate your setup.

Hope this helps.
Title: Re: PID controller settings?
Post by: klschnepp on January 22, 2013, 03:36:16 PM
Thanks for posting and it has been mostly resolved.  Initial heat is fine, but I am not happy with ramp time for the scald, but been working around with a manual fiddle.   I did not auto tune at a lower temp than what my milk is at.  I might try that and report back!!   Thanks again!
Title: Re: PID controller settings?
Post by: wharris on February 04, 2013, 05:06:48 PM
I am in the same boat with my new PID controller. I have it basically wired up, and can get to a desired temperature in with relatively little effort.
But using the controller to try and adhere to a temperature protocol seems to be a different matter all together.

(ie. Raising the vat temp 3deg/5min for 45 min.)

so, for now, I am still working that out. Will let you know what I find.

Title: Re: PID controller settings?
Post by: mjr522 on February 04, 2013, 05:37:54 PM
That's a cool looking setup you've got there, Wayne.  It's very similar to what I've been envisioning for my "utility sink vat" (http://cheeseforum.org/forum/index.php/topic,10791.msg82959.html#msg82959) using contact heaters instead of a water bath idea.  If I were to proceed my biggest issue would be trying to justify to my wife why I need such a huge upgrade to our electrical panel...

What size vat are you going to be putting in that tub?

Getting the temperature to follow a particular path is something that requires more than just a PID--you essentially need something that feeds the PID new temperature targets at the right time.  I wouldn't be surprised if the control system you have will do this (which means it's more than a simple PID).  If it's just a PID, you'll need a "brain" of sorts to tell it what to do.  Good luck!
Title: Re: PID controller settings?
Post by: wharris on February 04, 2013, 05:41:30 PM
24 gallon vat fits in there. You are probably right about the "brain".  Perhaps something by an Arduino (http://en.wikipedia.org/wiki/Arduino).
Title: Re: PID controller settings?
Post by: stratocasterdave on February 04, 2013, 05:50:39 PM
Wolfy, thanks for your reply.  I ran the auto tune and it has not had the desired result.  However, I am running it again as I type (after a day of experimentation).   Out of the box, mine was over running about 8 degrees C (eek).   It was not much better after tuning.   If you have a moment, it might be interesting to know what your P-I-D settings are??

Not too sure on your particular set up but the auto tune can take a very long time?  Did you let it run its coarse?  I know it took mine at least 3 hours!  However, my application may be quite different.

Your PID settings will be different than mine, or anyone elses with a differnt application.  Auto-tune will be best, in my opinion.  It should work very effectivly.
Title: Re: PID controller settings?
Post by: wharris on February 04, 2013, 05:54:51 PM
I did not let mine finish.  I will run through a test this afternoon and let you know.
Title: Re: PID controller settings?
Post by: BobE102330 on February 04, 2013, 06:01:24 PM
A PID with "Ramp Soak" capability will heat along your temperature profile.  One example is http://www.amazon.com/gp/product/B004HHW2P8/ref=oh_details_o02_s00_i00 (http://www.amazon.com/gp/product/B004HHW2P8/ref=oh_details_o02_s00_i00)  I haven't wired it up yet to report on how well it works.

I tried to auto tune my cave controller.  It just ran the temperature as cold as my mini fridge would go and stayed there for 10 hours.  Glad I didn't have any cheese in it, since it was a solid freeze. 
Title: Re: PID controller settings?
Post by: wharris on February 08, 2013, 01:45:13 PM
Here is my setup as it is right now.  Testing my temp protocols.  I may in fact swap out this controller for one that support Ramp/Soak.
In this, you will see lots of safety violations,  i get that, but this is testing and not normal operations.  Just seeing if the guts work.
In fact, I am thinking about moving the temp probe from the water bath, to the cheese milk itself..  Again, just playing with ideas.


 (http://youtu.be/Bv8n-OEGXSw)

PID Settings:
SV=104
AL1=104.5
AH1=105
AL2=103.5
AH2=103

also, I did run a calibration on this a few days ago,  ran for like 7 hours, temp was up at 190ish.  I shut it down...
Have a feeling that something was amiss and it was not able to converge properly.
Title: Re: PID controller settings?
Post by: stratocasterdave on February 08, 2013, 02:29:16 PM
Sorry ya had negative results on the auto tune.  Your set up is really coming together though.  Keep us updated.

Thinking outside the box, I wonder if you couldn't put some sort of submersible pump or something in the water tank.  Circulating that water might increase efficiency?  Just an idea.

Title: Re: PID controller settings?
Post by: wharris on February 08, 2013, 02:34:34 PM
The circulation pump is a solid idea. 
But if you look close on the left side of the tank, you will see a  black cord going into the tank, at the end is a small little circulation pump.
Having tested both with and without that little pump, it makes a huge difference.  It is amazing how still water can contain very seperate thermal zones.
Title: Re: PID controller settings?
Post by: stratocasterdave on February 08, 2013, 02:39:14 PM
Awesome!  You can use almost you it as sous vide system!   ;D
Title: Re: PID controller settings?
Post by: mjr522 on February 08, 2013, 03:34:06 PM
What values did you get for P, I, and D?  I have a controller, but when I let it run its auto-tune for a while it kept resetting.  I stopped mid-tune once and saw that it had an enourmous I and D values.  I'm really convinced that for the kinds of setup people use here, the values really should be a high P (which, depending on your controller might be a small number) and medium I and practically no D.  I'm putting a new vat together in the next couple of weeks and will run auto-tune on mine again to see what happens.

Good luck!
Title: Re: PID controller settings?
Post by: wharris on February 08, 2013, 05:39:30 PM
Good to know.  I would have to go back and check what my actual PID values are. 
Right now, I am considering a lot of tweaking to the whole setup.  Mainly centered around where the dang thermostat should go for the PID.  The water bath? or the cheese milk?

To this point, the thermostat has been in the water bath.  And while that works great if what i want is the water bath temp to get to particular temp, however, i really only care about the milk. So, I am going to play a bit.
In addition, I will revisit my PID values tonight. I really don't remember what they are. I do remember moving my overshoot coeffeicent from .2 to .5, but thats really the only change i have made..


And for those that think this is overkill, i would agree. But for me, this kind of tinkering is half the fun.
Title: Re: PID controller settings?
Post by: mjr522 on February 08, 2013, 06:22:32 PM
If it's legal to do, I'd want the thermocouple/thermistor/temp probe in the milk itself.  As you said, it's great that the water is the right temperature, but that doesn't mean the milk is.  If you are worried about putting the detector in the milk, I think the closest you could get would be to get a surface mounted temperature probe and put it on the water side of the milk container.  The stainless, with the temp probe mounted on the water side, should be pretty close to the temperature of the milk there at the edge.

If this is overkill, then most techincal profession are overkill...  :P
Title: Re: PID controller settings?
Post by: stratocasterdave on February 08, 2013, 08:24:52 PM
Wayne, I used my PID for two different setups.  One was a infusion mash system (a micro-brewing system).  It is now used to control an oven.  For the homebrew system my values were P=77, I=660, D=155.  On the oven setup I was P=47, I=825, D=206.

Each of the values were derived with the autotuning.  I  remember the oven system took at lease 4 hours to tune.  You might want to check with someone with more experience in value setting.

Dave
Title: Re: PID controller settings?
Post by: mjr522 on February 08, 2013, 08:59:35 PM
Something to consider when looking at other people's values is that the way the numbers are used might not be the same across systems.  I don't remember exactly what it was, but when I looked at and started messing with my values, I was surprised to find that one of my numbers was the reciprocal of what made sense (it was 1/(the number I thought it should have been) ).
Title: Re: PID controller settings?
Post by: stratocasterdave on February 08, 2013, 09:24:23 PM
This might help.  On my controller:

P = Controlls the output of the controller in degree units.  So, if you have P at say 100, the proportional band is 10 degrees.  In other words, when the sensor is 10 degrees below the proportional band, the controller will output.  When the temp is 5 degrees below set point, the output is 50%  When the temp is equal to set, there is 0 output.  And so on.

I = Time.  For me this is in seconds.  This controlls the output of your controller based on the difference the measured and set temp integrated with time.  A larger number would mean slower action.  For you, if temp fluctuates often, increase your I number.

D = Derivative time.  Contributes the output power based on the rate of temp change.  For you you can adjust your number to adjust for temperature overshoot.  Controllers out put based on the rate of change rather than the net amount of change.

Maybe this is stuff you already knew though.  So, you can try to adjust your values on your own.  Autotune would be the easier in my opinion.
Title: Re: PID controller settings?
Post by: kdttocs on March 09, 2013, 02:54:23 AM
PID values are completely unique to the system being used, even the temps being used at (direct/indirect heat, doubleboil, recirc.. A duel setup for example that does cheesemaking and Sous Vide will require different PID values. It's all a combination of volume/heating capacity, power of heating system, time, etc (that an unscientific list :) ).

Autotune MUST be run to completion. It's the best way to get as close as possible to the correct settings. In my setup I found that once autotune runs, it helped to de-tune it as my temps kept creeping up.

Also, there's no better way to maintain temps in large vats at home than direct heating on a recirculating waterbath setup. I'm working on a vat that has recirculating waterbath through a waterheater element in a pipe where output temps are monitored by the PID right after the heating element.
Title: Re: PID controller settings?
Post by: mjr522 on March 09, 2013, 03:13:15 AM
Also, there's no better way to maintain temps in large vats at home than direct heating on a recirculating waterbath setup.

That's a lot of confidence. ;)
Title: Re: PID controller settings?
Post by: kdttocs on April 03, 2013, 11:03:11 PM
Thought I would update this thread with some more info I've learned recently. PID controllers can run in PID, PI, and PD configurations simply by setting the value to 0. PD is very uncommon though. When tuning your PID I've found it's best to work only with PI and set D to 0. D essentially adds a predictive element and can only be used when using an RTD probe. If you're using a thermocouple, the erratic temp reads causes any value you set to D to get confused.

With autotune settings I had difficulty tuning my PID when used on a turkey roaster with a small water pump. I had problems with temp creep and sever overshooting. This last week I threw out any autotune settings set and started with some simple values:

P: 2% (.02)
I: 2000
D: 0

What resulted was a very quick and short response to small deviations to the target temp. This worked when trying to hold a water bath at 90F and at 134.6F. I made a 60 hour sous vide short ribs and then following day made a caerphilly. I only modified the PID values slightly to slow down the reaction to temp changes. It should be noted that I use a double-boil in the turkey roaster rather than direct heating to the milk.

Here are my current values. These allowed me to keep agitated water within +- 0.1F of 134.6F. The lack of a significant D value does result in an overshoot by a few degrees when heating up. This can easily be overcome either by prewarming and letting it stabilize or by starting with cold milk as the milk will lower the overshot temp before the milk has a chance to overheat.

P: 5% (.05)
I: 5000
D 5

I threw in 5 for D to see what it would do. I'm not sure it did much as it may be way too small to notice. I've kept it nonetheless.

Here's my setup... yes water and electricity don't mix. This was when I first tested before I dremeled the case to hold everything.