Hybrid fuzzy-based sliding-mode control approach, optimized by genetic algorithm for quadrotor unmanned aerial vehicles

According to the diverse applications of quadrotors in various military and space industries, this study attempts to focus on the modeling and simulation of a particular type of such robots, entitled unmanned aerial vehicles. The quadrotors are the vertical flying robots that contain four engines with impeller and it is possible to control this flyer with respect to the transitional force on these impellers. In fact, the quadrotors are the flyers with four propellers in a crisscross structure. These propellers allow the possibility of various movements to the quadrotors in such a way that control signals are applied to its operators and the difference in rotor speeds leads to the generation of different forces and movements. Such systems are dynamically unstable. Due to the nonlinear nature of quadrotor systems, modeling uncertainties and unmodeled dynamics in these systems, the need to design a suitable controller for optimal performance in different working conditions is strongly felt. In this paper, research on the modeling of unmanned flying robots in recent years is firstly reviewed and a mathematical model has been proposed for quadrotor robots with 6 degrees of freedom on the basis of the popular Newton–Euler equations. In the following, the capability of hybrid fuzzy-based sliding-mode control approach has been used to ensure the system stability. In addition, the genetic algorithm has been added to the control structure in order to optimize the proposed control system to meet the requirement of realizing fuzzy-based control approach. The results of the simulations in Matlab software clearly demonstrate that the state variables of the quadrotor robot reach a certain situation and place at the right time, once the nominal inputs are considered.


Introduction
Nowadays, with regard to improvement in use of space capabilities, the process to design spatial robots regarding removal of human parameter keeps expanding, under which is expected that robotic systems play a major role in the future of space applications [1]. Therefore, the design of dynamic models from space robots has been increasingly drawn into attention [2][3][4].
Long time has passed from lifetime of fixed-wing vehicles that such vehicles due to optimization of energy consumption have been widely drawn into attention, yet they have constantly suffered from the lack of power of maneuverability, at the affairs pertaining to unmanned vehicles. For instance, small air flasks can easily be controlled so far as there do not exist wind and turbulence. Under this state, natural lifting force causes moving aerial vehicle, yet causes decreasing its power of maneuverability. Helicopters have numerous advantages than fixed-wing vehicles and balloons especially at control and the reason for this can be known in their ability in take off and land at small area of space as well as high power of maneuverability. In addition, static flight (hover) has been regarded as one of the capabilities of aerial vehicles, mentioned top of aims. On the other hand, these advantages lead to difficulty in control of helicopters for which different sensors as well as rapid processing boards are required. Unmanned aerial robots have been regarded as efficient and practical solutions to cope with this challenge in helicopters. Building unmanned aerial robots include synergic combination at different stages including design, selection of sensors and development of controllers. All the stages are fulfilled in an integrative and parallel way, so that, each one affects another one. To build autonomous unmanned aerial robots, high information on position and direction is required. Such information is provided through self-stabilizing sensors such as inertial navigation system (INS). Global positioning system (GPS) and/or sensors such as sound navigation and ranging (SONAR) [5]. With regard to increasing trend of research at the area of unmanned vehicles especially quadrotors, the present research will intend to examine, simulate and control aerial robots [6].
In recent years, aerial robots or unmanned aerial vehicles (UAVs) regarding removal of human operator have been drawn into attention as the aerial instruments with wide applications and capabilities [1]. With regard to high potential of aerial instruments for flying at points that the manned aerial vehicles fail to access them, investigation, analysis and control of such system have been transformed to an important issue. Nowadays, UAVs develop an important part of scientific studies pertaining to military industries. Unmanned aerial vehicles compared to the systems that are conducted by man's intervention can have a high protective role in human's life at hazardous environments.
Autonomous aerial vehicles have been witnessed with numerous commercial applications. Recent advancements at areas of energy storage with high density, integrated miniature operators. Micro-electromechanical systems (MEMS), construction of miniature unmanned aerial robots has come to realize. This has opened the way towards complicated applications at military and non-military markets. Currently, military applications propose the leading part of UAVs with huge increasing in industrial sector. With regard to growing increase of research at the area of UAVs especially quadrotor, the present research seeks to examine, simulate and control these UAVs [5].
Quadrotor has been mentioned as a useful tool for researchers at universities to engage in examining new ideas at different areas including flight control theory, guidance and navigation, real-time and robotic systems. In recent years, most of universities have conducted research on complex aerial maneuvers through quadrotors for which different controllers have been designed. Since quadrotors are so maneuverable, they can be beneficial under any environmental conditions quadrotors with the flight ability in an independent way can assist for removal of required manpower at hazardous situations, whereby this ability represents the main reason for increasing research on these systems in recent years [6].
With regard to significance of topic of this research, to date numerous activities have been conducted at the area of optimization of UAVs via nonlinear controllers, so that there are numerous ways to control an UAVs [4,7,8]. Use of fuzzy logic regarding capabilities of this method in controlling nonlinear systems is one way to control UAVs. For instance, in long lost past, a variety of research to improve membership functions in fuzzy controllers which had been used in UAVs have been conducted via genetic algorithm, that also this theory has been used to detect status of system, indicating such a theory as a suitable method to detect status of aerial robot. An adaptive neuro-fuzzy inference system to control position of an aerial robot at three-dimensional space has been designed in reference [9], and a new idea which has integrated advantages of neural network method with advantages of fuzzy logic to control an aerial robot has been proposed in [10].
To date, numerous studies have been conducted at the area of control of quadrotor unmanned aerial robots. According to reference [11], sliding-mode control approach has been used to regulate the force at quadrotor engines. This is in a way that a sliding surface entitled as the suitable return for force at four engines has been defined, aiming at sliding force to this sliding surface so far as the force at each of these engines removes from this return. These controllers due to sustainability of system at nonlinear models have been mentioned as a suitable item for control. Yet, the phenomenon of chattering has been found as a defect in these controllers for which no solution has been represented to cope with it.
In [12,13], an output feedback adaptive fuzzy model following controller is proposed for a nonlinear and uncertain airplane model. The unknown nonlinear functions are approximated by fuzzy systems based on universal approximation theorem, where both the premise and the consequent parts of the fuzzy rules are tuned with adaptive schemes. Thus, prior knowledge and the number of fuzzy rules for designing fuzzy systems are decreased effectively. Also, to cope with fuzzy approximation error and external disturbances an adaptive discontinuous structure is used to make the controller more robust, as long as due to adaptive mechanism attenuates chattering effectively. All the adaptive gains are derived via Lyapunov approach thus asymptotic stability of the closed-loop system is guaranteed.
Type-2 fuzzy neural networks have a high ability to detect and control nonlinear systems and change systems over time as well as systems with uncertainties. In [14], the method of designing type-2 fuzzy neural adaptive (inverse) controller has been studied in order to control on-line an example of a nonlinear dynamical system of flying robot. In this reference, the class structure of interval type-2 fuzzy neural networks of T-S model has been displayed first. It has seven layers that fuzzy operation is carried out by the first two layers, which contains type-2 fuzzy nerves with uncertainty in the center of the Gaussian member functions. The third layer is the layer of rules and in the fourth layer, the operation of reducing degree is performed by matching nodes. Layers of fifth, sixth and seventh include the resulting layer, layers of calculating the center of gravity and layers of output, respectively. To teach network, decreasing gradient algorithm was used with adaptive training rate. Finally, in the section of the simulation of adaptive inverse on-line control with interval type-2 fuzzy neural network of model T-S and adaptive neuro-fuzzy inference system (ANFIS) for nonlinear dynamic system, a robot sample drone with certain parameters and with uncertain parameters were compared. The results of simulation show the effectiveness of the proposed method in this reference.
In [15], type-2 fuzzy neural network with fuzzy clustering method is used to identify structures and update the parameters of the condition and the gradient algorithm is used to update the parameters of the result. Also in this reference, it has been indicated that the method of fuzzy clustering is not appropriate for identifying and on-line controlling. In recent years, various methods for training type-2 fuzzy neural networks have been suggested, such as genetic algorithm [16] and PSO [17]. With the expansion of research in the field of type-2 fuzzy systems, these systems have found wide applications, including the prediction of time series [18], linear motor control [19], sliding-mode control [20] and control of robots [21].
For the first time Han et al. [22] have proposed an adaptive fuzzy-based control of sliding mode, which estimates input and output parameters of member functions by means of matching rules that are extracted from a Lyapunov function. But in their approach, asymptotic stability is not guaranteed and it results in an error of permanent state. Recently, Lin and Hsu [23] designed a new method of controlling adaptive fuzzy sliding mode for controlling a servo motor in a manner that estimates the parameters of member functions of input and output by means of matching rules that are extracted from a Lyapunov function and they do not need to be specified by a designer. Furthermore, at the expense of having discontinuous control, they have asymptotic stability. But the method is only applicable to a particular motor system. Peng and Shi [24] presented a new and direct method of controlling adaptive fuzzy of sliding mode for a class of flying robots that estimates the parameters of member functions in input and output by means of matching rules that are extracted from a Lyapunov function. Therein a proportional-integral adaptive controller is used to increase the consistency that ensures asymptotic stability.
In this investigation, with regard to an overview on the research in the area of modeling of the UAVs via Newton/Euler equation, a model has been proposed for quadrotor robot with 6 degrees of freedom. In following, the capability of fuzzy-based sliding-mode control approach, optimized by the genetic algorithm has been used to assure the sustainability of system. This research has organized in line with five sections, while after introducing the key materials, in the second section, based on the equation of 6 degrees of freedom through Newton-Euler equation of rigid body, a nonlinear model for the drone robot of quadrotor UAV is extracted. It is to note that in the third section, the hybrid fuzzy-based sliding-mode control approach is realized to address the weaknesses of the structure of the traditional sliding-mode control approach. In fact, there is the idea of combining it with the genetic algorithms and also fuzzy-based approach to be newly proposed. Subsequently, in the fourth section, the results of the simulations regarding the hybrid fuzzy-based sliding-mode control approach, optimized by the above-referenced genetic algorithm on UAV quadrotor model have been described and finally the last section is dedicated to conclusions.

The representation of a nonlinear dynamic model for quadrotor UAVs
It should be first noted that quadrotor uses four separate engines to create driving forces and movement, at threedimensional space, in general. Figure 1 represents a general schematic of a quadrotor.
Height and angle for setting robot in space are controlled through regulating speed of circulation at each of engines. Propellers at backward and forward rotate counterclockwise, yet the propellers at left and right sides rotate clockwise. This way for rotating blades meets the need to tail rotor. Four basic movements based on speed at rotation of engines are considered for a quadrotor. Movements roll, pitch, yaw and movement alongside axis z or height. To move alongside axis Fig. 1 A schematic of quadrotor [25] z, speed of four engines must be equal with each other, yet speed of the left engine is greater than the specified extent and speed of right engine is under the specified extent in movement roll, yet rest of engines have fixed speed, causing rotation around axis x, at movement pitch which rotates around axis y, the backward engine rotates with higher speed and the forward engine rotates with lower speed and rest of two engines rotate at fixed speed. Ultimately, at movement yaw, the left and right engines will rotate at lower speed and the backward and forward engines will rotate at higher speed at counterclockwise rotation by an angle θ about the z-axis. At all basic movements, all the forces raised through engines must be equal to the force at first state which is movement alongside z-axis [26,27].
Quadrotor is a flying vehicle with rotary wings. This flying aircraft receives various physical effects from the fields of aerodynamics and mechanics; therefore, the quadrotor model should consider all the important effects, including gyroscopic effects that enter it. This model can be evaluated and analyzed based on kinematic and dynamic relationships. Quadrotors contain 6 degrees of freedom follows [28]: 1. x: Quadrotor's movement in the direction of the axis x (surge); 2. y: Quadrotor's movement in the direction of the axis y (sway); 3. z: Quadrotor's movement in the direction of the axis z (heave); 4. φ: Quadrotor's rotation around the axis x (roll), where φ ∈ − π 2 · π 2 ; 5. θ : Quadrotor's rotation around the axis y (pitch), where θ ∈ − π 2 · π 2 ; 6. : Quadrotor's rotation around the axis z (yaw), where ∈ (−π · π).
For modeling, it is required to extract the equation with 6 degrees of freedom pertaining to the rigid body among Newton-Euler equations. The model derived from the flying robot quadrotor is as follows: (1) In model (1), r has been defined as r = 1 − 2 + 3 − 4 , where: • 1 represents the impeller speed at the front part of the quadrotor; • 2 represents the impeller speed on left side of the quadrotor; • 3 represents the impeller speed at the back of the quadrotor; • 4 represents the impeller speed on left side of the quadrotor.
In model (1), u 1 represents the total propulsive force in the body of quadrotor in parallel with axes z. u 2 and u 3 which, respectively, show such inputs as roll, pitch and u 4 yawing moment and are defined as the following relations: where F i = b 2 i represents the generated thrust on part of the four rotors existing in the structure of the quadrotor robot and are considered as real control input signals, which are applied to the system dynamics model. Other parameters of the model (1) and relation (2) are as follows: • m: total mass of the quadrotor; • K i : constant coefficients of the drag; • g: gravity acceleration of the ground; • l: distance between the center of each rotor from the center of quadrotor mass; • I x , I y and I z : the quadrotor's moment of inertia; • J r : moment of inertia belonging to the impellers of each rotor; • b: the quadrotor's ascending coefficient; • d: coefficient of drag for moment sampling.
In the simulations, for fixed values of the parameters that exist in the quadrotor dynamic equations, the values of a sample quadrotor are used in [28] and are all tabulated in Table 1. Now, in this research, the first step is to model the behavior of the robot quadrotor and validate dynamic equations of the system for open-loop. In Fig. 2, the response time of the state variables regarding the robot system without the presence of controller is shown.
By a close look at Fig. 2, it can be concluded that the state variables of the present robot system are unstable and its open-loop strategy is incapable of meeting the key needs of the designer in case of the system.

The hybrid fuzzy-based sliding-mode control approach realization
At first, to design the sliding-mode control approach, the UAV robot in (1) is divided into two subsystems as follows: The first step in implementing the sliding-mode control approach is the design of this controller for subsystem (3).
To this end, new variables are defined as follows: where Now, the sliding surfaces are defined as follows in order to follow the desired paths by the system states: In relation (7), m 1 , n 1 , m 2 and n 2 are positive odd integers wherein the relations m 1 < n 1 and m 2 < n 2 hold true. Consideration of sliding surfaces as (7) is focused on the time limit for the detection of the states, which is the main objective in UAV quadrotor systems. In the following, the control rules pertinent to u 1 and u 4 are calculated using the equivalent control method in sliding mode (i.e.,ṡ = 0) as follows: In the following, the equations pertaining to the subsystem (4) can be examined to control other system states. To this end, a series of new definitions in this case is presented as follows: With the new definition of the states, the subsystem (4) is now changed as follows: where Then, the tracking error has been defined as follows: Now, sliding surface can be defined in linear mode for the achievement of stability in the states of the subsystem (4): Thereafter, the control rule U 2 = u 2 u 3 has been calculated as follows through the equivalent control method in sliding mode (i.e.,ṡ = 0):

Reference SMC control
For applying the rules of the sliding-mode control approach (8) and (15) to the robot model of quadrotor UAV, the software MATLAB is accurately carried out. The numerical values of the parameters of the sliding-mode control approach are acquired [28] and are presented in Table 2. The results for this controller are illustrated in Figs. 3, 4, 5, 6, 7 and 8.
The results of applying the sliding-mode control to the quadrotor UAV in Figs. 3, 4, 5, 6, 7 and 8 illustrate that the aforementioned sliding-mode control designed in this research about subsystem (3) namely, the state variables z(t) and ψ(t) has acceptable performance, while regarding subsystem (4), namely, the state variables x(t), y(t), φ(t) and θ(t), it suffered a serious overshoot and had no optimal performance. Absence of sufficient flexibility in the nonlinear behavior can be considered as a major cause of inefficiency of sliding-mode control in the stabilizing state variables of subsystem (4). In the following section, in order to deal with the weaknesses in the structure of the sliding-mode controller, the idea of combining the controllers with intelligent algorithms will be implemented.
The fuzzy-based control approach shows high flexibility due to the lack of limitation on part of control signals to the mathematical absolute values. Hence, the idea of combining the sliding-mode control approach and fuzzy-based control approach can be an efficient way to improve the weaknesses of the above-referenced one against the nonlinear behaviors in the systems with uncertainty. Due to optimal performance of the sliding-mode control approach in the stabilizing states of z(t) and ψ(t), the fuzzy-based control is designed in this study to concentrate on the upgraded performance of con- (4)). By considering the fuzzy-based control in the structure of the sliding-mode control approach, the new control signal U 2 can be of the following forms: where FSM denotes the output signal of the fuzzy-based control and the signals pertaining to s i M , i = 5.6 have been proposed to normalize the fuzzy-based control and hold true in the following relation: Therefore, one can argue that the proposed structure of the fuzzy-based control includes two inputs, namely s 5 /s 5M and s 6 /s 6M and one output, namely FSM. The structure of hybrid fuzzy-based sliding-mode control approach is illustrated in Fig. 9.
To implement the fuzzy-based control approach, the fuzzy logic designer toolbox in Matlab software is directly used. Membership functions of the inputs and its output of the present control approach are shown in Figs. 10 and 11.
Despite the optimal impact of fuzzy-based control on the performance of the sliding-mode control approach, one of the weaknesses in the structure of the controller is lack of access to accurate information, in order to design the optimal sys- Fig. 9 The structure of hybrid fuzzy-based sliding-mode control approach tem. Given that considering the model of quadrotor UAV, in this research, such information is not available; therefore, the designed fuzzy-based sliding-mode control approach is incomplete and its performance is not optimal. To deal with this problem, a lot of resources are analyzed, which led to the idea of adding the genetic algorithm optimization to the structure of hybrid fuzzy-based sliding-mode control approaches. The reason to choose the genetic algorithms is regarding their parallel nature of random search on the problem situation because each of the chromosomes randomly generated by this one is considered, as a new starting point to search for a part of the problem situation and search on all of them takes place, simultaneously. In addition, there is no limit on the search path and choosing random answers. In fact, the main purpose of implementing a genetic algorithm is to determine the rules of designing fuzzy-based control approach in such a way that the control does not need information of the expert and be able to work, efficiently.

Controller
In this investigation, each of the two inputs and only output of the fuzzy-based control contains five membership functions. In order to optimize the fuzzy sliding control by means of intelligent fuzzy algorithm, fuzzy-based control inputs and output are replaced with binary numbers as follows: Inputs and output: As it can be observed, all membership functions of the fuzzybased control have been replaced 3-bit binary numbers. It is necessary to mention that the first bit in these numbers represent the sign; indeed, if it equals one, it will be a negative number; and if it is zero, it will be a positive number. In the following structure, this model has been shown for one of the membership functions of fuzzy control.
It is obvious that fuzzy rules are created as a result of the combination of the membership functions of fuzzy control.
As an example, the first rule of fuzzy-based control can be defined as follows: if (s 5 /s 5M , is NB) and (s 6 /s 6M is NB) then (FSM is NB).
Equivalently, each of the fuzzy rules can be expressed as the binary numbers attributed to them. For example, fuzzy rule (20) goes as follows: .
In this study, each of the fuzzy rules expressible in the design of fuzzy sliding control is defined in the form of a chromosome in order to design the intelligent genetic algorithm. In this way, the number of 5×5×5 = 125 is defined as follows: According to Eq. (22), there are three binary numbers in each 9-bit chromosome which mutually represent the input-output modes.
In this study, for the conduct of optimization by the genetic algorithm, the objective function has been selected out regarding fitness functions and the main goal is the minimization of these functions. The objective functions used in this study are as follows: The performance of the genetic algorithms in simulation is such that, after the determination of the results for each chromosome in each stage, the best one, which includes the chromosome with the fastest response is transferred to the next generation as the elite and the remaining ones are integrated together using mutation and hybrid methods to produce the next generation.

The results of the simulations
In order to implement the proposed control strategy, it is necessary to calculate the design parameters for the genetic algorithm. These values are tabulated in Table 3. In this work, the initial random population is considered based on the total number of defined rules for fuzzy-based control (the number of chromosomes in the genetic algorithm). The rest of the Table 3 was obtained by the information contained in the conducted study in [29] or by trial and error methods. Finally, after the implementation of the genetic algorithms in the software Matlab, top chromosomes (optimized fuzzy rules) are obtained according to member functions defined in Figs. 10 and 11 which are shown in Table 4.
By applying the optimized results obtained from the genetic algorithm in the structure of designed fuzzy-based  Table 4 The best fuzzy rules obtained for the fuzzy-based sliding mode control approach from the genetic algorithm sliding-mode control approach, it is expected that improvements can be made in the objectives of the control system. To prove this claim, the results obtained in this study are compared with the results of research carried out in [30], where type-2 fuzzy-based control is realized to stabilize the robot of quadrotor, and are illustrated in terms of the state variables of six systems in Figs. 12, 13, 14, 15, 16 and 17. Due to the limitations of the mechanical structure in modeled robot of quadrotor, the results obtained can be analyzed.
The mission of the studied robot is that in a vertical axis it can be as high as 3 m from the ground and have a minor rotation around it (0.5 radians). According to Figs. 12, 13, 14, 15, 16 and 17, it can be argued that the designed control strategy in this article has been able to achieve these goals. Since the intended robot does not have the ability to move or rotate around the x-axis and y-axis, thus in order to prevent the diversion of robots from the required route and also for the realization of the desired control objectives, it is essential that other state variables of system converge to zero. The results indicate that these demands have been met when robot was flying. Importantly, the state variables of system are stabilized without the need for expert information for designing fuzzy control. Therefore, we can conclude that the proposed genetic algorithm in this article has implemented its task properly.
Since the practical issues of control, sustained pressure on the actuators is very important, being aware of the control efforts is essential. Therefore, in the following, the signals generated by the fuzzy-based sliding-mode control approach, optimized by genetic algorithm, in order to apply to existing engines in structure of the quadrotor robot are shown in Fig. 18.
To compare the results obtained in this study with previous potential similar benchmarks, the implemented control algorithm for fuzzy-type 2 in the study [30] is investigated, in order to stabilize a drone robot of quadrotor. After the  survey was conducted, the control parameters for both methods are extracted and compared with each other in Table 5.
After integrating the absolute value of the output level for each controller in the designed method in this article and presented method in this study [30], the following results were achieved. As can be seen, the designed control strategy in this study could perform better both in reducing the amount of control efforts and in achieving of the control objectives.

Conclusion
In order to direct a sample of quadrotor robot automatically, in this paper, the capacities of hybrid fuzzy-based slidingmode control approach optimized by genetic algorithm was used. The main advantages of this approach are the following: • ensuring the stability of nonlinear system of robot due to the use of sliding-mode control; • ability to deal with the disturbance and uncertainty in the system due to the use of fuzzy control; • lack of need for expert information about the robot system so as to control design phase because of the use of genetic optimization algorithm.
Finally, the cited procedure for experimental model is a sample robot of simulated quadrotor. By comparing the results, it can be concluded that it is in line with previous similar studies and indicated that the proposed method has attempted to control signals of u2, u3 and u4, but the control signal of u1 was weak. Also it could dramatically improve the control parameters of maximum overshoot and landing time of state variables system. Some disadvantages of the proposed approach can be a high volume of computing and slow process of simulation compared with earlier work, which can be caused by a combination of the proposed algorithm. To cope with such a phenomenon, the use of intelligent algorithms such as optimization of multi-purpose development as part of future work in this area is suggested.