16.05.2020

Fuzzy control systems. Open Library - open library of educational information


Formulation of the problem. Design a fuzzy control system with a static transfer characteristic of the following form:

Option 1. y = sin(x), x  [-,].

Option 2. y = cos(x), x  .

Option 3. y \u003d (2) -1/2 exp (-x 2 / 2), x  [-3.3].

Option 4. y = (2/)arctg(x), x  [-,].

Option 5. y = (1/)arcctg(x), x  [-,].

Option 6. y = th(x) = (e x -e -x)/ (e x +e -x), x  [-,].

Option 7. y = e -x sin(x), x  [-,].

Option 8. y \u003d e -x cos (x), x .

Preparation for laboratory work.

    Selection of suitable reference points for subsequent linear approximation. It is recommended to build the displayed dependence quite accurately on a larger scale on graph paper and approximate it with straight line segments, trying to achieve a reasonable compromise between the minimum number of segments and the approximation accuracy. It is also useful to use math reference books to find information about mathematical rules for choosing the number of reference points that minimize the total approximation error.

    According to the obtained piecewise linear approximating dependence, the membership functions for the input and output variables of the fuzzy system are formed.

    Input and output linguistic variables and their terms are given names and abbreviations.

    A base of approximation rules is formed.

Work order:

    Download fuzzyTECH MP Explorer.

    To create a new project, select the line " N ew" main menu item " F ile". To the question of the program “Generate system?” answer in the affirmative. In the appeared dialog box "Generate system" set the following parameters of the fuzzy system:

    the number of input linguistic variables in the input field " I nput LVs:" (in this work 1);

    the number of output linguistic variables in the input field " O utput LVs:” (in this work 1);

    the number of terms per input linguistic variable in the input field "Input t erms/LV:” (according to the results of home training);

    number of terms per output linguistic variable in the input field "Output t e rms/LV:” (according to the results of home training);

    number of rule blocks in the input field " R ule blocks:” (in this paper, there is 1 block of rules).

Fix the input results by pressing the "OK" button. As a result, a conditional graphic image of the designed fuzzy system is formed in the “Project Editor” window, and a list with predefined system names for input and output variables is formed in the window of linguistic variables “LV”: in1, out1. In the symbolic graphic, the rectangle on the left with a schematic drawing of membership functions and named "in1" represents the input variable, the rectangle on the right with a defuzzification pattern and named "out1" represents the output variable. In the center is a block of rules.

3. To change the name of a linguistic variable and enter its terms, select the variable from the list in the "LV" window (by clicking the left mouse button on the variable name) and press the right mouse button to call the pop-up context menu. In the context menu, select the line " A tributes...". In the “Rename Variable” window that appears, you can change the name of the variable in the “ N ame:" and press the "Edit..." button to enter the terms for this variable.

In the window that appears, all terms in the list " T erm" also have predefined names that can be changed in a similar way: select the required term from the list and call the line " A tributes...". The new term name is entered in the field " T erm Name". Here you can also change the form of the fuzzy set of the term (the group of radio switches " S hape") and the position of the term in the list (the list " P position").

Before defining the membership functions, it is necessary to set the scope of the linguistic variable. To do this, by double-clicking the left mouse button on the "Base_Variable" line, go to the "Base Variable" window. Minimum ("Mi n:") and maximum (" M ax:") the range value ("Range") is set in the fields of the "Shell Values" column. In this window, you can also change the label under the graph of membership functions in the field " B ase Variable Name".

The membership function can be defined in two ways:

    determine which of the reference points of the membership function (rectangles on the graph), which has the same color as the name of the term, is marked with a “tick” inside. Set the coordinates of this reference point in the input fields " x», « y»;

    select the anchor point by clicking the left mouse button. Press the left key and, without releasing, move the reference point rectangle to the required place in the chart and release the key there.

4. After entering all the linguistic variables and their terms, it is necessary to create a rule base for the fuzzy system. To do this, double-click the left mouse button on the rule block of the conditional graphic representation of the fuzzy system. This will open the Spreadsheet Rule Editor window, which lists all possible combinations of rules. It is necessary to note successively all the rules that Not needed for the system to work, by clicking the left mouse button on the numbers of the corresponding rules and delete them all at once by pressing the "Del" key, followed by an affirmative answer to the system's request for the need to delete. Then close the rules editor window.

    Open the “Interface Options” interface options window by double-clicking on the rectangle of the input variable of the conditional graphic image and check that the “Fast Computation of MBF” radio switch of the “INPUT Fuzzification:” group is set and in the list of interface variables “ I ninterface Variable:" is a valid input variable. Similarly, open the same window for the output variable and check the setting of the defuzzification method "CoM" (Center of Maximum) and the correctness of the output variable in the list of interface variables.

    To obtain the transfer characteristic of a fuzzy system, form an input action that changes linearly over the entire allowable range of values. To do this, select the line " P attern Generator" main menu item " D ebug". In the appeared window "Pattern Generator" set the initial value in the input field " F rom:", ending in the "To:" input field and the change step in the " S tep:". To generate an input action file, click on the button « G enerate...". Specify the name of the impact file in the "Generate Pattern To ..." file save window and save it by pressing the "OK" button. Close the Pattern Generator window with the Close button.

    Call the function " F ile Recorder" from the menu " D ebug". In the "Read File Control Information From ..." window, specify in the "File n ame" file name with the generated input action and click on the "OK" button. This will open the "Debug: File Recorder" and "File Control" windows.

    Form a window for plotting a transfer characteristic graph. To do this, call the function "Time P lot..." from the menu " A nalyzer". Set the plotting configuration in the Time Plot Configuration window as follows:

    in the list " L Vs:» select the output variable by clicking the left mouse button;

    move this variable to window " P lot Items:" by clicking on the button " > >»;

    Finish entering the configuration by pressing the "OK" button.

After that, a window for the graph of the transfer characteristic "Time Plot - 1" will open. Position the "Time Plot - 1" and "File Control" windows on the screen so that they do not overlap each other. The "Debug: File Recorder" window may be covered by these windows.

    Obtain a transfer characteristic plot using the File Control window. To control the process, the buttons of the “Control” field are used, similar to the player keys, located in the following order from left to right:

    transition to the first point of the input action;

    automatic rewind to the first point;

    step-by-step rewind to the first point;

  • step forward to the last point;

    automatic fast forward to the last point;

    transition to the last point of the input action.

To get a graph, press the auto-forward button.

    After plotting the graph of the obtained transfer characteristic, close the "Time Plot - 1" window, go again to the first point of the input action and rewind the input action in a step-by-step mode, fixing the input (" I nputs:") and exit(" O utputs:") system in the "Debug: File Recorder" window. This data will be used to evaluate the accuracy of the transfer characteristic approximation. Close the "Debug: File Recorder" window, go back to the first point of the input action and open the window with the membership functions of the output variable by double-clicking the left mouse button on the variable name in the "LV" window. To study and draw the process of defuzzification according to the "CoM" method in a step-by-step mode.

    Change the defuzzification method setting from "CoM" to "MoM" (Mean of Maximum). To do this, you need to go to the “Project Editor” window either by clicking on it with the left mouse button, or by selecting it from the list of windows in the menu “ W indow" and double-click on the output variable rectangle of the conditional graphic image to open the interface options window "Interface Options" to set the "MoM" radio switch of the "OUTPUT Defuzzification:" group. After that, the above procedure for obtaining the transfer characteristic for the new defuzzification method should be repeated.

    Close all open windows and exit the program (string "E x it" main menu item " F ile").

Lecture number 6. DESIGN OF FUZZY ALGORITHMS FOR CONTROL OF DYNAMIC OBJECTS

General principles building intelligent control systems based on fuzzy logic

As noted above, the use of fuzzy logic provides a fundamentally new approach to the design of control systems, a "breakthrough" into new information Technology, guarantees the ability to solve a wide range of problems in which the data, goals and constraints are too complex or poorly defined and therefore not amenable to an accurate mathematical description.

There are various situations in which fuzzy models of dynamic systems can be used:

When there is some linguistic description that reflects a qualitative understanding (representation) of the process and allows you to directly build a set of fuzzy logical rules;

There are well-known equations that (at least roughly) describe the behavior of the controlled process, but the parameters of these equations cannot be accurately identified;

The known equations describing the process are too complex, but they can be interpreted in a fuzzy way to build a linguistic model;

With the help of input/output data, fuzzy logical rules of system behavior are evaluated.

First results practical application fuzzy logic algorithms for the control of real technical objects were published in 1974 in the works of E.Kh. Mamdani devoted to the problem of regulating a steam generator for a power plant. In these works, a block diagram of a fuzzy control system that has become a classic today was proposed (Fig. 3.1).

In this case, fuzzy control is understood as a control strategy based on empirically acquired knowledge regarding the functioning of an object (process), presented in a linguistic form in the form of a certain set of rules.

Rice. 5.1. Structural diagram of a fuzzy control system

On fig. 3.1 DF - a dynamic filter that, in addition to control error signals x 1 =r 1 -y 1 and x 3 =r 2 -y 2 , derivatives of these signals and ;

RNL - controller based on fuzzy logic ("fuzzy controller", which includes a knowledge base (more specifically, a rule base) and an inference mechanism;

respectively, the vectors of the setting influences (settings), inputs and outputs of the RNL, as well as the outputs of the control object (i.e., the steam generator); m is the vector transposition operation.

The inputs and outputs of the RNL are:

Pressure deviation in the steam boiler (y 1) in relation to and the required (nominal) value (r 1);

Rate of change P E;

Deviation of the rate of change of pressure (y 2) in relation to its set value (r 2);

SE change rate;

u 1 =H c - change in the degree of steam heating;

U 2 \u003d: Tc - change in throttle position.

Mamdani proposed to consider these quantities as linguistic variables, each of which can take one of the following values ​​from the set

L= (NB,NM,NS,NO,PO,PS,PM,PB).

Here, the 1st letter in the designation indicates the sign of a numerical variable and corresponds to the English word Negative ("negative") or Positive ("positive"), the 2nd letter indicates the absolute value of the variable: Big ("large"), Middle ("average "), Small ("small") or O ("close to zero"). For example, the symbol NS means "negative small".

During the operation of the IMS, one of two fuzzy algorithms is used at each moment of time: the first of them regulates the pressure in the boiler by changing the steam heating H c , the second one maintains the required rate of pressure change by changing the position of the control throttle T c. Each of the algorithms consists of a number of rules - statements written in natural language, such as:

"If the pressure deviation in the boiler is large, of a negative sign, and if this deviation does not decrease at a high or medium rate, then the degree of steam heating must be greatly increased."

"If the rate of pressure change is slightly below normal and at the same time this rate increases sharply, then the throttle position should be changed to a positive, sufficiently small value."

Using the notation introduced above, these rules can be rewritten as follows:

"IF (P E \u003d NB AND C PE \u003d HE (NB OR NM), THEN H C \u003d PB";

"IF (S E =NO AND C SE =PB), TO T C =PS".

The implementation of the proposed fuzzy control algorithms is fundamentally different from the classical ("hard") algorithms built on the basis of the concept feedback(Feed-back Control) and, in essence, simply reproducing some given functional dependency or differential equation.

The fuzzy controller takes over those functions that are usually performed by an experienced and skillful service personnel. These functions are associated with a qualitative assessment of the behavior of the system, analysis of the current changing situation and the choice of the most appropriate method for managing an object for a given situation. This control concept is called Feed-Forward Control.

Using a figurative comparison, we can say that an experienced tennis player acts like this, each time varying his shot so that the ball flies along a certain trajectory chosen by him, while the tennis machine works according to a rigidly set program, always delivering the ball to the same point, along the same trajectory.

The block diagram of the fuzzy controller in the general case takes the form shown in Fig. 3.2.

As can be seen from this scheme, the formation of control actions u 1 ,u 2 ,...,um includes the following steps:

a) obtaining deviations of controlled coordinates and their rates of change - x 1 ,x 2 ,...,x n ;

b) "fuzzification" of these data, i.e. transformation of the obtained values ​​to a fuzzy form, in the form of linguistic variables;

c) determination of fuzzy (qualitative) values ​​of output variables u 1 ,u 2 ,...,um m (in the form of functions of their membership in the corresponding fuzzy subsets) based on pre-formulated rules of inference recorded in the rule base;

d) "defuzzification", i.e. calculation of real numerical values ​​of outputs u 1 ,u 2 ,...,u m used to control the object.

Rice. 3.2. Block diagram of a fuzzy controller

In addition to what is shown in Fig. 3.1 options for "pure" use of fuzzy control, there are other options for building an IMS with fuzzy controllers. So, in the classical theory of regulation, the use of a PID controller is widely used, the output signal of which is calculated by the formula

(3.1)

where parameters TO P, TO and and TO e characterize specific gravity proportional, integral and differential components, respectively, and should be selected based on the specified indicators of the quality of regulation (regulation time, overshoot, attenuation of transients).

Possible use of fuzzy controller (NR) for auto tuning(adaptation) of the specified parameters of the PID controller is shown in fig. 3.3a. Other options for using HP are the formation of settings for conventional regulators (Fig. 3.3.6); connection in parallel with the PID - controller (Fig. 3.3, c); control with a preliminary assessment of the characteristics of signals (OCS) received from sensors based on the interpretation of their significance, the allocation of generalized quality indicators, etc., followed by processing using fuzzy logic algorithms (Fig. 3.3, d).

Rice. 3.3. IMS structures with fuzzy controllers

As prerequisites for the use of fuzzy controllers are usually called:

Big number input parameters to be analyzed (estimated);

A large number of control actions (multidimensionality);

Strong disturbances;

non-linearity;

inaccuracies mathematical models regulatory programs;

Ability to use technical knowledge "know - how".

Summing up what has been said, we note once again those areas of application in which the use of fuzzy controllers is more effective than traditional control algorithms. This:

1) applications that have not yet been associated with automation, requiring the use of "know - how", for example, brewing (where you can use the knowledge of experts to improve product quality), cranes (to increase the productivity of workers), etc. ;

2) applications in which mathematical methods are not efficient. This is very complex processes, not amenable to mathematical description, for the management of which, along with empirical knowledge, also obtained measurement information (for example, about the course of chemical processes) can be used;

3) applications in which standard regulators work well enough; however, control based on fuzzy logic offers in this case an alternative way to solve control problems, the ability to work with linguistic variables, and more opportunities for optimization.

Fuzzy systems (regardless of whether they are fuzzy models or fuzzy controllers) (Fig. 6) include two main components:

· Knowledge base (KB), which stores available or acquired knowledge about the problem that needs to be solved, in the form of fuzzy rules;

· An inference mechanism that uses fuzzy reasoning methods based on rules and inputs to obtain the system's output.

Both of these components must be designed to build a system for a particular application:

Knowledge base is formed from the knowledge of experts or by learning using machine methods;

· The mechanism of inference is built by choosing fuzzy operators for each component (conjunction, implication, defuzzification, etc.).

In some cases, operators are also parameterized and can be set up automatically.

Rice. 7

KB design involves two subtasks:

1. Definition of a database (DB):

· Universe for variables;

· Scaling factors or functions;

· Granularity (number of linguistic terms) for each variable;

· Membership functions describing terms.

2. Drawing up a rule base (BP): the formulation of basic rules.

As already noted, there are two different methods for designing a knowledge base (KB): information from experts and using machine learning methods based on numerical information obtained using fuzzy modeling or by simulating the designed control system.

Classification of genetic fuzzy systems

From the point of view of optimization, in order to find the corresponding fuzzy system, it is necessary to represent it as an equivalent parametric structure and then determine the values ​​of the parameters that provide the optimum for specific function fitness. Therefore, the first step in the design of the GNLS is to decide which part of the fuzzy system is to be optimized by encoding its parameters into chromosomes. In this section, we present a classification of GNLS corresponding to different parts of a fuzzy system encoded using a genetic model.

Usually, the design methods of GNLS are divided into two processes, setting(i.e. adaptation) and education. In this case, we will proceed from the fact whether or not the original KB exists, including the DB and BP. Then, within the framework of the GNLS, we introduce the following division.

· Genetic tuning. If a KB exists, we apply the genetic tuning process to improve the properties of the fuzzy system, but do not change the BP. Those. we adjust the NLS parameters in order to improve its properties, keeping the BP unchanged.

· Genetic training. The second possibility is to train the BP components, which include the adaptation of the inference mechanism. Those. we touch on the training of the BP components, along with other components of the NLS.



1) Genetic tuning of the database. It is carried out by preliminarily determining the type and parameters of the input and output scaling functions, as well as membership functions, and then setting these parameters and thereby changing the form of scaling functions and membership functions using the GA (Fig. 8).

2) Rule base genetic learning. Genetic training of a BP involves a predetermined set of membership functions in the database, which the rules refer to through linguistic terms.

When considering the task of learning a rule base, a wide range of possibilities open up. There are three main approaches: Pittsburgh, Michigan and iterative teaching methods. The Pittsburgh and Michigan approaches are the most common methods for learning rules developed in the field of GA. The first of them is characterized by the representation of the entire set (set) of rules as a genetic code (chromosome), “chromosome = set of rules”, keeping the population of candidates for the role of rules unchanged and using selection and genetic operators to create new generations of rule sets. The Michigan approach considers a different model in which the members of a population are individual rules, "chromosome=rule" and the set of rules is represented by the entire population. In the third case, an iterative method, chromosomes encode separate rules, and the new rule is configured and added to the rule set, in an iterative way.

The issues of designing fuzzy systems in the Fuzzy Logic Toolbox package of the MATLAB computing environment are considered. The necessary information in the field of fuzzy set theory and fuzzy logic is given. Theoretical material on the design of fuzzy systems is given. The theory of fuzzy identification, fuzzy clustering methods and their application for the extraction of fuzzy rules, as well as a decision-making method in fuzzy conditions based on the fusion of goals and constraints are presented. The author's extensions of the package for designing fuzzy classifiers, building hierarchical fuzzy systems, training fuzzy knowledge bases of the Mamdani type, as well as for logical inference with fuzzy initial data are considered. The book can be used as tutorial to university courses on intelligent systems, artificial intelligence, decision theory and identification methods.
For system designers, it will be useful to researchers, graduate students and senior students interested in the application of fuzzy set theory in control, identification, signal processing, as well as developers of intelligent decision support systems in medicine, biology, sociology, economics, politics, sports and other areas.

Foreword

Chapter 1. Short Course fuzzy set theory
1.1. Historical digression
1.2. fuzzy sets
1.2.1. Basic terms and definitions
1.2.2. Properties of fuzzy sets
1.2.3. Operations on fuzzy sets
1.2.4. Membership functions
1.3. fuzzy arithmetic
1.4. Fuzzy relationships
1.5. fuzzy logic
1.5.1. Linguistic variables
1.5.2. fuzzy truth
1.5.3. Fuzzy Boolean Operations
1.6. Fuzzy inference
1.6.1. inference
1.6.2. Fundamentals of fuzzy inference
1.6.3. Fuzzy knowledge bases
1.6.4. Compositional fuzzy inference rule Zadeh
1.6.5. Mamdani fuzzy inference
1.6.6. Sugeno Fuzzy Inference
1.6.7. Fuzzy inference on a singleton knowledge base
1.6.8. Fuzzy inference for classification problems
1.6.9. Hierarchical fuzzy inference systems
1.6.10. Neuro-fuzzy networks

Chapter 2. Theory of designing fuzzy systems
2.1. Identification of non-linear dependencies by fuzzy knowledge bases
2.1.1. Tuning Mamdani Fuzzy Knowledge Base
2.1.2. Tuning Sugeno Fuzzy Knowledge Base
2.1.3. Setting up a fuzzy knowledge base for classification problems
2.2. Fuzzy clustering
2.2.1. Introduction to Clustering
2.2.2. Clustering with c-means algorithms
2.2.2.1. Clear Clustering by C-Means Algorithm
2.2.2.2. Basic fuzzy s-means algorithm
2.2.2.3. Generalizations of the fuzzy c-means algorithm
2.2.3. Mining Clustering
2.2.4. Synthesis of fuzzy rules based on the results of clustering
2.3. Decision making in fuzzy conditions according to the Bellman-Zade scheme
2.3.1. Fuzzy Goals, Constraints and Decisions
2.3.2. Fuzzy multicriteria analysis of variants
2.3.3. Fuzzy multicriteria analysis of brand projects
2.3.4. "What if". Variant Analysis

Chapter 3 Fuzzy Logic Toolbox
3.1. Structure and features of the package
3.2. Fast start
3.2.1. Development of a Mamdani type fuzzy system
3.2.2. Development of Sugeno type fuzzy system based on expert knowledge
3.2.3. Extraction from Sugeno Fuzzy System Data Using the ANFIS Editor
3.2.4. Extraction of fuzzy system in command line mode
3.3. GUI modules
3.3.1. Fuzzy Inference System Editor
3.3.1.1. File Menu
3.3.1.2. Edit Menu
3.3.1.3. View Menu
3.3.1.4. And method, Or method, Implication and Aggregation menus
3.3.1.5. Defuzzification menu
3.3.2. Membership Function Editor
3.3.3. Rule Editor
3.3.3.1. Edit menu
3.3.3.2. Options Menu
3.3.4. ANFIS Editor
3.3.4.1. Edit Menu
3.3.4.2. Visualization area
3.3.4.2. ANFIS property area
3.3.4.3. Data loading area
3.3.4.4. Generation area of ​​the original fuzzy inference system
3.3.4.5. Areas of training, testing and output of current information
3.3.5. Rule Viewer
3.3.6. Surface Viewer
3.3.6.1. Options Menu
3.3.6.2. Axis Menu
3.3.6.3. Input fields
3.3.7. Findcluster
3.3.7.1. Visualization area
3.3.7.2. Data loading area
3.3.7.3. Clustering area
3.4. Demo examples
3.4.1. Running Basic Demos
3.4.2. Vehicle Fuel Efficiency Prediction
3.4.3. Nonlinear noise reduction
3.4.4. Time series prediction
3.4.5. Predicting the number of car trips
3.4.6. Identification of the process of heating air in a hair dryer
3.4.7. Juggling with a tennis ball
3.4.8. Holding the ball on the rocker
3.4.9. truck parking
3.4.10. Tank water regulator
3.4.11. Shower control
3.4.12. Holding an inverted pendulum on a trolley
3.4.13. Robot arm control
3.4.14. Clustering by the fuzzy s-means algorithm
3.4.15. Iris clustering
3.4.16. Defuzzification methods
3.4.17. Gallery of membership functions
3.4.18. Tip calculator
3.5. Fuzzy Logic Toolbox Function Reference
3.6. Data Structures
3.6.1. Data structure of fuzzy inference system
3.6.2. Structure of the fuzzy inference system file
3.6.3. Data Structures for ANFIS Learning and Clustering
3.7. Interaction with other packages
3.7.1. Blocks for a Simulink Package
3.7.2. C-code of a fuzzy inference machine

Chapter 4 Extending the Fuzzy Logic Toolbox
4.1. Tuning Mamdani fuzzy models using Optimization Toolbox
4.2. Extraction of fuzzy Mamdani models through fuzzy clustering
4.3. Designing Fuzzy Classifiers
4.4. Fuzzy inference with fuzzy input data
4.5. Design of hierarchical fuzzy systems
4.5.1. First way
4.5.2. Second way

Conclusion
Literature
Application. Internet resources on fuzzy systems

Design and Simulate Fuzzy Logic Systems

Fuzzy Logic Toolbox™ provides MATLAB ® functions, applications, and a Simulink ® block for analyzing, designing, and simulating fuzzy logic systems. The product guides you through the steps of developing fuzzy inference systems. Functions are provided for many common techniques, including fuzzy clustering and adaptive neuro-fuzzy learning.

The toolbox allows you to behave a complex model system using simple logical rules, and then implement those rules in a fuzzy inference system. You can use it as a standalone fuzzy inference engine. You can also use fuzzy inference blocks in Simulink and model fuzzy systems in a comprehensive model of the entire dynamic system.

Beginning of work

Learn the basics of Fuzzy Logic Toolbox

Fuzzy system inference modeling

Create Fuzzy Inference Systems and Fuzzy Trees

Fuzzy System Output Tuning

Customize Membership Functions and Rules of Fuzzy Systems

Data clustering

Find clusters in input/output data using fuzzy c-means or subtractive clustering


2023
newmagazineroom.ru - Accounting statements. UNVD. Salary and personnel. Currency operations. Payment of taxes. VAT. Insurance premiums