I saw a recent thread about fuzzy logic. In think fuzzy logic is a fraud.

Join Date
Apr 2002
Location
No income tax, no capital gains tax. Freedom!
Posts
8,351
I meant to say most papers comparing fuzzy logic vs PID are frauds.
Fuzzy logic can work but not better than PID with feed forwards.
I know some will take issue with this statement but I can prove that many papers comparing fuzzy logic to PID are not valid and have no basis in control theory.

Most of these fuzzy logic vs PID papers make the PID response look intentionally poor relative to the fuzzy logic response. The authors of these papers are either frauds or simply ignorant of how to properly use a PID. If I were their professor I would have failed the students. I would also question the credentials of those that though the paper was good enough to publish. What is really said is that engineering organizations publish these papers even though know one knows how to properly evaluate whether the document is valid.

You have been warned.
 
Last edited:
I can concur. So far haven't seen anyone show me fuzzy is any better for many of that control feedback systems that I work with. Not saying that it can't be an improvement but their implementations of it fails.

I think most of it is marketing and managers convinced that the latest buzzwords technologies are what is needed. Don't get me started on "The Cloud"......
 
I would love to debunk Fuzzy Logic. FL

I have a small collection of Fuzzy Logic articles that got published by engineering organizations. What is sad is that no one challenged the validity of these articles.

The first one switches between fuzzy logic and PID. The goal is to control servo hydraulic actuators better. There is a algorithm to make the switch smooth starting at page 4.

The scam begins on page 5. Notice that a transfer function Gs is provide. This transfer function is not one used for position control. Since the first paragraph mentions position I would have rejected this document right there. The authors don't know the difference between a open loop velocity and open loop position transfer function. A position transfer function requires an extra s in the denominator to integrate velocity to position.

On page 3 the fuzzy part of the diagram doesn't have an integrator term. The fuzzy logic would suffer from a proportional droop.

Now look at figure 4 and 5. The first response is horrible. In every document that I have the fuzzy logic fans make the PID control look bad. Either this is fraud or ignorance.
Figure 5 doesn't look too bad but there is still overshoot and the response is not that fast.
I did my own simulation using transfer function in pdf. You can see the response in my simulation is much faster and doesn't overshoot. I know how to calculate PID gains and feed forwards based on the transfer function.

http://deltamotion.com/peter/pdf/Wang_2017_IOP_Conf._Ser.%3A_Mater._Sci._Eng._231_012026.pdf

I used a simple PID that is one line long. Notice my time scale is only one second because that is more than enough time to reach the set point.
http://deltamotion.com/peter/pdf/Mathcad - t0p2 simple example pages 8 - 9.pdf

I provided the values of the gains and arrays so that someone can verify my results if they desire.

In theory I should be able to decrease the response time even more but I know there are practical limitations like feed back delays and resolution.

I have more.
 
The first mention of fuzzy logic I saw had to be over 20 years ago in a magazine. The application discussed was not a controls application but a way to count eggs coming down a conveyor belt. They had a limited number of laser distance sensors in a line over the conveyor (those things were really expensive) and they used a set of fuzzy rules to combine the data from the limited number of sensors into a count of the eggs going by.

I have searched for that article but it was early enough that it probably never got archived in the interwebs.

And with the cost of sensors much less today than back then there are probably more exact methods for counting eggs on a conveyor that are cost effective.

I thinks that is probably the best use of fuzzy methods. Combining limited data with a set of rules to infer a desired value.
 
My feeling is that fuzzy logic, because of being simpler to implement and configure, has been used for the wrong end when a good enough control is required.

As far as academic articles go, I think we should all take any of them with massive doses of salt as it's almost guaranteed to be a regurgitation of previous papers to suit someone's academic career.
 
This is one of the most honest fuzzy articles and is a good tutorial

What exactly is fuzzy logic anyways? Sounds imprecise, at any rate :D
The first few pages 1-12 are a good tutorial.
On page 13 there is a transfer function.
The gain has a value of .25. What are the @#$% units?
Usually gain in a motion system is speed/unit_of_output.
I use (mm/s)% now.
The model for a simple motor.
Notice that the set point jumps from 0 to 1. NO RAMPS!
Fig 13 is reasonably good. The author is not trying to make PID look bad.
Page 18 does a comparison between PID and different methods of membership functions and defuzzification. Notice the differences between different FL algorithms? Notice the author doesn't make the PID look bad.
In the conclusion the author states that fuzzy logic can handle non-linear systems and use human knowledge. Yet there is no example of modeling a non-linear system.
The author states the PID has only 3 parameters to adjust. True but sometimes only a PI is required and other times a second derivative gain is required. The author doesn't go into feedforwards commonly used in motion control.
The last paragraph is false.
http://deltamotion.com/peter/pdf/FLvsPID/FL vs PID 0.pdf

Here is my rebuttal. See page 5 of 10.
I use pole placement to calculate the PID gains using the authors transfer function.
What should be noticed is that I show the output. If the gain us 0.25 (mm.s)/%
the system would not be able to move as fast as show in any plot of the authors or mine unless there was no limit on the output. Notice I had to let the output go to 1000% to get the speed. This is a problem with many matlab and simulink simulations done by those without experience. They fail to show what the control output is doing. They fail to show that the control output is limited to +/- 100%. When I first ran my simulation the control output was limited to +/- 100% so the output was always in saturation. This is not a good way to do a simulation.

Look at my response time. It is half the time of the authors.
http://deltamotion.com/peter/pdf/FLvsPID/Mathcad - T1P1 CD PD vs FL.pdf
Now about the not being able to change PID gains on-the-fly. A Delta we have an advanced training class where we teach people how to change gains on the fly so they can control systems. The video is short. It is an inverted load that must go over center. It uses a cam table to convert motion in degrees to linear motion for the hydraulic actuator. As the hammer moves through the arc the gains change. We show people how to use the auto tuning to tune at different places along the arc and put the gains in a cam table or curve. There is a curve for each gain, so as the hammer moves through the arc the gains are changed every millisecond. The speed in controlled exactly. I though I would bring this up because there was a recent post about converting rotary motion to linear motion. There were concerns about the non-linearity of the motion. You can see it should be no problem with the proper controller and technique.
A few people on this forum have been to our advanced training class and have done this.
http://deltamotion.com/peter/NewHydraulicTrainingSystems/Basic and Hammer.mp4
 
Fuzzy Logic was a topic in an A.I. class I took back in the 80s. The study case was using FL to control a 4-way stop light intersection. Each queue, pedestrian and vehicle, was said to be empty OR some degree of not empty. The logic was then written around these "semi-boolean" states to adjust and control the logic controlling the lights. All falling under the study of set theory.

Years later I had opportunity to use what I learned in controlling a shim selection machine assembling rear axles. The components were measured, summed, subtracted from a base dimension and the result would be used to select a shim for setting the gear lash. The problem was that the set of shims that were available did not cover every result so based on which components were thick and/or thin, a "best-fit" shim could be "calculated". A "fuzzy" method was programmed allowing the customer to tweak the rules and actually worked quite well.

I'm pretty weak at PIDs but from what I do know, it seems to me that implementing a FL solution is really like using a screwdriver to drive in a nail - success is unlikely and there are better tools for the job. So for me, its one of those tools that is at the bottom of the box that may never be used again.

Interestingly, Omron has or had a fuzzy logic PLC and Allen Bradley had a fuzzy logic tools/instructions product starting with RSLogix 5K v16 around 2006 but discontinued. Never tried either.
 
Last edited:
Fuzzy Logic was a topic in an A.I. ....
I do not consider FL to be AI. AI should involve some learning. FL only requires you adjust member ship functions, rules and defuzzification methods until you get acceptable results. I realize that many people see PID the same way but I can write auto tuning programs where trial and error is eliminated.

Another claim FL fans like to make is that they can have two outputs and multiple inputs. You can with PID too. A few years back on this forum someone from Mauritius want to control the water for showers. There were two valves. One for hot water and one for cold water. The water was mixed in a tank and the level had to be maintained too. I solve this problem two ways. One used to PI controllers and the other used linear quadratic control to minimize a cost function.
I still have the work sheets. What I remember is that the OP's boss or teach was stupid. The tank needed a recirculation line otherwise it would cool off when no hot water was added.

I would consider minimizing a cost function over FL any time.

I think Omron and AB realized FL was a fad. I remember the Omron FL demonstration. It balanced an inverted pendulum.
 
The FL study was in relation to the study of sets and the operations that can be performed on sets. The lesson was one of a couple that led up to studying the language Prolog which does learn.
 
This next one it pitiful. It is tank level control. In the past I have simply recommend that one uses a proportional band unless there is a need for precise level control, then an integrator is required. When using a PLC type of PID the time constant should be set so the error is removed in 5 time constants. This is arbitrary and not very scientific. I could use my pole placement technique but it is overkill for most tank level control.

What is poor about this document is that is has an extremely simple transfer function given by equation 12. BTW, I think his transfer function is wrong. Only a PI controller is required yet the author uses a PID and ZN which is the worst way to tune a system. I can't believe the author claimed to use Matlab and Simulink for tuning. This makes the PID control look bad. I wish the people that use Matlab and Simulink would show the control signal. It looks like the water is almost being sucked out of the tank by a negative control signal instead of just letting it flow out. When the level in decreasing the level should be decreasing in a somewhat exponential way.

Finally read the conclusion. What a piece of garbage. I would failed the student. Notice it was presented at a conference. I would be embarrassed.
http://deltamotion.com/peter/pdf/FLvsPID/3857a131.pdf

Just for comparison look at this. I helped a student with a control project. This happened on LinkedIn. The student had to control the level in the second tank where a pump supplied water to a first tank with a orifice on the bottom that let water flow out into the second tank. The water would flow out the orifice in the bottom and recirculate. My calculations were gross overkill and everyone said so but my reply is that no one should go to college to just learn how to tweak gain until satisfactory results are achieved. I take into account the flow through the orifice is proportional to the square root of the level. I also change the surface area of the tank as a function of level. I change the gains on the fly to compensate and keep the closed loop poles in the same location. Yes, this is overkill but if one is designing system they need to model what will happen. The height of tank 1 is critical. If it isn't tall enough the water will not flow out fast enough to fill tank 2. If tank 1 has a small surface area the level will change rapidly. It may over flow or underflow. If the system is designed wrong the PLC programmer will not have a chance

The student got an A. I would have flunked him because he could not write the first two differential equations for tank 1 and tank 2.
http://deltamotion.com/peter/Mathcad/TwoTanks/Mathcad - t0p2 p pi Alin's two tanks Cascade.pdf

The two tank problem can be controlled with two proportional bands if the level in the second tank doesn't need to be controlled exactly. This would be kind of fuzzy. The pump would need to keep the level in the first tank high enough and supply enough water to maintain level in the second tank. This would required using a weighted average of the output of the two proportional bands. I wouldn't use a fixed ratio for the weight average. I would square the error from the ideal level for tank 1 and tank 2 and so the weight for tank 1 would be the square error of tank 1 divided by the square error of tank 1 plus the squared error of tank 2.
The weight for tank two would be the squared error for tank 2 divided by the sum of the two tanks squared error. The result would be that the tank with the largest error would get the most weight. Think about it. Now think about the hassle of trying the implement the same in FL.
 

Similar Topics

HI: After three years my customer has changed his mind and he finally decided to use a motion control system instead of conventional analog...
Replies
37
Views
10,151
Hi guys. I’m looking for input on this project. Any help is hugely appreciated! I’m in the planning phase of building an automatic length...
Replies
2
Views
2,709
On a flying shear or cut-off saw system, the encoder that measures the speed of the material fed is very important. To select an encoder, what is...
Replies
10
Views
4,449
I just received this, and thought some of you would be interested: http://www.bidspotter.com/forms/event.php?event=9831, Lots of AB stuff... David
Replies
1
Views
1,611
I have seen a lot of (I thought) large boars in California when I lived there but... nothing like this The small one was above my knee the large...
Replies
7
Views
2,712
Back
Top Bottom