Sign in to follow this  
Followers 0
Sajid

Implementing PID Auto Tuning

16 posts in this topic

Hi People, Just curious about implementing PID algorithm with Auto Tuning feature, all with ladder logic without the use of built in PID instruction for AB ML 1200 PLCs. I have managed to implement a custom PID equation in my program, with the sole purpose of making things easy for service engineers and customers with tuning the loop.Still working on it. But then I stumbled upon "Auto Tuning" that i read about in a book. Just wanted to ask if anyone has tried this before or can you give me some ideas as to where I can find information about Auto Tuning theory/flow charts with respect to digital controllers, and then I could put it in my ladder logic. Thanks for your help/suggestions. Sajid

Share this post


Link to post
Share on other sites
I think you would be the first to implement auto tuning in ladder. Writing a PID auto tuning program can ony be done by the high priests of PID. What makes you think that these PID priest would want to give away their holy secrets? First you must seek favor of the PID priesthood by gaining a thorough understanding of mathemajic, control theory and system identification. Once these topics are mastered then you can attept to join the PID priesthood. No one tells you that you if or when you become a high priest of PID. The high priests of PID have taken a vow of silence and won't talk to you until you have proven yourself worthy. The high priest of PID rarely share thieir holy secrets with each other.. If you become a high priest you will know. You will also know how to write a PID auto tuning program. Seriously, why should any body tell you how to write auto tuning software when they are trying to sell auto tuning software? That is like giving away the goose that lays the gold eggs. Do you think the high priests of PID are stupid?

Share this post


Link to post
Share on other sites
I have read this one several times today and I keep cracking up. Nice one Peter

Share this post


Link to post
Share on other sites
Thanks Peter for your suggestion.Well I know what you are taking about.There are people who have dedicate their entire time developing Auto Tuning software so that they can make a living out of it.And whos got a problem with them?Not me. See the kind of situation I am in right now is: I have a tough time with my customers and our commissioning engineers.No matter how nicely I would explain to them,they dont want to understand the fact that if a PID closed loop control is implemented then it requires tuning to obtain best performance.So to make things easy for them I have changed a very general PID equation slightly.And guess what the system,this is a weigh feeder,works very nice and we get the kind of response that we want. And whats the next step?Auto Tuning.No harm in trying it.

Share this post


Link to post
Share on other sites
A laugh a minute when you put on your sarcasim Brother Peter

Share this post


Link to post
Share on other sites
My response was written in half in jest or sarcasm. At one time I was clueless too. No one taught me what I know now. I learned it on my own after reading about three or four books over and over and over and over again. The term 'high priests of PID' I used over 3 years ago. Here is a link to a response that I had to a newsgroup http://groups.google.com/group/sci.engr.co...99a9269a751faa4. In the mid 90s there were a bunch of old process control guys that dominated the forum. I didn't know enough to challenge them. These high priest didn't really know anything an tuned by the seat of their pants. These old farts still have websites that people refer to even though I think that most of it is useless. Sometime along the way I realized that these high priests were imposters and I because to challenge what they said. Finally I got down right in-their-face and telling them how they were wrong and I posted links to .pdf files on my web site that proves it. Now there are guys like the control guru that tells it like it is, finally. However, even now these process guys see the PID world through their process eyes. As you know I make motion controllers so almost of my applications are motion control applications but I branch out at try to understand all PID applications. Nothing winds up my integrator like someone handing out advices on systems he know nothing about. Just as bad are those that have tune 20 to 30 PID loops that are all the same and then he believes that all the PIDs are the same. Once you become a high priest of the PID you realize that it is all about plant. You have to know the plant before you can 'tune' the system and tuning isn't done anymore. See the current control guru blog topic http://www.controlguru.com/?p=89#respond This is how calculating PID gains is done. You ID the system by finding the plant gain and time constants. Then you apply the formulas that are use to CALCULATE and NOT tune the controller gains. It is very fast and efficient but it also takes the 'art' out of tuning. When I reached this point it took a while realize that I see tuning in a much different way than most. BTW, the control guru is showing how he can calculate a model so he can predict very accurately how the PV will respond to the CV for minutes into the future. When you can do that then you know your plant. There is no more guess work or trial and error. It kind of takes the fun out of it. Now I look at the threads asking for PID help. For the most part they want a quick fix and not true understanding. True understanding can't be done on a thread or couple of threads. See the Controlguru site. It takes a novel. I let someone else answer those quick fix threads as long as the information is correct. The PID gains are just ways of moving poles and zeros around. To get a desired response. Most don't even know what the desired response should be.

Share this post


Link to post
Share on other sites
as always, Peter, I am truly impressed ... (NO sarcasm intended) ... there are also many among us (myself included) who don't even know what a "pole" or a "zero" is ... is there somewhere (book, site, etc.) that you could recommend that covers that type of information? ... personally, I'd like to know more about your techniques, but I don't have the math background to understand what you're talking about ... (I’m groaning here in anticipation of a ten-pound textbook on higher math - suitable for a two-semester course at the university level) ... my own approach to "systematic" (as in slightly beyond "seat-of-the-pants") tuning is to graph the response of the system through a couple of simple tests, and then print the graph on paper ... from that graph I can usually measure, mark, and calculate my way through a systematic "starting point" of reasonable values for P, I, and D ... this method works reasonably well for MOST systems ... and it works VERY well at teaching technicians (no, not engineers) what to look for as they work on (and around) PID-controlled systems ... basically: "this is what the response looks like when it's right" ... and "this is the part of the system to start troubleshooting when the response looks wrong" ... and "here's how the Allen-Bradley PID instruction fits into the system" ... and now a note to Sajid ... about two years ago I wrote an "autotuning" algorithm for a heat control loop ... my boss wanted this done so that some equipment that our company was involved in installing could be reasonably-well “tuned” by the installers - until the engineers arrived to do the final touchup ... I used basically the same “graphical” approach that I mentioned above - but automated it for use in a QBasic application ... it worked “ok” ... while working on this project, I quickly found out that the SLC-5/05 processor did not have enough horsepower to handle the math involved ... specifically, the data needed to be captured in an array (floating point register) and then the numbers had to be crunched to find values for “maximum rate of rise” and “deadtime” and “time constant” and so on ... and then finally the recommended values for P, I, and D could be calculated ... in short, I don’t think that the MicroLogix processor you mentioned is going to be up to the data storage task ... at least not if you use the same “storage intensive” approach that I used ... if you decide to forge ahead with your project, I would strongly recommend that you find at least one or two “sample” processes and then MANUALLY calculate the appropriate tuning values for them ... once your manual approach has been tested and proven valid, then (and only then) would I recommend that you try to implement the same method in an “automatic tuner” ... but that’s just my advice ... good luck with your project ... and please keep us posted ...

Share this post


Link to post
Share on other sites
why not buy rockwells pid loop software. it works

Share this post


Link to post
Share on other sites
Greetings low on the pole, if you're asking ME, then ... yes, RSTune works fine ... but the idea behind this project was to have a quick "just-push-this-button" solution and have the PLC "autotune" itself ... the on-site installers weren't exactly "computer literate" individuals and setting up the RSTune on a computer was pretty much beyond their current capabilities ... if you're asking Sajid, then I'm pretty much in agreement with you ... personally I don't think that the work that he'll spend on the "autotune" project will be worth his time ... what most people would like to see is a "try before you buy" demonstration of RSTune ... that's usually not possible ... so if it doesn't work on HIS system, then a customer is usually stuck with a software package that doesn't answer his needs ... and according to some people, it doesn't work on ALL systems ... frankly, I'm suspicious of those reports ... my guess is that the PID controls in those systems aren't set up correctly in the first place ... timing issues, scaling, etc. are usually the culprits ... Edited by Ron Beaufort

Share this post


Link to post
Share on other sites
Oh, this must be why know one has successfully written a auto tuning program in a PLC. I would use the data from the RSLogix trend data just like the 'Hotrod' data supplied by Ron Beaufort a couple years ago. It would be nice if this data could be exported in a comma separated variable file. See the current http://www.controlguru.com article. Ron, you should look at the advanced control thread on plcs.net. I am surprised I don't have a half dozen questions.

Share this post


Link to post
Share on other sites
Greetings Peter, I wish I had time right now to write more ... all I can manage right now are just a quick few notes ... wish I had the time ... maybe in a couple of weeks ... the bo$$ keeps coming up with things for me to do ... Last quote of Rons Ron, you should look at the advanced control thread on plcs.net. I am surprised I don't have a half dozen questions. again ... time is the issue ... thanks for your thoughts ... I'll get back to you ... EDIT ... I have NO idea what's wrong with my "quotes" ... if I get it figured out, I'll try to fix it later ... Edited by TWControls

Share this post


Link to post
Share on other sites
Not sure what was wrong with your post quotes. Took the last quote out and made it and the rest of the quotes worked. I hope that is ok. TW

Share this post


Link to post
Share on other sites
That is what I did with the hotrod data you sent me. The control guru can calculate out a model for the plant using his Control Station software. I just use my Mathcad. I have written auto tuning software for our motion controllers that does much the same as the Control Station software or Expertune only we tune motors and hydraulic systems.

Share this post


Link to post
Share on other sites
The setting was set to TEN QUOTES, I change it to 30.

Share this post


Link to post
Share on other sites
thanks, Steve ... that was driving me nuts - and that's not a long trip from where I usually stay ... and thanks to TW for the "quick fix" on my previous post ... Edited by Ron Beaufort

Share this post


Link to post
Share on other sites
GOOGLE... "Ziegler Nichols Tuning Method" Some of this may help someone start figuring it all out... Small overview http://www.htservices.com/Applications/Process/PID3.htm http://www.act-control.com/ZN.HTM TRW TuningCalculationsPidProportionalOnly.xls

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0