You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 27th, 2006, 10:55 AM   #1
Cryogen
Member
United States

Cryogen is offline
 
Join Date: Oct 2005
Location: NH
Posts: 151
Multimedia PID tuning - Is there an easy way??

Dear Friends,

I am about to tune a Level control on a micrologix PLC.I have learnt so much about PIDs now through my reading(Ron's posts were very helpful!). I understand what Gain, Intergral and Derivative actions does to the output. I read some articles on PID tuning too.. including Ziegler Nichols method and AB documentation etc...

I still cannot understand an easy way to tune the system. Some months back when i tried to tune a PID (again, level) I never got the oscillations as I increased the gain..SO I couldn't find the ultimate gain and natural period.. Is there an easier way to tune the PLCs? or should I just follow WAG (Wild *** Guess)!

Please help me understand..
Thanks..
  Reply With Quote
Old July 27th, 2006, 02:04 PM   #2
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,705
WAG works for simple systems.

I you have read Ron B's documents then you have a good start and the easiest/quickest way should be the WAG method. A level control should be relatively easy. Give WAG a try.

There are easier ways to tune. One is to get an auto tuning program or an expert to do it for you. Learning how to use an autotuning program may take longer than the WAG method on your application. An expert would probably not be challenged and cost too much.

One could study control theory and become an expert but that is a huge investment in time ( years ) but afterwards you will not needs to WAG.

If one were to tune a lot of systems then it pays to have a more scientific/mathematical approach. I prefer to use the scientific/mathematical approach. When that doesn't work I use the SWAG ( scientific wild a$$ guess )method.

GO for it! Use the trend feature. You can save the trends and post them on the forum where we can give advice. I don't think the RSlogix trends are used enough on this forum.
  Reply With Quote
Old July 27th, 2006, 02:05 PM   #3
Allan Barnes
Member
Canada

Allan Barnes is offline
 
Allan Barnes's Avatar
 
Join Date: May 2004
Location: Woodstock ON
Posts: 123
I have done the PID control in a Micrologix 1500. The biggest problem I found was that this can only be done with scaled increments of 100. Even though the PID function is set to have a Scaled Input and output value of 0-16383 you can only use 100 steps( 16383/100 = 163.83). If you do not scale the input to the PLC so that it has 100 increments(of you full scale) your PID will always oscillate.
__________________
Modivation

If a pretty poster and a cute saying are all it takes to modivate you, You probably have an easy job. The kind robots will be doing soon.
www.despair.com
  Reply With Quote
Old July 27th, 2006, 02:15 PM   #4
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,705
????

Quote:
Originally Posted by Allan Barnes
I have done the PID control in a Micrologix 1500. The biggest problem I found was that this can only be done with scaled increments of 100. Even though the PID function is set to have a Scaled Input and output value of 0-16383 you can only use 100 steps( 16383/100 = 163.83). If you do not scale the input to the PLC so that it has 100 increments(of you full scale) your PID will always oscillate.
Why is the PID limited to 100 steps? I think you should read Ron B's threads on scaling. The PID should have 16384 steps and percentages should not be quantized to the nearest percent.

You do make a good point. Resolution play a VERY important part in how well your system will work.

BTW, I liked you motivation or de-motivation thread.

"The early worm is for the birds." It made me laugh.
  Reply With Quote
Old July 27th, 2006, 03:53 PM   #5
russrmartin
Member
United States

russrmartin is offline
 
Join Date: Aug 2002
Location: Eastman, Wisconsin
Posts: 745
2 things

You don't need to be an expert at this to get yourself in the ballpark with your WAG. You do need 2 things. #1, you need to understand how the proportional, integral, and derivative gains work to modify the output of the PID. Once you know this, you need to at least make an educated guess on what kind of lag you have in the process you are controlling. Typically, your lag times are going to be fairly short. For example, if your loop PV is a pressure transducer in a plenum, and your fan is 500 yards away, you may have a little larger lag time. What you need to do, is try to figure out how long it takes for a change in output to affect the process variable. If you know these 2 things, and it sounds like you've gotten a good start on the first, then your WAG should be an educated guess, and your educated guess should put you in the ballpark. At least, this has always been my method. Good luck.

Russ
  Reply With Quote
Old July 27th, 2006, 04:23 PM   #6
Mark Buskell
Member
United States

Mark Buskell is offline
 
Mark Buskell's Avatar
 
Join Date: Sep 2003
Location: Florida
Posts: 891
I use this method for fast reacting loops.
Set I & D to zero, start bringing up "P" till it your output reaches around 60% and at this point you should have a nice occilating loop. Then start adding in the "I" value till your loop stabilizes.
I usually have loop update set to 50 milliseonds and use no "D". This should get your loop somewhat stable and then from there you can start tweaking it in. I think this is called the Ziegler Nichols method.

As for as auto tuning software. I have seen some that work good for certain types of loops and for other types they don't work.
__________________
"Take whatever idiot they have at the top, give me a better idiot. Give me a caring idiot. Give me a sensitive idiot. Just don't give me the same idiot."
  Reply With Quote
Old July 27th, 2006, 05:13 PM   #7
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,705
Assume Nothing.

Quote:
Originally Posted by Mark Buskell
I use this method for fast reacting loops.
The objection I have to these PID tuning 'hints' is that every one says how they tune their system but not the other guys systems. Each system is different. That is why I ask for the trend. That way I know how their system works before I give advice.

We don't even know if we are controling the inlet or outlet!
  Reply With Quote
Old July 27th, 2006, 06:15 PM   #8
Allan Barnes
Member
Canada

Allan Barnes is offline
 
Allan Barnes's Avatar
 
Join Date: May 2004
Location: Woodstock ON
Posts: 123
Quote:
Originally Posted by Peter Nachtwey
Why is the PID limited to 100 steps? I think you should read Ron B's threads on scaling. The PID should have 16384 steps and percentages should not be quantized to the nearest percent.
I do not know why this was designed with a resolution of 100. Hopefully in the next revision they will fix the resolution problem.
__________________
Modivation

If a pretty poster and a cute saying are all it takes to modivate you, You probably have an easy job. The kind robots will be doing soon.
www.despair.com
  Reply With Quote
Old July 27th, 2006, 07:13 PM   #9
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,705
Download the Hotrod.zip!!!

You can see the output is not limited to just 100 increments if you have your system scaled right. This is my simulation of Ron B's hotrod system and the code will run on a micrologix 1500 or SLC500.
  Reply With Quote
Old July 28th, 2006, 03:42 AM   #10
AutomaticLeigh
Member
United Kingdom

AutomaticLeigh is offline
 
Join Date: Jan 2005
Location: Kent
Posts: 104
Many simple level applications are dominated by the size of the tank relative to the filling/emptying rate. In this situation, you may have effectively a first order system, which is unconditionally stable.

If you have tried the Ziegler-Nichols closed loop method and couldn't get the system to oscillate, this may be what you have. Consequently, you may find that gain-only control is good enough, as the gain can be increased to reduce the static error to an acceptable level. In this situation, I would normally try gain-only to start with, but usually end up with a small amount of integral action so the customer can't moan about the (insignificant) static error.
  Reply With Quote
Old July 28th, 2006, 07:15 AM   #11
Cryogen
Member
United States

Cryogen is offline
 
Join Date: Oct 2005
Location: NH
Posts: 151
Thanks for all your useful replies..I am confident with my approach now. I understand how the P, I and D terms work on the AB equation.

Only question I have left is about the 'RG' term. I use Micrologix 1200, do I need to set the RG bit? I understand all it does it change the actual gain, integral range. But why does it exist? Can anyone explain the significance of this term?
  Reply With Quote
Old July 28th, 2006, 08:11 AM   #12
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,705
Quote:
Originally Posted by AutomaticLeigh
Many simple level applications are dominated by the size of the tank relative to the filling/emptying rate. In this situation, you may have effectively a first order system, which is unconditionally stable.
Yes, that is why I advised to 'go-for-it'. This should work well with just a PI and be easy to tune if the level doesn't change too much. The proportional gain Kc may need to change depending on the level in the tank. If the valve is on the output, the gain will be affected by the level of fluid in the tank. ( head across the valve ). However, we haven't been told where the control valve is yet even though I hinted it may be nice to know.
  Reply With Quote
Old July 28th, 2006, 08:18 AM   #13
Cryogen
Member
United States

Cryogen is offline
 
Join Date: Oct 2005
Location: NH
Posts: 151
It is the inlet valve that controls the liquid level on the tank not a valve on the output. So with more error (PV less than SP), the output is increased [E=SP-PV].

When used the system might have huge load fluctuations based on the unpredictable requirement of the liquid(Should I consider derivative action?). Due to high demand certain times, the system has to act quick. But the desire is not to have a high gain control that would make it more similar to ON/OFF and open/close the valve more agressively. I am thinking a moderate gain with a small intergral function..

Last edited by Cryogen; July 28th, 2006 at 08:21 AM.
  Reply With Quote
Old July 28th, 2006, 08:44 AM   #14
burnerman
Member
England

burnerman is offline
 
Join Date: Nov 2005
Location: Huddersfield
Posts: 212
A lot depends how quickly and accurately you need to maintain the level and which is the worst scenario - underfilling or overfilling

If overfilling is a problem you may be better off with proportional only control (basically an electronic ballcock). There is a possibility that if the fill rate is much higher than the emptying rate or the outflow can sometimes stop completely you will overfill, especially if the integral term is not tuned correcly or if there is any noise on the level transmitter signal.
  Reply With Quote
Old July 28th, 2006, 08:53 AM   #15
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,705
Quote:
Originally Posted by Cryogen
It is the inlet valve that controls the liquid level on the tank not a valve on the output. So with more error (PV less than SP), the output is increased [E=SP-PV].
This makes tuning very easy because the gain will be constant as long as the pressure across the control valve is constant.

Quote:
Originally Posted by Cryogen
When used the system might have huge load fluctuations based on the unpredictable requirement of the liquid(Should I consider derivative action?).
Simple first order systems do NOT require a derivatice gain.

Quote:
Originally Posted by Cryogen
Due to high demand certain times, the system has to act quick. But the desire is not to have a high gain control that would make it more similar to ON/OFF and open/close the valve more agressively. I am thinking a moderate gain with a small intergral function..
The ON/OFF action you fear shouldn't happen when tuned right and valve is sized to flow a little more than the peak demand.
Well, is it? If the valve is sized incorrectly it will adversely affect your tuning.

Quote:
Originally Posted by AutomaticLeigh
Many simple level applications are dominated by the size of the tank relative to the filling/emptying rate.
This was a hint that this is important. Your system is analogous to a RC circuit where the resistor that charges the capacitor is controlled by you and the PLC. There is also a resistor that discharges the capactio. Decreasing the size of the resistor is analogous to increasing the demand from the tank. A clever person could design a RC circuit that would simulate your level control application. It is more difficult than you think because you need to control the rate at which the capacitor ( tank ) is being charged or discharged by controlling the current ( flow ). This means some op-amps are required. At Delta we have used RC circuits for years to simulate motion systems.

One can see the level can be maintained as long as the rate at which you are filling is equal to the rate of flow out of the tank. If you want to respond quickly you should know the flow out of the tank. If you know the out flow is 50 GPM then you can instantly add a bias to the PID so the flow will be 50 GPM without waiting for error to build up.

Don't use a derivative gain. Use feed forward/bias.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PID for MicroLogix 1500 - conversion issues ... Ron Beaufort LIVE PLC Questions And Answers 5 November 8th, 2005 09:03 AM
learning PID for Allen-Bradley ... Ron Beaufort LIVE PLC Questions And Answers 9 August 23rd, 2005 01:40 PM
AB PLC5 PIDs Derek McFarland LIVE PLC Questions And Answers 23 March 2nd, 2005 01:18 AM
how often should I trigger the PID? Ron Beaufort LIVE PLC Questions And Answers 11 February 22nd, 2003 10:57 AM
Trying to find a website ganutenator LIVE PLC Questions And Answers 9 January 5th, 2003 03:06 PM


All times are GMT -5. The time now is 09:17 AM.


.