Design of fuzzy systems. Fuzzy control systems Values \u200b\u200bof linguistic variables

informatics, computing technology and management

UDC 004 052 R. d. KARABtsov

l. and. Denisova

Omsk State Technical University, Omsk

fuzzy control system design using genetic

optimization algorithm_

The issues of designing an automatic control system (ACS) implemented using fuzzy information technologies are considered. Fuzzy controllers with a different number of membership functions, optimized using a genetic algorithm, are investigated. The choice of a fuzzy ACS, which provides the best regulation according to the accepted quality indicators, has been carried out. Model studies of ACS were carried out in MATLAB / Simulink / Fuzzy logic Toolbox / Global Optimization Toolbox.

Key words: automatic control system, digital controller, mathematical model, fuzzy logic, genetic algorithm.

Introduction. When designing automatic control systems (ACS) by technological processes of heat power facilities, it is necessary to take into account the uncertainty of the parameters of the control object and disturbing factors caused by external conditions. One of the most effective approaches to improving ATS operating in conditions of uncertainty is a control strategy based on the theory of fuzzy sets.

Fuzzy control and regulation systems (FCS - Fuzzy Control Systems), belonging to the class of intelligent systems, allow the system to remain operational in conditions of interference and measurement errors, and also, taking into account the changing conditions of the processes, help to reduce losses caused by ineffective control. The paper presents the results of the development and research of a fuzzy control system

lation, the structure and parameters of which were determined based on the use of methods of mathematical modeling and optimization.

To optimize fuzzy ACS, genetic algorithms (GAs) were used to find the global extremum of a multiextremal objective function characterizing the quality of the system's operation, which, moreover, can be determined only on the basis of calculations during the operation of the ACS.

The CAP study was carried out in MATLAB / Simulink / Fuzzy Logic Toolbox / Global Optimization Toolbox.

Description of the fuzzy CAP model. As an example of a fuzzy ACS, a system of automatic control of a typical automation object - pressure in the steam header of a power unit is considered. ATS research was carried out in an interactive environment for scientific and engineering

Fig. 1. Mathematical model of fuzzy ACS with FC2 controller

Fig. 2. The structure of a fuzzy regulator

mATLAB calculations with Simulink and Global Optimization Toolbox add-on packages. To simulate and optimize a fuzzy control system, Simulink has been created - a model (Fig. 1) and script files that provide multiple calls to the ACS model, the calculation of quality indicators and data processing by a genetic algorithm.

The fuzzy ACS model contains models: a digital fuzzy controller, an actuator (MI) with a control valve (RC) and a technological control object and a fuzzy control subsystem (REG FIS). To take into account the sampling of signals in time, a zero-order extrapolator (Zero-Order Hold) is applied. In the study, four options for the implementation of fuzzy ACS are considered, which differ in the number of membership functions (FP) and the parameters of terms for linguistic variables of fuzzy controllers.

In the considered variants of the ACS that implement fuzzy control, the following linguistic variables are used: input variables e (control error) and de / dt (rate of change of control error), output variable Vcv (speed of opening / closing of the RK). Also, for all variants of fuzzy ACS, the following types of FP of input variables were selected: sigmoid sigmf (for lateral terms) and Gaussian gaussmf (for central terms). Singleton membership functions are used for the output variable.

In fig. 2 shows the generalized functional structure of fuzzy controllers, which traditionally includes the following blocks:

A phasification unit that converts clear data of process parameters (control error

e and the rate of its change de / dt) into fuzzy values \u200b\u200b(and and LL., ..);

Rule base block containing a set of linguistic rules reflecting the system operation algorithm;

Fuzzy inference block, which contains an algorithm for obtaining membership functions of the output value (LVcv);

The defuzzification unit converts the membership functions of the output quantity into a physical quantity (Vcv is the rate of change of the control action on the actuators).

Variants of fuzzy controllers with the following names (designations) are considered: Fuzzy Control 1 (FC1), Fuzzy Control 2 (FC2), Fuzzy Control 3 (FC3), Fuzzy Control 4 (FC4). These regulators differ from each other in the number of membership functions. For example, in the FC1 controller, three FFs are set for the input variables (e, de / dt) and five FFs for the output variable (V). In other controllers, the number of membership functions varied for the input variables (variants with 3 - 5 FPs were considered), for the output linguistic variable, the number of membership functions remained constant.

The base of fuzzy rules of the CAP is created as a set of logical statements corresponding to the logical operation of fuzzy implication.

The range of variation of the variable e (control error) is divided into terms: NL - negative large, Z - small, NZ - negative small, PZ - positive small, ZZ - no error, PL - positive large. The range of variation of the variable de / dt (rate of change of the control error) is divided into terms: N - negative high, NZ - negative, Z - low, PZ - positive, P - positive high, the Z term corresponds to small values \u200b\u200bof the rate of change de / dt, which accepted as characterizing a steady-state process.

The range of variation of the variable Vcv - the speed of the MI movement, is divided into terms: NL - negative high, NM - negative average, NZ - negative, Z - no movement, PZ - positive, PM - positive average, PL - positive high. Table 1 shows the formed base of fuzzy rules for the considered variants of fuzzy regulators.

In the future, out of four variants of regulators, only two were chosen, because, as

Fuzzy rule base

negative big

negative

no movement

positive small

positive big

negative high

negative

PZ positive P positive high

studies have shown that when adjusting controllers empirically, the use of a large number of membership functions negatively affects the quality of the controller (due to too many settings). In the calculations, the following was observed. The more FP each linguistic variable has, the more often the regulator is forced to trigger, performing, possibly, unnecessary actions, since the ranges of variation of the variables selected on the basis of expert estimates are small.

As a result of the study, it was concluded that when adjusting the regulators empirically, an expert based only on his own experience, the best regulator for the studied ACS is a fuzzy regulator with the smallest number of membership functions. Variants of fuzzy controllers with a large number of FPs in some cases work worse than a traditional optimally tuned linear controller (for example, operating according to proportional-integral law), because it is difficult for an expert to adjust a large number of parameters, and for this reason the controllers are poorly tuned.

It was taken into account that even the optimally tuned regulators on the models should be able to be tuned in real conditions at the control object, that is, it is preferable to have a smaller number of variable parameters.

As a result, for further research, we chose fuzzy ACS with FC1 and FC2 regulators, which were optimized using a genetic algorithm.

rhythm to increase performance and control accuracy.

Description of the optimization algorithm for fuzzy ACS using GA. The launch of the CAP Simulink model and the call of the genetic algorithm are implemented using the created m-file - a script that works with the functions of the MATLAB / Global / Optimization Toolbox package, which sets the necessary options and monitors the optimization performance.

The search for the minimum criterion of the system performance is performed by the ga function, and the creation of the structure of the genetic algorithm options is performed by the gaoptimset operator. The genetic algorithm is applied to the mathematical model of a fuzzy ACS with an FC2 controller in the MATLAB / Simulink / Fuzzy Logic environment (Fig. 1).

Let us consider step by step the operation of the fuzzy CAP optimization procedure based on the use of a genetic algorithm.

Stage 1. The ga function is called, which starts the genetic algorithm.

A vector of parameters is set: x \u003d (ks, kf, Ka2,

kc2, kai, kci, ka6, kc6), where ks and kf are the transmission coefficients for the speed of the MI (slow - slow, fast - fast); parameters of membership functions: Ka2, K

c2 "Ka4, K c4 Kai, K

On the basis of expert data, a divisible search range for the values \u200b\u200bof input variables (lower lb and upper ub boundaries), ee.

Stage 2. The genetic algorithm starts working with a certain random set of initial solutions, which is called a population (Population Size - the number of individuals in each generation). Each

each element from a population is called a chromosome and represents some solution to the problem in a first approximation. A chromosome is a string of characters (in our case, FP settings). Chromosomes evolve over many iterations called Generations. In the course of each iteration, the chromosome is assessed using a certain fitness function (in our case, the quality criterion of the ATS). To create the next generation, new chromosomes, called offspring, are formed either by crossing (English crossover) of two chromosomes - parents from the current population, or by random change - mutation (mutation) of one chromosome.

Stage 3. An m-function is called that implements the cyclic launch of the ACS model and repeated calculation of the criterion of the quality of its work J \u003d K (x) for various sets of parameters of the membership functions, varied within the specified limits using the GA, which determines the optimal value of the ACS performance criterion e \u003d [(ф) with the found optimal parameters

f \u003d (K "Hf< Hg\" Ыдл ЫчТ ЫсТ" Ыч(, Ыс(" Ыч6" Ысб).

Stage 4. The completion of work is checked: whether all individuals in the generation have been considered (Population), whether all generations have been generated (Generations) and whether the time of work has ended (Time limit). Using the Time limit parameter prevents the algorithm from running too long. If the algorithm stops due to this condition, and the optimization is not completed, then the results can be improved by increasing the value of the Time limit parameter.

Stage 5. Saving the optimization results. Completion of work.

Summary of optimization of fuzzy controllers. It was taken into account that fuzzy ATS n] are valued for work under uncertain conditions, when the parameters of the control object are unknown and, in addition, can vary in a wide ei \u003d slot.

For modeling the CAP, it is assumed that the transfer \u003d WHY function of the output control corresponds to the inertial link of the first order: W (s) \u003d K0 / (T0s + 1), where K0 is the transfer coefficient; T0 is a time constant. Based on the available expert information, the basic (initial) values \u200b\u200bof the parameters of the control object were adopted: K0 \u003d 0.25 kgf / cm2 /%, T0 \u003d 60 s. The study of fuzzy controllers was carried out with varying the parameters of the object K0 and T0 by ± 30%, ± 50% and ± 70% of the accepted values. To determine the quality of operation of each of the regulators under study and to select the structure of the fuzzy ACS (the number of membership functions), the quality indicators traditional for the theory of automatic control were used: the steady-state control error 5 and the time to establish the transition process t. The steady-state (static) error of the system 5 is understood as the difference between the set and current values \u200b\u200bof the output signal in the steady state. The duration (settling time) of the transient, t, is the time it takes for the system's output to approach its target value. To determine the time of the transient process, the required accuracy is set (± 1% of the set value of the controlled variable).

Fig. 3. Membership functions for the terms of input and output variables of controllers FC1, FC2, obtained: a) according to expert estimates; b) after setting

the genetic algorithm of the FC2 regulator; c) after tuning by the genetic algorithm of the FC1 regulator

During the research, the initial parameters of the FP of linguistic variables were taken on the basis of expert estimates (Fig. 3a): five FP for the input variable e, three FP for the input

Variation of the transmission coefficient of the control object

Regulator name Initial parameters K T O 0 Variation of parameters

K0 + 0.3K0 K0-0.3K0 K0 + 0.7K0 K0-0.7K0 K0 + 0.5K0 ^ 0-0.5 ^ 0

5,% 1, s 5,% 1, s 5,% 1, s 5,% 1, s 5,% 1, s 5,% b, s 5,% b, s

BS1 0.1 45 0.2 50 0.25 65 0.25 45 1.5 110 0.1 40 1.2 85

BS2 0.05 40 0.2 30 0.15 60 0.05 30 1.2 100 0.05 35 0.9 75

Table 3

Variation of the time constant of the control object

Regulator name Initial parameters K T0 Variation of parameters

T0 + 0.5T0 T-0.5T0 T0 + 0.3T0 T0-0.3T0 T0 + 0.7T0 T0-0.7T0

5,% 1, s 5,% 1, s 5,% 1, s 5,% 1, s 5,% 1, s 5,% 1, s 5,% 1, s

BS1 0.1 45 0.3 75 0.15 45 0.6 60 0.1 40 0.25 70 0.3 30

BS2 0.05 40 0.2 65 0.1 30 0.2 55 0.05 35 0.05 65 0.25 35

Fig. 4. Dependences of the static error and the settling time in the case of fuzzy control on the change in the parameters of the control object

variable de / dt and five FPs for the output variable V. After optimization using the genetic algorithm of the considered fuzzy controllers FC1 and FC2, the parameters of the FP were changed (Fig.3b and Fig.3c), providing the required quality of regulation.

The results of comparing the operation of optimally tuned fuzzy controllers showed the following. As expected, in both cases (for each of the two variants FC1 and FC2), the systems tuned by the genetic algorithm showed better results than systems running on expert

settings. The steady-state error 5 in systems optimized by the genetic algorithm is approximately two times less than before optimization. The settling time t was reduced by about 10%.

When varying the parameters of the control object, the operation of the FC1 and FC2 controllers (with a different number of membership functions for the input variable e) was compared in order to select the structure of the controller. It should be noted that, on the one hand, the choice of a controller with a smaller number of membership functions (and hence with a smaller number of adjustable parameters) is preferable.

more respectful due to its simpler implementation. But, on the other hand, a significant deterioration in the quality of the ATS operation is undesirable, especially a decrease in accuracy indicators.

The results of model studies of fuzzy controllers are presented in table. 2 and tab. 3. When varying the parameters of the control object, the values \u200b\u200bof the steady-state error 5 and the settling time t, obtained as a result of the study of fuzzy controllers, optimally tuned to the basic values \u200b\u200bof the object parameters (using GA), were compared. The best results are highlighted in color. As can be seen from the table, the FC2 controller with five membership functions for the input variable e is more accurate and faster than the FC1 controller with three membership functions. In addition, it is important that the FC2 regulator works more stable than FC1, with different parameters of the control object.

For the investigated variants of regulators when varying the parameters of the control object, the corresponding graphs are constructed (Fig. 4). The graphs show that with a significant change in the parameters of the control object, the FC2 controller (with five FFs for the variable e) provides more accurate regulation than FC1 (with three FFs for the variable e). With an increase in the time constant or a decrease in the transmission coefficient of the control object by 70%, the steady-state error decreases by about 25%. Also, when using FC2, if the time constant or gain of the object is increased by 70%, the settling time is reduced by about 10%.

Analysis of the results made it possible to determine the most preferable structure of the regulator. It was concluded that FC2 works more efficiently than FC1. With the selected structure of the ACS, the values \u200b\u200bof the steady-state error and settling time are the smallest when changing the parameters of the control object. This means that an increase in the number of membership functions increases the robustness of a fuzzy ACS, that is, insensitivity to changes in the parameters of an object caused by disturbing influences.

Conclusion. As a result of the study, it was concluded that the proposed optimization method based on the genetic algorithm is effective for the design of fuzzy control systems. In addition, it was found that an increase in the number of membership functions increases the system's insensitivity to changes in the parameters of the control object, which means that it allows to ensure high quality of regulation.

in conditions of uncertainty and parametric instability.

Bibliographic list

1. Fuzzy logic - mathematical foundations. URL: http://www.basegroup.ru/library/analysis/fuzzylogic/math/ (date of access: 09/10/2017).

2. Kudinov Yu. I., Dorokhov IN, Pashchenko FF Fuzzy regulators and control systems // Control problems. 2004. No. 3. S. 24-36.

3. Denisova LA Multicriteria optimization based on genetic algorithms in the synthesis of control systems: monograph. Omsk: Publishing house of OmSTU, 2014.172 p.

4. Denisova LA Synthesis of control systems with correction of the reference action based on fuzzy logical inference // Omsk Scientific Bulletin. 2009. No. 1 (77). S. 184-191.

5. Karabtsov RD, Denisova LA Optimization of a fuzzy control system // Information technologies and automation of control: materials of the VIII All-Russian. scientific-practical conf. Omsk: Publishing house of OmSTU, 2016.S. 84-91.

6. Zade LA The role of soft computing and fuzzy logic in understanding, design and development of information / intelligent systems / per. from English IZ Batyrshina // News of Artificial Intelligence. 2001. No. 2-3. S. 7-11.

7. Denisova LA, Nadtochy PN, Raskin EM Implementation of a control system with fuzzy compensation of static error in the TEPROL computer-aided design environment // Automation in industry. 2012. No. 8.P. 33 38.

8. Methods of classical and modern theory of automatic control. In 5 volumes. V. 3. Synthesis of regulators of automatic control systems / Ed. K. A. Pupkova, N. D. Egupova. M .: Publishing house of Moscow State Technical University named after N.E.Bauman, 2004.616 p. ISBN 5-7038-2191-6 (Vol. 3), ISBN 5-7038-2194-0.

9. Dyakonov VV, Kruglov VI Mathematical extension packages MATLAB. Special reference book. SPb .: Peter, 2001.480 p.

KARABTSOV Roman Dmitrievich, post-graduate student of the Department of Automated Information Processing and Control Systems. Correspondence address: [email protected] DENISOVA Lyudmila Albertovna, Doctor of Technical Sciences, Associate Professor (Russia), Professor of the Department of Automated Information Processing and Control Systems.

INSTRUMENTS, DEVICES AND AUTOMATIC CONTROL SYSTEMS

UDC 621: 658.011.56

M. V. Bobyr, V. S. Titov

DESIGNING ADAPTIVE FUZZY-LOGICAL CONTROL SYSTEM.

The stages of designing an adaptive fuzzy-logical control system are considered. Structural diagrams of the adaptive system and its constituent blocks are given, which make it possible to evaluate the principle of the system's operation.

Key words: fuzzy logic, fuzzy inference, control systems, adaptation.

Introduction. The reduction in the export of modern domestic machine-tool equipment is associated with the use of components in its structure, which do not allow the production of parts with an accuracy of 1-5 microns while reducing their cost. Achieving such characteristics is impossible without improving the supporting structure of both the metal-cutting equipment itself and the control systems for the machining process of products (MOI).

The current level of requirements for the quality of manufactured products determines the need to develop high-precision equipment with CNC of a new generation, combining the latest methods and means of automated control and management using computer methods for processing measurement information about the course of the technological process (TP). In this case, the main requirement for this class of equipment is to take into account the incompleteness, unreliability of information on the quantitative values \u200b\u200bof the input and output characteristics of the TP MOI under disturbing influences. A promising basis for taking into account the above requirements is the apparatus of fuzzy logic.

Structural and functional diagram of an adaptive fuzzy-logical control system. In the course of the research carried out under the grant of the President MK-277.2012.8, an adaptive fuzzy-logic control system was developed, which makes it possible to increase the accuracy of machining products and accelerate the adoption of control decisions in the presence of external factors. In fig. 1 shows its structural diagram (IM - actuators of equipment with CNC; BVI - block of information input; BOSI - block for determining the degrees of truth; BMNO - block of fuzzy relations matrix; BVVP - block of input of the output variable; BUTVP - block of truncation of terms of the output variable; BOUTVP - block for combining truncated terms of the output variable; DB - defuzzification block). The papers detail the methods and algorithms that explain the principles of the adaptive control system. Use-

articles are devoted to the development of this system in order to control the actuators of CNC equipment.

Sensors of the system of active control of equipment with CNC

External factors X

Technological process of mechanical processing of products

Motor control circuit

KE0 ... IE5 IS1.IS5

Microcontroller

BVI a BOSI

BVVP BUTVP

Control device

Element blocks of the adaptive control system. The information input block is designed to store data about input variables in the form of a parameterized membership function (FP)

| q (x) \u003d 2 x \u003d 1 \u003d 1

/ x1 + "12 ¡Г

/ x2 + "22 ([^

where 2 is the sign of the operation of combining the premises of the rules; x ^ - terms of the parameterized FP, / \u003d 1, ..., 5 - the number of terms; Г1, Г2, Г3, Г4 - parameters of the triangular FP (Fig. 2, Г1 \u003d 10, Г2 \u003d 30, Г3 \u003d 60, Г4 \u003d 80); | - according to the sign of the support of the FP terms; "11," 12, "21," 22 - boolean variables defined as

1 for a< х < Ь,

\\ 1 for b< х < с,

0 in other cases, from the output of the microcontroller RA1 to the inputs of the data bus D of the RAM, the first signal (0000000000) is received, and from the output of the microcontroller RD1 to the inputs D of the RAM - numbers in the range from 0 to 255, corresponding to the values \u200b\u200bof the degrees of truth of the FP located along the ordinate axis (see fig. 2). The values \u200b\u200bof the addresses transmitted via the address bus coincide with the values \u200b\u200balong the abscissa axis of the FP. The process of writing data to RAM continues until all memory cells are assigned the values \u200b\u200bof the FP truth degrees.

From sensors

The block for determining the degrees of truth is used to store fuzzy logical control rules of the form

IF [condition 1] AND [condition 2], THEN [conclusion], where [condition n] - prerequisites for fuzzy inference; [conclusion] - output of fuzzy logical inference.

Fuzzy logical operation "AND" is implemented as finding the minimum (Fig. 4) using the comparators K555SP1 (003.1 ^ 3.2) and data buffers BB, made on the K555AP5 circuits (BB4.1 ^ 4.2). To transmit input 8-bit signals a1 and B1 they must be divided into comparators by 4. For this, the high-order bits of signals a1 and b1 are transmitted to the inputs of the BB3.1 comparator A1 ... A8 and B1 ... B8, respectively. And to the inputs of the second comparator BB3.2 A1 ... A8 and B1..B8 are the least significant bits of signals a1 and b1, respectively.

Depending on the result of the comparison operation, the signal a1 or b1 will arrive on the bus c1, the value of which is minimal. If the signal a1 turns out to be less than b1, then the output „<" компаратора ББ3.2 поступит сигнал логической единицы, который заблокирует инверсные входы Е2/02 буферных схемы ББ4.1^4.2. Следовательно, на выходы 22 схем

004.1 and 004.2 will not skip high-order bits of b1 and low-order bits of b1. And the buffer circuits 004.1 and 004.2 will skip the high-order bits of a1 and the low-order bits of a1, respectively. At the output of the data bus c1, an 8-bit signal is generated that implements the operation of finding the minimum w1u (a1, b1).

The block of the matrix of fuzzy relations forms the cutoff levels of the FP terms of the output variable. The principle of operation of this unit is as follows (Fig. 5). In accordance with the matrix of fuzzy relations, the signal d1 \u003d c1 is stored in the buffer circuit 006.1, and d5 \u003d e9 - in 006.9. Buffer circuits 006.1 and 006.9 are made on digital logic gates K555AP5.

To find the maximum check (c8, c6), bundles of 4-bit comparators 005.1 and 005.2 and 4-bit buffer circuits 006.2 and 006.3 are used. Moreover, 006.2 stores the most significant bits ^ 2, and 006.3 stores the least significant bits? 2. Buffer circuits 006.2 and 006.3 are made on digital logic gates K555AP5, and comparators 005.1 and 005.2 - on K555SP1 gates. For comparison, the 005.1 comparator receives the high-order bits c8 and c6, and 005.2 receives the low-order bits c8 and c6. If the signal c6 turns out to be greater than c8, then the output „<" компаратора 005.2 будет сигнал логической единицы, который заблокирует инверсные входы Е1/01 буферных схем 006.2^6.3. Следовательно, на выходы 21 схем 006.2 и 006.3 не будут пропускаться старшие с8 и младшие разряды с8. А буферные схемы 006.2 и 006.3 пропустят старшие с6 и младшие разряды с6. При этом на выходе шины данных й?2 формируется сигнал, реализующий операцию нахождения максимума шах(с8, с6). Операция нахождения максимума для сигналов с4 и с2 осуществляется аналогичным образом.

To take the maximum check (c7, c5, c3), bundles of four 4-bit comparators 005.3 ^ 005.6 (K555SP1), three 8-bit buffer circuits 006.4 ^ 006.6 (K555AP6) and three logic circuits, 2I-NOT elements 005.9 ^ 005.11 are used (K555LA3), and the 8-bit outputs of the buffer circuits 006.4 ^ 006.6 are paralleled into one signal ^.

Depending on the result of the comparison operation, an 8-bit signal ^ 3 will be generated at the output of this circuit, which is the maximum of c7, c5 or c3. If the signal c5 turns out to be greater than c7 and c3, then at the output 22 „<" компаратора 005.4 и выходе 23 „>"comparator 005.6 generates a signal of a logical unit, and at the output of a logical element 2I-NOT 005.10 - a logical zero, which will open the input of the buffer circuit 006.5" E "and allow writing data c5 into it, which will be the output

8-bit signal d? 3. This bunch of logic elements is configured in such a way that if the output 21 of the BB5.4 comparator and the output g3 of the BB5.6 comparator are logical unit signals, then the output ^ 3 will have the maximum signal c7. If at the output 22 of the comparator BB5.4 and the output 24 of the comparator BB5.6 there are signals of a logical unit, then at the output ^ 3 there will be a maximum signal c3.

s8 ^ Sat Sat

s8, sat

< К555СП1 < < К555СП1 <

s7 / s5

c5 c7.

< К555СП1 < < К555СП1 <

, £ ¡; c3

sz C5.

< К555СП1 < < К555СП1 <

21 and 23 ^ max c7

22 U 23 ^ max c5 22 U 24 ^ max c3

A8 K555AP6 B8

c4 C2 ~

C4 c2, C2

< К555СП1 < < К555СП1 <

C1 A8 K555AP6 B8

Conclusion. In the first part of the article, a structural and functional diagram of an adaptive control system for actuators of CNC equipment is considered. Also considered are the elemental blocks that make up it, and the principle of their operation. In the second part of the article, blocks for inputting the output variable, truncating the terms of the output variable, combining the truncated terms of the output variable, defuzzification will be considered in detail.

The work was carried out within the framework of the grant of the President of the Russian Federation MK-277.2012.8 and FTP, state contract No. 14.740.11.1003.

list of references

1. Afanasyev M. Ya., Filippov AN Application of methods of fuzzy logic in automated systems of technological preparation of production. Izv. universities. Instrumentation. 2010. T. 53, No. 6. S. 38-42.

2. Bobyr MV, Titov VS, Antsiferov AV Algorithm of high-speed processing of parts based on fuzzy logic // Mechatronics, Automation, Management. 2012. No. 6. S. 21-26.

3. Bobyr MV, Titov VS, Chervyakov LM Adaptation of complex control systems taking into account the forecast of possible states // Automation and modern technologies. 2012. No. 5. S. 3-10.

4. Bobyr MV, Titov VS Intellectual control system of temperature deformations during cutting // Automation and modern technologies. 2011. No. 5. S. 3-7.

5. Bobyr MV Diagnostics of equipment with CNC fuzzy logic methods // Industrial ACS and controllers. 2010. No. 1. S. 18-20.

6. Titov VS, Bobyr MV, Milostnaya NA Automatic compensation of thermal deformations of spindle nodes of precision equipment with CNC // Industrial ACS and controllers. 2006. No. 11. S. 31-35.

7. Pegat A. Fuzzy modeling and control. M .: IUIT; BINOM, Laboratory of Knowledge, 2012.798 p.

8. Zade L. The concept of a linguistic variable and its application to making approximate decisions. Moscow: Mir, 1976.165 p.

9. Zade L. Foundations of a new approach to the analysis of complex systems and decision-making processes // Mathematics today. M .: Knowledge, 1974.S. 5-49.

Maxim Vladimirovich Bobyr - Cand. tech. Sciences, Associate Professor; Southwestern State University,

department of Computer Science, Kursk; Email: [email protected] Vitaly Semenovich Titov - Dr. sciences, professor; Southwest State University

tet, Department of Computer Science, Kursk; head of the department; Email: [email protected]

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

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

Option 2.y \u003d cos (x), x .

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

Option 4. y \u003d (2 / ) arctan (x), x  [-, ].

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

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

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

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

Preparation for laboratory work.

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

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

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

    The base of approximation rules is formed.

Work order:

    Download fuzzyTECH MP Explorer.

    To create a new project, select the line “ New "of the main menu item" File ". To the question of the program "Generate system?" answer in the affirmative. In the "Generate system" dialog box that appears, set the following parameters of the fuzzy system:

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

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

    the number of terms per input linguistic variable in the "Input terms / LV: "(based on the results of home preparation);

    the number of terms per output linguistic variable in the “Output t erms / LV: "(based on the results of home preparation);

    the number of rule blocks in the input field " Rule blocks: "(there is 1 block of rules in this work).

Fix the input results by pressing the "OK" button. As a result, a conditional graphic image of the projected fuzzy system is formed in the "Project Editor" window, and in the "LV" linguistic variables window a list with predefined system names for input and output variables: in1, out1. In the conditional graphical image, the rectangle on the left with a schematic drawing of membership functions and the name "in1" represents the input variable, the rectangle on the right with the dephasification drawing and the name "out1" represents the output variable. In the center there 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 “ Attributes ... ". In the "Rename Variable" window that appears, you can change the name of the variable in the " Name: "and press the" Edit ... "button to enter the terms for this variable.

In the window that appears, all the terms in the list “ Term "also have predefined names that can be changed in a similar way: select the required term from the list and call the line" Attributes ... ". The new name of the term is entered in the field “ Term Name ". Here you can also change the shape of the fuzzy set of terms (the group of radio switches “ Shape ") and the position of the term in the list (the list" Position ").

Before defining membership functions, it is necessary to specify 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 (" Max: ") the range value (" Range ") is set in the fields of the" Shell Values \u200b\u200b"column. In this window, you can also change the signature under the graph of membership functions in the field “ Base Variable Name ".

The definition of a membership function can be done in two ways:

    determine which of the control 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. Specify coordinates of this control point in the input fields " x», « y»;

    select the anchor point by clicking the left mouse button. Press the left key and, without releasing it, move the anchor point rectangle to the desired location on the chart and release the key there.

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

    Open the "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 " Interface Variable: A valid input variable is specified. 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 varies linearly over the entire permissible range of values. To do this, select the line “ Pattern Generator "of the main menu item" Debug ". In the appeared window "Pattern Generator" set the initial value in the input field " From: ", the final in the" To: "input field and the change step in the" Step: ". To generate a file of the input action, click on the button " Generate ... ". Specify the name of the impact file in the "Generate Pattern To ..." file saving window and save it by clicking the "OK" button. Close the "Pattern Generator" window with the "Close" button.

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

    Create a window for plotting the transfer characteristic. To do this, call the function "Time Plot ... "from the menu" Analyzer ". Configure the plots in the Time Plot Configuration window as follows:

    in the list " LVs: "select the output variable by clicking the left mouse button;

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

    complete the configuration input by pressing the "OK" button.

After that, the window for the "Time Plot - 1" transfer characteristic graph will open. Place the Time Plot - 1 and File Control windows on the screen so that they do not overlap. The "Debug: File Recorder" window can be overridden by these windows.

    Get a graph of the transfer characteristic using the File Control window. To control the process, use the buttons of the "Control" field, 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 by step forward to the last point;

    auto rewind to the last point;

    transition to the last point of the input action.

To get the schedule, press the auto forward button.

    After drawing 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 (" Inputs: ") and exit (" Outputs: ") system in the" Debug: File Recorder "window. This data will be used to evaluate the accuracy of the transfer response 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. Examine and sketch the CoM defasification process step by step.

    Change the defuzzification method setting from "CoM" to "MoM" (Mean of Maximum). To do this, 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 " Window "and open the" Interface Options "window by double-clicking on the rectangle of the output variable of the conditional graphic 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 (line “E xit "of the main menu item" File ").

Fuzzy systems design

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 requiring a solution, in the form of fuzzy rules;

· An inference engine that uses rule-based and input-based fuzzy reasoning techniques 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 training 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 tuned using automatic methods.

Fig. 7

KB design involves two subtasks:

1. Definition of the database (DB):

· Universum for variables;

· Scaling factors or functions;

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

· Membership functions describing terms.

2. Compilation of the Rule Base (Rule): Formulation of the 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 \u200b\u200bof the parameters that provide the optimum for a specific fitness function. For this reason, the first step in the design of GNLS is to decide which part of the fuzzy system should be optimized by coding its parameters into chromosomes. In this section, we present a classification of GNLS corresponding to the different parts of the fuzzy system encoded by the genetic model.

Usually, the design methods for GNLS are divided into two processes, customization(ᴛ.ᴇ. adaptation) and training... In this case, we will proceed from the fact whether the original knowledge base exists or not, including the database and the BP. Then, within the framework of the GNLS, we introduce the following division.

· Genetic customization. If there is a knowledge base, we apply the genetic tuning process to improve the properties of the fuzzy system, but we do not change the BP. Those. we adjust the parameters of the NLS in order to improve its properties, keeping the power supply unchanged.

· Genetic learning. The second opportunity to train the components of the BP, to which the adaptation of the inference mechanism can be attributed. Those. we touch on the training of the components of the BP, along with other components of the NLS.

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

2) Genetic learning of the rule base... Genetic learning of BP presupposes a predetermined set of membership functions in the database, which the rules refer to by means of linguistic terms.

When the task of training a rule base is considered, 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 teaching 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 \u003d 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 sets of rules ... The Michigan approach takes a different model in which the members of the population are separate rules, “chromosome \u003d rule” and the set of rules is represented by the entire population. In the third case, an iterative method, individual rules are encoded using chromosomes, and a new rule is configured and added to the rule set in an iterative manner.

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

General principles of 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" in new information technologies, guarantees the possibility of solving a wide range of problems in which data, goals and constraints are too complex or poorly defined and therefore not lend themselves to precise mathematical description.

There are various situations in which fuzzy models of dynamical 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 known equations that (at least roughly) describe the behavior of a 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;

Fuzzy logical rules of system behavior are evaluated with the help of input / output data.

The first results of the practical application of fuzzy logic algorithms to the control of real technical objects were published in 1974 in the works of Professor E.H. Mamdani, dedicated to the problem of regulating a steam generator for a power plant. In these works, the now classical structural diagram of a fuzzy control system was proposed (Fig. 3.1).

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

Fig. 5.1. Block diagram of a fuzzy control system

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

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

accordingly, 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); t - vector transposition operation.

The RNL inputs and outputs are:

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

The rate of change of P E;

The deviation of the rate of change of pressure (y 2) in relation to its specified value (r 2);

SE change rate;

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

U 2 \u003d: Тс - change of throttle position.

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

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

Here, the 1st letter in the designation indicates the sign of the numeric 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 ("mean "), Small (" small ") or O (" close to zero "). For example, NS stands for negative small.

During the operation of the IMS, at each moment of time, one of two fuzzy algorithms is used: according to the first of them, the pressure in the boiler is controlled by changing the heating of steam H c, according to the second, the required rate of pressure change is maintained by changing the position of the regulating 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, negative sign and if this deviation does not decrease at a high or average rate, then the degree of steam heating must be greatly increased."

"If the rate of change in pressure is slightly below normal and at the same time this rate rises sharply, then the position of the throttle should be changed to a positive, rather 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 (SE \u003d NO AND C SE \u003d PB), TO T C \u003d PS".

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

The fuzzy regulator takes on those functions that are usually performed by experienced and skillful service personnel. These functions are associated with a qualitative assessment of the behavior of the system, the analysis of the current changing situation and the choice of the most appropriate way to control the 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 stroke so that the ball flies along a certain path chosen by him, while a tennis machine works according to a rigidly set program, giving the ball always to the same point. along the same trajectory.

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

As can be seen from this diagram, the formation of control actions u 1, u 2, ..., u m includes the following stages:

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

b) "fuzzification" of this data, i.e. conversion of the obtained values \u200b\u200bto a fuzzy form, in the form of linguistic variables;

c) determination of fuzzy (qualitative) values \u200b\u200bof the output variables u 1, u 2, ..., u m (in the form of their membership functions to the corresponding fuzzy subsets) on the basis of pre-formulated inference rules written in the rule base;

d) "defuzzification", i.e. calculating the real numerical values \u200b\u200bof the outputs u 1, u 2, ..., u m used to control the object.

Fig. 3.2. Fuzzy regulator block diagram

In addition to the one 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 has become widespread, the output signal of which is calculated by the formula

(3.1)

where the parameters TOp, TOand and TOd characterize the specific gravity of the proportional, integral and differential components, respectively, and should be selected based on the specified control quality indicators (control time, overshoot, attenuation of transient processes).

Possible use of a fuzzy controller (NR) for automatic tuning (adaptation) of the specified parameters of the PID controller is shown in Fig. 3.3, a. Other variants of HP application - formation of setpoints of conventional regulators (Fig. 3.3.6); connection in parallel to the PID - regulator (Fig. 3.3, c); control with a preliminary assessment of the characteristics of signals (OHS) received from the 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).

Fig. 3.3. IMS structures with fuzzy controllers

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

A large number of input parameters to be analyzed (evaluated);

A large number of control actions (multidimensionality);

Strong indignation;

Non-linearity;

Inaccuracies of mathematical models of the regulation program;

The ability to use technical know-how.

Summarizing what has been said, let us note once again those areas of application in which the use of fuzzy controllers turns out to be more efficient in comparison with traditional control algorithms. It:

1) applications that have not yet been related to 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 workable. These are very complex processes that do not lend themselves to mathematical description, for the control of which it is possible to use, along with empirical knowledge, also the obtained measurement information (for example, on the course of chemical processes);

3) applications in which standard regulators work reasonably well; 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 broader opportunities for optimization.