Pid Loops

rob allan

Member
Join Date
Aug 2002
Location
UK
Posts
38
I am currently commisionning a water treatment plant and need to setup some PID loops for some variable speed drives. I am using an allen bradley 5/04 processer and have no problem with writing the code. It is information on the maths, how to set about tuning the loops andwhat sort of values to use.Anybody know of any websites where I can get myself clued up about PID

Cheers.
 
PID's

Hi Allen, I have just finished a Ultra Pure Water/ Industrial Waste system with many PID Loops, when you create a PID, you can start with
the prop being 1.00, Int .75/ der .003. But in a lots of cases I just
use proportional,and derivative for most of my pumps that are on VFD's.
 
Re: PID's

Roger Pate said:
Hi Allen, I have just finished a Ultra Pure Water/ Industrial Waste system with many PID Loops, when you create a PID, you can start with
the prop being 1.00, Int .75/ der .003. But in a lots of cases I just
use proportional,and derivative for most of my pumps that are on VFD's.
How can you tell someone what their PID gains will be when you know nothing of their plant? Is there some standard where the plant gains all must be the same? If not then the PID gains will not be the same.
 
Hopefully you know what PID stands for...you would be amazed at how many you ask that dont know.

NOTE: I am no authority on anything but I study/read alot and have to apply things as needed.

First I will state this THERE IS NO SINGLE PID ALGORITHM
There are 3 basic forms
First form: Kc(1 + 1/Tis)(1 + Tds)/(1 + Tds/Kd)
Second form: Kc'(1 + 1/Ti's + Td's)
Third form: Kc" + 1/Ti"s+Td"s

where

Kc, Kc' and Kc" relate to the P part of PID
Ti, Ti' and Ti" relate to the I part of PID
Td, Td' and Td" relate to the D part of PID
s is the Laplace notation for derivative with respect to time
Kd is the derivative gain

What Peter and others are or may state is the numbers involved depend on the devices and time involved. These you will have to know.

Depends on the situation and the person I guess, most drives have a PID that can be used which may allow quciker response than using a plc ...but alot like their own PID loops ...then again most think just PI is as effiecient.

What it boils down to is you will have to determine the appropriate course of action and NOTE: THERE ARE NUMEROUS WEBSITES on PID loops. Most PLC help sites have info also.

Wish you luck.
 
Did I see Laplace mentioned on a PLC site?

rsdoran said:
Hopefully you know what PID stands for...you would be amazed at how many you ask that dont know.

NOTE: I am no authority on anything but I study/read alot and have to apply things as needed.

First I will state this THERE IS NO SINGLE PID ALGORITHM
There are 3 basic forms
First form: Kc(1 + 1/Tis)(1 + Tds)/(1 + Tds/Kd)
Second form: Kc'(1 + 1/Ti's + Td's)
Third form: Kc" + 1/Ti"s+Td"s

where

Kc, Kc' and Kc" relate to the P part of PID
Ti, Ti' and Ti" relate to the I part of PID
Td, Td' and Td" relate to the D part of PID
s is the Laplace notation for derivative with respect to time
Kd is the derivative gain
Hey Ron, using the laplace operator is getting kind of high brow one who identifies with rookies. Good for you, but where you get form one?
Check out the link you posted awhile ago from CMU on using Matlab to simulate systems. It uses the form that motion people use.
The PIDs use time as parameters are used by process people with slow processes. Ron, have you figured out what you to with the laplace operator so you can get the equation in a form the computer can handle? If not ask. Hint, the s domain must be converted to the z domain and that result converted to a difference equation.

Terry, your link is also for process type of applications, not VFD.

See the links Tom posted on PIDs for the for motion people use in computer form.

In Laplace from the motion people use use:

u(s) = Kp + Ki/s + Kd*s

Where

Kp is the proportional gain
Ki is the intergral gain
Kd is the differential gain
u(s) is the output
s is the Laplace operator

Actually another pole is added to filter high frequency noise.
Now what is a pole?
 
Actually another pole is added to filter high frequency noise. Now what is a pole?

I am a rookie as far as plc's go, but I have studied electronics and the math associated with them. That is my weak area, knowing specifically what applies when, where and how. The purpose of my above post was to point out that for each person the specifics with PID may be different. I probably should have just posted this:
P Proportional Band = 100/gain
I Integral = 1/reset
D Derivative = rate = pre-act
Then stated that there are 3 forms used serial, ideal and parallel but those terms may be different depending on manufacturer/person that is explaining it at the time.


Now as for what a pole is. I thought using Laplace transform was standard when Kirschoff's Law wasn't capable of doing the equations simply. Functions of s (the Laplace operator)are often defined in terms of their poles and zeros.

Now another way to look at a POLE is when you think of using bandpass filters...each path is a pole. If you create a filter for a certain bandwidth and it is in parallel to your working circuit that is a ONE POLE filter..add another filter circuit to pass another set bandwidth in parallel and then you have a TWO POLE OR you can use these filters to retune the resonant frequency...lot of options and variables involved.

NOTE: This is probably not a good explanation because I probably should use the math and pictures to show/explain better but I am not prepared for that and dont have the time right now.

LAST: My weakness is not in knowing the math but in lack of opportunity to actually DO. I study things continuously but at some point I have to actually do it to truly understand it. Thats one of the reasons I state that drives and other devices have their own PID options, I have used those alot and in most cases have found them so simple that an understanding of the theories etc isnt always needed. There is always some trial and error but that is to be expected. Some of the Drives out there now have to be programmed from scratch and that can be unique.

Yes I am a rookie with plc's, I am NOT a rookie at electrical/electronics, board level diagnostics,Troubleshooting, pneumatics, hydraulics, HVAC (yes have EPA card), general machine work (bearing, pulleys, mill, lathes etc), drives (AC/DC tho not in DickDV's class),computers (had MCSE 3.51 track, never upgraded it, had a business for 5 yrs). I have 5 kids all school age that take up my after work time, which I enjoy them doing.

Please dont stop with asking things like this.
 
Last edited:
LaPlace... (did this guy have a home-life?)

Just for those that don't know...

If you have a mathematical situation where it appears that the only way you can develop an answer is through solving one or more ugly differential equations (which can be painful to the point of life-threatening!) then, there are some tools available to help ease the pain.

This guy, LaPlace, having an awful lot of spare time on his hands, came up with these. They are called "LaPlace Transforms". He came up with a lot of 'em. He had to be nuts! Or, at least, he had to have had many more Keepers than I have!

LaPlace Transforms allow you to take painful looking differential equations and convert them to a more readily solvable form - Algebra. Then, you simply solve the Algebra problem (Believe me, complex Algebra is MUCH simpler than a lot of the so-called SIMPLE Calculus!).

After solving them in Algebra, you then have to apply the "Reverse-Transform" to convert the answers back into the original form.

This is from memory - I might be a little off. But I sure do remember that this is a handy tool when you are dealing in situations that are as much Frequency-Domain as Time-Domain. Switching back and forth, or trying to deal with both at the same time, in Calculus, is a head-buster!

Easy? No-Forkulatin'-Way! Headache stuff for sure! Unless you do it all the time! I was looking forward to forgeting it as soon as I had it in college.

Of course, anyone that is fresh out of school can point to some simple examples.


Peter said...

"Terry, your link is also for process type of applications, not VFD."

I just gave the guy some introduction stuff to the concept of PID. Sounded like he needed it.


Peter also said...

"The PIDs use time as parameters are used by process people with slow processes. Ron, have you figured out what you to with the laplace operator so you can get the equation in a form the computer can handle? If not ask. Hint, the s domain must be converted to the z domain and that result converted to a difference equation."

In most implementations of PID (general industrial applications) this is the kind of stuff to avoid! At least, from the programmers point of view. (Yeah, I know! It sounds like I'm moving closer into Ron's camp!) But, in terms of real requirements and in terms of making the control-scheme more accessible to programmers, that is too much... I think!(... Therefore, I'm.... I Think? Maybe?)

Peter, I DO UNDERSTAND where you are coming from! But, a vast majority of so-called PID implementations don't need to be done to the degree that YOU might normally do in your particular applications, which I know to be incredibly PID dependent.

But then... I know what you are doing, and so, I leave it alone.


BTW, Ron, I am workin' on presenting a generic version of my "Roll Yer Own" version.
 
Set the Integral and Differential Gains to zero, and
increase the Proportional Gain until the system becomes unstable,
then lower the gain until the system stabilizes again. Set the Proportional Gain
about 15% less than that value that stabilizes the system. If only Proportional
Gain is used, and the system is operating in a steady-state condition (setpoint is
fixed and process variable has settled to a fixed value), there will always be a
certain amount of error in the system. This is called the steady-state error.
Integral Gain is used to force the steady-state error to zero by
increasing the output speed command with respect to time. Over time, the error
will be forced to zero because the Integral term will continue to change the speed
command, even after the Proportional term reaches steady state and no longer
affects the speed command. The Integral Gain affects the rate of rise of the output
speed command from the Integral term. Small amounts of Integral Gain can
cause large changes in PID performance, so care must be taken when adjusting
Integral Gain. Too much Integral Gain will result in overshoots, especially if
large step changes in error occur.
Typically, Proportional and Integral Gain are all that is needed to fine-tune the
system. However, it may be necessary to use Differential Gain to
further stabilize the system, especially when quick responses are required. The
Differential term responds to the rate of change of the error, not the actual error
itself. Differential Gain acts like a “shock-absorber” to dampen overshoots that
can occur when the PID tries to react quickly to changes in error or setpoint. This
allows fast PID response, with reduced risk of becoming unstable due to overshoots.
The Differential term is very sensitive to electrical noise on the feedback signal
and to digitizing errors, so it must be used with caution.
 
I might be exposing myself here as a raving idiot but, in 15 years of VFD application work, much of it involving test cells at speeds to 18000 rpm, I have always used a seat-of-the-pants approach to PID loops and got reasonably good results.

I first increase P gain until I detect instability (it shows up first in the motor torque), back P gain off slightly, then increase I gain until instability is detected, and back off I gain slightly. I have never needed to add D gain but, then, I don't do servo work either.

Actually, I usually don't have to tune a loop this hot to get satisfactory performance for my customer

Just one precaution. Some VFD's have their accel/decel block INSIDE the PID loop. I know it doesn't belong there but if it is, be sure to set both accel and decel to minimum or 0 seconds before tuning since it limits the slew rate of the PID block output.

Also, some VFD's have a loop gain setting based on setpoint rate of change in addition to D gain which is error rate-of-change. Since reference rate is outside the loop, you can use large gains without instability to get fast response to setpoint changes. Of course, if fast response to changes in actual feedback signal are required, you will need to use D gain, a dicey and very unstable element usually.
 
Think about this....

But before I get started.

Terry, you still remember the procedure correctly if you want a mathematical answer, but it is not an answer a computer can use for PIDs. See my hint to Ron. What puzzled me for the longest time is how one goes from a LaPlace transform to a formula a computer can use called a difference equation.

harryg, you last post is a good answer. Expertune is not an answer for a VFD/motion application.

DickDV, you have proven you are not a idiot. It just sounds like some VFD manufacturers are.

Ron e-mail me if you want to get detailed to death on converting the s-domain to useful equations.

Now think about this:

There is a difference between PIDs for point-to-point position systems and speed control systems like VFDs. The main difference is the definition of error.

On a point-to-point position system, error is defined as:

error = target position - actual position

On a speed control system, error is defined as:

error = target speed - actual speed

So what does this mean?

The proportional gain in a position control system is like the integral gain on a speed control system.

The differential gain in a position control system is like the proportional gain in a speed control system.

A differentiator in a speed control system is differential gain mulitplied by the difference between the target acceleration and actual acceleration. The target acceleration is easy to calculate but the actual acceleration is difficult or noisy and must be filtered. This is why I don't think VFD applications use the differentiator often. I have some time heard of this feature in position control systems refered to as the double derivitive.

On Tuning. DickDV and HarryG did a pretty good job. I prefer to have graphs or plots that can store the targets, actuals and output at the millisecond level. This removes the guessing. With the plots I can tune systems over the internet.

What hasn't been mentioned and it VERY important is feed forwards.

Details, details.
 
I might be exposing myself here as a raving idiot but, in 15 years of VFD application work, much of it involving test cells at speeds to 18000 rpm, I have always used a seat-of-the-pants approach to PID loops and got reasonably good results.

I first increase P gain until I detect instability (it shows up first in the motor torque), back P gain off slightly, then increase I gain until instability is detected, and back off I gain slightly. I have never needed to add D gain but, then, I don't do servo work either.

Actually, I usually don't have to tune a loop this hot to get satisfactory performance for my customer

Just one precaution. Some VFD's have their accel/decel block INSIDE the PID loop. I know it doesn't belong there but if it is, be sure to set both accel and decel to minimum or 0 seconds before tuning since it limits the slew rate of the PID block output.

Also, some VFD's have a loop gain setting based on setpoint rate of change in addition to D gain which is error rate-of-change. Since reference rate is outside the loop, you can use large gains without instability to get fast response to setpoint changes. Of course, if fast response to changes in actual feedback signal are required, you will need to use D gain, a dicey and very unstable element usually.
 

Similar Topics

Hey All, I am working on the programming to maintain level and pressure in a 80 gallon surge tank. This tank feeds fillers that fill either 2.5...
Replies
2
Views
1,537
Hi guys! It seems to me that PID loops with feed forward are underutilized. Maybe it's just me but I think almost every loop would work better...
Replies
6
Views
2,709
I have a need to control the speed of a pump using two different control scenarios. The hardware is an AB CompactLogix with Studio5000 V30...
Replies
47
Views
15,740
Hi, I am new to Eaton ELC Soft. I have a background with Allan Bradley plcs but this seems to be set as if from 1950. It seems to be powerful...
Replies
0
Views
1,975
Hi A few weeks back, I purchased PLCs.net Newsletter Tips Compilation 2002-2012 (good stuff) Noticed lately in the recent issues a series...
Replies
7
Views
2,293
Back
Top Bottom