PID Parameter help

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.

acarter5251

Well-Known Member
Joined
Dec 22, 2013
Messages
296
Reaction score
17
I just got my new EBIAB system set up and am having trouble with my PID. I tried autotuning, which seemed to go successfully, except that after autotuning, the controller kept turning the element on and off at the same rate even after the set point was reached. I finally turned it off once it reached about 5 degrees above my set point. I then searched through the forums here and found the advice to keep the default settings and only change I to a value of 1. This helped some as the temperature reached the set point, and the burner turned off. This resulted in an overshoot of about 1 degree.

I was just wondering what I should do to optimize my PID parameters to reach and hold a steady mash temperature in my system?
 
Please provide us with the model/type of PID and the settings.

Regardless of the PID settings, once the set point is reached the PID should hold temp.

Please also explain your method for autotuning.
 
Please provide us with the model/type of PID and the settings.

Regardless of the PID settings, once the set point is reached the PID should hold temp.

Please also explain your method for autotuning.

Sorry its a MyPin TA4. Currently I have it set to P=3, I=1, D=off

For autotuning, I heated a similar amount of water that I would use to make a batch of beer to about 140. I set my PID to 150 and set it to do an autotuning. It heated, overshot and allowed to cool a few times and the autotune light came off.
 
Getting to within 1 degree seems about right. You might have to change the precision of the control from single degrees to tenths of a degree.

When you tuned with the water, were you recirculating it at all, especially near the temp probe? Without mixing there would be hot and cold spots with in your kettle.

Wish I could help you more, but I don't use a MyPin controller.
 
Getting to within 1 degree seems about right. You might have to change the precision of the control from single degrees to tenths of a degree.

When you tuned with the water, were you recirculating it at all, especially near the temp probe? Without mixing there would be hot and cold spots with in your kettle.

Wish I could help you more, but I don't use a MyPin controller.

I have a pump that recirculates from the bottom and back in through the lid. My probe is connected at the tee where the water circulates back in. Thanks!
 
The D will keep the controller from over shooting the setpoint (SP), kinda. The D looks at how fast the Process Value (PV), or in our case the temp, is changing. If the D sees the PV changing rapidly (temp increasing fast) and we are approaching the SP, the D will pull back on the heater output. If the PV is approaching the SP too fast the D will reduce the output of the heater.


After the auto tune what were the P, I and D numbers?
 
The D will keep the controller from over shooting the setpoint (SP), kinda. The D looks at how fast the Process Value (PV), or in our case the temp, is changing. If the D sees the PV changing rapidly (temp increasing fast) and we are approaching the SP, the D will pull back on the heater output. If the PV is approaching the SP too fast the D will reduce the output of the heater.





After the auto tune what were the P, I and D numbers?


I don't remember exactly but they were fairly large. Does the set point that I use for autotuning make any difference. For example would it matter if I used a set point of 100 vs 150 degrees?
 
Suggested parameters for the system I have are P=1 I=30 and D=2 on an auber PID but I'm not sure if this translates to the same values for a my pin PID
 
The SP for auto tune should be around the temp you are going to use the controller at. Auto tune the controller with everything, temp, water volume etc. the same as you are going to use it. The controller sees different loads, it is not liner, if the SP temperature, water volume etc. are different then the tuning.

The P I and D numbers don't transfer from one type of controller to the next real well. Manufactures use different equations and terminology for there controllers. Some use gain for P and some use proportional band for P or PB. I and D can be in any time unit, sec, min, hour..... Also I and D can be time/repeat or repeat/time.

After the auto tune how does the system react to a temp change of say a 10* increase of SP? It should over shoot a few degrees and then settle on the SP. If you don't want the small over shoot it can be tuned out but the controller will take longer to get to SP.
 
The SP for auto tune should be around the temp you are going to use the controller at. Auto tune the controller with everything, temp, water volume etc. the same as you are going to use it. The controller sees different loads, it is not liner, if the SP temperature, water volume etc. are different then the tuning.

The P I and D numbers don't transfer from one type of controller to the next real well. Manufactures use different equations and terminology for there controllers. Some use gain for P and some use proportional band for P or PB. I and D can be in any time unit, sec, min, hour..... Also I and D can be time/repeat or repeat/time.

After the auto tune how does the system react to a temp change of say a 10* increase of SP? It should over shoot a few degrees and then settle on the SP. If you don't want the small over shoot it can be tuned out but the controller will take longer to get to SP.

After autotuning, if you change the SP by 10 degrees, the controller will reach temperature and overshoot, after which the controller starts firing the element intermittently. However, it keeps firing at roughly the same rate and the temperature keeps increasing. I have been cutting off the controller once it gets about 10 degrees above the set point, so I don't know if it ever allows the temperature to come down again.

I did try it with P=3, I=1 and D off which resulted in an overshoot of about 1-2 degrees and holding around 1 degree above the set point, so I may just go with that and tinker from there?
 
I've been doing some research on how everything works and I think I may have a handle on what to do. Since my controller uses proportional band for P, lowering the value should cause the controller to start backing off earlier, minimizing overshoot correct? So in theory, could I optimize P to minimize overshoot while still reaching my SP quickly, then adjust my I parameter to best hold my SP?

I think my main issue is that it heats up a lot quicker than it cools down and so the PID keeps firing expecting a quicker drop in temperature.
 
could I optimize P to minimize overshoot while still reaching my SP quickly

No. You would need at least the P and D. The controller output is calculated from three different equations.

error = PV - SP

P output = P*error
I output = i*(the sum of all errors)
D output = d*(current error-last error)

Controller output = P output + I output + D output:drunk:

This equation is simplified some what. P looks at the present, I looks at the past and D looks into the future. A P only controller will never reach the setpoint, it will always be low. If you want to get to SP fast the P needs to be made more sensitive and then use the D to pull back the output as the PV nears the SP. Well tuned controller will go full output till the PV gets kinda close to the SP, the P input. The heater will then turn off as the temp coasts up to the SP, this is the D input. Some where close to the SP the controller will then cycle the heater to keep it at SP and the I input will fine tune the output to SP.

Best way I can describe this is driving, we will always use a PID for gas and brake. I want to go from 0 to 60 mph as fast as I can but not over shoot. I floor the gas (100% output) P. Some where about 55 mph I let up on the gas fully so I don't over shoot 60, D. Then I give , say 50% gas to stay at 60 and if I am off a little I give more or less gas to stay there, I
 
If you want to read more about PID controllers I think this is a good place to start.

http://www.automationdirect.com/static/manuals/d2user/ch8.pdf

Capture.JPG
 
Did you get it sorted out? I want to see you get brewing with the new system:)

Not yet, but hopefully soon. The PID I have is different than the ones used in your controller, so I can't just transfer parameters it seems. I have it pretty close to being tuned how I want it, but will probably fiddle with the parameters a bit more to get it just right. I hope to maybe brew something next weekend.
 
I'm glad to say that I tweaked my parameters a bit and it is holding within half of a degree of my set point. Thanks everyone for the help!
 
What was your process of "tweaking" and where did you start?

Really all I did was adjust P, I and D independently to see their effect on the regulation of the temperature.

First, I noticed that by lowering the P, I could get the element to turn off earlier and therefore minimize the overshoot, so I set that to a value that gave me an overshoot of 0.5 degrees or less (P=0.5 in my case). I did this mainly because my system seems to heat up a lot more quickly than it cools down, so by minimizing overshoot, I can get it to my desired temperature more quickly.

Next, I found that higher I values caused my system to be unstable and it was suggested that I try a I=1. This value seemed to keep me from going all over the place with my temperature so I kept that.

Finally, I tried a few different values for D and found that with higher values, the element would cozy its way to my set point so I went with a D value of about 120.

I was mainly looking to get parameters where I would get pretty close to my set point on approach to minimize oscillations, which would take a long time to occur with my slow-cooling system.
 
Way to get it going! Keep us posted...


Got in my first brew on the new system yesterday. Ran into a few issues but nothing major and beer should be the result so that's always good.
I did have a few questions though. First, how do you disconnect your pump lines without getting wort everywhere, or do you just leave them attached? Also, how much boil off do you typically get with the unibrau mini?

View attachment 274079
View attachment 274080

The new system filled with water and ready to go

View attachment 274081

The start of my mash

View attachment 274082

Towards the end of my mash things started getting foamy

View attachment 274083

Starting the boil
 
I don't disconnect any of the fittings until boil but yes there is always a little spill for sure when you pull apart a fitting. To minimize spillage I close the ball valve and disconnect the tubing at the lid only. I remove the lid and keep the tubing female connect end over the lid of the pot. Boil off is usually around a 1/2 gallon for 3G batch.
I keep the tubing connected because I run pump and chiller back through the lid and replace the lid half cocked for the last 10 minutes to sanitize the pump, ball valve, plate chiller and tubing. This way after boil I pump through the plate chiller and into the fermentor.
 
I have four of these mypins and they all work very well for me by never doing the autotuning and just changing the "I" value to 1... this way they perform just as well whether I'm brewing a 5 gallon or a ten gallon batch of beer. its my understanding that autotuning works best if you always working with a specific amount of liquid and varying that a large amount throws off performance..

I set my system up so I dont have to remove any hoses during a brew, just turn a couple three way valves... I hated having to fiddle with drip pans all the time.
 
its my understanding that autotuning works best if you always working with a specific amount of liquid and varying that a large amount throws off performance..

Absolutely. This is one of the big limitations of PID control. Each 'load' has its own tuneset. Change the load without changing the tuneset and performance is degraded. PID control requires a model of the load and it is the purpose of autotuning to discover that model.

The Auber controllers use some combination of fuzzy and PID control and I believe the Mypin units do too. Fuzzy control is somewhat (but not entirely) immune to the modeling problem and therefore should give you a little more flexibility WRT tuning but keep in mind that P, I and D, do not mean the same thing in a fuzzy controller as they do in a PID controller although they mean similar things (relative importance of the error, its derivative and its integral).
 
acarter, have you brewed more batches using p=0.5, i=1, d=120? Is it still working out for you? My td4 still likes to fire when I'm already over the target temperature, which is really frustrating when trying to mash a lager at 148!
 
acarter, have you brewed more batches using p=0.5, i=1, d=120? Is it still working out for you? My td4 still likes to fire when I'm already over the target temperature, which is really frustrating when trying to mash a lager at 148!


I haven't. I've gone back to my stovetop brewing for now until I get into a place with a little bit larger of a kitchen. It's just a little difficult to set up everything with the little counterspace that I have inside and I don't have anywhere to brew outside
 
Here are some great instructions on PID tuning. They are tailored to Strangebrew Elsinore but no reason you couldn't put your PID in manual mode and do the same.

http://onbrewing.com/strangebrew-elsinore-faqbrewery-calibration-pid-setting-specification/

Also, he provides a webapp to simply plug your numbers into from the instructions and get the results.

https://jangevaare.shinyapps.io/pidcalculateR/

Hope this helps! Sure helped me.

Thanks for the referral. This method works, but it takes a very long time!

For a quicker alternative, check out this tutorial:

https://www.reddit.com/r/StrangeBrew/comments/3dnd3n/zieglernichols_pid_tuning/
 
Apologies for reviving an old thread, but I just wanted to note that after reading through the forums and trying a few things out, the MyPin TD4 PID settings that work like a charm for me are:

P=3, I=1, D=5

Temps are almost 100% within a degree in either direction (usually higher, FYI).

Maybe that can help out someone else like it did for me.
 
Back
Top