https://www.AutomationDirect.com/click-plcs
(VID-CL-0058)
This video take a deep dive into how PID actually works on the CLICK PLC so we can understand how the Freeze Bias option works and why it is important to use it. First we'll do a P only tuning, then a PI tuning without Freeze Bias and then a PI tuning with Freeze Bias so we can see the huge improvement it gives us. We also look visually at how PID works to get a better feel for exactly what the I-Term is doing.
Resources used in this series can be found here: https://library.automationdirect.com/click-plc-temperature-pid-tuning-resource-page/
Videos in this series:
Overview: https://www.automationdirect.com/VID-CL-0044
QuickStart: https://www.automationdirect.com/VID-CL-0045
Hardware: https://www.automationdirect.com/VID-CL-0046
Configure part A: https://www.automationdirect.com/VID-CL-0047
Configure part B: https://www.automationdirect.com/VID-CL-0048
AutoTune part A: https://www.automationdirect.com/VID-CL-0049
AutoTune part B: https://www.automationdirect.com/VID-CL-0050
Manual Tune part A: https://www.automationdirect.com/VID-CL-0051
Manual Tune part B : https://www.automationdirect.com/VID-CL-0052
Ramp Soak: https://www.automationdirect.com/VID-CL-0053
Loose Ends: https://www.automationdirect.com/VID-CL-0054
Bonus: Sizing Fans: https://www.automationdirect.com/VID-CL-0055
Bonus: Freeze Bias: https://www.automationdirect.com/VID-CL-0058
Bonus: C-more PID Template part A: https://www.automationdirect.com/VID-CL-0056
Bonus: C-more PID Template part B: https://www.automationdirect.com/VID-CL-0057
to understand the freeze bias option you need to understand how the P and the I portion of the PID algorithm works I'm using the same little oven demo we've been using in a previous videos and the system's holding steady at 110 degrees using a PID coefficient set from a previous video the freeze bias option is currently disabled and have also enabled bumpass mode - so the setpoint doesn't change them we enter auto mode let's get a baseline with a P only tuning I'm gonna switch to manual mode to reset everything and force the control output to 38 percent we know from our previous videos that P needs to be around 24 and I'll disable the I turn by setting it to a large number and disable the D term by setting it to zero let's switch to auto mode now remember everything PID does is relative to when we switch to auto mode in particular remember that the control output was 38% when auto mode started let's bump the setpoint up 10 degrees to 120 I'll fast forward and we see it only took about two and a half minutes to get up to temperature and it just P only tuning doesn't look bad at all does it this little oven demo system were using is responsive enough to give us a decent tuning with P only let's zoom all the way into our one second sample time so we can see how it worked now understand these one second updates are just when the display was updated they're not the actual samples that were used in the PID calculations but for argument's sake let's pretend they are the actual samples the click PID equation looks like this we've zeroed out I and D so we just need to take the error multiply it by P and add it to the original control output which we had set to 38 percent so at this sample time the setpoint rose to 120 degrees which gave us a 10 degree error which happens to be 10% of our process variables range which we had measured in a previous video to be 68 to 168 degrees put that into the equation and PID sees that it needs to modify the original control output by 240 percent well the control output only goes to 100% of course so it's slams into this rail at the next sample time if we scroll until the air is only 5% PID still has to modify the control output by over a hundred percent so the control output is still maxed out looks like when we get to about two and a half degrees the control output starts to drop why because when you put two and half degrees which happens to be two and half percent of the process variable range into the equation we see the control output drops to 98% exactly what we see on the trend view and that keeps going until the process variable gets close to the set point but there's a problem on paper this all works perfectly and the process variable settles out exactly at the set point in many real-world systems though P only tunings never come close to this set point because the error gets too small to affect change in the system this little oven demo does respond to small changes so it was able to get the process variable close to the set point but if we zoom in we do see there's still a small offset between the set point and the average process variable regardless of how big that offset is the purpose of the I term in the PID equation is to close that gap by adding a bias to the control output to remove that offset now I don't know about you but this equation in the help file doesn't do anything for me when written like this but if we realize that all this I term says is take the sample time times the first error plus the second error plus the third error etc and then distribute the sample time so now we have the sample time times the first error plus the sample time times the second error and so on and divide and multiply that by the I and the P coefficients to scale everything then it becomes very visual to see what I mean by that let's run a P I example the systems back to 110 degrees let's switch to manual mode to reset the PID algorithm and let's set the control output to 38% again this time let's enter the PEI coefficients that we got from a previous video and switch back to auto and I'll bump the set point 120 degrees again fast-forward through a few minutes and zoom in on a steady state and look at that the I term has eliminated the offset it took a while to get there but the average process variable is right at the set point well that's great but if we zoom back out we see we now have a new problem this I term created is huge overshoot and if we look at the P only step and the P I step side by side we see the P I step took twice as long for the process variable to settle out so we sacrificed our performance to get a little better steady-state what happened well remember our rewritten equation it says take two sample time times each error and sum them if we zoom in so this is roughly one sample time then graphically that equation says take one sample time times the error in other words take this area and divide multiply that by the I into P terms to scale it and add that to the control output then at the next sample time add in this area next sample time add in this area and so on so the I term is simply calculating this area between a set point and the process variable curves over here the error is negative so this area gets subtracted from the control output and eventually things all settle out so the process variable is right at the set point so the problem is when we change the set point when we get a big error which gives us a big area between the curves so the I term gets large very quickly so it'll take a long time for the smaller areas downstream to cancel that out this trace on the PID monitor is what we call the bias it's the original control output plus the I term of the equation you can see on our plot that the bias grew way past 100% and that that alone was keeping the control output saturated but if the I term is really only intended to remove the small steady state offset out here why don't we just tell it not to calculate the bias when the air is big well guess what that's exactly what the bias fries does it stops or freezes the biased calculations anytime the control output hits its min or max value okay let's enable the freeze bias function and repeat the exact same step fast-forward and we got a much better response this is P only this is P I without bias freeze and this is P I with bias freeze why did we get a better response well when the control output went to 100% the bias term was frozen at its last value look how flat the bias term is all the control output it's at a hundred percent once the control output came down out of the clouds the bias started adding up all those little areas again but since it started adding here there aren't any large areas to add up so the bias doesn't get all wound up and out of control which is why you'll hear some folks call the freeze bias option and he wind up by the way this is also why getting your sample time right is important if you have a sample time that's real long then you get a crude approximation of the area if you have a really short sample time then you get a super accurate estimate of the area but you just unnecessarily wasted a bunch of processor time so you want a sample time that's good enough you can see why the I terms units are in seconds it has to cancel the sample time which is also in seconds some PLC's will have AI and inverse seconds that just means they're multiplying the sum by I instead of dividing by I you can also see away a large value for I disables the I term dividing by a large number here makes this whole term insignificant well hopefully that gives you a better feel for how this PID stuff works and why you almost always want freeze bias enabled click here to see all the videos in this series click here to learn about automation directs free support options and click here to subscribe to our YouTube channels you'll be notified when we publish new videos
Voted #1 mid-sized employer in Atlanta
Check out our
job openings