Pid

rsdoran

Lifetime Supporting Member
Join Date
Apr 2002
Location
Birmingham, AL
Posts
7,371
Recently in a post a quote was made concerning PID:
The equation for the form of PID I would use for temperature control is:
e(n) = SP(n) - PV(n) Error
u(n) Control Output.
dPV(n) = PV(n) - PV(n-1)
Td = differentiaor time constant. Pre act
Ti = integrator time constant. Reset
T = sample time.
K = Gain

u(n) = u(n-1)+K*( e(n)*(T/Ti) - dPV(n) - (Td/T)(dPV(n)-dPV(n-1))

Just wondering if there is a non engineering/non mathematical way to explain a PID config. I understand that the math leads to the setting used BUT

Its been years now since PID and PLC have controlled temp and motion, the process has to have been documented over and over.

Is this one of those well kept secrets?
 
This is the way I used to explain this thing without math.

More error - more output. How much is "more"? This is set by "proportional gain" value. The higher the gain, the larger is the output for the same error, i.e. the system is trying to react faster. You want to find such a value that it reacts as fast as possible - but not too fast. This is the proportional term.

The longer the error stays uncorrected - more output. Once again, see the description of "more" above, although this tern is called "integral gain". This is the integral term.

The faster the error grows - more output. This is "dervative gain" and the derivative term respectively.

The total output of the system is the sum of the three.

Something like this... With the necessary addition that proprtional and integral gains are sometimes expressed through their inverse values which are called, repspectively, deadband and integral time.
 
Hi Ron!

Here's my 2 cents.

In a PID control loop you have some variables and constants.

The constants are your PID settings and TIME.
The variables are the INs and OUTs of your process.

Take a heating process for example.

The load varies, its there or not and its nature varies
The heat input varies
The heat losses varies

You want to control the process and make it's error become a constant. What you have to do is to match the process variations with one of your own, Like dancing. She moves, I move. She walks, I go for another beer!

So if you want the load to be at a certain value and its far from it, you will add a lot of heat. When it comes close to the desired value you will decrease the amount of heat you put in. This is the proportional side of the PID loop.

You check the error (SP-MV)/SP=E its the error in %

If you have Set the P value at 100%, it only means that you will need a 100% error to have a 100% output of heat (wether its a valve or triac or anything else)
In this case, if the Setpoint SP is 1500°F and the Measured variable MV is at 750°F, your error is 50% and the output of the controler will be 50%.

You can see that with this controler, the load will never reach the Setpoint. When it comes closer, the output of heat becomes smaller.

This controler will output 0% with a 0% error. IMPOSSIBLE!

Some other functions are added to this controler but the most important is the P value. It does the job of varying the output in relation to the error. BIG error BIG output.

So when a process fluctuates, the best value to act upon is always the P value. Increase it and the variation will become smaller and smaller. You might certainly not be close to the setpoint but you will stabilise the process AND THIS IS THE NAME OF THE GAME.

The I or Reset value is a value that adds or substract some output to your P value.

When the process has stabilized and it can be said that within a single second any process is stable. The controler modifies the output in relation to the erro and the time this error is present.

A I value of 1 second will act to boost or calm down the heat output every seconds. Its impatient. It wants to go!

I value will raise the whole curve.

Just like when we wait for our dear ones in the car. If you honk after 5 minutes its not to bad. If every minutes... OVERSHOOT will come to you. I is a push in the back. So dont push to hard.

D well.... D if for the fifi. You should never use it.

Its to react on a variation of Inputs or Outputs. A load variation or a heat content of your energy variation or a variation of losses.

Such variations are not so common. Most processes are stable about what you put in and what you take out.

Sudden variations of this nature require sudden variations of your heat you put in. Like the dance I was telling you about. She makes a false move to the left. OOOFFF I got to make a sudden move to the right. Else we both lose control. Go figure how many beers this will cost me?

So a sudden variation of load will be matched by a sudden variation of heat. The process drops 5 degrees... the controler raises to 25% more output to match this sudden change.

But the load is stil the same. Who knows maybee some one openned a door or shove the garbage can in the kiln.

This hike in output should not stand forever. The controler has to eliminate it somehow. It decreases the added 25% value to the heat output slowly in, how many seconds? The answer to this is the value of D.

The longer this value, the longer this addition from D will be phased out.

D makes everything unstable.

OK that enough for me.
 
You were doing so well until....

Pierre said:
D well.... D if for the fifi. You should never use it.

Its to react on a variation of Inputs or Outputs. A load variation or a heat content of your energy variation or a variation of losses.

Such variations are not so common. Most processes are stable about what you put in and what you take out.

Sudden variations of this nature require sudden variations of your heat you put in. Like the dance I was telling you about. She makes a false move to the left. OOOFFF I got to make a sudden move to the right. Else we both lose control. Go figure how many beers this will cost me?

So a sudden variation of load will be matched by a sudden variation of heat. The process drops 5 degrees... the controler raises to 25% more output to match this sudden change.

But the load is stil the same. Who knows maybee some one openned a door or shove the garbage can in the kiln.

This hike in output should not stand forever. The controler has to eliminate it somehow. It decreases the added 25% value to the heat output slowly in, how many seconds? The answer to this is the value of D.

The longer this value, the longer this addition from D will be phased out.

D makes everything unstable.

OK that enough for me.

I can't let this pass as too many read these posts.

If you don't ever use the differentiator then you will have to settle for sub par performance. The control world did not invent the differentiator just to destablize your process.

The differentiator term DOES NOT MAKE EVERYTHING UNSTABLE! In fact the differentiator adds stability. It is easy to prove if you understand Laplace transforms. There are other factors that make the differentiator appear to misbehave. Quantizing error, sampling jitter, analog noise, and improper filtering are the real culprits. The problems is how do you solve these problems in a PLC? This is why there is a market for temperature controllers and motion controllers. Attention to these details are the difference between a good and a great PID controller.

R. S. Doran, PID theory is not a secret. There are tons of good info on the web. You have posted some good links yourself. Unfortunately I think one needs to understand Laplace and z transfroms to understand this stuff inside and out. Playing with a simulator or a real system will give one an intuitive feel eventually. I don't think anyone can truley understand PIDs by just reading books or web pages unless one is a super genius. Hands on experience and playing around with the formulas with Matlab, Mathcad or Excel are a must. Like everything else, there is no easy way. It takes time and effort to absorb this.
 
Practice does make perfect.

Or at least you will get closer to it that way. Web sites are evolving quickly and bringing lots of new things to us that were not possible before. A case in point are these two sites:

1. http://www.chem.mtu.edu/~tbco/cm416/pid.html

2. http://www.clabberhead.com/pidtutorial.html

They are both PID tuning practice sites and may help someone with a dilemma about PID. I have tuned loops over the years and never understood why I was able to achieve stability with the settings I ended up with. But, you can not argue with success. So, as many have said, you can understand a lot about PID and all its sticky Laplace and Z transform mathematics, but it is doing the tuning job on the factory floor that makes the most impression on those who depend on you. Personally, I am very glad there is autotune available now. That is a feature well worth the having.
 
Well, pardners, I gotta add my 2¢ worth.

It kin help if you looks at the proportional term (P) as the reaction in real time to an error. Gain or bandwidth is how much the controller reacts to error. The more gain, the more the output changes.

The integral term "looks backwards". In the old days it was called "reset". It varies the output based on the history of the error, and it serves to keep nudging the output up until the controlled variable is at the setpoint. (Mathematically it is eliminating "proportional droop", whut is the effect of proportional control alone never getting the process to the exact setpoint.)

The derivative term "looks forward". It measures the rate of change or the error, and adds or subtracts from the output to help eliminate overshoot. Many processes perform better without the derivative term, but in others it makes the control more stable and reduces overshoot.
 
Just a question - in the quoted section that RSDORAN started off this thread with, it looks like the computed new output is added to the previous output. I don't remember seeing this addition before. Is this the normal equation?
 
It is called the velocity form.

bernie_carlton said:
Just a question - in the quoted section that RSDORAN started off this thread with, it looks like the computed new output is added to the previous output. I don't remember seeing this addition before. Is this the normal equation?

This form of the PID is derived by taking a tradition PID at time nT and subtracting PID at time (n-1)*T from it. That forumula was taken out of a text book written by a MSOE proffessor John Lumkes. I just combined PV(n)-PV(n-1) into dPV(n) to illustrate the point. This velocity form is also used in DSPs. I have notice that Rockwell is using this form of the PID in the Control Logix.
 
Tuning PID's does not need to be hit or miss.

QUOTE] I have tuned loops over the years and never understood why I was able to achieve stability with the settings I ended up with. But, you can not argue with success. So, as many have said, you can understand a lot about PID and all its sticky Laplace and Z transform mathematics, but it is doing the tuning job on the factory floor that makes the most impression on those who depend on you. Personally, I am very glad there is autotune available now. That is a feature well worth the having. [/B][/QUOTE]

I think more should follow Ron's Beaufort's example and learn how to determine the Gain and time constants of the system. From this PID terms can be calculated. However, someone needs to venture into the s and z domains to figure out these equations or it may be easier to buy the formulas for $30.

In a more perfect world I think the PID block should just give the operator slider bar or options for faster or slower response. The lambda tuning that Ron B used would be a very conservative, slow response and at the other extreme would be the ZN formula's where the response is faster but has a lot of and many overshoots. It is time for the people who develope PID learn that the users should be able to specify the end results. ( response and overshoot ). The user should not need to specify the means ( The PID gains ).

BTW. ZN works Ok for some applications. It doesn't work at all for motion control. My customers would not put up with a motion controller that overshoots that much. Ron B's customer did not want overshoot. I would think the best tuning for an application would meet user specified settling times and overshoot, if ZN tuning turn out to be the best then so be it.
 
Peter wrote:

If you don't ever use the differentiator then you will have to settle for sub par performance....No thrue!

Most of the process don't need any D, it add disturbance to them.

Peter wrote:

There are other factors that make the differentiator appear to misbehave. Quantizing error, sampling jitter, analog noise, and improper filtering are the real culprits.

This is where we meet. When a plant technician gets a call to "Help stop da darn cycling of the heating system" he comes in contact with the REAL WORLD!

In so many plants they install Inverters and other noise generating equipments without any consideration for the instrumentation that is standing a few meters away. The tunning of most loops is relatively simple because its often tunned when the initial comissioning of the equipments take place.

Along the life of the system, people add there few modifications, to a point where all hell breaks loose.

When this happens, taking out the D factor is the fastest and best bet one can make. Oh course it is not the real cause of the loop instability BUT its the real apparent cause and its REAL LIFE.

In the real life, technician and engineers don't hunderstand the Laplace transforms. They learned about it in school but seldom if ever use them.

My point about D is EXACT. And yours also. We just talk about different things.

I mention stuff about the real world and you my friend, are telling about a place where people have time to sit and check the maths and find and reduce the input noise, adjust the filtering to optimium instability and replace the analog card with one of higher resolution.

Alice in wonderland!

Stick with me Ron.

The process is unstable in you want to give it a try.

Remove the D value
Observe
Double the Proportional band
Observe

Lower the Band slowly to a point where it is stable.
Tweack the I value.

Done.

If then you need D. Use it with extra care.
 
Here is an analogy I use to help people understand PID a bit better.

P is like a three year old child. It runs around really fast, but doesn't really know where to stop.

I is like the mother. She chases the child making him run faster until she eventually gets him under control.

D is like the father. He has no clue what is going on, but if it keeps up he is going to step in and stop it.
 
That explanation I like.
P is like a three year old child. It runs around really fast, but doesn't really know where to stop.

I is like the mother. She chases the child making him run faster until she eventually gets him under control.

D is like the father. He has no clue what is going on, but if it keeps up he is going to step in and stop it.
 
icky812 said:
Here is an analogy I use to help people understand PID a bit better.

P is like a three year old child. It runs around really fast, but doesn't really know where to stop.

I is like the mother. She chases the child making him run faster until she eventually gets him under control.

D is like the father. He has no clue what is going on, but if it keeps up he is going to step in and stop it.

ROFLMAO

That's a really good one Icky!!!
 
What's this?

Pierre said:
Peter wrote:

If you don't ever use the differentiator then you will have to settle for sub par performance....No thrue!


Hold it there. Increasing the differentiator increases the system ( closed loop ) damping factor. As Tom stated earlier, the proportional gain increases the bandwidth (closed loop natural frequency). This is good but increasing the proportional gain by itself reduces the system damping factor. Increasing product of the bandwidth times the damping factor is a good thing as it reduces the settling time. The settling time is equal to:

4/(damping factor * bandwidth)

This assumes one uses 4 time constants or being within 2% of the SP as the target.

Increasing the damping factor also reduces overshoot.

It is not the differentiator that is bad. It is all the deviations from a perfect analog system, the lazy engineer, and cheap management that doesn't minimize these deviations that is bad.

Here is part of a solution. How many of you over sample the analog inputs? For instance, if the PID is updated every .1 minutes do you take just one reading every 6 seconds or do you take a reading every second and average or filter the 6 readings before using it as the PV?
Over sampling 8 time reduces noise by a factor of the sqrt(8). Reducing the noise by 2.8 may allow one to increase the differentiator by up to 2.8 times. This can result in significant performance increases by reducing settling time and overshoot. We have been doing this for years.
 
So, Peter, are you saying that the answer to Ron's original question
  • [COLOR=royal blue]"Just wondering if there is a non engineering/non mathematical way to explain a PID config."[/COLOR]
would be "no"?... :D

Just kidding... ;)

beerchug

-Eric
 

Similar Topics

Hi, I would like to assemble a simulator/practice booster pump system that uses PID to maintain steady water pressure under various outlet demands...
Replies
0
Views
82
Hello, I have a motor that we are sending a RPM Speed Output from 0-100% to the VFD. However, the Motor HP needs to be limited to 6000 HP and the...
Replies
3
Views
91
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
604
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
953
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
418
Back
Top Bottom