Trajectory-tracking is an attractive application for quadcopters and a very challenging, complicated field of research due to the complex dynamics of a quadcopter. Various control algorithms have been developed to stabilize the quadcopter over a certain trajectory since it is hard for a quadcopter to follow a certain trajectory. In this paper, a fuzzy-PID controller is designed to stabilize the quadcopter over a certain trajectory using the speed information as an input. The proposed controller is compared to a PD controller and a fuzzy logic controller (FLC) to distinguish which has a better performance using MATLAB/Simulink. The simulation results demonstrate that under different trajectories the fuzzy-PID controller shows a better response than the other two controllers.
Quadcopter is a type of unmanned aerial vehicles (UAVs), which is lifted and propelled by four rotors. Compared to the other types of UAVs, a quadcopter is low-cost, simpler, and smaller. Furthermore, it has high maneuverability as it can hover, take off, cruise, and land on narrow areas. Because of this, there has been an increasing interest in quadcopter applications such as surveillance, mapping, search and rescue, object detection and landing to drone station [1–5].
Trajectory-tracking is a very important task for quadcopters as it is proven to be effective in many different example scenarios, such as forest fires and damage surveying after floods and storms where time is a critical factor for decision-making and measures implementation.
Generally, quadcopters are dynamically unstable, under-actuated, and nonlinear systems. This is principally the reason why it is very challenging to design a controller to stabilize a quadcopter over a certain trajectory. To deal with these difficulties, many control algorithms for trajectory-tracking have been developed to stabilize a quadcopter. A proportional-integral (PI) and proportional-integral-derivative (PID) controller were used to develop a tracking control algorithm of a quadcopter [6, 7]. A linear quadratic regulator (LQR) control method has been proposed in [8]. To overcome the under-actuated problem of a quadcopter, a back-stepping controller and a sliding mode controller were proposed in [9–11].
Even though the prior researches work well, their results show slower response and higher overshot. Therefore, in this paper, a fuzzy-PID controller is designed to overcome the previously mentioned problems. MATLAB/Simulink is used to compare the output of the proposed controller to a typical PD controller and an fuzzy logic controller (FLC). Simulations are carried out under different trajectories. The comparison shows that the proposed controller has a higher response and no overshoot compared to the other two controllers.
In the next section, the dynamic model of a quadcopter system is explained. In Section 3, the controllers used in this system are explained. In Section 4, simulation studies are carried out for all the three controllers followed by the simulation results. Furthermore, a comparison between these controllers is discussed, followed by the conclusion.
As shown in Figure 1, a quadcopter consists of six degrees of freedom (DOF) body actuated by four propellers. The four rotors provide upward thrusts as well as the direction of the quadcopter. Each motor is located at one end of the quadcopter arm. The motors located diagonally opposite to each other rotate in the same direction while the adjacent motors rotate in the opposite direction. The mathematical model of a quadcopter is developed based on Newton-Euler equations. A quadcopter is assumed to be rigid, symmetric and the gyroscopic effects of the propellers are negligible [12, 13].
A quadcopter system has four inputs (U_{1}, U_{2}, U_{3}, U_{4}) and six outputs (x, y, z, ϕ, θ, ψ), where U_{1} is the force acting on the quadcopter body, U_{2} is the force causing the roll motion, U_{3} is the force causing the pitch motion and U_{4} is the force causing the yaw torque.
The block diagram of quadcopter system is shown in Figure 2. The path command block sends the required trajectory to the position control block by accepting a time series input from the user. The position control block isresponsible for controlling the position of the quadcopter by sending the attitude data required to fly the quadcopter over a desired trajectory. This data is used inside the attitude controller to manage the required angle for quadcopter to follow the trajectory. This data (U_{i}) is used as an input to quadcopter dynamics block, which has been explained in the previous section. Figure 3 shows the block diagram of the three controllers that is used to control the position of the quadcopter.
PID controller is a control loop feedback mechanism commonly used in industrial control systems because of its simple design [14].
In this paper, the integrator part of PID controller is avoided since it is more preferable to use a PD controller in position control algorithms. A PD controller continuously calculates an error value as the difference between the desired reference and the output of the system, then applies a correction based on proportional and derivative terms according to
where K_{p} and K_{d} are the proportional and derivative gains, e (t) is the error value and y (t) is the output of the system. Figure 4 shows the PD controller block diagram.
FLC is a logic operation method based on many-valued logic rather than the usual “true or false” (1 or 0) Boolean logic on which the modern computer is based. FLC has some advantages compared to other classical controllers such as simplicity of control, low cost, and the possibility to design without knowing the exact mathematical model of the process. FLC has two inputs, error (e) and its derivative (δe). As shown in Figure 5, the FLC has three main stages: fuzzification, rule base, and defuzzification. Fuzzification describes the input and output of the FLC to specify set of rules to control our system. The collection of rules is called a rule base. The rules are in “If Then” format and formally the If side is called the conditions and the Then side is called the conclusion. The computer is able to execute the rules and compute a control signal depending on the measured inputs error (e) and its derivative (δe). Defuzzification is when all the actions that have been activated are combined and converted into a single non-fuzzy output signal which is the control signal of the system [15, 16].
The designed fuzzy-PID controller is a hybrid controller, utilizing two sets of PI gains in order to achieve a nonlinear response. Fuzzy-PID takes two inputs, error (e) and its derivative (δe), and gives two outputs, K_{pf} and K_{if}, which are determined by a set of fuzzy rules. Figure 6 shows the basic structure of fuzzy-PID controller. The output of the fuzzy-PID controller (K_{pf} and K_{if}) are used to adapt the K_{p} and K_{i} gains of the PID controller as shown in
MATLAB/Simulink is used to test the proposed trajectory-tracking system by comparing the performance of the three controllers: PD controller, FLC, and fuzzy-PID controller. The used quadcopter simulation system is available on MATLAB file exchange and it’s free to use. Figure 7 shows the simulation system of the quadcopter and Table 2 shows the values of the parameters used in the quadcopter simulation system. In this system, the position control block is responsible for taking the trajectory data (x, y, z, t) from the user, and gives out the required angle responsible for controlling the quadcopter over a desired trajectory. Figure 8 shows the position control block. As shown in Figure 8, the error rotation block keeps on calculating the position error between the current position in the desired trajectory and the current position of the quadcopter, and gives out the desired velocity. The Theta/Phi Command Control block takes the difference between the desired velocity and the actual velocity of the quadcopter as an input to the controllers, and gives out the required Theta/Phi (Roll/Pitch) angle required for tracking based on the outputs of the three controllers. Figure 9 shows the controllers used in Theta/Phi Command Control block to control the trajectory-tracking of the quadcopter. In Figure 9, the switch block is used to switch between the three controllers. An attitude limit switch is used to limit the output angle between −12° and 12°. The PD controller implementation is shown in Figure 9. The gains used in the PD controllers are K_{p} = 0.32 and K_{d} = 0.1.
FLC is used to generate gains instead of PID to avoid high fluctuations in the start. In FLC, five linguistic variables are used for each input, which means there are 25 possible rules with all combinations of the inputs. The set of linguistic values for two inputs and one output with 25 rules are negative big (NB), negative small (NS), zero (ZE), positive small (PS),and positive big (PB). A Mamdani type with triangular membership functions is used for the two inputs and one output as shown in Figure 10. The FLC uses MIN for t-norm operation, Max for s-norm operation, MAX for aggregation, MIN for implication, and Centroid for defuzzification. FLC rule base of the trajectory-tracking control algorithm is shown in Table 3. FLC takes two inputs (e and δe) and one output (angle). Membership functions of the inputs and output variable are shown in Figure 11. The FLC implementation is shown in Figure 9.
The fuzzy-PID controller uses the same parameters of FLC. It has two inputs (e and δe) and two outputs (K_{p} and K_{i}). The fuzzy-PID parameters is shown in Figure 12.
Figure 13 shows the membership of the inputs and outputs.
Figure 14 shows the implementation of the proposed controller. The rule base for K_{p} and K_{i} are shown in Tables 4 and 5.
In order to verify the validity and efficiency of the control algorithm proposed in this paper, a comparison between the three controllers has been carried out under three different trajectories. In Figure 15(a) and (b), fuzzy-PID shows the best response in x and y-direction while PD controller and FLC have overshot.
Figure 15(c) shows the output of the three controllers in the XY plane. The fuzzy-PID has the best response among the three controllers. FLC has overshot while PD controller has bigger overshot and oscillation. In Figure 16(a) and (b), fuzzy-PID and FLC have close results. However, there is a small oscillation in the FLC. PD controller has poor stability and it takes more time to settle. Figure 16(c) shows a comparison of the three controllers in the XY plane. According to Figure 16(c), fuzzy-PID has a slightly better response than FLC. In Figure 17(a), fuzzy-PID shows faster response than the other two controllers. PD controller shows a slower response to the other two controllers, while FLC shows poor stability. Figure 17(b) shows close results for both fuzzy-PID controller and FLC while PD controller has a slower response. Figure 17(c) shows that the fuzzy-PID controller has a faster response than the other two controllers. Table 6 shows the sum of square errors (SSE) in the three trajectories to determine the best performance among the three controllers where:
where n is the number of data, i = 1, . . . , n and e is the error.
According to the comparison results and SSE results, the PD controller shows the poorest response. Although PD controller is easy to use and implement, entailing a fast way to control the system, it will nonetheless fail to control the quadcopter in case of disturbances like wind or sharp turns because of the usage of fixed gains. In order to get the best performance from a PD controller, gains need to be changed continuously. Although both fuzzy-PID controller and FLC controller have close results because both controllers use error and its derivative as input to minimize the error between the reference and the actual output as much as possible, fuzzy-PID tends to work more as an auto-tuning method by continuously changing the PI gains according to the controller input. Thus, a fuzzy-PID combines the pros of both a PID controller and an FLC.
In this paper, a trajectory-tracking control system for quadcopter has been designed based on fuzzy-PID controller. In order to test the performance of the designed controller, three different trajectories were used to compare the output of the designed controller with a PD controller and an FLC using MATLAB/Simulink. According to the comparison results, the designed controller and the FLC has close results. By calculating the SSE of each controller, the designed controller shows that it has the best performance among the three controllers and can be used in the practical test.
No potential conflict of interest relevant to this article was reported.
This work was supported by Korea Institute of Planning and Evaluation for Technology in Food, Agriculture, Forestry(IPET) through Advanced Production Technology Development Program, funded by Ministry of Agriculture, Food and Rural Affairs(MAFRA)(318007-3).
No potential conflict of interest relevant to this article was reported.
Quadcopter structure.
Block diagram of the quadcopter system.
Block diagram of the trajectory-tracking controller of the quadcopter.
PD controller block diagram.
FLC block diagram.
Fuzzy-PID basic structure.
Quadcopter simulation system.
Position control block.
Trajectory-tracking control system.
FLC parameters.
(a) FLC input membership functions. (b) FLC output membership function.
Fuzzy-PID parameters.
(a) Fuzzy-PID input membership functions. (b) Fuzzy-PID output membership function.
Fuzzy-PID controller implementation.
Simulation results of the three controllers in a rectangular trajectory in (a)
Simulation results of the three controllers in a triangular trajectory in (a)
Simulation results of the three controllers in a circular trajectory in (a)
Parameters description
Parameter | Unit | Description |
---|---|---|
rad | Pitch angle | |
rad | Yaw angle | |
rad | Roll angle | |
kg.m^{2} | Moments of inertia of the quadcopter | |
kg.m^{2} | Moment of inertia of the rotors | |
rad/s | Angular velocity of the rotor | |
N | Input forces | |
m/s^{2} | Acceleration due to gravity | |
kg | Mass of quadcopter | |
m | Length from the motors to the center of mass |
Parameters in the quadcopter simulation system
Parameters | Unit | Value |
---|---|---|
N.s^{2} | 1.4865e–07 | |
N.m.s^{2} | 2.925e–09 | |
kg.m^{2} | 0.0095 | |
kg.m^{2} | 0.0095 | |
kg.m^{2} | 0.0186 | |
kg.m^{2} | 3.79e–06 | |
rad/s | 4000 | |
m/s^{2} | 9.81 | |
kg | 1.0230 | |
m | 0.2223 |
FLC rule base of the trajectory-tracking system
e | NB | NS | ZE | PS | PB |
---|---|---|---|---|---|
NB | NB | NB | NB | NS | ZE |
NS | NB | NB | NS | ZE | PS |
ZE | NB | NS | ZE | PS | PB |
PS | NS | ZE | PS | PB | PB |
PB | ZE | PS | PB | PB | PB |
Rule base for
e | NB | NS | ZE | PS | PB |
---|---|---|---|---|---|
PB | PS | PS | PS | ZE | |
PS | PS | PS | ZE | NS | |
PS | PS | ZE | NS | NS | |
PS | ZE | NS | NS | NS | |
ZE | NS | NS | NS | NB |
Rule base for
e | NB | NS | ZE | PS | PB |
---|---|---|---|---|---|
NB | NS | NS | NS | ZE | |
NB | NS | NS | ZE | PS | |
NS | NS | ZE | PS | PB | |
NS | ZE | PS | PS | PB | |
ZE | PS | PS | PS | PB |
The SSE results of each controller
Controller | SSE of | SSE of | SSE of |
---|---|---|---|
127.6 | 92.5 | 386.6 | |
120.2 | 82.4 | 352.1 | |
105.9 | 80.2 | 321 |
E-mail: mohamedmostafamousa1991@gmail.com
E-mail: ali_rohan2003@hotmail.com
E-mail: yjhan@sunillab.co.kr
E-mail: shkim@kunsan.ac.kr