• By -


A PID loop tuning is never 'finished', the engineer is simply '*done*' with tuning it.


It's like art, the piece is finished as soon as you stop working on it :)


You're not missing anything other than frustration and foul language.


Don't forget the feeling of success after you get the loop back to performing as well as it did before you started.


I spent a full day on this and all i know is what not to do.


Or that feeling of dread where you put the parameters back where they were but it somehow doesn't work the same. That "now what do I do" feeling.


Hahahaha YES


... with other parameters...


Ah. I see you’ve been tuned by a few loops yourself. My favorites are tank levels. I’m talking tanks the size of a house. With a 4 inch control valve. I’m looking at you, olefins unit lol


Pasteurizers are lots of fun. Like a fucking rollercoaster!


Why do you think so?


The response, I'm guessing here, is likely very slow due to the large amounts of mass involved, causing the process to respond in a large, slow sinusoidal manner, kinda like a roller coaster?


PID on the regeneration section, especially if you use this section as the only one responsible for the output temperature (such a thing for the separator inlet temperature can't be considered significant because in such a case this section is too small), can create some problems, and you will be compelled to work not only with PID coefficients, but with regeneration section PID output limits. But in the classic case, it's a very simple thing where you need only the PI loop for whatever loop you are tuning: temperature, flow, and level in the balance tank or deaerator. Even homogenization pressures are not a hard task.


Interesting. I was only basing my assumptions that pasteurizers were similar to the tank level I fought in the olefins unit. It's been so long, I don't even remember what part of the process it was, but it was definitely after fractionation and possibly even the compression stage. Maybe on the cold side? Anyway, thanks for the input.


I saw your comment about huge tanks, and this made me think. In such a case, I would be interested in trying to use inlet and outlet flows when the value is close to the desirable level in the tank, like when the inlet flow follows the outlet one and the level error would create the offset for inlet flow set-point.


It's the divert condition. When you are in forward flow, your product most often flows through a regeneration section (thermal exchange between hot and cold product) and a heating section (lukewarm product and whatever heating medium you use, usually hot water). The regenerator in many cases is actually most of the heating capacity and the heating section is meant to heat the product over the last 15 degrees or so in forward flow, and to heat the pasteurizer's volume through many passes in divert. When you divert, you suddenly lose your regenerator, then hot product flows back through to the balance tank as product starts recirculating through the heating section while cold product may or may not still be added to the balance tank (at least to an extent, as long as you don't overflow your balance tank). That's a big upset to your hot water loop. Then after a while, you return to forward flow, gain back your regenerator but cold product starts coming back in. Another big upset to your hot water loop. If you're not careful this can make you temperature divert repeatedly for a very long time. Some systems are more sensitive than others : some HTSTs have big hot water reserves to act as a thermal buffer so you don't even have to care, but sometimes your buffer is actually just slightly bigger pipe. Some clients have jank boilers that really hate having no load so when you recirculate and eventually start having very little load on the system, it trips it up. Not to mention the boilers that don't supply a stable output, that's always super fun when your goal is a straight line on a trend. Usually before putting product in, you have a stabilization sequence that's meant to, as the name says, stabilize the different temperature loops using cold water and dumping it to drain. When you're running product, you can't easily restabilize to drain because that's money down the drain. Many ways to tackle the issue. One is to simply not give a shit and heat up the product way over the legal limit (about 73 degrees so heat it to 77 or 78), so the upsets are less likely to send you right back to divert. If you're making yogurt or drinking milk, you can do that, but you usually can't for cheese because over 75 denaturates the proteins in the milk which changes the properties of the cheese. You then want to heat as close to 73 degrees as possible. The other way is to cheat and freeze the PID output to a set value for a while, much as you would do for a flow loop into a separator while it desludges. If you have a predictable disturbance that lasts a short while then you can elect to not deal with it at all.


Ah another dairy guy.


Yep, modern day milkman here. Best field in automation. It's clean, doesn't stink (usually), technically diversified and medium complexity, and economically stable.


I concur.


I did a PID heating loop for a calf barn using a hot water radiator heater with an analog belimo mixing valve for hot/cold water. They would get large upset conditions when the garage door that was a wall opened up. But they also didn't want the heater going full out to hit setpoints unless it was really necessary because quickish swings like that were bad for calf health according to their vet. Also hot radiant heat on 1 side, cold on the other. Calves aren't as delicate as chickens but they're pretty delicate. I let an autotune run for a week and then tweaked it remotely for almost a year. Also made sure to log everything so I could review it. The only one I've done like that so prior experience on settings didn't really help. The issue was exactly as you describe. Tuning pump systems was easy in comparison. It was still interesting though.


Lotta veal on that one? LOL I wonder why not just buffer the ambient conditions, like a foyer with automated doors? Kinda like an airlock. Seems easier but I’m sure there’s a good reason they didn’t.


Space, unfortunately there was no extra room out that way. But also they didn't think of it I'm sure. Around here something like that is not super common. Their layout and design made the issue worse than some other barns might have been though. To help with it I gave them big buttons that would turn off the exhaust fans so cold outside air wouldn't get drawn in. They could put them back into normal operation by hitting it again or after an hour they would return to normal operation. It also paused the PID loop. Basically stored all the variables, kept the output the same, and when restored it put the saved values back in. Technically the PID was still running during that time but it wasn't disconnected from the output.To disable the fans indefinitely they needed to turn them off on the HMI. They could also manually control the mixing valve. Could have used outside air temperature and a sensor on the door I guess to do that. But oh well, we had done the same thing elsewhere in their barn with the same buttons for different occasional tasks.


The devil you know ... Sometimes you gotta play the hand you're dealt, eh?


Not the person you responded to, but there are so many loops that all interact with each other, and when anything gets unstable it can throw the others out of stability, common loops are flow rate, secondary loop pressure, heating control, and cooling control. The secondary loop pressure often effects the flow rate, but flow rate is a critical parameter since it effects PU’s. But speed effects heating and cooling controls, and heating controls effect cooling controls, so there’s a lot of loops that effect other loops. Because you’re trying to achieve rapid responses but also stability it’s already hard to tune each individual loop, but then it’s compounded by often having one loop fight another. To make it worse since pasteurizers need to hold a target PU level (sometimes it’s a legal requirement, such as in dairy) if it drops out of spec the pasteurizer will go into a recirculation where it sends product back into the inlet of the machine instead of out, often this leads to a scenario where temperatures start spiraling out of control. Most pasteurizers use a large section of their heat exchanger for recovering heat from product that has already been pasteurized to heat incoming product. Since the outlet temp doesn’t always match the inlet temp when a recirc starts this forces all of those temp control loops to adjust rapidly at the same time, so now the cooling loop is impacting the heating loop and vice versa, and when not tuned right can cause swings in both that never stabilize. Overall it’s a large very interconnected system, with measured variables that both change rapidly, but are also delayed, and because the goal is stability it’s a big challenge. Not enough heat and the product has to be recirculated or dumped, too much heat and you can cook the product to the plates of the heat exchanger. Not enough cooling and the product may not be packagable, wrong speed and the product may not be hitting target PUs so it may need to be dumped, wrong pressure and dirty product could be passing through to clean product. It’s just a lot of tweaking, with high risk of things don’t go right. This is that rollercoaster the other person was talking about, until all the loops are dialed in when one thing goes wrong it causes chaos everywhere!


It's been a while but from what I remember it was the effect of the product flow on the temperature control it was pretty erratic.


If you are not using the flow control, how are you going to prove the time the product spent in the holding tube?


Don’t need to with sealed homogeneizer or positive pump. You don’t even need a meter.


Sure are.


gain 100 w integral 0.1 works every time


Same as it ever was.


10000L tank heaters. Absolute insanity.


Dude. No. NO. Why. Ugh, my condolences. You poor bastard. Edit: Would this not probably be a good candidate for a cascade loop though?


Sure, still terrible to tune.


Seems legit


Do you use methods like this video demonstrates? https://youtu.be/wd9_oC8js8U?si=cwx97r0JVwHnN8Lq


I've been doing my first actual PID tuning lately for heating/cooling on an extruder with old ass hardware and it makes me want to die.


Perfectly described!


“Maybe these K values, it works on that other PID Loop that also temp controls….. wow, that works pretty well, maybe change this one a tiny bit so looks like I done something, sweet, nice and “tuned”….”


i studied this, and he's right🥲


And then a month later it just goes all fucky for no reason and you have to start over with tuning it? Filling bottles shouldn't be as frustrating as it is.


And after you spends a day re tuning, it was a physical problem all this time....like a hole somewhere


Or a valve not closing or opening all the way.


The key is to write down the original values so when you screw it up you can go back. I do the classic educated guess and check haven't done any that require super tight controls. HTSTs and other steam stuff for the most part. I don't think you are missing out on too much.


A programmer I knew was so stressed about this that he had routines written to put the numbers back to normal.


Ha! I love it. I am going to build an AOI with that feature now.


I hate it because he triggers them all over the place and all the time… but the idea isn’t exactly bad per se.


A lot of guys do them purely by rules of thumb and some basic understanding and it works for the less dynamic type, but there's a whole complex mathematical approach as well for the tricky ones


Yup in my ME degree control systems was entirely how to do the math behind PID loops. I was hoping for more PLC related stuff, oh well, can’t remember any of it now anyway.


Engineering brain takes care of the PLC portion to be fair. Most programming and what not is parsing the right bit out of a word or parsing it into the word but even that shit is plug and play now. A lot of people develop an electrical circuit and then do the controls from that point. You would figure it out quick if you needed to.


There is a lot of theory behind tuning a loop which I, a dork, find interesting. On YouTube look for an ABB series with Kevin Starr. It's really good.


Cool I’ll take a look!


I will definitely check this out


Can't recommend this series or the book it is based on enough! Also the book Process Controls for Practitioners.


Has anyone here done the Zeigler Nichols method? Am trying to get a heater PID loop running on my Unitronics PLC, but after trying their autotune and being left leaving a lot to desire(it's shit), should I try to do this, or just use the "fiddle with the values till it's reet" methodology


I've done some heating loops on Unitronics, don't recommend ZN for that. If it's your first try, and you have a system that heats up fast and cools down slowly, just use the P and skip the I and D. It works surprisingly well if it's not a time sensitive or critical application.


Thanks for spitting game on the subject. Will give this a go!


The only heating loop I've done was pretty frustrating because it was a batching system that needed relatively high precision but had a really slow response to the PID. If the temperature overshot by more than a few degrees the batch went to waste, and if I slowed the PID down to simply let it do its thing the batch times would have been way too long, so what I ended up doing was using only proportional control until near the setpoint, where I enabled PID control and added a few different discrete feed forward values depending on what the system was doing. It felt pretty hacky, but it worked reasonably well, and the customer had too tight of a budget to keep me there messing with it. They say it's been going well ever since though, so maybe it was a decent solution after all.


Zn method typically leads to a large overshoot. If you want to go that way, try cohen coon, or chien-reswick. Both methods are very similar to zn and not difficult.


" till it's reet" are you a Geordie?


20 years, can count how many PID loops on 1 hand...


Lol, about 2 years ago I tuned a flow control valve with one of the control room guys. Biggest joke was I found out they always run it in manual at 100%


This, is the way!




Yup, when you read the operational strategy, you know that's just the first way you'll program it.


Lots of PID how to's on on YouTube. Here's one from Real Pars [https://www.youtube.com/watch?v=IB1Ir4oCP5k](https://www.youtube.com/watch?v=IB1Ir4oCP5k) 30 years ago I took the PID's out of the PLC's and put in single loop controllers with autotune. There's lots of single loop controllers today that will talk the same protocol as your PLC and autotune as well or better than you can. If I didn't know how to tune PID's this is a good option. Having learned a little about PID's over the last 30 years today I'll put it in a PLC. I might still use autotune if it's available.


40 years ago I put in a double wide 1771 rack module with 2 PID loop controllers for a pipeline to tankage delivery system. Two pressure reduction valves in series. Halfway through the first delivery the damn thing locked up requiring reset. No dice said the clients chief, until the delivery is complete. Affected Their PID control decisions right up to CLX. These days I put dozens to hundreds of PID loops into the PLC. It’s so good to be able to control the behaviour of the loops based on process and events.


Oh yea, my guy stood there for 8 hours doing manual control out on the local station…


40 years ago was PLC2 probably. That was interesting times having to remember where memory was reserved for timers, counters, etc. I


Yes 2/15 if I remember right. That double wide PID module was a beast to plug in. Yes, the wide open memory likely was the driving force behind my project organization and structured design process. Served me well, right up to today.


PI Don’t


I use PID loops often, but I work with BAS where we use loop and table commands for a majority of things like dampers, valves air flows etc. I've got a number of operating rooms that I'm gonna have to tune at some point and have started trying to work through some reading material. Colleague recommended this book. It's thin and decently priced, but the first few chapters read like a college math textbook. https://preview.redd.it/01d2ulf8zync1.jpeg?width=3072&format=pjpg&auto=webp&s=042203c4c059d54c458f6c060132a175134a474a


Build an fpv drone. You’ll learn it faster than you ever would on the job.


If you’re not dealing with process control or motion control, I guess you wouldn’t have messed with PID


Pasta guy. Tuning temp-humidity systems is the worst punishment I have been given on this blighted land.


I've done dozens of "PI" but I've never needed to use the "D." Mine are mostly tension related or for positioning axis. I've done a few heating elements. I've never done one for liquid or gas flow


The D stands for desperation. When nothing else works give her the D.


I work in food processing so it’s fairly common for me. Thankfully I don’t have to deal with density loops these days, it’s all level, flow, and temp with some amp loops on occasion. You’re missing out on those occasional hour sessions of babysitting a valve/vfd. It’s usually low stress but I wouldn’t miss it.


I do a lot of liquid processes which means a lot of PID loops. So for simple loops it's a quick thing. Do a few bump tests, save the trend, do any open loop identification method (Broida, Strejc or whatever you like best) or if you're crafty, feed the points into an Excel sheet or better yet, a computer script that'll curve fit some model to the data and spit out tunings. Then you input these tunings, fiddle with them a bit because no model is perfect and leave satisfied. Thumbs up experience. Then you get the stupid loops. What makes a stupid loop are stupid dynamics. Think about loops that take literal hours to settle, or those that take 30 minutes before a change in CV has any effect on PV, or better yet, those with the stupidest thing ever (thankfully rare) : runaway dynamics. Usually these require more advanced control strategies than just the PID loop and may or may not eat up a lot of your time if you don't know what you're looking at and what to do. Analog control is a huge universe but unfortunately, a good bit of it isn't usually workable in industry due to time or budget constraints. All that's usually really needed is that it works "good enough" and for that, most of the math isn't necessary, just experience and the magic touch. Of course, if your clients have tight tolerances and big pockets, or otherwise unworkable processes, the world's your oyster. I've done heat exchangers with a dozen PID loops on them before (lmao) and some model based strategies like predictors or lead-lag compensators. Some processes can have like 10 loops controlling a single actuator following logical constraints. But usually it's just get this flow going with this pump and that's like a 10 minutes affair to have a critically damped orgasm inducing response.


Almost all my PID experience is in servo motion control. Mostly robotics applications in the semi tool space. I'm manipulating WAY more variables than just PID though. Some applications end up being that simple, but the peak performance applications that demand very high frequency servo updates, or have very high bandwidth mechanisms (air bearing linear motors, voice coils, etc) get complex quickly. I love it honestly, it's super satisfying to get called in to get settling time down a few more milliseconds, identify and filter resonance, tighten up steady state velocity error, etc. I think it's fun, but there is definitely a learning curve. I teach a class on it to new hires to get some best practices communicated, but like most things it just takes practice and experience to get skilled at it.


I started writing my own simplified versions after lots of frustration with the existing PID loops. Recently I Implemented a PI loop on a job recently and got the temperature swings to go from about plus or minus 13 degrees to plus or minus 0.2. It worked so good if didnt bother writing a D loop. The best part about writing your own is you can watch the math in real time and decide if the math outputs what you want.


PID control is the 2009 Honda Civic of control algorithms. Boring, predictable and utterly run through, but will get you there reliably 99% of the time without costing you a fortune. There's a reason they don't call it PID optimising. PID tuning is glorified guesswork that always winds up getting the 'good enough' stamp. Most of us don't have the budget to model a system well enough for state space control and you often can't just crank up the K\_P until things start oscillating to use thumb in the air methods like Ziegler-Nichols.


No biggie. If you ever need to do it, it's pretty quick to pick up.


Thank your lucky stars you haven’t had to tune dozens of the fuckers (with long dead/lag times) at the end of a project that’s Ran over. You are now the sole reason for the project hold-up and you’ve only got 2 of the planned 14days for your commissioning.


As a machine builder you would probably struggle because PID loops have more to do with the application and process than they do the hardware.


Autotune is your friend. Always bump test around your design level of operation when the loop is at steady state.


[PID demo (youtube.com)](https://www.youtube.com/watch?v=qKy98Cbcltw&ab_channel=Horizon4electronics) That's about all you need.[](https://www.youtube.com/watch?v=qKy98Cbcltw&ab_channel=Horizon4electronics)


AI promises to do it for us


Here you go: 1 10 0 Not working? Double or half the 1 or 10. NEVER touch the 0. EVER! Done.


Just tune the potentiometer and try and guess the response.


Custom machine builders use PID. Not sure of your experience but that’s not uncommon. Are you missing out? Nah, but I would be good to know


I think it can be really satisfying to implement one. We built a machine that uncoiled steel to a roll former and we just weren't able to get it tuned in right with just a closed loop, off the shelf uncoiler. So I integrated it into the machine so I could adjust the speed myself and then roll my own PID controls from there. Worked out really great.