Different Autopilot Systems Design For a Small Fixed Wing Unmanned Aerial Vehicle

The aim of this study is to design an autopilot system for Unmanned Aerial Vehicle (UAV) in a small size and to compare the efficiency of the systems designed with different methods. For this purpose, linearized equations of motion for a small size UAV is firstly obtained. Then the state space equations are used to check the stability characteristics of the UAV. Using the classical method, the longitudinal pitch angle,  altitude and speed controller are designed for separate transfer functions according to the location curve of the roots and the desired response values. The values were determined by considering the effects of  P, I and D and the response of the system together. On the other hand, a feedback design has been designed to improve the stability of different lines and an orientation controller has been designed. Another method used was Adaptive Network Based Fuzzy Inference Systems  (ANFIS) controller design. The value ranges and numbers of the input and output functions are tried to be determined by some predicted and known values. Arrangements for input and output coefficients were made and the results were tried to be improved.


Introduction
In recent years, unmanned aerial vehicles have been the subject of both official and private researches due to various uses. These types of vehicles are used for many purposes, such as searching, carrying out various military tasks, conducting atmospheric research and agricultural data collection. New studies are carried out for the development of both military and search and rescue mini and micro UAV dimensions (Çoban and Oktay, 2017). The smaller the size of the vehicle, the lower the cost of both the construction cost and the use. For both military and special purpose jobs, small aircraft are preferred for these reasons. One disadvantage of this type of tools is the aerodynamic requirements, which vary in size.
During the literature search, articles and thesis abstracts and theses on modeling and control systems design on various aircraft and especially UAVs were examined. The main objective is to use the classical control system, which is thought to be used in the thesis, the design of linear quadratic control system for the optimal control system and the control system applications based on fuzzy logic applications are reviewed more carefully, the differences in the model and the non-linear control applications and the effectiveness of the control system and future studies.
Modeling is an important step for controlling the system in various conditions. The necessary coefficients for UAV type vehicles can be provided with a non-linear model which was previously created to find the aerodynamic parameters and then the values determined by flight tests (Çoban and Oktay, 2017). These data can also be tested with simulation programs that provide the required conditions. The model can then be linearized and adapted to the desired control design (Çoban and Oktay, 2018;Fahlstrom and Gleason, 1998). In the same way, it is also possible to design a general control system by using the model lineerization method for different flight conditions (Kumon et al., 2006).
Once the model of the aircraft was obtained for the desired conditions and the longitudinal and lateral state equations were found, a study of the ground curve of the roots for stability control was performed in the studies, so that the effect of small changes on the character of the aircraft was calculated (Fahlstrom and Gleason, 1998;Kumon et al., 2006;Christiansen, 2004;Kinoshita and Imado, 2006). Similarly simulating the equations of the aircraft, it is also possible to understand how to treat the aircraft in known modes. A similar study was performed with lateral dutch roll and spiral modes, and a longitudinal period with a short period mode (Lopez et al., 2007). There is also the possibility of comparing the model with the real flight data and coefficients determined by the same methods.
After deciding the desired control design, cycles are formed according to the stability or direction determination characteristics to be produced by the controller. For example, the controller design for a small-scale aircraft was followed by a study to follow the situation according to the flight curve instead of the nested design for the classic role mode, pitch angle control, alignment and height control, and a study was performed to correct the errors to pass through a specified curve, with the equations according to the angle of the elevator, the lateral position is controlled by the equations according to the aileron, elevator and rudder angles and by the PID control structure by using the equations (Mermoud and Gonzalez, 2006). In another study, the coefficients were determined using the ground curve of the roots using classical feedback cycle for both longitudinal and lateral control, the stability increasing cycle including the pitch angle and angle change for the pitch angle, using the velocity control for speed control for longitudinal total control and Considering the change in pitching angle, the total cycle in which the pitch angle control was updated was calculated, and in lateral control, coefficients were calculated by using a cycle that considers the tilt angle and angle changes for the role mode control together with the deflection angle change (Nelson, 1998). In a study, the classical control methods were used to design a control system that provided the angle of attack, wobble angle and speed control for the model found, the angle of attack in the longitudinal control and the control of the pitch angle provided by the feedback and the addition of the PI controller; the control system was again created by the addition of a PI controller ( Vural and Hajiyev, 2008). In another study, external controllers such as height, direction and speed were designed as PID. The internal controllers are the side-tilt angle and tilt angle control, the pitch angle for the deflection angle, the pitch angle for the longitudinal movement and the pitch pitch change and the longitudinal speed controllers, respectively, for role mode control for lateral motion (Lopez et al., 2007). As seen, although different methods are applied, internal controllers for pitching, tilting and deflection angles and interactions with each other and generally external controllers such as height, longitudinal speed and direction of rotation are designed for longitudinal and lateral control of the aircraft. Classical control methods are also known to give good results for UAVs, and they are often used in autopilot control systems. With the development of artificial intelligence techniques, human decision making processes are left to computers. With the development of this field, artificial intelligence techniques have found their place in control systems (Bilgic el al., 2016;Şen et al., 2016). Bilgic et al. designed the LQR controller for the stability control of an experimental cart pendulum system and used the controller application data as training data in the ANFIS environment. In this way, they have designed a fast and efficient fuzzy controller (Bilgiç et al, 2014). In this study, a new approach to fuzzy controller design which is one of the artificial intelligence techniques is proposed.

Flight Motion Equations and Flight Control System
In order to perform any dynamic modeling of any aircraft or any UAV, it is necessary to obtain the governing equations of the aircraft body. These equations can be classified into three groups. These equations are the force equations of the body, the moment equations and kinematic equations. Newton's Second Law was used in the literature to extract the force equations. Equation 1 provides this law: The components of the force in the three axes (X, Y, Z) are as follows: the weight of the aircraft, linear accelerations (u, v, w), linear speeds (u, v, w), angular velocities (p, q, r) and Euler orientation angles ( , AA  ) (Yechout et al., 2003): For the extraction of the moment equations, the Angular Momentum Conservation Law, which is widely used in the literature, has been utilized. In Equation 3 this law is granted: The components of the moment in the three axes (L, M, N) can be given in terms of the elements of the aircraft inertial matrix ( , , , xx yy zz xz I I I I ), angular velocities (p, q, r) and angular accelerations ( ,, pqr) (Yechout et al., 2003): Kinematic equations are used in aviation by using 3-2-1 axis transformation order as follows: Compared to the most general approach mentioned above, dynamic modeling of fixed-wing aircraft has been widely used in the literature. Longitudinal movement dynamics and lateral movement dynamics have little relationship with each other in fixed wing aircraft and this relationship is negligible. In addition, the movement of the vertical axis has little effect on the aircraft Dynamics (Yurt, 1995). Therefore, longitudinal and lateral movement can be examined independently of each other. In the equations 6 and 7, longitudinal and lateral state-space models are presented, respectively: Equations A and B matrices of state-space models equations 6 and 7 consist of stability derivatives. In order to achieve numerical models, these stability derivatives should be found. The relationships necessary to find these desired stability derivatives in Tables 2 and 2 are presented for longitudinal and lateral dynamic models, respectively. Since real-time flight environments will always have atmospheric rains, this reality must be taken into account in the simulation environment in order to achieve convincing results. There are many approaches to modeling atmospheric turbulence in the literature.
In this study, von-Karman turbulence modeling was considered because of its success in other studies. Table 4 and 5 show the power spectral densities of turbulent velocities and the transfer functions of showers, respectively, for Von-Karman turbulence modeling. In Equations 8 and 9, Von-Karman turbulence affects the simulation environment, while longitudinal and lateral state-space models are

ANFIS Based Fuzzy Controller Design
ANFIS with fuzzy controller; fuzzy logic is the combination of expert knowledge and ability to draw conclusions, as well as the ability to compute and learn artificial neural networks in parallel. As a result, neural fuzzy systems make artificial neural networks more understandable (Jang, 1993).
In this study, a new controller approach based on fuzzy logic is proposed. Four data sets, PID control inputs and control sign, have been obtained for the design of the proposed controller. These data sets have been used to train the fuzzy controller in the ANFIS environment. The 452x4 size data set has been used for network training. In the design, a total of 9 membership functions have been created for each of the three membership functions, namely Small (S), Medium (M) and Large (L). The network is trained using the hybrid method and "0" error tolerance. There are 30 nodes in the ANFIS structure. A total of 12 linear and 18 non-linear 30 parameters were used. There are 3 rules in the training, which uses the Sugeno type fuzzy inference method. The structure of the artificial neural network is seen in  ANFIS training, using 2547 data sets for training and testing, is supported by the test results and is shown in Figure 5. As a result of the training, 0.030893 error value was obtained in 2nd Epoch and the training was completed. There was a significant overlap in education and test data. In this context, it can be said that the number of data used is enough for ANFIS training.

Results and Discussion
Autopilot systems attempt to track a pitch angle of 3 degrees to the UAV. 3 degree pitch angle tracking in longitudinal motion and closed-loop responses of some longitudinal state variables during this trajectory tracking and also closed-loop response of the elevator surface with longitudinal motion are presented in Figure 4. It is seen that the UAV longitudinal autopilot system has successfully followed the desired trajectory, and also other state variables and control surface did not show excessive behavior. The initial P, I and

Conclusions and Recommendations
A data set is needed when designing the controller with ANFIS. For this reason, PID controller was designed by using s environment. PID control application data were used as educational data in ANFIS environment. A new approach has been introduced to the Fuzzy controller with the controller designed to eliminate the negative effects of linear acceptances and the negative effects of disruptors when modeling the system. Successful simulation and system performance results in system control are verified by graphs in simulation studies. Values of a vehicle used as UAV, which is close to the desired dimensions and which are used in various researches, were determined and the stability values were examined with the help of state equations over these linearized values. Using the classical method, the longitudinal pitch angle, altitude and speed controller are designed for separate transfer functions according to the location curve of the roots and the desired response values. The values were determined by considering the effects of P, I and D and the response of the system together. On the other hand, a feedback design has been designed to improve the stability of different lines and an orientation controller has been designed. Another method used was Adaptive Network Based Fuzzy Inference Systems (ANFIS) controller design. The value ranges and numbers of the input and output membership functions are tried to be determined by some predicted and known values. Arrangements for input and output coefficients were made and the results were tried to be improved.
In this study, unmanned aerial vehicle with 6 degrees of freedom has been modeled and PID controller design which is one of the classical control methods for the modeled system has been designed. The application data for fuzzy logic controller design were obtained from the controller designed in the simulation environment. While fuzzy controller design is a long and demanding process, fuzzy controller design has been made quickly and efficiently with the application data obtained. With the fuzzy logic controller, which is preferred in the control of nonlinear systems, system behaviors due to non-linearity of the system have been tried to be reduced. As a result, ANFIS based fuzzy controller can be an effective controller when sufficient information about the system is obtained.