Difference between PID and EXPERT(Fuzzy)

shooter

Member
Join Date
Sep 2002
Location
duketown
Posts
2,711
I am fan of expert system, and peter is trying to convince me of the opposite.
BTW no hard feelings as both types have advantages/disadvantages.

I think a PID is restricted to only three processes (P,I,D) where expert can have more, it also has the capability of having > 1 inputs. and outputs.
It is never trial and error, (well it is same learning type as PID also trial and error.) And i think you must have knowledge on the proces to control it.
 
I think a PID is restricted to only three processes (P,I,D)

You forgot "Feedforward" or bias. Which would take into account more then one input,
many more if you like.
 
The great debate, FL vs PID. Take a deep breath..and hold on.

I am fan of expert system, and peter is trying to convince me of the opposite.
BTW no hard feelings as both types have advantages/disadvantages.
No hard feelings. This isn't a religious issue as you will see. I am quite willing to modify the PID in any way I think works best. I think a good debate is educational.

I think a PID is restricted to only three processes (P,I,D)
Strictly speaking you are right but like I said above. There are modifications and ways to augment PIDs.

where expert can have more,
I object to the word expert system being applied.
People can be experts not software. At least not yet.
The use of FL doesn't give anybody any knowledge about the system.

it also has the capability of having > 1 inputs. and outputs.
Yes, but there is nothing to keep me from using 2 PIDs and tricks to achieve the same thing. Low select is a common example of how one can combine two inputs. A cascaded loop is an example of two or more PIDs each with an output and a input.

Honestly, I prefer neural nets, NN, over fuzzy logic. I will get to that later.

I always cringe when I hear someone wants to learn how to tune a PID.
ONE DOESN'T TUNE A PID. ONE TUNES A SYSTEM.
Therefore one should understand their plant.

People ask how to tune a PID and so many give advice based on their own experiences. The problem is that the person asking often doesn't know there are many types of systems and each is slightly different.

Starting from simple to more complex
type 0 ( non integrating, temperature, velocity ) single pole.
type 0 single time constant with dead time, FOPDT
type 0 , two real poles
type 0, two real poles plus dead time. SOPDT
type 0, two complex poles like a mass on a spring.
type 0, 1 real pole and 2 complex poles, not rare but rare to identify as such.
type 1 ( integrating, position, tank level ) and a single pole. Simple motor model and tanks
type 1 2 real poles. Motor models that model inertia and RL time constants.
type 1 2 imaginary poles. hydraulic cylinders and motors.

I have all these cases worked out symbolically. This gives me the ability to handle non-linear systems.

So where do you begin with FL if you don't know what kind of system you are trying to control? I can look at a system and know which of those models will apply. Knowing that I know how to approach controlling the system. With FL I must use a lot of trial and error or make a FL system look like a PID.

Things I do to augment PIDs.
1. Add feed forward. This is my most common trick.
2. The I gain must be in the forward path ( uses the error between SP-PV ) the P and D terms can be in either the forward path or only the feed back path ( -PV )
3. The gains in the forward path can be different from those in the feed back path. This is handy to move zeros or make a notch filter.
4. Often we add a second derivative gain. Adding a second derivative gain is important when controlling hydraulic systems. Without the second derivative gain the bandwidth of a hydraulic system is limited by the damping factor* natural_frequency. In other words the second derivative gain extends bandwidth.
5. I sometimes use cascaded loops.
6. Use Low-select. This can be tricky if the low select is bi-directional. In other words a low or high select at the same time.
7. I can add a smith predictor to compensate for dead time. I don't see how you can do this using FL.
8 I can use model based control where the PID is actually feedback from a model instead of the actual feed back. This is handy when the feedback isn't good enough.
9 I can change gains on-the-fly as a function of many factors.
10 I think you brought up the case of a car following a line. I mentioned how the chain rules should be applied so that the PID is updated as it covers distance as opposed to time. The speed relates the distance to time. Here is another example of two inputs being used. One for speed and one for detecting the line.
11 PIDs can be incremental so that changing gains on-the-fly do not result in a step in the control output.
12 PIDs execute in just a few instructions and are very efficient relative to FL.
An expert would know how to use all these tricks. People using FL are making rules up as the go along. Where is the expertise in that?

What is sad is that most people only think about PI or PID control and they are stuck using the PID that comes with their PLC.

It is never trial and error, (well it is same learning type as PID also trial and error.) And i think you must have knowledge on the proces to control it.
PID is trial and error for most people because they don't truly understand it.
 
Last edited:
Interesting :)

So Peter, I am one of those users that uses standard PID blocks (your favorite kind, from Siemens) because I have very little understanding of PID control. I actually just shot an email to a prof at my university to ask if he would let me sit in on his controls class so I may get a better understanding.

My question, how do you go ahead when programming a system with PID. Do you analyze the system to (gu)estimate the transfer function/poles and set your values from there?
Do you actually program your own loops such that they fit your needs completely?

As to Fuzzy Logic, it seems very interesting to me, but I haven't actually had the time to do research on it.

Thanks for a great thread!
 
Interesting :)
So Peter, ....
First I try to estimate the system. Sometimes I can just look at it and get a close enough estimation. However, I can write my own auto tuning programs for both motion control and FOPDT and SOPDT systems. I can break down a system into open loop gains, poles, offsets and dead times. That is the hard part. The next part I think is kind of unique to me because I have calculated the formulas for Ki, Kp, Kd for each model symbolically so I always get a critical response. For instance the formula for Ki for a type 1 single poles system is

Ki=λ^4/(K*α)
where
Ki is the controller gain.
K is the actuator or motor gain in speed/% output.
α is the corner frequency or bandwidth of the open loop plant.
λ is specifies where the closed loop poles will be. For this type of system I put all 3 poles at -λ in the s-plane. The user specifies λ. The higher it is the faster the response but the actuator still shouldn't overshoot. Eventually the system is limited by the resolution of the feed back.

About the auto tuning. I have posted links to
http://www.deltamotion.com/peter/Scilab/AutoTune/
before. Basically I need to know 3 things.. I need to know the control output and PV as a function of time. I then try to fit a model to this data. I usually try a couple different models and chose the one that fits the actual data the best. I do this by feeding the actual control output into my model to get an EV ( estimated value ). I then subtract the EV from the PV at each time increment and square it then add it to a sum of squared errors, SSE. The goal is to minimize the SSE between the EV and the PV. When the sum is small I have a good model.

Then I use formulas for calculating the gains based one which model resulted in the lowest SSE. Most auto tuning programs only use one model.
http://en.wikipedia.org/wiki/Residual_sum_of_squares
There are better techniques to find the least squares estimator that what is shown in the wikipedia article.

If you go to class and have questions then feel free to ask. Years ago I helped Pandiani with his questions. I still Skype with him from time to time.
 
Thanks Peter, I appreciate you taking the time! And I will hit you up if I have any questions, thank you!

Now, lets see if my fellow Dutchman has as much information on Fuzzy Logic as you have on PID :)
 
Great explanation Peter, simple and practical.

I would like to add some things:
1- When you add a feed-forward gain to the integral part of the controller, you are lowering the cumulative effect which causes instability; this is one of the components of an anti-windup system (not commonly used).
2- Fuzzy PIDs have their science and tricks, and stability regions are less constrained as a result. However, working on predesigned PID blocks can be tricky if one has no further understanding on stability and PID. Please do not misunderstand me, I’m not saying you should stop using them, just that there are many adjustments to take into account when working with fuzzy logic controllers.
3- You can easily create your own algorithm and control blocks, but this requires both experience and some theory knowledge. For example, modeling a process is not a simple task and the closer you are to the process’ reality, the better your controller will work.

There are so many ways to design a PID controller, and some are much more beneficial to some processes than others... I suggest to check out some control theory (especially robust control).
 
For those of you looking for a quick and dirty on getting your PID loop roughly tuned. Ziegler Nichols method will get you very close a lot of circumstances, saving a lot of initial guesswork.

More information:
http://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method

With flow control and motor speed routines it always got me 'close enough' for what I was working on, and much better tuned results than not using a PID controller on the process.
 
peter and me are thinking same the process needs to be analyzed. Solving the control is easy after the analyse.

and yes i would love the implementation of 61131-7.
 
Great explanation Peter, simple and practical.

I would like to add some things:
1- When you add a feed-forward gain to the integral part of the controller, you are lowering the cumulative effect which causes instability; this is one of the components of an anti-windup system (not commonly used).
To be clear the feed forwards are not integrated.
However the integrator term and the feed forward term are part of the total control output. If the feed forward terms are tuned right the integrator term should be 0. In fact I often tell people to plot the integrator term so they can see where in the motion profile the feed forward gains are not right. If the integrator term deviates during the constant velocity part of the move then you know the velocity feed forward gain needs adjusting. If the deviation occurs during acceleration or deceleration then the acceleration feed forward needs adjusting.


2- Fuzzy PIDs have their science and tricks, and stability regions are less constrained as a result. However, working on predesigned PID blocks can be tricky if one has no further understanding on stability and PID. Please do not misunderstand me, I’m not saying you should stop using them, just that there are many adjustments to take into account when working with fuzzy logic controllers.
What adjustments and tricks? You can add more rules or make the shape of the membership functions account for non-linearities but when it comes down to it there isn't much you can do without resorting to the same tricks that are needed for a PID.

3- You can easily create your own algorithm and control blocks, but this requires both experience and some theory knowledge. For example, modeling a process is not a simple task and the closer you are to the process’ reality, the better your controller will work.

There are so many ways to design a PID controller, and some are much more beneficial to some processes than others... I suggest to check out some control theory (especially robust control).
I have checked out robust control or H-infinity. Now what makes you think the control is robust? I did a comparison between Kalman Filters and H-Infinity control and the difference were small. The big advantage I saw to H Infinity is that the engineer didn't need to know the co-variance of the plant and feed back devices as precisely.

Kalman filters and H-Infinity work but they are almost useless unless there is a user that understands them.

My approach to robustness is to calculate the gains with the model I derived and then change the derived model parameters by about 10%. This would mean I would try all combinations of gain+/- 10%, damping factor, and natural frequency to simulate the fact that my model may not be exact. After each combination of model parameters I check the pole locations to make sure they are safe.
 
For those of you looking for a quick and dirty on getting your PID loop roughly tuned. Ziegler Nichols method will get you very close a lot of circumstances, saving a lot of initial guesswork.

More information:
http://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method

With flow control and motor speed routines it always got me 'close enough' for what I was working on, and much better tuned results than not using a PID controller on the process.
Z-N is only meant for FOPDT systems.
This link was at the bottom of the wiki article. Notice that ZN was only meant for one simple type of system.
http://www.mstarlabs.com/control/znrule.html
It was never intended integrating systems like position or level control On top of that, the close loop response is horrible ( quarter wave ).
 
I think this thread helped me understand both PID and fuzzy control a bit better. A bit more than the resources you guys gave me haha. This is awesome.
 
I think this thread helped me understand both PID and fuzzy control a bit better. A bit more than the resources you guys gave me haha. This is awesome.
Actually we haven't heard a good case for fuzzy logic. I am waiting.
BTW, I have played with FL and NN educational kits. They were interesting but as far as I could see they weren't ready for prime time.

The reason I like NN better is that I know how to optimize the weights for the "neurons" however one still needs to integrate and differentiate the PV and use that is inputs. I don't see where the NN or FL can work without first integrating and differentiating the PV.
 
Actually we haven't heard a good case for fuzzy logic. I am waiting.
BTW, I have played with FL and NN educational kits. They were interesting but as far as I could see they weren't ready for prime time.

The reason I like NN better is that I know how to optimize the weights for the "neurons" however one still needs to integrate and differentiate the PV and use that is inputs. I don't see where the NN or FL can work without first integrating and differentiating the PV.

Well TBH I honestly never knew what fuzzy logic completely was. I only heard that it was a basic type of logic saying that the value doesn't have to be exact but it can be in a range of types. Just from this thread, its proven to be way more complex.

As for PID, reason I had trouble with it was because the only real example I could find was the "driver in a car with cruise control" example. This thread has kinda let me add 2+2 and its starting to click
 
I have only seen one truly interesting use of fuzzy logic and I have searched and searched to no avail for the magazine article. It was in the very early 1990's and had to do with counting eggs at a hen house. The eggs vary so much they couldn't use weight to count them.

They had a line of some type of photo distance sensors set up in a line that would measure heights as the eggs rolled by. They said the fuzzy algorithm much better at counting the eggs than any other method they had come up with. It seems to rely on statistics as well.

Anyway, I never have been able to find that article as it was before most of the industry mags were online.
 

Similar Topics

Hello, Do you know what is the difference between the PID controllers PIDFF, PID1 and PIDP1 in a Schneider PLC? I have to modify a PLC program...
Replies
1
Views
1,737
Hi, whats the difference between the above two types of PID controllers. For example, there are the S7 PID blocks FB41 CONT_C and FB58 TCONT_CP...
Replies
1
Views
8,407
Hello, I have a problem with AO- and AA-Tags. When I use for example the tag AO_Test with the address 200 and type the value 1,2 in, the AA-Tag...
Replies
7
Views
1,410
As per the title. This might seem like a basic question to many, but I'm unclear about the difference between a coil ( ) and an application...
Replies
28
Views
4,030
Good Morning , I have 2 Frequency Drive panels to build and commission . It is for 2 pump systems . Just wondering , what is the...
Replies
4
Views
1,968
Back
Top Bottom