PID help please

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Yambor44

Supporting Member
HBT Supporter
Joined
Nov 19, 2008
Messages
2,106
Reaction score
77
Location
Ocala Florida
I did a search for PID in the titles but found nothing so thought I would ask here and hope some folks are on the forum today that can help me.


I "think" I am in automatic mode.

Set temp on the PID 2352 is 150. Strike temp went to 150 and held. Then went to 155F then came back to 150. Then took off to 167. My A-M light was on. I pushed the A/M button to turn that light off and the temp slowly began to drop.

I am doing a recirculating mash, BIAB for the first time today. I doughed in. Temp started to rise again so I turned the element off. I have the element on one switch and the PID on another. This way i can see what the temp is at on the PID without the element being on.

Now, each time I flip the switch when the temp falls below 150, I hear the element boiling! I have turned the unit off and back on. Seems it is stuck in manual mode even though I "think" it is in auto mode.

Any idea's? I am reading my manual and think i am doing it right but obviously I am missing something.
 
I dod run it intially which has been a while ago. I have brewed with this setup several times and it has worked fine.

I found in the instructions how to lock out the manual mode and this is what I ended up doing so far.

Basically when the setting is A-M=0 it is in manual mode only.
A-M=1 it is in auto and manual?? (this is where mine was)
and A-M=2 it is auto only, manual locked out.

So I pressed the SET button and held it to go into settings, then pressed the SET button until reaching the A-M setting and changed it to A-M=2. Then I dropped my set temp to 148º and this held the temp at 150-151º.

I haven't had to do this before. Don't know if the recirculating has something to do with it or something else. :confused:
 
'Rehearse' with water. This will let you see how the controller behaves without wasting brewing materials. 'P' stands for 'proportional'. The controller has some 'band' around the set point, say ± 20 °. When the PV (process variable i.e. measured temperature) is below this (20 ° below the SP or 130 ° for a 150 ° SP) the controller is full on. As the temperature rises into the band the power output drops in proportion to the difference between the SP and the PV. When the PV reaches the SP the output drops to 0 and stays at 0 as long as PV > SP. But the element contains heat for a time even after the power is turned off and the temperature continues to rise. This is called 'overshoot'. To prevent it the controller accumulates (integrates - that's where the 'I') comes from the difference between the PV and the SP. A portion of the integrated difference is added to the unintegrated (proportional) signal. Finally the rate of change of the difference ('D') between the SP and PV is calculated and that difference is added to the output along with the P and I signals. The relative amounts of the three signals is determined by the thermal mass of the load, the rate at which it loses heat to the ambient and the rate at which the heating element can supply heat. For a particular combination of mass and rates there is an optimum 'tuneset' (a set of three gains for, respectively, each of P, I and D). If these aren't set properly performance will be sub optimal and dramatic overshoots and undershoots will be seen. There are various ways to get a tuneset, the easiest being to use the controllers autotune function as suggested in #2. Autotune with water and then see how the controller performs. Finally, autotune with mash in the system.

Note that even a perfectly tuned system is subject to overshoot and droop. This is the nature of PID control. Fuzzy logic controllers over come this.
 
Yambor44 said:
I dod run it intially which has been a while ago. I have brewed with this setup several times and it has worked fine.

Gotcha

Yambor44 said:
I found in the instructions how to lock out the manual mode and this is what I ended up doing so far.

Basically when the setting is A-M=0 it is in manual mode only.
A-M=1 it is in auto and manual?? (this is where mine was)
and A-M=2 it is auto only, manual locked out.

So I pressed the SET button and held it to go into settings, then pressed the SET button until reaching the A-M setting and changed it to A-M=2. Then I dropped my set temp to 148º and this held the temp at 150-151º.

I was actually looking through my manual and was about to suggest this, lol

Yambor44 said:
I haven't had to do this before. Don't know if the recirculating has something to do with it or something else. :confused:

If this is the first time recirculating on your system, then you would need to run auto tune again which would explain the runaway temps.
 
Yambor44 said:
So, I would need to do another AT while recirculating?

If this is the first time recirculating on your system and you didn't run AT with recirculation prior to today's brew, then yes. Finish up your brew day as best possible, don't try to run AT during your brew. You could even keep your spent grain from today's brew and use them in your pot/bag for thermal mass while you run a mock brew during AT.
 
'Rehearse' with water. This will let you see how the controller behaves without wasting brewing materials. 'P' stands for 'proportional'. The controller has some 'band' around the set point, say ± 20 °. When the PV (process variable i.e. measured temperature) is below this (20 ° below the SP or 130 ° for a 150 ° SP) the controller is full on. As the temperature rises into the band the power output drops in proportion to the difference between the SP and the PV. When the PV reaches the SP the output drops to 0 and stays at 0 as long as PV > SP. But the element contains heat for a time even after the power is turned off and the temperature continues to rise. This is called 'overshoot'. To prevent it the controller accumulates (integrates - that's where the 'I') comes from the difference between the PV and the SP. A portion of the integrated difference is added to the unintegrated (proportional) signal. Finally the rate of change of the difference ('D') between the SP and PV is calculated and that difference is added to the output along with the P and I signals. The relative amounts of the three signals is determined by the thermal mass of the load, the rate at which it loses heat to the ambient and the rate at which the heating element can supply heat. For a particular combination of mass and rates there is an optimum 'tuneset' (a set of three gains for, respectively, each of P, I and D). If these aren't set properly performance will be sub optimal and dramatic overshoots and undershoots will be seen. There are various ways to get a tuneset, the easiest being to use the controllers autotune function as suggested in #2. Autotune with water and then see how the controller performs. Finally, autotune with mash in the system.

Note that even a perfectly tuned system is subject to overshoot and droop. This is the nature of PID control. Fuzzy logic controllers over come this.

Thank you!! Very detailed and took me a couple of reads to comprehend!

:mug:
 
If this is the first time recirculating on your system and you didn't run AT with recirculation prior to today's brew, then yes. Finish up your brew day as best possible, don't try to run AT during your brew. You could even keep your spent grain from today's brew and use them in your pot/bag for thermal mass while you run a mock brew during AT.

Good idea! I do have my grains left and still in the bag. Now I just have to re-read and figure out how to run Auto Tune!! :p
 
'Rehearse' with water. This will let you see how the controller behaves without wasting brewing materials. 'P' stands for 'proportional'. The controller has some 'band' around the set point, say ± 20 °. When the PV (process variable i.e. measured temperature) is below this (20 ° below the SP or 130 ° for a 150 ° SP) the controller is full on. As the temperature rises into the band the power output drops in proportion to the difference between the SP and the PV. When the PV reaches the SP the output drops to 0 and stays at 0 as long as PV > SP. But the element contains heat for a time even after the power is turned off and the temperature continues to rise. This is called 'overshoot'. To prevent it the controller accumulates (integrates - that's where the 'I') comes from the difference between the PV and the SP. A portion of the integrated difference is added to the unintegrated (proportional) signal. Finally the rate of change of the difference ('D') between the SP and PV is calculated and that difference is added to the output along with the P and I signals. The relative amounts of the three signals is determined by the thermal mass of the load, the rate at which it loses heat to the ambient and the rate at which the heating element can supply heat. For a particular combination of mass and rates there is an optimum 'tuneset' (a set of three gains for, respectively, each of P, I and D). If these aren't set properly performance will be sub optimal and dramatic overshoots and undershoots will be seen. There are various ways to get a tuneset, the easiest being to use the controllers autotune function as suggested in #2. Autotune with water and then see how the controller performs. Finally, autotune with mash in the system.

Note that even a perfectly tuned system is subject to overshoot and droop. This is the nature of PID control. Fuzzy logic controllers over come this.

Although you provide a wealth of knowledge here, I would beg to differ on a couple of points on the behalf of the OP.
The power output to the element does drop off in proportion to the SP and by the time the SP is reached the element should be the same temp as the solution the temp probe is sensing. That is what true proportional control is. There should be no overshooting (on any detectable level that is).
A perfectly tuned system should be just that, perfect.
I setup and program PID position control systems and they have to be perfect, no overshooting or oscillating. If these systems were unstable, I would probably be out of a job.
Even our hydraulic system heaters which operate only on a differential based thermostat maintains the set point, give or take a degree or two.
 
The power output to the element does drop off in proportion to the SP and by the time the SP is reached the element should be the same temp as the solution the temp probe is sensing. That is what true proportional control is.
In true proportional control one part of the output is proportional to the difference between the SP and the PV. When the PV reaches the SP then there is 0 output. If the thermal masses of heater and load were both infinitessimal so that their thermal time constants were effectively 0 and there were no losses to the environment then a proportional controller would go straight to the set point and stay there. But that's not the real world. To deal with the simplest of these concepts if there is heat loss the element must be partially on i.e. supplying heat to the load in order to make up for those losses. Under these conditions a P only controller cannot hold the set point. It has to take the load to a temperature somewhat below the set point so that there is a finite difference between SP and PV in order that there be output to maintain a heat flow into the load. A P only system is a 0th order loop. It can follow change in setpoint but it cannot reach setpoint.

So now suppose that the error (SP - PV) controls a pump which pumps water into a can. And lets suppose the weight of that can of water controls the power output to the heater. The heavier the can the more heat. When we turn the system on (there is no P component to this system) the can is empty and there is no heat applied but this results in a large flow of water because SP - PV is large so the can starts to fill quickly and heat starts to be applied to the load. This results in its temperature rising so that SP - PV becomes smaller and the rate of flow of water into the can decreases but it keeps getting heavier and so more heat is applied which causes the temperature of the load to rise further. At some point PV = SP and the pump goes off but there is still water in the can and thus still heat being applied to the load. This heat balances the heat lost so that the system holds at PV = SP.

In the real world there is a time lag between when heat is applied and when the temperature rises and there is also a time lag between when the temperature reaches a certain value and the device measuring it senses that. Thus PV does not represent the true state of the system to include recent heat inputs. This is the reason for overshoot and droop. It also explains, in part why the response of a system like this (an integral system) is slow. The other part is that the error signal has to 'integrate up'

So a Proportional system never reaches SP and an Integral system is slow responding and overshoots. Neither by itself will satisfactorily solve the control problem and so that is why they are combined in a PI system.


We can compensate for overshoot to some extent by observing that (PV-SP) does not change over time and adding extra heat in proportion to the rate of change of (PV-SP) with time. If the system is drooping then extra heat is added. This is the I channel in a PID system.

There should be no overshooting (on any detectable level that is).
A perfectly tuned system should be just that, perfect.

What is a perfectly tuned system? To my way of thinking it is one response to a unit step in SP would be a unit step in temperature. There is no such system. In coming up with a tuneset we must make compromises. If we want quick response we will have to accept overshoot and droop. If we allow no overshoot we have to accept an overdamped system which takes a long time to come to SP.

I setup and program PID position control systems and they have to be perfect,

Were there such a thing the world would be beating a path to your door.


no overshooting or oscillating.

This is, then, how you have done your tradeoff. To completely damp overshoot you must accept slower response.


If these systems were unstable, I would probably be out of a job.
Then you better tune them so they don't overshoot. Stability is a different issue. When I say that overshoot and droop are part of the world of PID I am assuming that the systems are properly tuned such that overshoot and droop damp out eventually.

Tuning a PID controller used to be an art. Now you just push the autotune button. The resulting tuneset is not perfect nor is it necessarily the best tuneset for the given application. It represents the algorithm designers compromise. For a given application it is often advisable to tweak the autotune parameters in order to best fit the application.

Brewing is a tough application for PID controllers because and input heat pulse may take a fraction of a minute to propagate throughout the mash and it is hard to mix mash uniformly enough that a sensor at one particular point accurately reflects the temperature of the whole mash.


Even our hydraulic system heaters which operate only on a differential based thermostat maintains the set point, give or take a degree or two.

I'm not sure I understand the relevance of this point to the current discussion. The differential in a differential controller is not the same as the differential in a PID controller.
 
What you have stated is true.
I am not comparing apples to apples here.
I'm simply trying to state a point for the OP that using PID controls you should be able to get a whole lot more control over his temperature than he is and it is not necessarily the nature of the beast.
And my hydraulic system statement was just an example of accuracy using a simple thermostat with a small differential setting to avoid large temperature swings.
My statement of PID being perfect may have been overstated as nothing in this world is perfect. Although there are a lot of systems out there that are fast and accurate such as motion controls in robotics or positioning systems in manufacturing, we can't compare these with maintaining temperature in a Mash tun.
 
I'm simply trying to state a point for the OP that using PID controls you should be able to get a whole lot more control over his temperature than he is and it is not necessarily the nature of the beast.

He potentially can but a lot depends on the system. Some just aren't good matches for PID (this is where fuzzy comes in). My last encounter with this was when my aging hippie friend asked me if I could PID (yes, he used it as a verb) his espresso machine. I was sure I had misunderstood him but that is what he meant: retrofit a PID controller into his espresso machine. Apparently this is all the rage among aging hippies with espresso machines. there are websites with instructions, discussions, tune sets and if you call Auber on the phone they know all about this. I expect they sell more controllers to this crowd than to brewers. To the point of the story. The Auber controllers they use have on/off (duty cycle) output. The espresso machine has a tiny boiler with a pretty hefty heater. The controller asks for heat and the temperature zooms. The controller says 'turn off the heat' but if the controller is in the on part of a cycle the cycle completes (would be a simple mod to have logic which resets the cycle whenever power output goes to 0) and the element itself holds so much heat even when off that the temperature continues to zoom. The thing overshoots a lot and there is no tuning scheme I can think of to reduce this to what I would consider an acceptable level (in brewing terms).

The Wikipedia article on PID control is pretty good and discusses many of the points that have come up in this thread. It also has diagrams which show the kinds of overshoot and ringing I have been talking about.
 
Thank you both for your insight. I still have not performed a new auto tune with the recirculation on as time became an issue. Sunday.

Could the challenge be that the bag is creating a pocket between the element and RTD? I hear an almost immediate gurgling (boiling) as soon as I turn the element on and the temp jumps 8-10 degrees F within seconds.

See my crude drawing below. Before I had a false bottom with legs to keep the bag away from the element but NO PUMP recirculating the wort during the mash.

9801867786_3debb508be_c.jpg
 
The problem (or part of it) may be that the RTD is located close to the heater. I don't know much about the RIMS/HERMS systems but you definitely want recirculation on when tuning. This makes sure the dynamics of the load are seen by the controller when it is trying to tune.

Perhaps the RTD should be in the pump outlet?
 
Move the RTD to a tee in the valve. This will help smooth the fluctuations, but maybe not entirely. You might want to read my Bad Kitty Brewery thread for a description of my similar problems.
 
The reason I suggested the pump output is because the system will try to regulate the temperature at the place where the RTD is located. There will be a drop across the pump. If you regulate at the pump input you can still set the mash temp to the value you want by setting SP higher by the amount of the drop.
 
So it would be better to regulate right at the pump outlet than the lid inlet? I was thinking of putting the probe in a tee on the lid but then I would need 2 RTD probes to monitor the temp of the BK coming up to temp and then again while chilling because I can't have the lid on with the IC in place. Your way, I can plug the current RTD hole in the kettle and add the tee to the pump outlet and see the wort temp when chilling BUT I won't have one in the kettle. Anyone running 2 probes and one QD wire? I'm thinking a RTD in the BK is needed so the PID knows what's going in in the BK during ramp up but is it really needed? Sorry to sound so confusing.
 
I think the inlet to the mash tun would be the best place but figured it would probably be easier to locate an RTD at the pump outlet. If you can put it right where the wort discharges into the tun that's the best as that is really what you are trying to regulate.

Multiple RTD's are easily connected and disconnected with a connector like the one shown here:
http://www.pbase.com/agamid/image/84072468

These are available from anyone who sells RTDs, thermocouples or similar gear.

I'm not really following your question about the 2nd RTD, however. The controller does not need a second input to regulate. It only needs to know the temperature of the load and have a good model (through the tuneset) of the way in which it responds to heat input from the element.
 
My second probe question:

If I place the RTD probe that I have in the BK now at either the pump outlet or lid, I will not have a RTD sensor reading when I boil seeing that I am not recirculating nor will I have the lid on the BK at this time. So I think I need two sensors. Leave the one where it is in the BK and add one to the pump outlet or at the lid.
 
My second probe question:

If I place the RTD probe that I have in the BK now at either the pump outlet or lid, I will not have a RTD sensor reading when I boil seeing that I am not recirculating nor will I have the lid on the BK at this time. So I think I need two sensors. Leave the one where it is in the BK and add one to the pump outlet or at the lid.

When you are boiling the probe really doesn't do anything. It just must be connected to the PID to keep the system functioning. You will be controlling the duty cycle in the manual mode.
 
I purchased another probe and installed it in the "T" coming out of the pump. Ran AT. Started a batch. Mash went PERFECT.

HOWEVER, now I am into the boil process and its not running right. In the past I would set my A-M to 0 for manual mode and my value at 70 for 70% power and the wort would roll perfectly for the entire boil.

NOW....the element is turning on and off so the boil is ramping up then stopping.

Any help would be much appreciated.

Rob
 
I purchased another probe and installed it in the "T" coming out of the pump. Ran AT. Started a batch. Mash went PERFECT.

HOWEVER, now I am into the boil process and its not running right. In the past I would set my A-M to 0 for manual mode and my value at 70 for 70% power and the wort would roll perfectly for the entire boil.

NOW....the element is turning on and off so the boil is ramping up then stopping.

Any help would be much appreciated.

Rob

That's how proportional output works. The element will be on 70% of the time and off 30%. If the wort cools down too much during the off time the only recourse you have is to shorten the cycle time so that it is off 3 seconds out of 10 rather than 30 out of 100, for example.
 
That's how proportional output works. The element will be on 70% of the time and off 30%. If the wort cools down too much during the off time the only recourse you have is to shorten the cycle time so that it is off 3 seconds out of 10 rather than 30 out of 100, for example.

Weird. I never noticed it before. It may have had something to do with me leaving the "false bottom" in during the boil. I have a SS pizza pan I fashioned with 4" legs to keep the bag off the element and out of the drain while recirculating.
 
I purchased another probe and installed it in the "T" coming out of the pump. Ran AT. Started a batch. Mash went PERFECT.

HOWEVER, now I am into the boil process and its not running right. In the past I would set my A-M to 0 for manual mode and my value at 70 for 70% power and the wort would roll perfectly for the entire boil.

NOW....the element is turning on and off so the boil is ramping up then stopping.

Any help would be much appreciated.

Rob

This is why PWM or a phase angle controller works better for boil than a PID in manual mode. With PWM and phase angle your heat is applied more evenly and your boil is steady.
 
No, the auto tune would have no effect here as when the controller is in manual mode all it does is set output level to whatever you have asked for. Leaving the false bottom in would not have much of an effect unless the heater is under the false bottom in which case it might. Depending on your configuration a false bottom in the kettle can be a big benefit as it traps hops. If you use some other sort of 'hop back' you might want to remove the false bottom to see if it results in improved circulation.

You should probably do some experiments to determine the 'time constant' of your system. You can do this, as suggested earlier, with water. Turn on the element and bring to a boil. Then turn the element off then back on and try to determine the longest time you can leave the power off without collapsing the boil. Then set the cycle time on the controller such that the longest off (the minimum power setting you will use) time is less than the boil collapse time. Set the controller time to the largest cycle time you can use without disrupting your boil. I assume power is being switched with an SSR but even so the on/off cycling puts stresses on, for example, the heater. Setting the controller for minumum cycles time maximizes the number of switchings and these stresses.

In 'PWM' systems (though that's really what you have here - the pulses are just long) and angle modulated systems the duty cycles are so short that they are less than the thermal time constant of the heater and the short cycling = thermal stress problem largely goes away.
 
The false bottom is above the heating element which is the purpose of it, to keep the bag from being sucked onto and around it as well as the drain.

I am setting up to do another brew. I will check the cycle time and see what it is set at. I have a feeling that the FB is part of the challenge. As soon as the element would turn off the boil would cease immediately. Probably the FB trapping the heat under it?
 
... I have a SS pizza pan I fashioned with 4" legs to keep the bag off the element and out of the drain while recirculating.

The false bottom is above the heating element which is the purpose of it, to keep the bag from being sucked onto and around it as well as the drain.

I am setting up to do another brew. I will check the cycle time and see what it is set at. I have a feeling that the FB is part of the challenge. As soon as the element would turn off the boil would cease immediately. Probably the FB trapping the heat under it?
I also think the problem is related to your false bottom. I suggest that you change it to one that is an open screen so that the fluid can pass through it.
 
I also think the problem is related to your false bottom. I suggest that you change it to one that is an open screen so that the fluid can pass through it.

Thanks Paul. Good to hear from you! I am currently about 10 minutes left in my recirculated mash. I will remove the FB this time and see how it rolls.
 
Well, pretty much doing the same thing. I know this sounds crazy, but before, when I set it to 65-70% on manual, I would get a slower, constant boil - like you were dialing it down on an electric stovetop. Now its basting vigorously when the element fires and nothing when it turns off.

I have to believe there is a setting off. I looked at the "t" (cycle) setting and it was set to 24. When i lowered it to 2 (per the instructions default) my PV reading shot up to 580 something and was acting weird and the element shut off. I reset it to 24 and it went back to normal.

I have a call into Auber (from yesterday) hopefully he will call me back tomorrow.

EDIT - should I change my output H from 100 to 70?
 
Got home early enough today to set up and give Suyi a call at Aubern Ins. we emailed back and forth and he wanted me to call him so we could go over the settings. Turns out AT changed things around enough to cause my on again off again boil issue. He helped me change some settings around so that the on again off again was quick enough that I don't lose the boil.
 
Got home early enough today to set up and give Suyi a call at Aubern Ins. we emailed back and forth and he wanted me to call him so we could go over the settings. Turns out AT changed things around enough to cause my on again off again boil issue. He helped me change some settings around so that the on again off again was quick enough that I don't lose the boil.

I was having this same problem. The person I talked to at Arber told me that they have been having problems with the SYL 2352's. Are you able to set the cycle time (T) to less than 3 now?
 
Here are my settings i changed. I ran a trial with 7 gallons of water in the kettle and it worked as my video showed. The AT knocked it out of whack for the boil.

At needs to be 3 after you run AT.
P=300
d= 37 (we didn't change that one)
t=2 (mine was at 24)
Also, Sn is at 21 that he had me change a while back if that makes a difference.

Rob
 
Back
Top