Next Article in Journal
Predictive Fault Diagnosis for Ship Photovoltaic Modules Systems Applications
Previous Article in Journal
Analytical and Experimental Performance Analysis of Enhanced Wake-Up Receivers Based on Low-Power Base-Band Amplifiers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Fuzzy Gain-Scheduling PID for UAV Position and Altitude Controllers

by
Aurelio G. Melo
1,
Fabio A. A. Andrade
2,3,*,
Ihannah P. Guedes
4,
Guilherme F. Carvalho
4,
Alessandro R. L. Zachi
4 and
Milena F. Pinto
4
1
Department of Electrical Engineering, Federal University of Juiz de Fora, Juiz de Fora 36036-900, Brazil
2
Department of Microsystems, Faculty of Technology, Natural Sciences and Maritime Sciences, University of South-Eastern Norway (USN), 3184 Borre, Norway
3
NORCE Norwegian Research Centre, 5838 Bergen, Norway
4
Department of Electronics Engineering, Federal Center for Technological Education of Rio de Janeiro, Rio de Janeiro 20271-110, Brazil
*
Author to whom correspondence should be addressed.
Sensors 2022, 22(6), 2173; https://doi.org/10.3390/s22062173
Submission received: 3 February 2022 / Revised: 4 March 2022 / Accepted: 8 March 2022 / Published: 10 March 2022
(This article belongs to the Section Physical Sensors)

Abstract

:
Unmanned aerial vehicle (UAV) applications have evolved to a wide range of fields in the last decade. One of the main challenges in autonomous tasks is the UAV stability during maneuvers. Thus, attitude and position control play a crucial role in stabilizing the vehicle in the desired orientation and path. Many control techniques have been developed for this. However, proportional integral derivative (PID) controllers are often used due their structure and efficiency. Despite PID’s good performance, different requirements may be present at different mission stages. The main contribution of this research work is the development of a novel strategy based on a fuzzy-gain scheduling mechanism to adjust the PID controller to stabilize both position and altitude. This control strategy must be effective, simple, and robust to uncertainties and external disturbances. The Robot Operating System (ROS) integrates the proposed system and the flight control unit. The obtained results showed that the proposed approach was successfully applied to the trajectory tracking and revealed a good performance compared to conventional PID and in the presence of noises. In the tests, the position controller was only affected when the altitude error was higher, with an error of 2% lower.

1. Introduction

Unmanned aerial vehicles (UAVs) give new opportunities to the industry due to their flexibility of flight, efficient and easy deployment, and simple structure [1]. These aerial systems are being applied in a wide range of practical applications, such as inspection [2,3], surveillance [4,5], search and rescue [6,7], cargo transportation [8], etc. Over the past few years, many improvements have been made in quadrotor UAV modeling and control.
The sensors’ noise and environmental disturbances cause motion in the UAV’s platform, impacting directly in the camera-based measurement, harming both the mission and the inspection process. An example of a recent application is the inspection of solar panel farms by UAVs [9]. This automated monitoring practice provides rapid maintenance service, fast and efficient failure detection, extending the service life and performance [9]. UAVs can suffer from environmental disturbances, such as wind, magnetic fields, or uncertain disturbance effects, such as sensor noise or payload during inspections. In this sense, this aircraft must have a reliable and robust control for attitude control and stabilization problems [10,11].
Note that a design of high-quality flight is a tough effort for quadrotor UAVs due to their nonlinear characteristics [12]. To improve the UAV flight performance, several researchers proposed advanced approaches for stabilizing the attitude and improving the UAV positions and tracking [13,14]. Most of these works are based on fuzzy logic [15,16], sliding-mode controller (SMC) [17], neural network-based control [18], backstepping-based adaptive control [19], and a linear quadratic regulator (LQR) [20], among others.
Proportional-integral-derivative (PID) controllers have a simple structure. However, the nonlinear characteristics make the design and tuning of the PID complex. Furthermore, it cannot ensure closed-loop performance in different conditions of flight. Fuzzy controllers applied to UAVs undoubtedly have some advantages in performance evaluation compared to PID controllers, such as dynamic property and steady-state error [21]. In the work of [22], the authors used the Takagi–Sugeno (TS) technique, along with linear parallel distributed compensation for vehicle stabilization. Ref. [23] proposed the utilization of the Mamdani-type fuzzy control algorithm for attitude and altitude control. The authors of [16] proposed a Fuzzy-type PID hybrid approach to improve the attitude controller by adjusting the PID gains through fuzzy logic. PIDs are robust and widely used approaches for controlling and stabilizing robotic systems. The challenge arises in the gain values of the PID scheme to fit the robot in a different operational situation. For instance, in [24], the authors applied a self-tuned PID control in a quadrotor UAV to overcome the external disturbances. The authors of [25] used a hybrid PID control strategy to deal with wind disturbances. Many methods have been proposed for PID gain scheduling. For instance, the authors of [26] proposed an optimal gain scheduling backstepping controller based on the Particle Swarm Optimization (PSO) algorithm. Another scheduling approach was proposed in [27], where the authors proposed a single neural adaptive PID (SNA-PID) for rotor speed control. The use of a fuzzy controller can improve the system’s robustness and adaptability [28]. According to [29], the fuzzy-scheduling approach enables the possibility of having variable gains over time that can be more suitable and robust for uncertainties, disturbances, and possible faults. A systematic approach to tune these design parameters is an interesting task.
Scheduling the PID gain can improve the UAV in-flight performance and change the flight characteristics according to the performed task, as shown in [10,30,31,32]. This is related to the different requirements presented by different flight stages or applications. For example, moving the UAV in a given direction in an inspection application could generate a collision. In order to prevent this, it may be desired that the UAV prioritizes the control in this direction, allowing, for example, a more significant error in the opposed direction in case of a wind gust. As an example of different flight requirements tied to the flight stage, the ground effect can impact controller performance during take-off. Thus, an additional configuration can be useful concerning the distance from the soil.
Another example is the case of a UAV carrying a load that can move or changes weight during flight, such as carrying a cable [33]. I could be desired that, in sudden load change, the PID gain is modified to allow a response that avoids a crash. In such cases, permitting more significant position errors while focusing the motor power on maintaining height and stability is desired. Complex controller implementations emulate safety characteristics by enhancing control performance. In [34], the authors used an L1 controller to improve response to disturbances. A similar methodology was implemented in [35] by using an active disturbance rejection control (ADRC) controller. Both methods can be efficient by improving the response to disturbance. However, in safe critical conditions, only improving control performance may not be enough and it may be desirable to allow different margins of errors in distinct control axes.
There are already a few works that have tried to introduce in-flight features by using fuzzy logic. In [36], the authors applied a fuzzy logic to introduce safety aspects to landing. The authors replaced the PID controller with a fuzzy logic controller during the landing stage in their work. This strategy is functional but more complex than adjusting the gains to accommodate the differences. The same is true for [31], where the authors employed fuzzy to try to reduce tracking errors. However, their work relied only on simulations for the validation process. Ref. [37] proposed the use of an adaptive PID controller for fault-tolerant control and a fuzzy inference scheme for real-time tuning of PID controller gains. In the work of [38], the authors evaluated the performance between the hybrid fuzzy logic PD controller and classical PD controller. They used a real system to perform the tests. The results indicated that the fuzzy PD controller is more suitable for non-linear systems. Ref. [39] evaluated the stabilization performance of the quadrotor by using a classical PID against the fuzzy logic controller. The outcomes indicated that the fuzzy logic presented a faster response. In [40], the authors used a fuzzy system, tuning gains from the PID controller to stabilize the quadrotor to control the attitude and to track the desired trajectory. The inputs of the fuzzy controller are the speed required for the distance between the current position of the UAV and the reference point. The authors evaluated their methodology in a quadrotor in a MATLAB/Simulink environment.
Despite the many Fuzzy implementations in the literature, there is still space to propose methods to schedule the changes to improve UAV performance according to application needs. In this work, the authors present two fuzzy gain schedulers to evaluate the use of fuzzy logic to introduce this effect. The first controller changes the altitude controller gains as the altitude error changes. The second controller adjusts the position controller gains to reduce its action as the height error. Note that the features added by the second fuzzy gain scheduler, where the altitude error is used to control the position performance, are not present in other implementations [16,29,32,37,40,41,42,43,44,45]. This fuzzy controller allows changing performance following the UAV application requirements.

Main Contributions

The main contribution of this research work is the proposition of a novel strategy based on a fuzzy-gain scheduling mechanism to adjust the PID controller to stabilize both position and altitude control. This control strategy must be effective, simple, and robust to uncertainties and external disturbances. The control parameters of the PID control structure are tuned and scheduled based on the fuzzy logic rules. The proposed strategy results were compared with a conventional PID controller. The contributions can be summarized as follows:
  • Proposition of a novel PID-gain schedule through the use of a fuzzy logic scheme to stabilize the position and altitude controller of a UAV;
  • Devise a strategy to tune Fuzzy PID controllers, considering environmental conditions.
  • Present a testing solution that can be embedded on UAV companion computers using ROS;
  • Evaluate the proposed strategy in simulated and real environments.
The rest of this paper is organized as follows. Section 2 formulates the kinematics and dynamics model of quadrotors. In Section 3, we describe the design of the fuzzy-gain scheduling mechanism to adjust the PID controller to address the position and altitude stabilization. Section 4 gives the proposed control performance in both simulation and real-world scenarios. Section 5 presents the concluding remarks and also the future works from this manuscript.

2. Quadrotor Modeling

The quadrotor UAV has four rotors attached to its structure, moving in hover, take-off, and landing positions by changing the speed of the rotor. This kind of system presents a stable yaw angle rotation that is represented in Figure 1. Note that F1, F2, F3, and F4 represent the four rotors. The center of the UAV is represented by O b , and ϕ is the roll Euler angle, θ is the pitch, and ψ is the yaw.
These Euler angles can be used as inputs on the forward kinematics equations to calculate the world-to-frame conversion matrix, which, based on the estimated values of roll, pitch, yaw, and velocity at each moment, can estimate the actual UAV position. Equation (1) gives this process calculation.
R ψ , θ , ϕ = cos ( ψ ) sin ( ψ ) 0 sin ( ψ ) cos ( ψ ) 0 0 0 1 · cos ( θ ) 0 sin ( θ ) 0 1 0 sin ( θ ) 0 cos ( θ ) · 1 0 0 0 cos ( ϕ ) sin ( ϕ ) 0 sin ( ϕ ) cos ( ϕ )
The UAV body frame axes mathematical model is presented in Equation (2). Authors refer to [46] for this type of model limitation and characteristic. This equation uses auxiliary variables, which are Δ = cos ( ϕ ) sin ( θ ) cos ( ψ ) and Γ = cos ( ϕ ) sin ( θ ) sin ( ψ ) .
ϕ ¨ θ ¨ ψ ¨ z ¨ x ¨ y ¨ = I y y I z z I z z θ ˙ ψ ˙ + θ J r I x x Ω r + l I x x U 2 I z z I z z I y y ϕ ˙ ψ ˙ + ϕ J r I y y Ω r + l I y y U 3 I x x I y y I z z θ ˙ ϕ ˙ + l I z z U 4 g cos ( ϕ ) cos ( θ ) U 1 m U 1 m ( Δ + sin ( ϕ ) sin ( ψ ) ) U 1 m ( Γ + sin ( ϕ ) cos ( ψ ) ) = ξ ϕ ( t ) ξ θ ( t ) ξ ψ ( t ) ξ h ( t ) 0 0
where ϕ is the roll Euler angle, θ is the pitch, and ψ is the yaw. The thrust and the actuation torques responsible for the roll, pitch, and yaw movements are represented by U i | ( i = 1 , , 4 ) variables. Moreover, Ω r is the engines residual angular speed. The variables ξ ( ϕ , θ , ψ , h ) represent the disturbances that respectively affect the dynamics of the respective Euler angles.
One strategy to combine these variables is to use the Motor Mixing Algorithm. It is also possible to analyze how the U i inputs are related to the angular speeds of the rotors Ω ( 1 , 2 , 3 , 4 ) , as shown in Equation (3). U 1 is the thrust equivalence force, U 2 represents a rotational force on the roll axis, U 3 represents a rotational force on the pitch axis, and U 4 represents a rotational force on the yaw axis. Note that b ( N s 2 ) is the impulse coefficient and d ( N m s 2 ) is the drag coefficient.
U 1 U 2 U 3 U 4 Ω r = b ( Ω 1 2 + Ω 2 2 + Ω 3 2 + Ω 4 2 ) b ( Ω 2 2 + Ω 4 2 ) b ( Ω 1 2 Ω 3 2 ) d ( Ω 1 2 + Ω 2 2 Ω 3 2 + Ω 4 2 ) Ω 1 + Ω 2 Ω 3 + Ω 4
The fuzzy-gain scheduling technique is used to adjust the PID gains for both position and altitude controllers, reducing the UAV quadrotor error dynamics and improving the performance and robustness.

3. Control Strategy

This paper used a classic UAV control system composed of different stages to control the UAV position and orientation. Those stages were position, orientation, and altitude control. This model assumed that the full UAV state was known. Each PID controller was tuned using classical methods once the full UAV model was known. After that, a fuzzy scheduler was applied to increase or decrease the gain of the altitude control and the position control, allowing the controller to adjust to environmental changes. A simplified diagram of different control stages is illustrated in Figure 2.
Note in the diagram that the PID Fuzzy controllers were independent. Because of this, the authors could test the first controller separately and then evaluate them together. As these controllers were independent, the authors first worked on the altitude controller to produce an adequate response to the altitude error by adjusting the ideal controller for high and low altitude error environments. Once the altitude controller performance was within the desired values, the authors proceeded to the next step: designing the position controller and fuzzy scheduling for this controller. Each fuzzy implementation had one different objective related to the variable being controlled and its requirements. Each fuzzy controller measured the variable errors to determine the scheduling mechanism. Figure 3 shows a representation of this process.
Differences between fuzzy schedules aim to improve aircraft performance and introduce safety characteristics. The primary variable is the aircraft’s height and stability in this sense. Next, once the aircraft is stable, controlling the yaw keeps the aircraft from spinning. Controlling the yaw is important because it is not possible to perform position control without a stable yaw. In the end, the last objective is to keep the aircraft from losing its desired position. If the aircraft has plenty of thrust available, this prioritization may not be relevant once enough power is available to control all these parameters. However, in situations where battery voltage may be low, in the presence of wind gusts or payload change, the power available may not be sufficient to provide a stable response for all these variables. These scenarios may be beneficial to reduce control input for the position, such as allowing more space for height and stability control.
If a good prioritization is performed in the presence of a continuous high load, the aircraft would first start losing position. Then, it would start spinning to lose height at the end. This is an example of one implementation that can be extended to other applications, as already suggested in the introduction. Based on these, the fuzzy scheduler designed in this work evaluated a proposition to improve PID performance for height control and to prioritize height control over the position in determining cases. The strategy is a proof of concept because the more advanced and flexible implementation of fuzzy scheduling can be built using the same concepts. The authors detail the proposed implementation and its characteristics in the next subsections.

3.1. PID Tunning

The quadrotor altitude control design is well researched in many works [47,48]. In this work, a classic strategy was applied by linearizing the plant loop to obtain its reference model. This simplified model was used to provide reference performances for two operating conditions. The first condition was a very aggressive and fast controller that was used as the main control law. The condition was a smoother controller, and the fuzzy logic switched to this second control law following the observed errors. The plant model obtained is shown in Equation (4).
0.000198 · z + 0.000198 z 2 2 · z + 1
The two control laws were obtained using the frequency response method to obtain a stable controller and good response times. The parameters obtained are shown in Table 1.
Regarding the parameters of Table 1, it is possible to quantify the performances, as presented in Table 2. Notice that the first control law had a slower rise time than a fast response at the cost of a larger overshoot. The second was smoother but took a little longer to respond.
In Figure 4 and Figure 5, one can observe the qualitative response related to each of these control laws. A faster response meant that the UAV could respond to any environmental change faster. In order to avoid the overshoot, the fuzzy logic moderated the gains when closer to the target. Additionally, integral control was only added when the error was low enough to require steady-state compensation.
Once the altitude controller was set, the position controller used a similar strategy. The only differences was that a PD controller was used, and the first control law was configured to produce a good and robust response. The second control law produces a slow response that was used when the altitude error was very high. Table 3 shows the gains for the position control.

3.2. Fuzzy Gain Scheduler for Altitude Controller

For this controller and fuzzy scheduler, a simple strategy was applied. The P control gain was set to produce an overshoot response. In this configuration, the aircraft promptly responded to any change in the error. The fuzzy scheduler was responsible for moderating this gain when the target was closer, thus removing the overshoot behavior.
The integral control signal was only applied when both error and error derivatives were low, meaning that the UAV was closer to the target. Otherwise, the integral action was not used. Figure 6 gives the input fuzzification, and Figure 7 presents the output defuzzification. Note that the inputs were the X-error (Figure 6a) and its time derivative (Figure 6b).
In Figure 7, the outputs are presented for each control effort of the PID controller. The values in the output represent the changes in the control law in effect, i.e., how much the PID gain was moderated or increased.
The idea behind the shapes selected for the input rules was to produce a selective transition between control laws as the error level increased. The output smoothly increased the PD gains to still and somewhat stable values as the error increased. However, the integrative error K I was only applied when small errors were present. This, along with anti-windup, ensured that steady-state errors were going to be corrected, but no instability would be produced.
Using the fuzzy rules and these fuzzy inputs, it was possible to design the controller to produce the transition between these two control laws according to the error and the error rate. Figure 8, Figure 9 and Figure 10 show the fuzzy surface generated by the rules applied using a Mamdani inference method [49]. The rules were built manually under the expected errors and were evaluated in different scenarios, such as response to the ramp, unit degree, and noisy input.

3.3. Fuzzy Gain Scheduler for Position Controller

The fuzzy applied in the position controller used a different strategy; a robust and fast position controller during normal operation. However, when the altitude error became too great, the gains were reduced to prioritize power to the altitude controller. The concept behind this strategy was to prevent the position controller from saturating the control signal in case of sudden altitude disturbances. In real UAVs, further levels would be required to produce a behavior that prioritizes height control first, then yaw control, stabilization, and at last, the position control. The idea behind these steps was to ensure that the UAV could continue flight in extreme conditions, such as load change, wind, and others. Only the interaction between the altitude and position control was evaluated in this work.
Figure 11 shows the control surface designed for this controller. As altitude errors increased, the surface behavior changed, moderating the controller. This meant that, as the position error increased, the controller got a boost in the gains. However, the altitude error moderated the PD gains as the error increased. The same behavior was also implemented for the derivative control law.

4. Results and Discussion

For the simulation tests, a virtual world environment was created by using GAZEBO/ROS software platforms. Figure 12 illustrates the UAV 3DR IRIS used in the simulations. The GCS ran the operating system Ubuntu 18.04.4 LTS 64 bits, and it had an Intel Core i7-5500U CPU @ 2.40GHz x 4, Intel HD Graphics 5500 (Broadwell GT2) and a 15.6 Gb of memory. The desired position or speed set point was applied to the PX4 flight controller board, creating a simple and efficient external control loop.
The results section is divided into three parts. First, the authors evaluate the fuzzy schedule control usage to improve the performance of an altitude controller in a simulated environment. The different gains used are shown in Section 3.1. This step produced the effect of increasing the controller effort in response to larger errors while still allowing a smooth response. The authors evaluated the combined position and altitude gain, scheduling in the simulated environment from this step. This idea reduced the position controller effort when a high altitude error was observed while still producing an adequate response otherwise. At last, the height control scheduling was evaluated in a practical scenario as a control experiment to validate the first simulation. The evaluation of a complete architecture in a realistic scenario is proposed for future works.

4.1. Results for Fuzzy Gain Scheduler for Height Controller

In this first experiment, a mixed set of inputs was used to evaluate the controller performance when responding to the increase and decrease errors with different slopes. The performance for this mixed set of inputs summarizes the controller performances for the original and scheduling controller with and without noise. The result for the altitude control using the fuzzy gain scheduling strategy is shown in Figure 13. Note that distance units here were standardized in the per unit (p.u.) system. The proposed scheme and the classical PID control were both applied to the system for comparison purposes, regarding two different scenarios: (i) in the absence of measurement noise and (ii) in the presence of 10 % of measurement white noise with constant probability distribution.
Figure 14 presents an approximation of Figure 13. It was possible to observe more closely the performances of each controller and scenario. We were able to notice the differences in performance for each controller in relation to the reference.
Figure 15 and Figure 16 show the performance of the proposed fuzzy gain scheduler for position control along the z-, x-, and y-axis, respectively. This kind of result can help us to understand the importance of adaptive controllers for UAVs. In Figure 14, it is possible to note that the fuzzy gains presented a slightly smaller error in the z-axis when compared to the other control strategies. Additionally, during stabilization, the output obtained with the proposed strategy oscillated less than the results obtained with the other controllers, thus achieving the positioning objective in a more well-behaved profile.
For better visualization, Figure 17 shows a 3D profile of the results for comparisons among other control approaches. It is possible to observe the good performance, in terms of smaller error amplitude, of the PID control that had the gains estimated by the proposed fuzzy scheduling approach.

4.2. Results for Fuzzy Gain Scheduler for Position Controller

The next series of simulations consisted of applying this strategy using the previous fuzzy controller alone and using both (i.e., altitude and position) controllers. In this test, the position control error became relevant, and the entire 3D path is shown in Figure 18. Four different controllers were analyzed, which are PID without noise, PID with noise combined fuzzy without noise, and combined fuzzy with noise. As the position controller prioritized altitude, a minor overall error was expected.
By looking at the detail of the height response at the end of a step (shown in Figure 19), it is possible to observe the combination of these effects of the controllers. Note that the error in the position controller was only affected when the altitude error was higher. Quantitatively, the error was 2% lower.

4.3. Experimental Results

In order to test the performance of the proposed fuzzy gains-scheduling for the PID control in a real-world scenario, the quadrotor used in Figure 20 was used. This UAV was embedded with a Pixhawk 2.4.8 32-bit flight controller unit (FCU), with an Ardupilot firmware, a NEO-8M GPS, and a companion computer. The FCU of the quadrotor was compatible with the network interface for a Robotic Operating System (ROS) and the MavLink communication protocol for a telemetry and offboard controller. The MAVROS interface allowed real-time information access.
This experiment evaluated both the position and altitude controller. The original gains were obtained from standard PID gains.

4.3.1. Altitude Control

In this first experiment, the UAV was subject to a fast input change in the altitude stick, and the position response was measured, simulating a step response. The proportional gain was changed to modify aircraft responsiveness, and the process was repeated. The proportional gain was kept fixed, while derivative and integral gains were adjusted. Note that this practical strategy was used to avoid any possible modeling issues in the PID adjustment.
The fuzzy-PID and PID gains were selected using the same strategy as in the simulations, using the values obtained in the previous phase. The UAV was submitted to a few inputs to simulate step response and evaluate the methods. Figure 21 presents the UAV height during the first experiment.
The behavior observed in the practical experiment was that the fuzzy scheme produced a higher noise than the original controller. This may be related to the increased gains used and their scheduling. It could also be due to the sensors amplified noise in the controller. However, the height tracking was more noticeable, being closer to the reference. We could also use this data to estimate the controller performance parameters, as seen in Table 4.
This work used a fuzzy scheme to adjust the altitude and position controller following the environmental changes. Each fuzzy controller measured the variable error to determine the scheduling approach. The first fuzzy-gain scheduler, applied to the altitude controller, was based on the output error and time derivative. This process is common in most works of literature. However, the second fuzzy-gain scheduler for the position controller was based on the position and altitude errors, which is different from other works. Note that the PID-gain was chosen through frequency response. However, other methods, such as the Ziegler–Nichols ultimate gain and oscillation period method, could be used.

4.3.2. Control on Critical Condition

In this second experiment, the authors intended to evaluate the control scheme performance in a critical condition. This meant that the authors commanded the UAV to a given height and then added height to simulate a sudden increase in power requirements from the motors, thus allowing the fuzzy scheme to prioritize power to the altitude control.
The steps taken were the first take-off of the UAV and finding a stable position control while hovering at 1 m. Then, the authors applied a 5-m step with a load attached to a 4-m cable. This situation increased the UAV weight to 95 % of its designed load. In Figure 22, one can observe the experimental results for a condition where the fuzzy scheduling was not present. One can notice that, during the few seconds as the load increase took effect, both the position and height control stopped operating properly.
It is important to note that the scale of the vertical axis (height) was different from the scale of the horizontal axes (latitude and longitude). The latitude axis of Figure 22, for example, had approximately 1 m of length.
Next, the authors used the same strategy but applied the fuzzy scheduling. This process was repeated five times to quantify the average response observed. Figure 23 shows the result for one of these tests with the fuzzy scheduling.
One can notice that the UAV was capable of maintaining a relatively stable position up to its designed height with a little overshoot. The overshoot is a possible sign of the position and height control interaction when subjected to the high disturbance caused by the load. Additionally, it is possible to notice that the position control lost reference very quickly. A little height loss was observed as the UAV could not maintain its altitude due to the motors’ thrust condition.
This is easier to visualize through Figure 24, where the position response is isolated. Note that the positions were concentrated at a given area related to the wind disturbance and GPS errors. Suddenly, the position reference was lost, and the UAV started to deviate from its location.
To quantify the performance improvement in this condition, the height error in the last 500 samples was averaged. The fuzzy scheduler observed an average error of 0.765 m, while the average error was 2.038 m without it. The absolute improvement value was not very informative when the ground truth was not captured externally. However, this difference shows that the method can potentially change UAV flight behavior, adding different flight characteristics for different situations.

5. Conclusions and Future Work

The PID controller is a simple control scheme, widely applied in the literature. However, as a linear control strategy, it is observed that its performance suffers degradation when it is applied in linearized systems at different operating points. The sudden change in operating points is usually due to rapid changes in motion. In such a scenario, the gain schedule technique is an attractive solution to adjust this type of controller during changes in plant operating regions. In this sense, this work developed a fuzzy gain-scheduling PID controller for a quadrotor vehicle in order to control its position and altitude. The tests were performed both in a simulation environment and in a real quadrotor system. The obtained results for the trajectory tracking problem showed that the proposed control-plus-tuning strategy revealed a good performance compared to the classical PID results, even considering the presence of measurement noise.
The fuzzy logic has multiple parameters and instructions that impact directly in the processing speed. Therefore, this work opens the possibility of several improvements in terms of implementation. For instance, optimal algorithms could be used to improve the processing speed. Another potential interest is dealing with the vehicle payload changes, which usually occur in product delivery situations.
In terms of evaluation, this research work opens up several future possibilities. In future works, authors expect to implement a complete version of the PID scheduling method, capable of handling complex situations by prioritizing height first, stability pitch, roll, and third yaw second, and position control last. In future works, the authors also intend to test strategies to perform control in restricted spaces, where a few directions have more freedom of movement than others. For instance, inspections close to structures, where the UAV can’t move in the structure direction but can go freely in another way. The MATLAB/Simulink software was used for the proof of concept of the Fuzzy Logic algorithm. However, in future works, this should be embedded in the FCU of the UAV, avoiding delays in the information processing.

Author Contributions

Conceptualization, A.G.M., F.A.A.A. and M.F.P.; methodology, A.G.M., I.P.G., G.F.C. and M.F.P.; validation, A.G.M.; formal analysis, A.R.L.Z., A.G.M. and F.A.A.A.; investigation, A.G.M. and M.F.P.; writing—original draft preparation, A.G.M. and M.F.P.; writing—review and editing, M.F.P., A.R.L.Z. and F.A.A.A.; visualization, F.A.A.A., A.G.M. and M.F.P.; supervision, F.A.A.A., M.F.P. and A.G.M.; project administration, A.G.M.; funding acquisition, M.F.P. and F.A.A.A. All authors have read and agreed with the submission of the current manuscript version.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The source-codes are openly available in https://github.com/GeneralAdmin/FuzzyGainSchedulingUAV (accessed on 2 February 2022).

Acknowledgments

The authors would like to thank CEFET/RJ, the Rio de Janeiro state research agency FAPERJ, and the Brazilian Federal Agencies, CAPES and CNPq, for supporting this research.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MDPIMultidisciplinary Digital Publishing Institute
PDProportional Derivative
PIDProportional Integral Derivative
UAVUnmanned Aerial Vehicle
ROSRobotic Operating System
SMCSliding-Mode Controller
PSOParticle Swarm Optimization
SNA-PIDSingle Neural Adaptative PID
ADRCActive Disturbance Rejection Control

References

  1. Pinto, M.F.; Honorio, L.M.; Melo, A.; Marcato, A.L. A Robotic Cognitive Architecture for Slope and Dam Inspections. Sensors 2020, 20, 4579. [Google Scholar] [CrossRef] [PubMed]
  2. Melo, A.G.; Pinto, M.F.; Honorio, L.M.; Dias, F.M.; Masson, J.E. 3D Correspondence and Point Projection Method for Structures Deformation Analysis. IEEE Access 2020, 8, 177823–177836. [Google Scholar] [CrossRef]
  3. Biundini, I.Z.; Melo, A.G.; Pinto, M.F.; Marins, G.M.; Marcato, A.L.; Honorio, L.M. Coverage Path Planning Optimization for Slopes and Dams Inspection. In Proceedings of the Iberian Robotics Conference; Springer: Cham, Switzerland, 2019; pp. 513–523. [Google Scholar]
  4. Scherer, J.; Rinner, B. Multi-UAV surveillance with minimum information idleness and latency constraints. IEEE Robot. Autom. Lett. 2020, 5, 4812–4819. [Google Scholar] [CrossRef]
  5. Pinto, M.F.; Melo, A.G.; Marcato, A.L.; Urdiales, C. Case-based reasoning approach applied to surveillance system using an autonomous unmanned aerial vehicle. In Proceedings of the 2017 IEEE 26th International Symposium on Industrial Electronics (ISIE), Edinburgh, UK, 9–21 June 2017; pp. 1324–1329. [Google Scholar]
  6. Atif, M.; Ahmad, R.; Ahmad, W.; Zhao, L.; Rodrigues, J.J. UAV-Assisted Wireless Localization for Search and Rescue. IEEE Syst. J. 2021, 15, 3261–3272. [Google Scholar] [CrossRef]
  7. Pinto, M.F.; Honório, L.M.; Marcato, A.L.; Dantas, M.A.; Melo, A.G.; Capretz, M.; Urdiales, C. ARCog: An Aerial Robotics Cognitive Architecture. Robotica 2021, 39, 483–502. [Google Scholar] [CrossRef]
  8. Villa, D.K.; Brandao, A.S.; Sarcinelli-Filho, M. A survey on load transportation using multirotor UAVs. J. Intell. Robot. Syst. 2020, 98, 267–296. [Google Scholar] [CrossRef]
  9. Liao, K.C.; Lu, J.H. Using UAV to Detect Solar Module Fault Conditions of a Solar Power Farm with IR and Visual Image Analysis. Appl. Sci. 2021, 11, 1835. [Google Scholar] [CrossRef]
  10. Sun, C.; Liu, M.; Liu, C.; Feng, X.; Wu, H. An Industrial Quadrotor UAV Control Method Based on Fuzzy Adaptive Linear Active Disturbance Rejection Control. Electronics 2021, 10, 376. [Google Scholar] [CrossRef]
  11. Ulus, Ş.; Eski, I. Neural network and fuzzy logic-based hybrid attitude controller designs of a fixed-wing UAV. Neural Comput. Appl. 2021, 33, 8821–8843. [Google Scholar] [CrossRef]
  12. Wei, J.; Zhou, J.; Du, H.; Wu, D. Flying velocity constraint control for quad-rotor system based on finite-Time control technique. In Proceedings of the 2020 39th Chinese Control Conference (CCC), Shenyang, China, 27–29 July 2020; pp. 311–316. [Google Scholar]
  13. Rodríguez-Abreo, O.; Rodríguez-Reséndiz, J.; Fuentes-Silva, C.; Hernández-Alvarado, R.; Falcón, M.D.C.P.T. Self-tuning neural network PID with dynamic response control. IEEE Access 2021, 9, 65206–65215. [Google Scholar] [CrossRef]
  14. Castillo-Zamora, J.J.; Camarillo-Gomez, K.A.; Perez-Soto, G.I.; Rodriguez-Resendiz, J. Comparison of PD, PID and sliding-mode position controllers for V–tail quadcopter stability. IEEE Access 2018, 6, 38086–38096. [Google Scholar] [CrossRef]
  15. Kim, H.S.; Lee, K.; Joo, Y.H. Decentralized sampled-data fuzzy controller design for a VTOL UAV. J. Frankl. Inst. 2021, 358, 1888–1914. [Google Scholar] [CrossRef]
  16. Carvalho, G.; Guedes, I.; Pinto, M.; Zachi, A.; Almeida, L.; Andrade, F.; Melo, A.G. Hybrid PID-Fuzzy controller for autonomous UAV stabilization. In Proceedings of the 2021 14th IEEE International Conference on Industry Applications (INDUSCON), São Paulo, Brazil, 15–18 August 2021; pp. 1296–1302. [Google Scholar]
  17. Eltayeb, A.; Rahmat, M.F.; Basri, M.A.M.; Eltoum, M.M.; El-Ferik, S. An Improved Design of an Adaptive Sliding Mode Controller for Chattering Attenuation and Trajectory Tracking of the Quadcopter UAV. IEEE Access 2020, 8, 205968–205979. [Google Scholar] [CrossRef]
  18. Zhang, Z.; Chen, T.; Zheng, L. A multilayer neural dynamic controller design method of quadrotor UAV for completing time-varying tasks. Nonlinear Dyn. 2021, 104, 3597–3616. [Google Scholar] [CrossRef]
  19. Chen, F.; Jiang, R.; Zhang, K.; Jiang, B.; Tao, G. Robust backstepping sliding-mode control and observer-based fault estimation for a quadrotor UAV. IEEE Trans. Ind. Electron. 2016, 63, 5044–5056. [Google Scholar] [CrossRef]
  20. Minervini, A.; Godio, S.; Guglieri, G.; Dovis, F.; Bici, A. Development and Validation of a LQR-Based Quadcopter Control Dynamics Simulation Model. J. Aerosp. Eng. 2021, 34, 04021095. [Google Scholar] [CrossRef]
  21. Lara Alabazares, D.; Rabhi, A.; Pegard, C.; Torres Garcia, F.; Romero Galvan, G. Quadrotor UAV attitude stabilization using fuzzy robust control. Trans. Inst. Meas. Control 2021, 43, 2599–2614. [Google Scholar] [CrossRef]
  22. Torres, F.; Rabhi, A.; Lara, D.; Romero, G.; Pégard, C. Fuzzy state feedback for attitude stabilization of quadrotor. Int. J. Adv. Robot. Syst. 2016, 13, 2. [Google Scholar] [CrossRef] [Green Version]
  23. Domingos, D.; Camargo, G.; Gomide, F. Autonomous fuzzy control and navigation of quadcopters. IFAC-PapersOnLine 2016, 49, 73–78. [Google Scholar] [CrossRef]
  24. Joyo, M.K.; Hazry, D.; Ahmed, S.F.; Tanveer, M.H.; Warsi, F.A.; Hussain, A. Altitude and horizontal motion control of quadrotor UAV in the presence of air turbulence. In Proceedings of the 2013 IEEE Conference on Systems, Process & Control (ICSPC), Kuala Lumpur, Malaysia, 13–15 December 2013; pp. 16–20. [Google Scholar]
  25. Tanveer, M.H.; Hazry, D.; Ahmed, S.F.; Joyo, M.K.; Warsi, F.A.; Kamaruddin, H.; Razlan, Z.M.; Wan, K.; Shahriman, A. NMPC-PID based control structure design for avoiding uncertainties in attitude and altitude tracking control of quad-rotor (UAV). In Proceedings of the 2014 IEEE 10th International Colloquium on Signal Processing and its Applications, Kuala Lumpur, Malaysia, 7–9 March 2014; pp. 117–122. [Google Scholar]
  26. Derrouaoui, S.H.; Bouzid, Y.; Guiatni, M. PSO Based Optimal Gain Scheduling Backstepping Flight Controller Design for a Transformable Quadrotor. J. Intell. Robot. Syst. 2021, 102, 67. [Google Scholar] [CrossRef]
  27. Tang, W.; Wang, L.; Gu, J.; Gu, Y. Single neural adaptive PID control for small UAV micro-turbojet engine. Sensors 2020, 20, 345. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  28. Dief, T.N.; Yoshida, S.; Abdelhady, M. Attitude and altitude stabilization of quad rotor using parameter estimation and self-tuning controller. In Proceedings of the AIAA Atmospheric Flight Mechanics Conference, Dallas, TX, USA, 22–26 June 2015; p. 2392. [Google Scholar]
  29. Ammar, N.B.; Bouallègue, S.; Haggège, J. Fuzzy gains-scheduling of an integral sliding mode controller for a quadrotor unmanned aerial vehicle. Int. J. Adv. Comput. Sci. Appl. 2018, 9, 132–141. [Google Scholar]
  30. Jatsun, S.; Emelyanova, O.; Leon, A.S.M.; Stykanyova, S. Control fligth of a UAV type tricopter with fuzzy logic controller. In Proceedings of the 2017 Dynamics of Systems, Mechanisms and Machines (Dynamics), Omsk, Russia, 14–16 November 2017; pp. 1–5. [Google Scholar]
  31. Dong, J.; He, B. Novel fuzzy PID-type iterative learning control for quadrotor UAV. Sensors 2019, 19, 24. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  32. Andrade, F.A.; Guedes, I.P.; Carvalho, G.F.; Zachi, A.R.; 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. [Google Scholar] [CrossRef]
  33. Ramos, G.S.; Pinto, M.F.; Coelho, F.O.; Honório, L.M.; Haddad, D.B. Hybrid methodology based on computational vision and sensor fusion for assisting autonomous UAV on offshore messenger cable transfer operation. Robotica 2022, 1–29. [Google Scholar] [CrossRef]
  34. Fernández, R.A.S.; Dominguez, S.; Campoy, P. L1 adaptive control for wind gust rejection in quad-rotor uav wind turbine inspection. In Proceedings of the 2017 International Conference on Unmanned Aircraft Systems (ICUAS), Miami, FL, USA, 13–16 June 2017; pp. 1840–1849. [Google Scholar]
  35. Zou, Y.; Yin, Y.; Song, J. Flight control of a flying-wing UAV based on active disturbance rejection control. In Proceedings of the 2017 3rd IEEE International Conference on Control Science and Systems Engineering (ICCSSE), Beijing, China, 17–19 August 2017; pp. 50–55. [Google Scholar]
  36. Talha, M.; Asghar, F.; Rohan, A.; Rabah, M.; Kim, S.H. Fuzzy logic-based robust and autonomous safe landing for UAV quadcopter. Arab. J. Sci. Eng. 2019, 44, 2627–2639. [Google Scholar] [CrossRef]
  37. Amoozgar, M.H.; Chamseddine, A.; Zhang, Y. Fault-tolerant fuzzy gain-scheduled PID for a quadrotor helicopter testbed in the presence of actuator faults. IFAC Proc. Vol. 2012, 45, 282–287. [Google Scholar] [CrossRef] [Green Version]
  38. Erginer, B.; Altuğ, E. Design and implementation of a hybrid fuzzy logic controller for a quadrotor VTOL vehicle. Int. J. Control. Autom. Syst. 2012, 10, 61–70. [Google Scholar] [CrossRef]
  39. Sharma, A.; Barve, A. Controlling of quad-rotor uav using pid controller and fuzzy logic controller. Int. J. Electr. Electron. Comput. Eng. 2012, 1, 38–41. [Google Scholar]
  40. Demir, B.E.; Bayir, R.; Duran, F. Real-time trajectory tracking of an unmanned aerial vehicle using a self-tuning fuzzy proportional integral derivative controller. Int. J. Micro Air Veh. 2016, 8, 252–268. [Google Scholar] [CrossRef] [Green Version]
  41. Prayitno, A.; Indrawati, V.; Trusulaw, I.I. Fuzzy gain scheduling PID control for position of the AR. Drone. Int. J. Electr. Comput. Eng. (IJECE) 2018, 8, 1939–1946. [Google Scholar] [CrossRef]
  42. Rabah, M.; Rohan, A.; Mohamed, S.A.; Kim, S.H. Autonomous moving target-tracking for a UAV quadcopter based on fuzzy-PI. IEEE Access 2019, 7, 38407–38419. [Google Scholar] [CrossRef]
  43. Sarhan, A.; Qin, S. Adaptive PID control of UAV altitude dynamics based on parameter optimization with fuzzy inference. Int. J. Model. Optim. 2016, 6, 246. [Google Scholar] [CrossRef] [Green Version]
  44. El Hamidi, K.; Mjahed, M.; El Kari, A.; Ayad, H. Neural network and fuzzy-logic-based self-tuning PID control for quadcopter path tracking. Stud. Inform. Control 2019, 28, 401–412. [Google Scholar] [CrossRef]
  45. Kaplan, M.R.; Eraslan, A.; Beke, A.; Kumbasar, T. Altitude and position control of parrot mambo minidrone with PID and fuzzy PID controllers. In Proceedings of the 2019 11th International Conference on Electrical and Electronics Engineering (ELECO), Bursa, Turkey, 28–30 November 2019; pp. 785–789. [Google Scholar]
  46. Castillo-Effen, M.; Castillo, C.; Moreno, W.; Valavanis, K. Control fundamentals of small/miniature helicopters—A survey. In Advances in Unmanned Aerial Vehicles; Springer: Dordrecht, The Netherlands, 2007; pp. 73–118. [Google Scholar]
  47. Idrissi, M.; Salami, M.; Annaz, F. A Review of Quadrotor Unmanned Aerial Vehicles: Applications, Architectural Design and Control Algorithms. J. Intell. Robot. Syst. 2022, 104, 22. [Google Scholar] [CrossRef]
  48. González, J.A.C.; Salas-Peña, O.; De León-Morales, J. Observer-based super twisting design: A comparative study on quadrotor altitude control. ISA Trans. 2021, 109, 307–314. [Google Scholar] [CrossRef]
  49. Sakti, I. Methodology of fuzzy logic with mamdani fuzzy models applied to the microcontroller. In Proceedings of the 2014 The 1st International Conference on Information Technology Computer, and Electrical Engineering, Semarang, Indonesia, 8 November 2014; pp. 93–98. [Google Scholar]
Figure 1. Quadrotor Mechanical structure.
Figure 1. Quadrotor Mechanical structure.
Sensors 22 02173 g001
Figure 2. Proposed methodology.
Figure 2. Proposed methodology.
Sensors 22 02173 g002
Figure 3. Fuzzy logic implementation.
Figure 3. Fuzzy logic implementation.
Sensors 22 02173 g003
Figure 4. Altitude response to the first control law.
Figure 4. Altitude response to the first control law.
Sensors 22 02173 g004
Figure 5. Altitude response to the second control law.
Figure 5. Altitude response to the second control law.
Sensors 22 02173 g005
Figure 6. Input fuzzification: (a) Altitude error; and (b) Derivative of altitude error.
Figure 6. Input fuzzification: (a) Altitude error; and (b) Derivative of altitude error.
Sensors 22 02173 g006
Figure 7. Output defuzzification: (a) Delta-P; (b) Delta-I; and (c) Delta-D.
Figure 7. Output defuzzification: (a) Delta-P; (b) Delta-I; and (c) Delta-D.
Sensors 22 02173 g007
Figure 8. Fuzzy surface for proportional gain.
Figure 8. Fuzzy surface for proportional gain.
Sensors 22 02173 g008
Figure 9. Fuzzy surface for derivative gain.
Figure 9. Fuzzy surface for derivative gain.
Sensors 22 02173 g009
Figure 10. Fuzzy surface for integral gain.
Figure 10. Fuzzy surface for integral gain.
Sensors 22 02173 g010
Figure 11. Fuzzy surface for position control-proportional gain.
Figure 11. Fuzzy surface for position control-proportional gain.
Sensors 22 02173 g011
Figure 12. UAV used in the simulation tests.
Figure 12. UAV used in the simulation tests.
Sensors 22 02173 g012
Figure 13. Comparison of the proposed method and PID controller for altitude control.
Figure 13. Comparison of the proposed method and PID controller for altitude control.
Sensors 22 02173 g013
Figure 14. Detail of comparison of the proposed method and PID controller for altitude control.
Figure 14. Detail of comparison of the proposed method and PID controller for altitude control.
Sensors 22 02173 g014
Figure 15. Comparison of the proposed method among others for position control in the X-axis.
Figure 15. Comparison of the proposed method among others for position control in the X-axis.
Sensors 22 02173 g015
Figure 16. Comparison of the proposed method among others for position control in the Y-axis.
Figure 16. Comparison of the proposed method among others for position control in the Y-axis.
Sensors 22 02173 g016
Figure 17. 3D visualization for the comparison of the proposed method among other approaches for position control.
Figure 17. 3D visualization for the comparison of the proposed method among other approaches for position control.
Sensors 22 02173 g017
Figure 18. UAV 3D path during simulations.
Figure 18. UAV 3D path during simulations.
Sensors 22 02173 g018
Figure 19. UAV height response details.
Figure 19. UAV height response details.
Sensors 22 02173 g019
Figure 20. Quadrotor used in the experimental tests.
Figure 20. Quadrotor used in the experimental tests.
Sensors 22 02173 g020
Figure 21. Height response for the practical experiment.
Figure 21. Height response for the practical experiment.
Sensors 22 02173 g021
Figure 22. Height response without fuzzy scheduling.
Figure 22. Height response without fuzzy scheduling.
Sensors 22 02173 g022
Figure 23. Height response with fuzzy scheduling.
Figure 23. Height response with fuzzy scheduling.
Sensors 22 02173 g023
Figure 24. Position response.
Figure 24. Position response.
Sensors 22 02173 g024
Table 1. Gain for the altitude control law.
Table 1. Gain for the altitude control law.
Gain
Control Law 1Control Law 2
P1.70.16
I00.009
D0.60.6
Table 2. Performance of altitude controllers.
Table 2. Performance of altitude controllers.
Control Law 1Control Law 2
Rise time0.120.2
Setting time1.01.6
Overshoot20%2%
Table 3. Gain for position control law.
Table 3. Gain for position control law.
Gain
Control Law 1Control Law 2
P0.240.07
I00
D0.10.05
Table 4. Controller performance.
Table 4. Controller performance.
OriginalFuzzy
Rise Time0.1 s0.1 s
Settling Time0.1 s0.2 s
Overshoot13%1%
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Melo, A.G.; Andrade, F.A.A.; Guedes, I.P.; Carvalho, G.F.; Zachi, A.R.L.; Pinto, M.F. Fuzzy Gain-Scheduling PID for UAV Position and Altitude Controllers. Sensors 2022, 22, 2173. https://doi.org/10.3390/s22062173

AMA Style

Melo AG, Andrade FAA, Guedes IP, Carvalho GF, Zachi ARL, Pinto MF. Fuzzy Gain-Scheduling PID for UAV Position and Altitude Controllers. Sensors. 2022; 22(6):2173. https://doi.org/10.3390/s22062173

Chicago/Turabian Style

Melo, Aurelio G., Fabio A. A. Andrade, Ihannah P. Guedes, Guilherme F. Carvalho, Alessandro R. L. Zachi, and Milena F. Pinto. 2022. "Fuzzy Gain-Scheduling PID for UAV Position and Altitude Controllers" Sensors 22, no. 6: 2173. https://doi.org/10.3390/s22062173

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop