AUTONOMOUS LANDING OF UAV: A COMPARISON BETWEEN TYPE-1 AND TYPE-2 FUZZY LOGIC SYSTEMS ATERRISSAGEM AUTONÔMA DE VANT: UMA COMPARAÇÃO ENTRE

The Unmanned Aerial Vehicles (UAV) are an important technology with multiple applications. It is an object of study for researchers aiming to improve the performance of these vehicles, especially in flight stages as the landing. Therefore, this paper presents a method for the landing of a UAV based on Type-2 Fuzzy Logic System considering static targets. The advantage of this process is more precision and accuracy compared with Type-1 Fuzzy Logic System.


INTRODUCTION
An Unmanned Aerial Vehicle (UAV) is an airframe and a computer system which combines sensors, Global Positioning System (GPS), servos, and Flight Control Unit (FCU) providing the aircraft's flight without human intervention. It is a revolutionary technology which is growing in the market, being a study object for researches around the world. Its applicability is present in several areas of society, as remote environmental research, pollution assessment and monitoring, fire-fighting management, security, border monitoring, agricultural and fishery applications, oceanography, communication relays for wide-band applications (PASTOR; LOPEZ; ROYO, 2007).
The UAV's operation is composed basically of five steps: takeoff, climb, cruise, descent, and landing. The last one is very important because it is the step which there can be accidents and, consequently, human and material losses. The automation of this stage is necessary because the many factors as the ability of operator and climate conditions can affect the success of the non-autonomous operation.
In some industrial applications, PID controllers are used because of their simple structure and the easy control design in the case when a process is linear or can be linearized at an operating point, however, there are processes that are not linear in the whole operating range but piecewise linearizable, for example, plants with nonlinear characteristics, chemical processes, robots, and UAVs (SOUZA et al., 2019). The Fuzzy Logic System (FLS) is a good alternative of control that can manage highly nonlinear systems with uncertainties and do not need an accurate vehicle mathematical model (PRECUP; HELLENDOORN, 2011), which can be a problem for classical controllers. According to (SOUZA et al., 2019), the FLS is real-time expert system implementing human experiences and knowledge, which can not be realized by PID and, in addition, the FLSs are the heuristic modular way of defining any non-linear control system, that flexibility is absent in PID.
Several works have been published in the literature about UAVs vision-based landing motivated by the FLS characteristics. The authors in (OLIVARES-MENDEZ; KANNAN;VOOS, 2015), adopting the aruco eye augmented reality package, adopted four fuzzy controllers to perform the UAV autonomous landing which one controller for each three-dimensional linear displacement and other for yaw orientation. The authors in (BENAVIDEZ et al., 2014), adopted two fuzzy controllers and the package used to recognize and estimate the landing site is the ar track alvar. Although, these multiple concurrent controllers approaches are not practical and simplified alternative when the goal is the embedded use. The authors in (SOUZA et al., 2019) present an alternative method to train a multilayer perceptron neural network based on fuzzy Mamdani logic to control the landing of a UAV on an artificial marker. The works Revista Mundi, Engenharia e Gestão, Paranaguá, PR, v. 5, n. 6, p. 277-01, 277-13, 2020DOI: 10.21575/25254782rmetg2020vol5n61286 (SOUZA et al., 2019OLIVARES-MENDEZ;KANNAN;VOOS, 2015;BENAVIDEZ et al., 2014) adopted the markers composition for landing spot making it an interesting alternative since different sizes are proposed for detection at distinct vehicle height levels.
According to (KARNIK; MENDEL, 1998), a Type-2 FLS arose due to the insufficiency of Type-1 FLS in modeling the uncertainties inherent in defining the antecedents and consequent membership functions in a fuzzy inference system, becoming an extension of the traditional fuzzy set. Thus, a Type-2 FLS opens up an efficient way of developing improved control systems and for modeling human decision making. Consequently, this paper addresses the UAV's autonomous landing using a Type-2 FLS due to its potential capability to solve robotics problems that have uncertainty about the membership degree, uncertainty about the membership functions size or uncertainty on some parameters of membership functions.
The main contribution of the present paper is an implementation of a UAV autonomous landing technique based on Type-2 FLS. The main goal is to realize the procedure with more precision and accuracy compared with Type-1 FLS considering static target.
This work is organized as follows: Section II presents the problem formulation, Section III presents the Interval Type-2 FLS, Section IV discusses the numerical results and Section V concludes the work.

PROBLEM FORMULATION
The procedure consists in detecting a landing spot, reducing the relative distance between the aircraft ({V }), and the marker ({M }). The image capture is done by a standard webcam and the computer vision algorithm returns the position of the marker ( C P M ) relative to the camera frame ({C}). All the movements made by the aircraft are based on an inertial frame ({I}), the location where it is turned on. Figure 1 shows the frame coordinate system of the problem. The landing logical is divided into two parts. The first part works with the horizontal adjustment to approximate the aircraft and the marker until it reaches a region acceptable for a landing spot that varies between -15% and 15% from the marker. At that moment, the second part works with the vertical adjustment until the height that the camera can not see and identify the marker due to the short distance and the landing is forced. If the aircraft goes away from the acceptable region during the vertical adjustment, the horizontal adjustment is performed again and this loop is repeated until the end of the process.

INTERVAL TYPE-2 FUZZY LOGIC SYSTEM
A general Type-2 FLS is shown at Figure 2. It is composed of fuzzifier, rules, inference, type-reducer and defuzzifier, being necessary to have the presence of, at least, one Type-2 Fuzzy Set in one of the antecedents or in the consequent, which compose one of the rules that form the system. The specific case of Interval Type-2 FLS happens when all of the antecedents and consequent are Type-2 Fuzzy Sets, being this approach used in this work.

Input Variables
It was adopted for the controller the horizontal distance (dX and dY ) between the UAV and the landing spot in the X axis and Y axis of UAV body frame, respectively. Figure 3(a) shows the membership functions for dX (dY have similar membership functions) which are divided into three fuzzy trapezoidal groups: negative (red), close (blue) and positive (green). The variables indicate velocity values between -100% and 100%, relative to the field of view of the camera used. The Equations (1) -(6) represent them listed above, where NS means negative superior, NI means negative inferior, CS means close superior, CI means close inferior, PS means positive superior and PI means positive inferior. The other shapes in fuzzy sets are outside the scope of this paper. Revista Mundi, Engenharia e Gestão, Paranaguá, PR, v. 5, n. 6, p. 277-01, 277-13, 2020 DOI: 10.21575/25254782rmetg2020vol5n61286

Output Variables
It was adopted for the controller the linear velocity (vX, vY and vZ) in the UAV frame. Figure 3(b) shows the membership functions for vX (vY and vZ have similar membership functions) which are divided into three fuzzy trapezoidal groups: negative (red), zero (blue) and positive (green). The variables indicate velocity values between -100% and 100%, which will later be denormalized for actuation on the plant, according to an established maximum velocity of the UAV. The Equations (7) -(12) represent them listed above, where NS means negative superior, NI means negative inferior, ZS means zero superior, ZI means zero inferior, PS means positive superior and PI means positive inferior. The other shapes in fuzzy sets are outside the Revista Mundi, Engenharia e Gestão, Paranaguá, PR, v. 5, n. 6, p. 277-01, 277-13, 2020 DOI: 10.21575/25254782rmetg2020vol5n61286 scope of this paper. Source: Author's own.

Fuzzifier
This module has the function of transforming crisp inputs (dX and dY ) in Type-2 Fuzzy Sets. For this work singleton fuzzifier was used.

Rules
This module has the function of describing the relationship between linguistic variables, defining system's performance and behavior. Four experts worked for the build of Type-2 fuzzy sets. Its format is "if dX is ... and dY is ..., so vX (or vY , or vZ) is ...". As the combination of dX and dY includes the descent movement, the variable dZ did not participate on the rule base, being responsible for forcing the landing in a predetermined height.

Inference
This module has the function of processing mathematically each rule proposition through approximate reasoning techniques, providing output from input combination. Considering the design of the FLS, it was adopted the minimum operator as the implication method. The Equations (13) -(21) represent the medium activation degrees for each one of the nine rules referring to vX. (20)

Type-Reducer
This module has the function of finding a Type-1 Fuzzy Set that better represents Type-2 Fuzzy Set, in such a way that in the absence of uncertainty, the results of Type-2 FLS are reduced to Type-1 FLS (MENDEL; JOHN;LIU, 2006). For that, Karnik Mendel (KM) Algorithm (KARNIK;MENDEL, 2001) that can be executed on parallel and are monotonically and exponentially convergent is used.
The Equations (22) -(24) represents the KM Algorithm to obtaining the pertinence resultant functions to the left (L). The Equation (22) represents the vX I initially estimated, whose result is refined through Equations (23) or (24), depending on the interval in which vX I is placed. The variable vX I receives this new value and this iterative process repeats until a new value of vX I becomes equal to the previous one.  (27) represents the KM Algorithm to obtaining the pertinence resultant functions to the right (R). The Equation (25) represents the vX S initially estimated, whose result is refined through Equations (26) or (27), depending on the interval in which vX S is placed. The variable vX S receives this new value and this iterative process repeats until a new value of vX S becomes equal to the previous one.

Deffuzification
This module has the function of transforming Type-1 Fuzzy Sets in crisp output (vX, vY and vZ). For the present work, centroid defuzzification was used. The Equation (28) represents this transformation.
The step by step for calculating vY and vZ is the same as for vX.

EXPERIMENTAL RESULTS
Software In The Loop (SITL) consists of running the real PX4 firmware and the proposed algorithms in a virtual experiment. It is realized in Gazebo software, a simulation environment that simulates physics and dynamics of bodies close to reality. The code is implemented in C++ along with the ROS framework and the experiment is proposed with a static target. The landing procedure started with the UAV surrounding the marker about 8 meters from the ground. By the time the procedure starts, the proposed algorithm takes control of the aircraft, initiating a horizontal displacement towards the center of the marker. Then, the vertical error is reduced by moving the aircraft downwards until reaching the landing marker, while simultaneously correcting any horizontal disturbances. The stability analysis is outside the scope of this paper.
The simulation experimentation was repeated 30 from same starting points (dX = 2m, Revista Mundi, Engenharia e Gestão, Paranaguá, PR, v. 5, n. 6, p. 277-01, 277-13, 2020 DOI: 10.21575/25254782rmetg2020vol5n61286 dY = 2m and dZ = 8m) and the results are shown in Table 2, where dX means the distance of the target on the X axis and dY means the distance of target on the Y axis. The radial error is calculated through Pythagorean Theorem at Equation (29).

Radial Error
The landing based on Type-2 FLS returned an average radial error, from the center of mass of the vehicle to the central marker of the landing spot, of 0.13 ± 0.06 m. The results for Type-1 FLS under the same conditions was 0.23 ± 0.09 m. The completed experimental results of Type-1 FLS can be founded in (SOUZA et al., 2019). Aiming to compare these error values between the algorithms a hypothesis test is adopted.
The two-sample t-test allows us to infer assumptions from two independent data samples and to verify their validity statistically. This statistical test is represented by Equation (30) (MOORE; KIRKLAND, 2007), where G 1 and G 2 are the mean values of the samples G 1 and G 2 , sG 1 and sG 2 are the standard deviations of the samples, n and m correspond to the size of the sample sets sG 1 and sG 2 , respectively. The degree of freedom is defined as n + m − 2.
In addition to the determination of t, it becomes important to infer the hypotheses. The hypotheses are presented in Equation (31), where H 0 is the null hypothesis (which indicates that both algorithms have obtained the same mean radial error value) and H 1 is the alternative hypothesis (which indicates that both algorithms have obtained the distinct mean radial error value).
Given a significance level α, the p-value is calculated from t and represents the lowest value of α to reject the null hypothesis. Thus, values of the p-value below α show that the null hypothesis is not true (MOORE; KIRKLAND, 2007).
For the landing problem, it is intended by the t-test to verify that the mean radial errors obtained by the experiments with Type-2 FLS and Type-1 FLS are not equivalent. For this, the sets of samples G 1 and G 2 of Equation (30), are the radial error data obtained for the 30 landings made in SITL for each one FLS. As the degree of freedom is relatively high, equal to Revista Mundi, Engenharia e Gestão, Paranaguá, PR, v. 5, n. 6, p. 277-01, 277-13, 2020 DOI: 10.21575/25254782rmetg2020vol5n61286 58, it is not necessary to verify the normality of errors distributions (MOORE; KIRKLAND, 2007).
For α = 0.05, p-value = 2.4683e − 6. As p-value is less than α, it is possible to reject the null hypothesis of equal means for landings, that is, there is statistical difference between the mean radial error generated by landings of Type-2 FLS and Type-1 FLS.
The Equation (32) is used to calculate the radial error percentage of Type-2 FLS in relation to Type-1 FLS. The term radial.error t2 is the radial error of Type-2 FLS and the term radial.error t1 is the radial error of Type-1 FLS obtained in (SOUZA et al., 2019). The results was 45.53%.

CONCLUSION
This paper addressed a comparison between two controllers for autonomous landing of UAV: Type-2 FLS and Type-1 FLS. Numerical results obtained through computational simulations revealed that there is an extremely statistically significant between Type-1 FLS and Type-2 FLS and it had a better performance in relation to the precision and accuracy of the landing.
For futures works, the next steps consists in to compare Type-2 FLS and Type-1 FLS controllers for a target in linear motion, circular motion and path with obstacles.