<<

inventions

Article Analysis of Firefly–Fuzzy Hybrid for Navigation of Quad-Rotor Unmanned Aerial Vehicle

Brijesh Patel 1,* and Bhumeshwar Patle 2 1 Department of Aeronautical Engineering, MATS School of Engineering & IT, Raipur 490042, India 2 Department of Mechanical Engineering, National Chung Cheng University, Chiayi 60078, Taiwan; balu_patle@rediffmail.com * Correspondence: [email protected]; Tel.: +91-99-2611-9575

 Received: 6 August 2020; Accepted: 31 August 2020; Published: 16 September 2020 

Abstract: In the present scenario for the development of the unmanned aerial vehicle (UAV), artificial intelligence plays an important role in path planning and obstacle detection. Due to different environments, it is always a task to achieve the proper moment for achieving the target goal while avoiding obstacles with minimum human interference. To achieve the goal with the avoidance of obstacles, individual optimization techniques with such as fuzzy, particle optimization (PSO), etc. were implemented in various configurations. However, the optimal solution was not attained. Thus, in order to achieve an optimal solution, a hybrid model was developed by using the firefly algorithm and the fuzzy algorithm, establishing multiple features of the individual controller. The path and time optimization were achieved by a standalone controller and a hybrid firefly–fuzzy controller in different conditions, whereby the results of the controller were validated by simulation and experimental results, highlighting the advantages of the hybrid controller over the single controller.

Keywords: quadcopter; unmanned aerial vehicle; UAV; firefly; fuzzy logic; navigation

1. Introduction Over the most recent couple of decades, the utilization of multicopters has generally been considered in military and civil purpose settings with different kinds of uses such as surveillance, target-based missions, mapping and weather forecasting, etc. As unmanned aerial vehicles (UAVs) have to follow a defined path, path planning or navigation is an important parameter of UAVs, which allows them to perform intelligently and compute the shortest optimum flight path between an initial position and an end checking point, to fulfill their missions with specific constraints such as path length, obstacle avoidance, etc., as path planning is also related to obstacle avoidance. Path planning process development has undergone rapid growth in recent years and the problem has been solved especially with the help of various advancements in genetic and metaheuristic algorithms happening in recent days, such as the advance algorithm, , firefly, , etc. Many genetic or metaheuristic algorithms provide an optimal solution such as swarm intelligence, which gives results inspired from observing the behavior of swarms of animals, for example ants, bees, glowworms, etc., to get more complex results. An inspirational swarm intelligence algorithm that was inspired by the behavior of ant colonies for solving combinatorial optimization problems is ant colony optimization (ACO), which provides optimal results for a virtual environment. ACO works cooperatively to reach the optimal solution to a problem on the basis of virtual colonies of artificial ants. A property of communication with other ants through trails is adopted in this algorithm. A tracking hybrid controller for UAVs was developed using an adaptive neuro-fuzzy inference system (ANFIS) and particle swarm optimization (PSO) algorithm. This hybrid controller

Inventions 2020, 5, 48; doi:10.3390/inventions5030048 www.mdpi.com/journal/inventions Inventions 2020, 5, 48 2 of 12 gave good results compared to an individual algorithm-based controller for a quadrotor UAV [1]. Sarthi et al. [2] developed the bio-inspired metaheuristic approach named antlion optimization for local searching on the basis of total routing distance. Fuzzy algorithm has been evolved in the path optimization of UAVs but the limited possibilities have been analyzed. For the control of a multicopter with a conceivable solution, the latest evolving fuzzy controllers were reviewed [3]. The firefly algorithm is a very well-known metaheuristic algorithm developed by Yang [4] and was inspired by the flashing behavior of fireflies. It is stochastic in nature as it follows the randomness of the environment and it works on the principles of trial and error for finding the optimal solution in a realistic amount of time. In one study, the firefly algorithm was a hybrid with particle swarm optimization for solving continuous optimization problems [5]. The study presented here was designed with a firefly and fuzzy-based optimal solution for path planning of a quadrotor UAV in an unstructured environment. We found that, despite many researchers exploring the navigation of using genetic algorithms, there was a lack of results available for quadcopters. On the other hand, many studies have explored the optimal solutions for the navigation of unmanned aerial vehicles (multicopters) using genetic algorithms, or other techniques which have been presented in static and dynamic environments [6–9]. A hybrid algorithm was developed for the application of the firefly algorithm with an artificial bee colony for the enhancement of optimized values by minimizing the randomness in each step [10]. The research discussed above outlined the application of various algorithms with specific configurations for path planning and obstacle detection. The problem of trajectory optimization of multirotors was stated by Pradeep et.al. [11] as follows: in attaining the goal of path planning, certain obstacles that are dynamic in nature often present themselves, thus algorithms should be good enough to overcome the dynamic obstacles presented by many researchers investigating navigation [12,13]. Path planning for a unmanned combat aerial vehicle was optimized by using various algorithms like firefly and modified firefly [14], as well as a fuzzy hybrid scheme consisting of a fuzzy logic controller and a regulation pole-placement tracking (RST) controller with a model reference adaptive control (MRAC), in which the adaptive gains of the RST controller were fine-tuned by a fuzzy logic controller and done on a trimotor [15]. However, no studies have investigated hybridization of the firefly and fuzzy algorithms. In order to hybridize the firefly algorithm (FFA) and the fuzzy logic (FL) for an efficient controller, the FFA was used as an initial filter, while the FL was used as a secondary filter. This was done because fuzzy logic uses a gradient-based algorithm which reduces the performance and results in low convergence rates when using training parameters. This limitation of the gradient method is minimized when using the FFA. The FFA with least squares estimation was used to train the initial parameters, thereby providing optimal results. The FFA provides a well-trained parameter to the controller to achieve tasks with few errors. The FFA is a metaheuristic algorithm influenced by the behavior of fireflies, hence its conversion rate is higher than others when solving a high-level optimization problem. In this paper, a new firefly–fuzzy-based hybrid approach for navigational properties such as path planning and obstacle avoidance for a quadcopter in a various static and dynamic environments was analyzed and compared to a standalone controller. A comparison of path length and time was done for both the standalone controller and the hybrid controller. Section2 describes the input parameters of the hybrid algorithm in different environments. The FFA and the FL are described in Sections3 and4. In Section5, simulation and experimental analyses are carried out on the results of the standalone and the hybrid algorithms. In Section6, the results and conclusions are presented.

2. Firefly Mechanism (FFA) The firefly algorithm is a that was inspired by the nature of fireflies and was created by Yang in the year 2008. This algorithm provides optimal solutions based on the flashing behavior of flies. Different optimization problems are solved through the nature-based technique in Inventions 2020, 5, 48 3 of 12

Inventions 2020, 5, x FOR PEER REVIEW 3 of 12 which the fireflies generate light, usually at night, by the property of bioluminescence (energy released which the fireflies generate light, usually at night, by the property of bioluminescence (energy by chemical reactions). released by chemical reactions). The light generated is used by the flies to protect them from enemies, as well as to communicate The light generated is used by the flies to protect them from enemies, as well as to communicate with other flies for selecting their mates. From the flashing light, the flashing intensity and amount of with other flies for selecting their mates. From the flashing light, the flashing intensity and amount flashing time are observed as the important parameters for the algorithm. The objective function to of flashing time are observed as the important parameters for the algorithm. The objective function optimize the algorithm is developed from the light of fireflies. The FFA is analyzed by the intensity to optimize the algorithm is developed from the light of fireflies. The FFA is analyzed by the intensity of light created by the fireflies, which should be unique in order to attract each other. The algorithm of light created by the fireflies, which should be unique in order to attract each other. The algorithm follows different rules, where the first rule states the attraction of flies and depends on the genders of follows different rules, where the first rule states the attraction of flies and depends on the genders the flies, and in order to get optimal results all flies should be unisex. In the second rule, the flies will be of the flies, and in order to get optimal results all flies should be unisex. In the second rule, the flies attracted to each other with their intensity of light. In the third rule, the intensity of light (brightness) will be attracted to each other with their intensity of light. In the third rule, the intensity of light of the fireflies is decided. The FFA is presented in the form of the flowchart in Figure1. (brightness) of the fireflies is decided. The FFA is presented in the form of the flowchart in Figure 1.

FigureFigure 1.1. Flow chart of fireflyfirefly algorithm.algorithm.

InIn the the FFA, FFA, ββ,, αα andand γγ areare the the parameters parameters denoting denoting attractiveness, attractiveness, randomization, randomization, and and light light absorptionabsorption coecoefficientfficient respectively. respectively. The The positions positions of of the the first first and and second second fireflies fireflies are denotedare denoted by x ibyand xi xandj. The xj. The iteration iteration and theand random the random number number of the of flies the flies are denoted are denoted by r andby r t.and The t. distanceThe distance between between two th k fliestwo isflies denoted is denoted by d by and d theand value the value of the of firefly the firefly in the inK thedimension Kth dimension is given is given by xi by. xik. AA comparisoncomparison ofof thethe attractivenessattractiveness ofof thethe firefliesfireflies (i.e.,(i.e., lowlow brightbright flyfly andand highhigh brightbright fly)fly) isis givengiven byby EquationEquation (1).(1). m β(r) = β0 exp( γr ); m 1 (1) − m ≥ (r ) 0 exp(   r ); m  1 (1) Two fireflies are approximated with the distance given below in Equation (2). Two fireflies are approximated with the distance given below in Equation (2). uv t d dX k k 2 r =r x x x x = (xk(x xk )2x ) (2) ij ijk i −i jkj  i i −j j (2) kk1=1

TheThe attractionattraction ofof thethe firefliesfireflies towardstowards eacheach otherother isis calculatedcalculated byby EquationEquation (3). (3).

1 k xk (t 1)k xk (t)   exp(r 22)((xk (kt)  xk (tk)) (r  ) 1 x (t + 1i) = x (t)i + β exp0 ( γrij )((xj (t) i x (t)) + α(r ) (3)(3) i i 0 − ij j − i 2 − 2

Inventions 2020, 5, x FOR PEER REVIEW 4 of 12 Inventions 2020, 5, 48 4 of 12 3. Basic Fuzzy-Logic Mechanism

3. BasicFuzzy Fuzzy-Logic logic methods Mechanism were developed by Lotfi Zadeh in the year 1965 [16], and act like a mechanism based on human decisions. Fuzzy logic refers to the various factors that are unclear and Fuzzy logic methods were developed by Lotfi Zadeh in the year 1965 [16], and act like a mechanism it gives a real-world representation by its if–then, rule-based mechanism. Its process depends on based on human decisions. Fuzzy logic refers to the various factors that are unclear and it gives inexact and partial data for different problems. Fuzzy logic models complex data problems with a real-world representation by its if–then, rule-based mechanism. Its process depends on inexact maximum uncertainty to the linear one. The basic fuzzy inference model is explained in the flowchart and partial data for different problems. Fuzzy logic models complex data problems with maximum Figure 2. uncertainty to the linear one. The basic fuzzy inference model is explained in the flowchart Figure2.

Figure 2. Flowchart of fuzzy system. Figure 2. Flowchart of fuzzy system. Key steps for the fuzzy logic mechanism are given as follows: Key steps for the fuzzy logic mechanism are given as follows: Fuzzification: Input variables are converted by a membership function. •  Fuzzification: Input variables are converted by a membership function. Inference and Aggregation: Final output by fuzzy-based rules. •  Inference and Aggregation: Final output by fuzzy-based rules. Defuzzification: Crisp value conversion from fuzzified output. •  Defuzzification: Crisp value conversion from fuzzified output.

3.1.3.1. Fuzzy Fuzzy Inference Inference ForFor mapping mapping the the sensory sensory input input data data with with the the output output variable, variable, the the if–then if–then rule rule is is used used which which also also hashas the the base base for for its its decision decision making. making. Let Let the the collection collection of of objects objects (x ()x denoted) denoted by byX Xand andx xbe be the the known known ordered pair for fuzzy set A. ordered pair for fuzzy set A.  A = (x, µA(x) X (4) Ax{( ,A(xX)}∈ (4) From Equation (4), µA(x) states the fuzzy membership function provided for set A. However, the membershipFrom Equation values (4), used Ax() to measure states the x willfuzzy be membership 0 to 1. In fuzzy function logic theprovided problem for is set solved A. However, by two typesthe membership of membership values function, used to i.e., measure trapezoidal x will and be triangular.0 to 1. In fuzzy logic the problem is solved by two typesThe of triangular membership membership function, i.e., function trapezoidal is stated and as triangular. The triangular membership function is stated as  0, x < p  x p   − , p0, xpx q Triangle(x, p, q, r) =  q p ≤ ≤ (5)  r−xpx  r−q , q x r  − ≤, p≤ x q  qp0, r X Triangle(;,,) x p q r   ≤ rx (5)  ,q x r As per the principle of maxima and minima, Equation rq (5) can be represented by   0,x rXp r x Triangle (x, p, q, r) = max.(min. − , − , 0) (6) { q p r q } As per the principle of maxima and minima, Equation −(5) can− be represented by

푥−푝 푟−푥 Triangle (x,p,q,r) = max.(min.{ , }, 0) 푞−푝 푟−푞 (6) Inventions 2020, 5, 48 5 of 12

Similarly, the trapezoidal membership function can be specified by using the four-parameter {p,q,r,s} as represented in Equation (7).   x p  0, <  x p  − , p x q  q p ≤ ≤ trapezoid(x; p, q, r, s) =  − (7)  1, q x r  s x ≤ ≤  − , r x s  s r ≤ ≤  −0, s X. ≤ By using a minimum and a maximum, the above equation can also be represented by the following equation: ! x p s x trapezoid(x; p, q, r, s) = max.(min. − , 1, − , 0) (8) q p s r − − where (p,q,r,s) determines the value of the x-coordinates (with p < q < r < s) of the corners of the defuzzification–trapezoidal membership function.

3.2. Defuzzification Defuzzification is mathematically represented as in the equation given below, which works on the center of gravity concept and converts the fuzzy set into a crisp value. P R b crisp i i µi µ = P R (9) i µi

Here the crisp value output is defined by µcrisp and the center of the membership function is given by bi. Consequently, rule i and µ(i) give the area under the membership function.

4. Proposed Hybrid Firefly–Fuzzy Controller The firefly–fuzzy controller is a hybrid controller using firefly and fuzzy mechanisms for optimizing different parameters such as quadcopter to obstacle distance, quadcopter to goal distance, and mutual distance between the quadcopter with its motion. All these navigational parameters are defined in the controller to provide the necessary turning angle for the quadcopter. In Section2, it was shown that the firefly algorithm gets optimal parameters from the system. Figure3 describes the model of the firefly–fuzzy hybrid controller for the calculation of the required parameters for path planning of Inventions 2020, 5, x FOR PEER REVIEW 6 of 12 the quadcopter.

(12 )

Figure 3. Position mapping of a quadcopter. Figure 3. Position mapping of a quadcopter. In the first part, front obstacle distance (FOD), left obstacle distance (LOD), and right obstacle distance (ROD) are the input parameters provided to the firefly controller (FFA), whereas intermediate turning angle (ITA) is the output of the FFA. This output ITA stated by FFA controller, will be the

Figure 4. Firefly–fuzzy hybrid system.

Sensors are equipped to calculate the distance of the quadcopter from obstacle to goal, as the initial input or the information to be provided first for the environment plays an important role in the objective function selection parameter. In the FFA approach, the efficient position of the firefly with respect to its group will be decided by the position of the obstacle which is nearest, and those flies which have a safe distance from the obstacle. These flies update its position until it clears all the obstacles. The distance between the best firefly with respect to its obstacle is given in Equation (10) and this distance is known as Euclidean distance.

2 2 퐷푓표 = √(푥표 − 푥푓1) + (푦표 − 푦푓1) (10)

Here, Dfo = Euclidean distance (firefly to nearest obstacle); xfi and xo = x are the firefly position and obstacle respectively; yfi and yo = y are the firefly position and obstacle respectively. DRO is the distance between the nearest obstacle and the quadcopter. In a complex environment it is necessary to select the nearest obstacle and this distance is calculated by the equation given below.

2 2 퐷푅푂 = √(푥푂 − 푥푅) + (푦푂 − 푦푅) (11)

Xon and xR = x are the obstacle position and quadcopter position respectively and yon and yR = y are the firefly position and obstacle respectively. The selection of the best fly among the group of flies will be considered with different parameters. According to the first parameter, the brighter fly will have a maximum distance from an obstacle and the second parameter will be that at the same time the brighter fly will be nearer to the goal. This system will continue until it reaches the goal by successfully avoiding all the obstacles. The distance from the quadcopter to the final position is calculated as the Euclidean distance (Dfg) and is formulated as Inventions 2020, 5, x FOR PEER REVIEW 6 of 12

(12 )

Inventions 2020, 5, 48 6 of 12 input for the fuzzy logic controller and the existing position of the quadcopter including FOD, LOD, and ROD will also be its input parameters for FL controller as shown in Figure4. For the detection of these parameters (FOD, LOD, ROD),Figure 3. the Position quadcopter mapping is fittedof a quadcopter with IR sensors. which are connected to an Arduino board, and these sensors also detect the position of the given goal.

FigureFigure 4.4. Firefly–fuzzyFirefly–fuzzy hybridhybrid system.system.

TheSensors input are from equipped the FFA to controller calculate will the be distance considered of the by thequadcopter fuzzy controller from obstacle as a hybrid to goal, controller, as the whereasinitial input its obstacle or the information would be given to be to provided the ITA. ThefirstITA for isthe used environment to train the plays final an turning important angle role (FTA) in forthe all objective conditions. function For the selection performance parameter. of the In multicopter the FFA approach, in a real-time the efficient environment, position a quadcopter of the firefly is used,with respect which is to embedded its group withwill be a microcontroller.decided by the position of the obstacle which is nearest, and those flies Sensorswhich have are equippeda safe distance to calculate from the the obstacle. distance These of the flies quadcopter update its from position obstacle until toit clears goal, asall thethe initialobstacles. input or the information to be provided first for the environment plays an important role in the objectiveThe distance function between selection the best parameter. firefly with In the respect FFA approach, to its obstacle the e isffi cientgiven position in Equation of the (10) firefly and withthis distance respect tois itsknown group as willEuclidean be decided distance. by the position of the obstacle which is nearest, and those flies which have a safe distance from the obstacle. These flies update its position until it clears all the obstacles. 2 2 퐷 = √(푥 − 푥 ) + (푦 − 푦 ) (10) The distance between the best푓표 firefly with표 respect푓1 to its obstacle표 푓1 is given in Equation (10) and this distance is known as Euclidean distance. Here, Dfo = Euclidean distance (firefly to nearest obstacle); xfi and xo = x are the firefly position and r obstacle respectively; yfi and yo = y are the firefly position2  and obstacle2 respectively. D = xo x + yo y (10) DRO is the distance between thef o nearest obstacle− f 1 and the− quadcopter.f 1 In a complex environment it is necessary to select the nearest obstacle and this distance is calculated by the equation given Here,below.D fo = Euclidean distance (firefly to nearest obstacle); xfi and xo = x are the firefly position and obstacle respectively; yfi and yo = y are the firefly position and obstacle respectively. D RO is the distance between퐷 the= nearest √(푥 obstacle− 푥 and)2 + the(푦 quadcopter.− 푦 )2 In a complex environment(11) it is necessary to select the nearest obstacle푅푂 and푂 this distance푅 is calculated푂 푅 by the equation given below.

on R q on R X and x = x are the obstacle position and quadcopter2 position respectively2 and y and y = y are the D = (x xR) + (y yR) (11) firefly position and obstacle respectively.RO O − O − The selection of the best fly among the group of flies will be considered with different X and x = x are the obstacle position and quadcopter position respectively and y and y = y are parameters.on R According to the first parameter, the brighter fly will have a maximum ondistanceR from an the firefly position and obstacle respectively. obstacle and the second parameter will be that at the same time the brighter fly will be nearer to the The selection of the best fly among the group of flies will be considered with different parameters. goal. This system will continue until it reaches the goal by successfully avoiding all the obstacles. The According to the first parameter, the brighter fly will have a maximum distance from an obstacle and distance from the quadcopter to the final position is calculated as the Euclidean distance (Dfg) and is the second parameter will be that at the same time the brighter fly will be nearer to the goal. This system formulated as will continue until it reaches the goal by successfully avoiding all the obstacles. The distance from the quadcopter to the final position is calculated as the Euclidean distance (Dfg) and is formulated as r  2  2 D = xe x + ye y (12) f e − f 1 − f 1 where x and y are the positions of the goal. Inventions 2020, 5, x FOR PEER REVIEW 7 of 12

2 2 Inventions 2020, 5, 48 퐷푓푒 = √(푥푒 − 푥푓1) + (푦푒 − 푦푓1) 7(12) of 12

where x and y are the positions of the goal. TheThe final final objective objective function function of of the the FFA FFA is is given given as as 11 f1 = Ki + K2 D f g (13) 푓1 = 퐾푖 minon os D f o +k 퐾2 k ∥ 퐷푓푔 ∥ (13) 푚푖푛표푛 ∈∈ 표k푠 ∥ k퐷푓표 ∥ ForFor getting getting an an optimal optimal solution solution by by using using the the objective objective function, function, the the parameters parametersα α,, β β,, and andγ γare are testedtested variably. variably. After After testingtesting thethe parametersparameters forfor manymany trials, the best values values obtained obtained are are given given as as α α== 0.5,0.5, ββ == 0.20.2,, and and γγ = =0.5.0.5. FuzzyFuzzy logic logic is is also also known known as aas universal a universal approximator approximator and and it can it docan the do mapping the mapping of sensory of sens dataory anddata output and output variables. variables. The terms The terms given forgiven various for various parameters parameters are stated are stated in Figure in Figure5. 5.

Figure 5. Linguistic terms. Figure 5. Linguistic terms. The final output in terms of turning angle (TA) is stated by more negative, negative, zero, positive, and moreThe positive final output respectively in terms as shown of turning in Table angle1. By (TA) the fuzzy is stated logic by mechanism, more negative, the if–then negative, function zero, ispositive, used when and themore obstacle positive is inrespectively the way of as the shown quadcopter in Table and 1. By when the therefuzzy islogic no obstaclemechanism, the fuzzythe if– mechanismthen function will is not used be when activated the asobstacle described is in inthe Tables way 2of and the3 .quadcopter Triangular, and triangular–trapezoidal when there is no obstacle and Gaussianthe fuzzy membership mechanism functionswill not be are activated presented as described in Figure 6in. Table 2 and Table 3. Triangular, triangular– trapezoidal and Gaussian membership functions are presented in Figure 6. Table 1. Few Fuzzy logic rules for navigation of the quadcopter.

Sl. No. FOD LOD ROD TA LV RV 1 N N F Positive Slow Fast 2 M N F Zero Medium Medium 3 F N F Negative fast Slow 4 N N M Positive Slow Fast 5 M N M Zero Medium Medium 6 F N M Negative fast Slow 7 N N N Positive Slow Fast 8 M N N Zero Medium Medium 9 F N N Negative fast Slow 10 N M F Positive Slow Fast

Table 2. Fuzzy logic parameters (obstacle).

Linguistic Variable Very Near (VN) Near (N) Medium (M) Far (F) Very Far (VF) LOD 0.0 0.2 0.4 0.6 0.8 ROD 0.0 0.2 0.4 0.6 0.8 FOD 0.4 0.6 0.8 1.0 1.2

Table 3. Fuzzy logic parameters (Turning angle).

Linguistic Variable More Negative (MN) Negative (N) Zero (Z) Positive (P) More Positive (MP) 180 120 10 10 60 Figure 6. (a)Triangular,− (b) triangular–trapezoidal,− (c) −Gaussian membership functions. Target Turning Angle 120 60 0.0 60 120 − − 60 0 10 120 180 − Inventions 2020, 5, x FOR PEER REVIEW 7 of 12

2 2 퐷푓푒 = √(푥푒 − 푥푓1) + (푦푒 − 푦푓1) (12) where x and y are the positions of the goal. The final objective function of the FFA is given as 1 푓1 = 퐾푖 + 퐾2 ∥ 퐷푓푔 ∥ (13) 푚푖푛표푛 ∈ 표푠 ∥ 퐷푓표 ∥ For getting an optimal solution by using the objective function, the parameters α, β, and γ are tested variably. After testing the parameters for many trials, the best values obtained are given as α = 0.5, β = 0.2, and γ = 0.5. Fuzzy logic is also known as a universal approximator and it can do the mapping of sensory data and output variables. The terms given for various parameters are stated in Figure 5.

Inventions 2020, 5, x FOR PEER REVIEW 8 of 12

Table 1. Few FuzzyFigure logic 5.rules Linguistic for navigation terms. of the quadcopter.

Sl.The No. final outputFOD in termsLOD of turningROD angle (TA) isTA stated by more LV negative, negative,RV zero, positive,1 and more positiveN respectivelyN as Fshown in TablePositive 1. By the fuzzySlow logic mechanism,Fast the if– then function2 is usedM when the obstacleN is inF the way of theZero quadcopter andMedium when there isMedium no obstacle theInventions fuzzy3 2020 mechanism, 5, 48 F will not beN activated asF describedNegative in Table 2 and Tablefast 3. Triangular, triaSlowngular 8 of– 12 trapezoidal4 and GaussianN membershipN functionsM are presentedPositive in Figure 6.Slow Fast 5 M N M Zero Medium Medium 6 F N M Negative fast Slow 7 N N N Positive Slow Fast 8 M N N Zero Medium Medium 9 F N N Negative fast Slow 10 N M F Positive Slow Fast

Table 2. Fuzzy logic parameters (obstacle).

Linguistic Very Near Very Far Near (N) Medium (M) Far (F) Variable (VN) (VF) LOD 0.0 0.2 0.4 0.6 0.8 ROD 0.0 0.2 0.4 0.6 0.8 FOD 0.4 0.6 0.8 1.0 1.2

Table 3. Fuzzy logic parameters (Turning angle).

Linguistic More Negative Negative More positive Zero (Z) Positive (P) Variable (MN) (N) (MP) −180 −120 −10 10 60 Target Turning −120 −60 0.0 60 120 Angle −60 0 10 120 180 Figure 6. (a)Triangular, (b) triangular–trapezoidal, (c) Gaussian membership functions. Figure 6. (a)Triangular, (b) triangular–trapezoidal, (c) Gaussian membership functions. 5. Analysis of Firefly Firefly–Fuzzy–Fuzzy HybridHybrid ControllerController The hybrid controller was tested by by experimental experimental work which was validated validated by simulation simulation through MATLABMATLAB software, software, for for the the experimental experimental work work quadcopter quadcopter having having an Arduino an Arduino board board as a flight as a controllerflight controller with sixwith IR six sensors IR sensors fitted aroundfitted around its periphery. its periphery. The coding The coding of Arduino of Arduino was done was usingdone embeddedusing embedded C and C navigation and navigation in a realtime in a realtime environment environment is shown is shown in Figures in Figure7 and8s. 7 and 8.

Inventions 2020, 5, x FOR PEER REVIEWFigure 7. Quadcopter used for experimental analysis. 9 of 12

Figure 8. Experimental setup for real real-time-time navigation of quadcopter.

For the simulation, MATLAB software was used and results were generated for both static and dynamic obstacles obstacles in in di differentfferent environmental environmental conditions. conditions. Navigation Navigation using using three three controllers controllers was used was used and the output was taken, which is shown in Figures 9–11, and similarly, the analysis of dynamic obstacles was simulated in MATLAB and the results are shown in Figure 12.

Figure 9. Navigation using (simulation).

Figure 10. Navigation using fuzzy logic algorithm (simulation).

Figure 11. Navigation using firefly–fuzzy hybrid algorithm (simulation).

In the case of a dynamic environment, the hybrid controller was tested under a moving obstacle as shown in Figure 12. For validation of the results, the hybrid firefly–fuzzy controller was compared with standalone firefly and standalone fuzzy controllers with the same environment in both simulation and experimental cases. These results are presented over its path length and navigational Inventions 2020, 5, x FOR PEER REVIEW 9 of 12 Inventions 2020, 5, x FOR PEER REVIEW 9 of 12 Inventions 2020, 5, x FOR PEER REVIEW 9 of 12

Inventions 2020, 5, 48 9 of 12

and the output wasFigure taken, 8. whichExperimental is shown setup in for Figures real-time9–11 navigation, and similarly, of quadcopter. the analysis of dynamic obstacles was simulatedFigure in 8. MATLABExperimental and setup the resultsfor real- aretime shown navigation in Figure of quadcopter. 12. InFor the the case simulation, of aFigure dynamic MATLAB 8. Experimental environment, software setup the was for hybrid usedreal-time and controller navigation results was were of tested quadcopter. generated under for a moving both static obstacle and asdynamic shownFor the inobstacles Figuresimulation, 12 in. different For MATLAB validation environmental software of the results,was conditions.used the and hybrid results Navigation firefly–fuzzy were generated using controller three for controllersboth was comparedstatic wasand withdynamicusedFor standalone and the obstacles the simulation, output firefly in anddifferent was MATLAB standalone taken, environmental whichsoftware fuzzy is controllerswas shown conditions. used in and with Figures results Navigationthe same9– were11, environment and generated using similarly, three for in controllersboth theboth analysis simulation static wasand of anddynamicused experimental and obstacles the output cases.was in differentwas simulated These taken, resultsenvironmental in which MATLAB are is presented shown and conditions. the in over Figuresresults its Navigation pathare 9– 11,shown length and using in similarly,and Figure three navigational 12. controllers the analysis time was as of shownuseddynamic and in obstacles Figures the output 13 was and was simulated 14 . taken, Tables 4in which and MATLAB5 provide is shown and the the in optimal results Figures values are 9– 11,shown of and all thein similarly, Figure three controllers12. the analysis tested of overdynamic 10 runs. obstacles was simulated in MATLAB and the results are shown in Figure 12.

Figure 9. Navigation using firefly algorithm (simulation).

Figure 9. Navigation using firefly algorithm (simulation). Figure 9. Navigation using firefly algorithm (simulation). Figure 9. Navigation using firefly algorithm (simulation).

Figure 10. Navigation using fuzzy logic algorithm (simulation). Figure 10. Navigation using fuzzy logic algorithm (simulation). Figure 10. Navigation using fuzzy logic algorithm (simulation). Figure 10. Navigation using fuzzy logic algorithm (simulation).

Figure 11. Navigation using firefly–fuzzy hybrid algorithm (simulation). Figure 11. Navigation using firefly–fuzzy hybrid algorithm (simulation).

Figure 11. Navigation using firefly–fuzzy hybrid algorithm (simulation). In the case ofFigure a dynamic 11. Navigation environment, using fireflythe hybrid–fuzzy controller hybrid algorithm was tested (simulation). under a moving obstacle as shownIn the in case Figure of a 12. dynamic For validation environment, of the theresults, hybrid the controller hybrid firefly was– testedfuzzy controllerunder a moving was compared obstacle aswith shown In standalone the in case Figure of fireflya 12. dynamic For and validation environment, standalone of the fuzzytheresults, hybrid controllers the controllerhybrid withfirefly was the– testedfuzzy same controllerunder environment a moving was compared obstacle in both aswithsimulation shown standalone in and Figure experimental firefly 12. For and validation cases. standalone These of the results fuzzyresults, are controllers the presented hybrid withfirefly over the –itsfuzzy path same controller length environment and was navigational compared in both withsimulation standalone and experimental firefly and cases. standalone These results fuzzy are controllers presented with over the its path same length environment and navigational in both simulation and experimental cases. These results are presented over its path length and navigational Inventions 2020, 5, x FOR PEER REVIEW 10 of 12

time as shown in Figures 13 and 14. Tables 4 and 5 provide the optimal values of all the three controllers tested over 10 runs.

Inventions 2020, 5, x FOR PEER REVIEW 10 of 12 timeInventions as shown2020, 5, 48 in Figures 13 and 14. Tables 4 and 5 provide the optimal values of all the 10 three of 12 controllers tested over 10 runs.

Figure 12. Navigation in the presence of a moving obstacle using firefly–fuzzy hybrid controller.

Table 4. Path length comparison over similar environmental setup.

Experimental Path Length Simulational Path Length Sl. No. Controller % of Deviation (in ‘cm’) (in ‘cm’) 1 FFA 684.04 650.77 5.11 2 FL 633.27 605.17 4.64 3 FFA-FL 602.92 577.13 4.71

Table 5. Navigational time comparison over similar environmental setup.

Sl. No. Controller Experimental Time (in ‘sec’) Simulational Time (in ‘sec’) % of Deviation 1 FFA 33.98 29.90 5.56

2 FL 32.23 30.73 4.63 Figure 12. Navigation in the presence of a moving obstacle using firefly–fuzzy hybrid controller. 3 FigureFFA 12. -NavigationFL in the presence26.57 of a moving obstacle using25.30 firefly –fuzzy hybrid controller4.77.

Table 4. Path length comparison over similar environmental setup.

Experimental Path Length Simulational Path Length Sl. No. Controller % of Deviation (in ‘cm’) (in ‘cm’) 1 FFA 684.04 650.77 5.11 2 FL 633.27 605.17 4.64 3 FFA-FL 602.92 577.13 4.71

Table 5. Navigational time comparison over similar environmental setup.

Sl. No. Controller Experimental Time (in ‘sec’) Simulational Time (in ‘sec’) % of Deviation Inventions1 2020, 5FFA, x FOR PEER REVIEW 33.98 29.90 5.56 11 of 12 Figure 13. Comparison of firefly–fuzzy with a single controller (experimental). 2 FLFigure 13. Comparison32.23 of firefly –fuzzy with a single controller30.73 (experimental). 4.63 3 FFA-FL 26.57 25.30 4.77

Figure 14. Comparison of firefly–fuzzy with a single controller (simulation). Figure 14. Comparison of firefly–fuzzy with a single controller (simulation). Figure 13. Comparison of firefly–fuzzy with a single controller (experimental). 6. Conclusions and Future Scope In this investigation, for both experiment and simulation it was found that there are more possible ways for developing controllers that provide optimal results, which has been proved in this paper through the successful testing of a firefly–fuzzy-based new controller for navigation of a quadcopter in the stated environment with a static or dynamic obstacle. The results in Section 5 show that the deviation is less than 6%. The navigational time required to accomplish the task in simulation and in the experimental environment with the hybrid firefly–fuzzy algorithm was less when compared to standalone controllers. The simulation and experimental results show that the path obtained by the hybrid controller had optimal results compared to a standalone controller for both static and dynamic environments. Making the firefly controller an initial filter provides a key feature to get the optimal values because it can easily train and update its parameters and do calculations in each step. In future work, more metaheuristic or genetic algorithms like a blue whale, antlion, grey wolf, etc. can be tested for more optimal results. In this investigation, the FFA and the FL were used for hybridization, so further studies with more genetic algorithms used for hybridization could give better results. In this study, experimental work was carried out with a static obstacle, so for future work the model could be tested for dynamic obstacles experimentally. This hybrid controller could be tested in robots, underwater drones or any unmanned autonomous vehicle.

Author Contributions: All the experimental and simulation work was investigated by B.P. (Brijesh Patel) and all the mathematical calculations as well as controller design was done by B.P. (Bhumeshwar Patle). All authors have read and agreed to the published version of the manuscript.

Funding: The research has no external funding.

Conflicts of Interest: The authors declare no conflicts of interest.

References

1. Selma, B.; Chouraqui, S.; Abouaïssa, H. Fuzzy swarm trajectory tracking control of unmanned aerial vehicle. J. Comput. Des. Eng. 2020, 7, 435–447, doi:10.1093/jcde/qwaa036. 2. Sarathi Barma, S.B.; Dutta, J.; Mukherjee, A. A 2-opt guided discrete antlion optimization algorithm for multi-depot vehicle routing problem. Decis. Mak. Appl. Manag. Eng. 2019, 2, 112–125. doi:10.31181/dmame1902089b. 3. Ferdaus, M.M.; Anavatti, S.G.; Pratama, M.; Garratt, M.A. Towards the use of fuzzy logic systems in rotary wing unmanned aerial vehicle: A review. Artif. Intell. Rev. 2020, 53, 257–290. doi:10.1007/s10462-018-9653- z. 4. Yang, X. Firefly Algorithm. In Nature-Inspired Metaheuristic Algorithms, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2010; doi:10.1016/B978-0-12-416743-8.00005-1. 5. Zouache, D.; Nouioua, F.; Moussaoui, A. Quantum-inspired firefly algorithm with particle swarm optimization for discrete optimization problems. Soft Comput. 2016, 20, 2781–2799, doi:10.1007/s00500-015- 1681-x. Inventions 2020, 5, 48 11 of 12

Table 4. Path length comparison over similar environmental setup.

Experimental Path Simulational Path Sl. No. Controller % of Deviation Length (in ‘cm’) Length (in ‘cm’) 1 FFA 684.04 650.77 5.11 2 FL 633.27 605.17 4.64 3 FFA-FL 602.92 577.13 4.71

Table 5. Navigational time comparison over similar environmental setup.

Sl. No. Controller Experimental Time (in ‘sec’) Simulational Time (in ‘sec’) % of Deviation 1 FFA 33.98 29.90 5.56 2 FL 32.23 30.73 4.63 3 FFA-FL 26.57 25.30 4.77

6. Conclusions and Future Scope In this investigation, for both experiment and simulation it was found that there are more possible ways for developing controllers that provide optimal results, which has been proved in this paper through the successful testing of a firefly–fuzzy-based new controller for navigation of a quadcopter in the stated environment with a static or dynamic obstacle. The results in Section5 show that the deviation is less than 6%. The navigational time required to accomplish the task in simulation and in the experimental environment with the hybrid firefly–fuzzy algorithm was less when compared to standalone controllers. The simulation and experimental results show that the path obtained by the hybrid controller had optimal results compared to a standalone controller for both static and dynamic environments. Making the firefly controller an initial filter provides a key feature to get the optimal values because it can easily train and update its parameters and do calculations in each step. In future work, more metaheuristic or genetic algorithms like a blue whale, antlion, grey wolf, etc. can be tested for more optimal results. In this investigation, the FFA and the FL were used for hybridization, so further studies with more genetic algorithms used for hybridization could give better results. In this study, experimental work was carried out with a static obstacle, so for future work the model could be tested for dynamic obstacles experimentally. This hybrid controller could be tested in robots, underwater drones or any unmanned autonomous vehicle.

Author Contributions: All the experimental and simulation work was investigated by B.P. (Brijesh Patel) and all the mathematical calculations as well as controller design was done by B.P. (Bhumeshwar Patle). All authors have read and agreed to the published version of the manuscript. Funding: The research has no external funding. Conflicts of Interest: The authors declare no conflict of interest.

References

1. Selma, B.; Chouraqui, S.; Abouaïssa, H. Fuzzy swarm trajectory tracking control of unmanned aerial vehicle. J. Comput. Des. Eng. 2020, 7, 435–447. [CrossRef] 2. Sarathi Barma, S.B.; Dutta, J.; Mukherjee, A. A 2-opt guided discrete antlion optimization algorithm for multi-depot vehicle routing problem. Decis. Mak. Appl. Manag. Eng. 2019, 2, 112–125. [CrossRef] 3. Ferdaus, M.M.; Anavatti, S.G.; Pratama, M.; Garratt, M.A. Towards the use of fuzzy logic systems in rotary wing unmanned aerial vehicle: A review. Artif. Intell. Rev. 2020, 53, 257–290. [CrossRef] 4. Yang, X. Firefly Algorithm. In Nature-Inspired Metaheuristic Algorithms, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2010. [CrossRef] 5. Zouache, D.; Nouioua, F.; Moussaoui, A. Quantum-inspired firefly algorithm with particle swarm optimization for discrete optimization problems. Soft Comput. 2016, 20, 2781–2799. [CrossRef] Inventions 2020, 5, 48 12 of 12

6. Allaire, F.C.J.; Tarbouchi, M.; Labonté, G.; Fusina, G. FPGA implementation of genetic algorithm for UAV real-time path planning. J. Intell. . Syst. Theory Appl. 2009, 54, 495–510. [CrossRef] 7. Dikmen, I.C.; Karadag, T.; Yeroglu, C. Multi-Parameter Optimization of Sliding-Mode Controller for Quadcopter Application. Anatol. Sci. 2018, 3, 14–28. Available online: http://dergipark.gov.tr/bbd/issue/38331/422681 (accessed on 28 March 2018). 8. Gaur, M.; Chaudhary, H.; Khatoon, S.; Singh, R. Genetic algorithm based trajectory stabilization of quadrotor. In Proceedings of the 2nd IEEE International Conference on Innovative Applications of Computational Intelligence on Power, Energy and Controls with Their Impact on Humanity, CIPECH, Ghaziabad, India, 18–19 November 2016; pp. 29–33. [CrossRef] 9. Roberge, V.; Tarbouchi, M.; Labonte, G. Comparison of parallel genetic algorithm and particle swarm optimization for real-time UAV path planning. IEEE Trans. Ind. Inform. 2013, 9, 132–141. [CrossRef] 10. Abbas, N.H.; Jumia, B.S. Design of a Kinematic Neural Controller for Mobile Robots based on Enhanced Hybrid Firefly-Artificial Bee Colony Algorithm. Al-Khwarizmi Eng. J. 2016, 12, 45–60. [CrossRef] 11. Pradeep, P.; Park, S.G.; Wei, P. Trajectory optimization of multirotor agricultural UAVs. In Proceedings of the IEEE Aerospace Conference, Big Sky, MT, USA, 3–10 March 2018; pp. 1–7. [CrossRef] 12. Budiyanto, A.; Cahyadi, A.; Adji, T.B.; Wahyunggoro, O. UAV obstacle avoidance using potential field under a dynamic environment. In Proceedings of the ICCEREC 2015—International Conference on Control, Electronics, Renewable Energy and Communications, Bandung, Indonesia, 27–29 August 2015; pp. 187–192. [CrossRef] 13. Ranade, S.; Manivannan, P.V. Quadcopter Obstacle Avoidance and Path Planning Using Flood Fill Method. In Proceedings of the 2019 2nd International Conference on Intelligent Autonomous Systems (ICoIAS), Singapore, 28 February–2 March 2019; pp. 166–170. [CrossRef] 14. Wang, G.; Guo, L.; Duan, H.; Liu, L.; Wang, H. A Modified Firefly Algorithm for UCAV Path Planning. Int. J. Hybrid Inf. Technol. 2012, 5, 123–144. Available online: http://www.earticle.net/article.aspx?sn=208177 (accessed on 6 May 2018). 15. Ali, Z.A.; Wang, D.; Aamir, M. The fuzzy-based hybrid control algorithm for the stabilization of a tri-rotor UAV. Sensors 2016, 16, 652. [CrossRef][PubMed] 16. Zadeh, L.A. Fuzzy sets. Inf. Control 1965, 8, 338–353. [CrossRef]

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).