**1. Introduction**

Recently, the use of autonomous vehicles and robotics technologies has increased significantly. Such systems are now being used to perform a great number of tasks in an optimized manner. Most traditional solutions demanded human resources, which may provide gaps and cause unsafe working places or human workers' depletion due to repetitive tasks. Human safety issues are taken into account in some autonomous unmanned vehicle-related tasks in [1–4].

The field of Unmanned Aerial Vehicles (UAVs) is gaining a growing interest over the past years due to the possibility of enabling new services that help modernize transportation tasks [5], inspection [6], supply chain support [7], search and rescue activities [8],

**Citation:** Andrade, F.A.A.; Guedes, I.P.; Carvalho, G.F.; Zachi, A.R.L.; Haddad, D.B.; Almeida, L.F.; de Melo, A.G.; Pinto, M.F. Unmanned Aerial Vehicles Motion Control with Fuzzy Tuning of Cascaded-PID Gains. *Machines* **2022**, *10*, 12. https:// doi.org/10.3390/machines10010012

Academic Editors: Marcos de Sales Guerra Tsuzuki, Marcosiris Amorim de Oliveira Pessoa and Alexandre Acássio

Received: 18 November 2021 Accepted: 20 December 2021 Published: 23 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 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 (https:// creativecommons.org/licenses/by/ 4.0/).

change detection in water scenes [9], air quality assessment (e.g., by measurements of gaseous elemental mercury) [10], early wildfire detection [11], delivery goods tasks [12,13], information warfare [14], topographic surveys in active mines [15], plant genotyping [16], documentation and inspection of historical buildings [17], among others. The reason for using them in several applications can be explained by the UAV's ability to perform complex activities with low-cost flight operation and maneuvering flexibility [18,19].

Autonomous or semi-autonomous UAVs have been used to substitute human workers in different tasks in order to reduce maintenance costs and intervention times, especially in inspections [20,21]. There are different ways of performing such inspections with a UAV. In these all different flying situations, the UAV can fly very close to the object with a slow speed, producing valuable and reliable information about the inspected area. According to [1], the use of UAV can help to reduce the the mission's complexity for data gathering due to its high versatility, and the possibility of attaching new technologies into it. In this work, this and some other aspects are also taken in place to use as work motivation.

The UAV should also be capable of performing these missions stably. Therefore, there is also great importance in controlling the UAV's movement itself. For example, the authors of [22] have used a self-tuned PID control method to deal with external disturbances in a quadrotor UAV. In [23], the authors have proposed a hybrid PID control strategy to overcome sensor noise and strong wind disturbances. Several works in the literature have been proposed to make UAVs more robust to disturbances, parametric uncertainties, among other problems. For example, the control method proposed in [24] is a fault-tolerant strategy that takes into account system uncertainties and actuator failures. In [25], the authors have proposed a flight control for a quadrotor UAV for hovering with a slung load attached to it. The mathematical model was simplified to several controllable linear subsystems via reasonable assumptions. A robust *H*∞ controller was designed by utilizing the estimated states of a state observer. Other works have proposed robust control techniques for compensating for the effects of external disturbances and uncertainties in the UAV model parameters [26–29].

The physical instability of the UAV's platform causes motion in the acquired videos, which imposes harmful impacts on the accuracy of camera-based measurements [30]. These issues, among others, motivate the adoption of flight stabilization techniques, which allow the adaptation to operational changes based on the knowledge of dynamical properties [31]. They commonly use a navigation system to feed a classical PID controller, which has a simple structure, good stability, and less dependence on the exact system model. Although the PID controller has a simple structure to be implemented, the process of adjusting its parameters requires attention from the designer, particularly when nonlinearities are present. This is an issue that has been receiving growing attention. Such dynamical characteristics force the PID design and tuning to become even more complex, demanding an additional control approach. Computational Intelligence techniques can be used to optimize the PID gains, as seen in [32], where the PID gains were tuned by using Particle Swarm Optimization technique, and in [33], where Genetic Algorithm was used. The Fuzzy Logic Theory has also emerged as a solution for dealing with systems that are not easy to be modeled because of their nonlinearities and undetermined states. In this sense, many researchers have applied fuzzy controllers to obtain improved performance, and robustness properties compared to those that use pure classical control algorithms [34–38].

Note that the fuzzy-based control is considered as a control scheme that can improve the system's robustness and adaptability. This approach can be used to dynamically adjust the controller parameters in accordance with the output [39]. The authors in [40], proposed the use of a fuzzy PID scheme to control the attitude of a UAV. They used the fuzzy to adjust the controller parameters by inference rules. A similar scheme was proposed in [41]. The results showed that the UAV obtained better dynamics and stable performance.

In this work, a hybrid approach composed of a Cascaded-PID and a Fuzzy Logic controller is implemented. Due to the Cascaded-PID module, the proposed approach offers the system adaptive capabilities engendered by the Fuzzy Logic part and a robustness property against parametric uncertainties.

The focus of the devised approach is to propose a controller that has the robustness of a PID, but also that could be applied to many different scenarios. PIDs are widely used in the context of machine control and stabilization. However, the values of the Proportional, Integrative, and Derivative gains rely directly on the plant model. It can be very challenging to choose values that will fit the best way in all operational situations that this kind of robot can use. In order to amplify the range of use for those UAVs, the insertion of a fuzzy-based algorithm is implemented. In this case, the fuzzy would not control the movement speed and position itself, as usually is seen in state of the art, but would provide the adapted PID gains to the system and develop an optimized new PID controller to it.

Therefore, the main contributions of this work are:


This paper is structured as follows. Section 2 described the advanced method, whereas Section 3 describes some promising results and Section 4 the discussion. At last, Section 5 concludes the paper by furnishing the final conclusions.
