50 Table 4.5 Statistics table of fuzzy rules leading to output membership function values .... Figure 1.1 2D gantry cranes system used in farm warehouse Trang 18 is easy to operate, eve
Trang 1
GRADUATION THESIS AUTOMATION AND CONTROL ENGINEERING
ADVISOR : STUDENTS:
CONTROL SIMPLIFIED SYSTEM BASED ON THE 2D GRANTRY CRANE MOTION
Trang 2HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND
EDUCATION FACULTY FOR HIGH QUALITY TRAINING -o0o -
GRADUATION PROJECT
CONTROL SIMPLIFIED SYSTEM BASED ON THE
2D GRANTRY CRANE MOTION
Student name: TRAN QUOC CUONG Student ID : 16151008
Student name: TRAN THI THANH THUY Student ID : 18151130
Major : CONTROL ENGINEERING AND
Advisor : NGUYEN VAN DONG HAI, PhD
Trang 3
THE SOCIALIST REPUBLIC OF VIETNAM
Independence – Freedom– Happiness
-
Ho Chi Minh City, July 13 th , 2023
GRADUATION PROJECT ASSIGNMENT
Major: Control Engineering and Automation Tel: 0392346356 Email: 16151008@student.hcmute.edu.vn
Advisor: PhD Nguyen Van Dong Hai
1 Project information
Project’title: Control simplified system based on the 2d grantry crane motion
Project’purpose: Research and application of control algorithms
2 Initial materials
Advisor provides a number of research papers available for research purposes
3 Content of the project:
Learn the dynamic equation of the 2D gantry crane’s system
Build PID and Fuzzy control algorithms for the system on simulation and experiment (on available model)
Survey to find the optimization parameters so that the system is stable quickly to meet the requirements
4 Final product:
Model of the 2D gantry crane’s system
Simulation program and Embedded program that stabilizes the 2D gantry crane’s
system
Ho Chi Minh City, July 13 th , 2023
(Sign with full name)
Trang 4
THE SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom– Happiness -
Ho Chi Minh City, August 13 th , 2022 ADVISOR’S EVALUATION SHEET Student name: Tran Quoc Cuong Student ID: 16151008 Tran Thi Thanh Thuy 18151130 Major: Control Engineering and Automation Tel: 0392346356
Email: 16151008@student.hcmute.edu.vn Advisor: PhD Nguyen Van Dong Hai EVALUATION 1 Content of the project:
2 Strenghths:
3 Weaknesses:
4 Approval for oral defense? (Approved or denied)
5 Overall evaluation: (Excellent, Good, Fair, or Poor)
Trang 56 Mark: (in words: )
Ho Chi Minh City, July 13 th , 2023
(Sign with full name)
Trang 6SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom – Happiness
CONFIRMATION OF GRADUATION PROJECT EDITION
Student’s name: Tran Quoc Cuong Student’s ID: 16151008
Project’s name: Control simplified system based on the 2d grantry crane motion
2 Edit request 2: Student needs to modify some figures in the comparation part
Answer: Student modified some figures in the comparation part in Chapter 5: Experiment result, figure 5.19 and 5.20 from page 71 to page 72 Student also added the comment for each figures
3 Edit request 3: Students needs to present clearly about the object
Answer: Student presented clearly about the object in Chapter 2: Fundamental theory, page 6, 7 and 8
Ho Chi Minh City, July 30 th , 2023
(Sign and specify full name) (Sign and specify full name)
Trang 7First of all, we would like to express our deep gratitude to PhD Nguyen Van Dong Hai, who directly supported and guided the research of the graduation project with full of enthusiasm and encouragement Always consult and give advice on equipment, control algorithms, and support to lend necessary equipment available from the laboratory during the implementation of the project
My team would like to thank the teachers in the Faculty of High-Quality Training and in the Technology of Control Engineering and Automation in particular, and the University of Technical Education in general for their warm teaching gave us knowledge not only specialized but also subjects with high practical application, to help us have a solid foundation for further development
My team also would like to especially thank Ms Nguyen Tran Minh Nguyet for encouraging and giving us advice on studying in the most difficult times
The project has been completed but errors will not be avoided, my team hopes to receive suggestions and comments to help the team complete the project better
Ho Chi Minh City, July 13 th , 2023
Students
Trang 8SUMMARY
Today's human society is developing dramatically with the help of modern and advanced technologies Any industry field has more or less the presence of machinery and electrical appliances, and electronic components However, not just putting them together will get the product we want, we need to make adjustments to suit the needs
of each purpose, each object Since then, control algorithms were born to apply many different methods and ways of operating mechanical devices so that they can achieve the smoothest operation
However, not any control method can affect the desired object, so choosing the object as well as the control method is extremely necessary Through research and comparison, students have decided to choose the 2D gantry crane's system motion as the based control target to introduce simplified system, and the control methods will
be basic PID, Fuzzy, and Neuron Fuzzy as their graduation project
Trang 9TABLE OF CONTENTS
ACKNOWLEDGMENTS i
SUMMARY ii
TABLE OF CONTENTS iii
LIST OF FIGURES vi
LIST OF TABLES ix
CHAPTER 1: INTRODUCTION 1
1.1 Give problem 1
1.2 Purpose 3
1.3 Content 3
1.4 Limit 4
1.5 Research methods and means 4
CHAPTER 2: FUNDAMENTAL THEORY 6
2.1 Mathematical equations 6
2.1.1 Introduction about the 2D gantry cranes system 6
2.1.2 Mathematical equation of 2D Gantry Crane system 8
2.2 Control method 12
2.2.1 PID Controller 13
2.2.2 Fuzzy controller 14
2.2.2.1 Development history 14
2.2.2.2 Fuzzy set 15
2.2.2.3 Operations on fuzzy sets 15
2.2.2.3.1 Intersection 15
2.2.2.3.2 Union 16
2.2.2.3.3 Complement 16
Trang 102.2.2.4 Fuzzy relationship 16
2.2.2.5 Fuzzy inference method 17
2.2.2.6 Fuzzy system 19
2.2.3 The Neuron System 20
2.2.3.1 Definition 20
2.2.3.2 Nerve cells 20
2.2.3.3 A neural network 21
2.2.4 ANFIS Controller (Adaptive Neuro-Fuzzy Inference System) 24
2.2.4.1 Definition 24
2.2.4.2 Training for the ANFIS network 27
CHAPTER 3: HARDWARE AND SOFTWARE 30
3.1 Understanding hardware 30
3.1.1 Hardware overview 30
3.1.2 Devices 30
3.1.2.1 Microcontroller STM32F4 DISCOVERY 30
3.1.2.2 Omron Rotary Encoder E6B2-CWZ6C 1000P/R 32
3.1.2.3 Minertia Motor UFFMED-03SRI21 33
3.1.2.4 Sharp rotary encoder 34
3.1.2.5 H-Bridge IBT_2 34
3.1.2.6 UART XP2102 converter circuit 36
3.1.2.7 Source of beehives 36
3.1.3 Hardware connection diagram 37
3.2 Flowchart of control algorithm 38
3.3 Simulation software 38
3.3.1 Matlab/Simulink 38
3.3.2 Waijung blockset library 39
Trang 113.3.3 Hyper terminal 40
CHAPTER 4: DESIGN OF THE CONTROLLER 42
4.1 System Simulation 42
4.2 Design of the PD controller 43
4.3 Controller design using ANFIS 44
4.3.1 Fuzzy controller 44
4.3.2 Fuzzy controller using ANFIS 48
CHAPTER 5: SIMULATION AND EXPERIMENT 57
5.1 Control program for the system 57
5.2 Simulation 58
5.2.1 PD controller 58
5.2.2 ANFIS Controller 59
5.2.3 Fuzzy controller 60
5.3 Experimental results 61
5.3.1 PD controller 61
5.3.2 ANFIS controller 68
5.3.3 Fuzzy controller 70
5.4 Compare 3 controllers 71
5.4.1 Position 71
5.4.2 Angle 72
CHAPTER 6: CONCLUSIONS AND DEVELOPMENT ORIENTATIONS 74
6.1 Conclusions 74
6.2 Development orientations 74
REFERENCES 75
Trang 12LIST OF FIGURES
Figure 1.1 2D gantry cranes system used in farm warehouse 1
Figure 1.2 The 2D gantry cranes system used in industry 2
Figure 1.3 The gantry cranes system used in cargo ports 2
Figure 2.1 The 2D gantry cranes 6
Figure 2.2 Mathematical model of 2D gantry crane system 8
Figure 2.3 Motor circuit 11
Figure 2.4 PID control algorithm block diagram 13
Figure 2.5 The intersection of two sets 16
Figure 2.6 The union of two sets 16
Figure 2.7 The complement of 2 fuzzy sets 16
Figure 2.8 Fuzzy inference by MAX-MIN method 18
Figure 2.9 Fuzzy inference by MAX-PROD method 19
Figure 2.10 A basic fuzzy controller 19
Figure 2.11 A simple neural network 22
Figure 2.12 Direct Network 23
Figure 2.13 Regression network 23
Figure 2.14 The structure of the ANFIS system 25
Figure 2.15 The membership function of class 1 is bell-shaped (illustrated) 25
Figure 3.1 Microcontroller STM32F4 Discovery 31
Figure 3.2 Encoder Omron 32
Figure 3.3 Schematic diagram of Encoder Omron 33
Figure 3.4 DC Minertia Motor 33
Figure 3.5 Sharp Encoder 34
Figure 3.6 H-Bridge 35
Figure 3.7 UART TTL Circuit 36
Figure 3.8 The source of beehives 37
Figure 3.9 Hardware wiring diagram 37
Figure 3.10 Flowchart of the control algorithm of the system 38
Figure 3.11 MATLAB software logo 39
Figure 3.12 MATLAB/Simulink Logo 39
Trang 13Figure 3.13 Waijung Library 40
Figure 3.14 The main interface of Hyper Terminal software 41
Figure 4.1 Matlab Function block 42
Figure 4.2 The 2D Gantry cranes system without controller 42
Figure 4.3 System simulation results without controller 43
Figure 4.4 PD controller for the system 44
Figure 4.5 The membership function of the angle input 45
Figure 4.6 The membership function of the angular velocity input 45
Figure 4.7 The membership function of the angle fuzzy output 46
Figure 4.8 The membership function of the position input 46
Figure 4.9 The membership function of the velocity input 46
Figure 4.10 The membership function of the position fuzzy output 47
Figure 4.11 Simulink collects data for anfis training 49
Figure 4.12 ANFIS block interface 51
Figure 4.13 The neural network structure of ANFIS 51
Figure 4.14 ANFIS's fuzzy logic block 52
Figure 4.15 The membership function of the position error input 52
Figure 4.16 The membership function of the velocity error input 53
Figure 4.17 The membership function of the deviation angle error input 53
Figure 4.18 The membership function of the deviation angular velocity error input 53
Figure 4.19 The membership function of the output 54
Figure 5.1 The gantry cranes system control program 57
Figure 5.2 Program of the PD controller 58
Figure 5.3 Simulation results using PD controller 59
Figure 5.4 Controller program ANFIS 59
Figure 5.5 Simulation results using the ANFIS controller 60
Figure 5.6 Fuzzy controller 61
Figure 5.7 Simulation results using the Fuzzy controller 61
Figure 5.8 Control result with initial PD parameter 62
Figure 5.9 Control results with PD parameters after reducing Kp1 63
Figure 5.10 Control results after further reduction of Kp1 64
Figure 5.11 Control results after reducing Kp2 65
Trang 14Figure 5.12 Control results after further reduction of Kp2 66
Figure 5.13 Control results after reducing Kd1 67
Figure 5.14 Control results with PD parameters after increasing Kd2 68
Figure 5.15 Result when using ANFIS controller 69
Figure 5.16 Result when using ANFIS controller with 3 membership functions 69
Figure 5.17 Control result after acting system by hand 70
Figure 5.18 Fuzzy controller result 71
Figure 5.19 Control position results of 3 methods 71
Figure 5.20 Control angle results of 3 methods 72
Trang 15LIST OF TABLES
Table 2.1 Parameters of the object's quantities 8
Table 2.2 The effect of changing an independent parameter 14
Table 4.1 Symbol annotation in fuzzy block 45
Table 4.2 Fuzzy rule table for angle 47
Table 4.3 Fuzzy rule table for position 47
Table 4.4 Range of errors on Simulink 50
Table 4.5 Statistics table of fuzzy rules leading to output membership function values 54
Table 5.1 PD controller parameter 58
Table 5.2 System initial PD parameter 62
Table 5.3 PD parameters after Kp1 reduction 63
Table 5.4 PD parameters after further reduction of Kp1 64
Table 5.5 PD parameters after Kp2 reduction 64
Table 5.6 PD parameters after further reduction of Kp2 65
Table 5.7 PD parameters after Kd1 reduction 66
Table 5.8 PD parameters after increasing Kd2 67
Table 5.9 Fuzzy controller parameters 70
Trang 16CONTENT
Trang 17CHAPTER 1: INTRODUCTION
1.1 Give problem
Agriculture is a profession that can be considered to have existed for a long time and throughout the history of human development With the support of modern equipment and machines, agricultural output has been significantly improved Since that leads to the transportation of agricultural products from the fields to the warehouse or from the distribution warehouse to the factories, traders gradually become a big problem because the number of agricultural products that need to be transported is increasing The 2D gantry cranes system - the subject of the thesis, has been used to solve and improve this problem Starting from transporting grain, and straw to fertilizer and other production materials, the above system has done its job quite well
Figure 1.1 2D gantry cranes system used in farm warehouse
The same demand also appears in the industrial segment Rolled steel sheets weighing approximately 25 tons are too heavy for a mid-range forklift to handle, let alone human power With a simple design that does not take up too much space and
Trang 18is easy to operate, even if a 3D crane system is used, it also has good adaptability to industrial environments
Figure 1.2 The 2D gantry cranes system used in industry
For areas with larger sizes, further, larger capacity, and closer to the river, we will have cargo ports and warehouses These places apply the crane system with a much larger scale and the load that the system will bear also increases with
Figure 1.3 The gantry cranes system used in cargo ports
Through the above three practical problems, students find that the crane system is
a fairly common and highly applicable system With such tasks and activities, it
Trang 19seems quite simple to transport goods from one location to another, but it requires quite high stability control If the gantry crane system controller does not operate smoothly, it can cause great consequences
Realizing the high demand and practicality of the object, the students have chosen the 2D gantry crane's system as the object of study, and at the same time tested the algorithms from basic to more complex that have been taught to practice to find the most effective control method Starting from small models with small capacity, the risk is not high, gradually the topic can be developed to apply larger models with more stringent requirements Therefore the group of students will use a simplified system which can simulate the 2D gantry crane’s motion and chose this topic as their thesis
1.2 Purpose
In order for the topic to be completely and properly planned, students have set specific milestones:
- Building dynamic equations for the 2D gantry crane's system object
- Design of PID controller
- Simulating the 2D gantry crane's system using MATLAB simulink
- Design of Fuzzy controller
- Design of Fuzzy-Neuron controller
- Programming for microcontrollers via Matlab
The most common goal is to realistically model with minimal oscillation while operating up to a set point Through experimental results, students can compare different control methods, thereby drawing conclusions about this topic
1.3 Content
Topics include:
Chapter 1: Introduction: introduces information related to the research object, and
gives the objectives and limitations when implementing this topic
Trang 20Chapter 2: Fundamental theory: Building the dynamic equation of the subject's
object, and presenting the applied theories Introduction to control methods that will
be studied in this topic as well as theories related to controllers
Chapter 3: Hardware and software: Introduction to hardware and software used to
simulate the system
Chapter 4: Controller design: From the dynamic equation, simulate the object as
well as the object's behavior when applying the controller Simulation and design of controllers using Matlab software
Chapter 5: Simulation and experiment: Comparison of results between control
methods at simulation and experimental
Chapter 6: Conclusion and development: Summarize what the topic has done and
propose directions for development
1.4 Limit
In the topic, students will only be interested in:
- Develop a simple 2D crane system model and do not have the same complexity
as a 3D crane and can simulate some basic motion of it only
- Use only 3 control methods (PD control, Fuzzy control, Fuzzy control using ANFIS) and have not applied other controllers
1.5 Research methods and means
For objects with mechanical and physical properties, such as 2D gantry crane systems, the Euler-Lagrange method is a relatively suitable method for students to reconstruct the mathematical model of the object In addition to mechanics, the object also has the electrical characteristics of the DC motor, although it is not too complicated, but it directly affects the system, so the characteristics and parameters
of the motor need to be mentioned and considered
To design the controller, students use PD and Neuron-Fuzzy control methods to summarize and present the analysis of position control for the 2d gantry cranes axis system object This work will be performed and simulated on the Matlab Simulink
Trang 21tool Then compare with the results on the experimental model from which to draw conclusions about the topic
An overview of the research methods used in this thesis:
- Research, survey, and analyze: Refer to a number of topics related to the subject from published scientific articles and research articles, including experimental and simulation models Then build a simulation of the mathematical model on Matlab Simulink and compare it with the experiment to draw the experience
of controlling the object
- Computer simulation: Verify the dynamic equation by simulating on Matlab/Simulink
- Using simulation experience to control the model: Using the model inherited from the previous topic to apply a new control algorithm
Trang 22CHAPTER 2: FUNDAMENTAL THEORY
2.1 Mathematical equations
2.1.1 Introduction about the 2D gantry cranes system
Figure 2.1 The 2D gantry cranes
Gantry cranes are commonly used in many applications such as transporting heavy loads and hazardous materials in shipyards, factories, nuclear installations, and high-building constructions The trolley of the crane should move the load as fast as possible without causing any excessive payload swing at the desired position However, most of the common gantry crane results in a swing motion when the payload is suddenly stopped after a fast motion [1] The swing motion can be reduced, but it will be time-consuming, i.e., reducing productivity Moreover, the gantry crane needs a skillful operator to control manually based on his or her experiences to stop the swing immediately at the right position Furthermore, to unload, the operator has
Trang 23to wait until the load stops swaying The failure of controlling the crane also might cause an accident and may harm people and surroundings
Various attempts at anti-swing control for automatic gantry cranes have been proposed Singhose et al [2] and Park et al [3] adopted the input shaping technique which is the open loop approach However, these methods could not dampen the residual swing angle well Gupta and Bhowal [4] also presented a simplified open-loop anti-swing technique They have implemented this technique based on velocity control during motion These are open-loop approach which is sensitive to parameters change in the system and disturbances
On the other hand, anti-swing feedback controls which are well known to be less sensitive to parameter variations and disturbances have also been proposed in some research, varying from conventional PID (proportional + integral + derivative) to intelligent approaches The best-known controllers used in industrial processes are proportional-integral derivatives (PID) because of their simple structure [5,11] Significant efforts have been put into the PID research area in past years Despite the advancements of control theory, the popularity of PID control design is still a challenge for researchers since its simplicity of implementation and broad applicability Specifically, the tuning method of PID controller for multivariable (non-SISO) system remains interesting
Many algorithms and methods have been developed for the design and tuning of PID parameters [6] The Ziegler-Nichols tuning formula is perhaps the most well-known tuning method for SISO However, most of the proposed methods are applied
to SISO systems where the performance index used is common, such as ITAE, IAE,
or ISE It is sometimes not straightforward to design an objective function (performance index) for a system that is not SISO The gantry crane system is an under-actuated system belonging to SIMO (single input multi output) system When the actuator receives an input signal, the trolley starts to accelerate while causing a swing of payload hanging on a flexible cable Thus, the objective function has to take into account the trolley positioning error and swing angle at the same time
Trang 242.1.2 Mathematical equation of 2D Gantry Crane system
Figure 2.2 Mathematical model of 2D gantry crane system
Where x is the position of the vehicle in the range [-32; 32], θ is the angle of the object relative to the y-axis F is the force exerted by the engine to pull the vehicle to move P is the force acting on the mass m2 is the resting friction force
According to document number [8], students inherit some parameters so that in the end, the 2D gantry crane system that students use will have the typical parameters as shown in Table 2.1 below:
Table 2.1 Parameters of the object's quantities
Trang 25Kb 0.031 The motor reactance constant V
In there:
T!ả" =12 + 12 #$ (2.5) The potential energy U is calculated by the following formula:
Trang 26Substituting (2.13) into (2.5) and replacing (2.4), (2.5) into (2.3) we get:
Substituting (2.14) and (2.6) into (2.2) we get the Lagrange function:
=12 +12 7- + & $ + 2-&$ cos($)8 + 12 #$ + %&'()($) (2.15)
We have the Euler – Lagrange function in terms of 2 variables - and $ as :
Trang 27Suppose x = x ; x = x ; x? = θ ; xA = $ From formulas (2.18) and (2.19), we have:
- + (−&)01(-?)-A+ -: + &'()(-?)-A) = − ,- (2.20)
#-A+ & -A+ %& sin(-?) + & -:'()(-?) = 0 (2.21) Control signal we can use force to act But to resemble reality, students will model a DC motor – using electricity to power the motor to create a torque that acts
on the system
Figure 2.3 Motor circuit
The inside of the DC motor has a structure like Figure 2.5 The structure of a DC motor consists of two parts, the electrical part, and the mechanical part
Applying Kirchhoff's 2nd law to the electric part, we get:
Trang 28Substituting (2.33) into (2.34) and (2.35) we get the system of kinetic equations as follows:
Trang 292.2.1 PID Controller
PID stands for Proportional Integral Derivative and is a controller with a control loop feedback mechanism that is widely used from simple systems to huge systems like ocean liners The control algorithm of PID will be based on calculating the error between the current parameter and the desired parameter, thereby adjusting the input value, and minimizing the error as low as possible
The expression of the PID algorithm has the form:
B( ) = J^_( ) + J ` _(I) I
We have the algorithm block diagram of the PID controller as Figure 2.6:
Figure 2.4 PID control algorithm block diagram
To tune the algorithm input based on three parameters:
- Kp: is the parameter representing the ratio P (Proportional) Multiplying Kp
by the error, we get the proportional output response of the link Increasing the proportional gain Kp will increase the transient time, but at the same time potentially
increase the overshoot and decrease the stability and vice versa
- Ki: is the parameter representing the integral stage I (Integral) Multiplying Ki
times the integral of the error for a period plus the output signal of the controller, we get the integral factor of the system Increasing the integral gain Ki will increase the
steady-state and transient times, but significantly decrease the stability and vice versa
- Kd: is the parameter representing the derivative D (Derivative) Multiplying
Kd by the error derivative, we get the system's output differential factor Increasing the differential gain Kd reduces the transient and steady-state times and theoretically
Trang 30has no effect on the stability error and vice versa Especially if Kd is smaller, the
stability of the system will be improved
An overview of the impact of changing an independent parameter is shown in Table 2.2 below:
Table 2.2 The effect of changing an independent parameter
Parameter Transient Steady-state Stability error Stability
decrease Less decrease No impact
Improve if Kd
is small Based on the above characteristics, students realize that for the object of the topic, the stability of the system is the most important factor The instability of the system will make it difficult for the deviation angle theta to stay in the least volatile state Therefore, students decide not to include the integral gain factor Ki inside the PID controller or can consider Ki of the system to be zero
2.2.2 Fuzzy controller
2.2.2.1 Development history
According to the literature [7], fuzzy thinking was first proposed by Lotfi A Zadeh
of the University of California in 1965 and began to build on that idea until 1973, the concept of fuzzy linguistic variables was introduced to the scientific community at that time, but did not receive any significant attention By 1985, a complete fuzzy system was designed by two Japanese engineers Seiji Yasunobu and Soi Miyamoto, the system was simulated and used experimentally to control acceleration and braking
on trains in 1987 Since this period, the fuzzy control method has started to receive more attention and research in key fields such as cars, manufacturing plants, etc… In the same year, Takeshi Yamakawa demonstrated how to use a fuzzy controller through a dedicated fuzzy logic chip on a rotating inverted pendulum and released one of the classic control topics
Trang 31In 1988 Japan established an International Laboratory dedicated to Fuzzy technology with the participation of forty-eight companies with an interest in this field The results of this work can be seen as very successful when fuzzy is applied
to many later products, such as Matsushita's vacuum cleaner that adjusts the suction power based on the level of dust read from the sensor, or the self-collecting camera Canon's focus adjusts the position of the lens
In 1995, the Maytag company's smart dishwasher was launched
In 2017, Xiera Technologies developed the fuzzy controller auto-tuning tool The technology has been validated by Mohawk University and can be applied to two-in two-out or three-in-three-out non-linear systems
2.2.2.2 Fuzzy set
Fuzzy thinking is currently one of the most widely used and applied methods in many fields, especially in controlling machinery and equipment The fuzzy concept gives a value that cannot be expressed as true or false like the bit data type of computer To form a fuzzy system, we need to define two factors:
- Fuzzy set: a set of input values that do not need to be clearly demonstrated to belong to the set Whether the value belongs to the set or not will be evaluated gradually, and at the same time it has a relationship called the membership function
- Membership function: is a necessary element to define a fuzzy set, usually a term describing function characteristics or because it is a mathematical formula 2.2.2.3 Operations on fuzzy sets
Trang 32Figure 2.5 The intersection of two sets
Trang 33To be able to establish a fuzzy relationship, we have two main types to rely on: the establishment between the fuzzy relationship and the fuzzy relationship, and the establishment between the fuzzy set and the fuzzy relationship The above two types are almost the same, after all, the fuzzy relation is also a fuzzy set but is defined on a multidimensional basis set
Assuming Cg is a fuzzy relation on XxY, de is a fuzzy set on X, the formation of Cg and de is a fuzzy set ,g, denoted by:
cpg(q) = crg°Wg(q) = w (crg(-) cWg(-, q) (2.45) 2.2.2.5 Fuzzy inference method
A fuzzy inference method is a set of values of one or more inputs that have been dimmed in the form of linguistic values, from which computations draw conclusions about the fuzzy value for the output There are many fuzzy inference methods, but the two most commonly used are:
- MAX-MIN inference method:
Consider the kth rule of a fuzzy rule system
Trang 34Figure 2.8 Fuzzy inference by MAX-MIN method
- MAX-PROD inference method:
With the same assumption (2.46), instead of applying the max-min formula, we use the max-prod formula for fuzzy inference to calculate the inference result, we have:
cpz}~(q) = |x cpz~(q)} (2.48) Where |x = ∏ {max
Trang 35Figure 2.9 Fuzzy inference by MAX-PROD method
2.2.2.6 Fuzzy system
A basic fuzzy system will consist of three components: the fuzzy block, the rule system, and the defuzzification block, according to the literature [7] The fuzzy block collects and modifies the input values to singleton form, i.e crz }(-) = Š1, 0y - = -0, 0y - ≠ -ƒƒ The rule system will process data from the fuzzy block based on the inference methods and fuzzy rules given during the design The defuzzification block will process the calculated signals from the fuzzy rule system into physical signals that can be used by the system
Figure 2.10 A basic fuzzy controller
The fuzzy control method is no longer either strange, there are many studies, rules, methods of fuzzy and defuzzification, inference methods, etc… have been implemented in many fields In many cases where it is difficult to get an accurate mathematical model of the system because of its complexity, the use of fuzzy is a great solution But the controller design mainly still needs the experience to determine the input fuzzy set of the controller as well as fine-tune the fuzzy rule systems to
Trang 36achieve the desired control results Just choosing the rule systems will take a lot of time proportional to the volume of input and output
2.2.3 The Neuron System
2.2.3.1 Definition
The Neuron system, also known as the nervous system, the neural network in control engineering describes the actual operation of the neural network in the human body, thereby building a simple mathematical model that shows it The neural network will consist of many neurons, where computations are processed, and connected together to form connections Each link is associated with a weight, which characterizes the excitatory or inhibitory properties of the neuron [7] In practical applications, neural networks are applied as nonlinear system data modeling tools Re-model the relationships between input and output data, taking advantage of the learnable properties of the network to apply it to image processing …
2.2.3.2 Nerve cells
The nerve cell is considered the most central processing unit of the neural network, depending on whether the neuron receives data as input or output, there will be different types of processing functions
For the case of input processing functions, the sum function will have the form:
Trang 37y = 1_ = Œw G•-•
••
Ž − $
(2.51)
In the above expressions, $ is the threshold level of nerve cell[7]
In the case of an output processing function, the function is called an action or transfer function and has the form like:
Trang 38A simple neural network will have artificial neurons linked together and divided into three layers:
- Input layer: where data is received directly from the source and then processed for analysis, classification, and transfer of that data to the next layer
- Hidden layer: this is the layer with the largest number of neurons, as well as the layer whose density is more or less no specific number This is the main data processing place, receiving data from the input layer and doing more intensive calculations
- Output layer: this is the layer that produces the final result of all data fed into the artificial neural network There will be one or more outputs, depending on the complexity of the network you design ourself
Figure 2.11 A simple neural network
In fact, when it comes to using neural networks, one is not talking about a simple neural network but an intensive neural network architecture With the number of inputs and outputs, and the number of hidden layers is a much larger number with millions of nerve cells creating links with each other Theoretically, it can imitate and learn with any type of input or output data In return, it requires hundreds of thousands
of times more training than usual The application of intensive neural networks can
be used in many fields such as weather forecasting, risk assessment, technical data analysis, etc…
Trang 39Depending on the network structure, we can have many types of neural networks, the most prominent and popular are the two types of neural networks:
- Direct Network: A network in which data flows only from input to output
Figure 2.12 Direct Network
- Regression network: is a network where data plus data feedback from the output back to the input
Figure 2.13 Regression network
In parallel with the network structure, the network training method should also be considered when using There will be two different learning methods used until now and popularly:
- Parameter learning: update the link weights and then process the data calculation Besides the array of learning parameters, there are three distinct types:
Trang 40+ Supervised learning: the data used for training are the desired pairs of input and output data samples available
+ Reinforcement learning: based on the correctness of the weight matrix to evaluate and give feedback without instructions on how to change the weights correctly
+ Unsupervised learning: Without a given desired data pair, nor a true or false degree of the weight matrix, the network must detect and change the parameters itself to produce the correct results
- Learn the structure: change the network structure to suit the object
It can be seen that the neural network works best with a lot of input and output data
of the required system used for training It can also learn and improve the input data processing, thereby producing the output data However, the critical point of neural networks is that for objects that are vague and have no clear characteristics, the network will be almost useless to use for control
2.2.4 ANFIS Controller (Adaptive Neuro-Fuzzy Inference System)
2.2.4.1 Definition
ANFIS (Adaptive Neuro Fuzzy Inference System) is an adaptive fuzzy inference neural network structure and can be considered as an extension of the Takagi-Sugeno fuzzy model presented by Jyh-Shing Roger Jang and Chuen-Tsai Sun in 1994 Since then, it has become popular and widely applied in many fields and gradually replaced the traditional fuzzy Its feature is to combine the good aspects of both fuzzy systems and neural networks and remove their aforementioned limitations It can be said that the ANFIS system is a fuzzy system capable of learning or a neural network that can receive fuzzy, unknown input data
ANFIS is a fuzzy neural system that uses five layers of neural networks along with supervised learning and has the following structure: