Abstract
This paper proposes a quadrotor aircraft motion control method based on the combination of PID and a fuzzy control algorithm. The dynamical system of quadrotor aircrafts is modeled. Target colors are recognized and tracked based on the OpenCV. The target-following flight attitudes of the quadrotor is controlled by a fuzzy PID control algorithm. We focus on exterior, unknown, interfering factors, such as gusts, and adjust k p , k i , k d parameters online in real time. This allows the response speed of the quadrotor flight control system to increase and improves the anti-jamming capability for the exterior non-linear factors. The simulation of the control system is accomplished with the Matlab/Simulink, and the real flight tests are based on the Parrot AR Drone 2.0 quadrotor aircraft, which verifies the effectiveness of the proposed method. The proposed method is able to improve the adaptability of the quadrotor for exterior, environmental changes, shorten the system adjustment time and improve the following accuracy of the quadrotor.
Introduction
Recently, quadrotor aircrafts have been more widely applied in civil and military fields due to their strong practicability and low cost. There is growing interest in this topic among researchers around the world. As quadrotor aircrafts have stable hovering functions, especially for small-scale quadrotor aircrafts, they can take photos and videos, both inside and outside rooms.
Researchers have made a large number of studies on quadrotor control algorithms and achieved promising results. D. Cabecinhas et al. studied the robust departure control problem of quadrotor aircrafts and ensured that their departure was possible in situations where the land inclines and exterior interference exists [3]. Arash Kalantari et al. controlled perching maneuvers by using Microsoft Kinect combined with the PID algorithm. As a result, the rotor micro-air vehicles could park on and take off from vertical walls [1]. Prof. T. Dierks used a new non-linear neural network (NN) control method to achieve the target following flight of the quadrotor [12]. Deepak Gautam et al. introduced a fuzzy adaptive PID control algorithm based on the EKF algorithm, in which the intelligent flight is in the programmed path and obstacles could be avoided [4]. Mehmet Onder Efe developed a new control method for the quadrotor based on the NN with a finite impulse response (FIR) type coefficient approximation [7]. Under the environment where GPS is unavailable, flight could be constructed by using cameras based on the visual SLAM algorithm [9, 15].
As the target-following flight has high requirements for system response speed, the anti-interference ability of the ordinary PID [8] and LQR control algorithm [6, 10] cannot adjust online in order to adapt to the system changes in real time. The sliding mode control [11, 14] is one of the commonly used methods in the quadrotor control. The sliding mode is completely independent of the external disturbance and parameter perturbation, but the actual sliding mode control is accompanied by chattering. The neural network control and other intelligent control methods [2, 5] have gradually become the hot spots in the field of quadrotor control.
In this paper, we propose a control method that combines the PID and fuzzy control algorithms. It can solve the following problems: the quadrotors cannot be adjusted in real time and the response speed is slow. For the disturbance, the fuzzy rule controller is designed to compensate for the disturbance and make the system quickly reach a steady state. Simulation experiments and outdoor experiments with the AR Drone 2.0 demonstrate the effectiveness of the proposed algorithm. It is shown that the proposed method can improve the system’s adaptability, shorten the system’s adjustment time and improve the target following accuracy.
Dynamical system modeling of quadrotor aircrafts
To obtain the dynamical model of the quadrotor aircrafts, two basic coordinate systems are established: the inertia coordinate E (OXYZ) and the quadrotor aircraft coordinate B(OXYZ). According to the rotation order of ZYX, the rotation matrix from the quadrotor aircraft coordinate B to inertia coordinate E is as follows:
According to Newton’s Laws, the linear and angular velocities of aircraft in the inertia coordinate system are:
The sum of the exterior force can be expressed as: ∑F = F
T
- F
D
+ RE-BF
G
, where F
T
is the lift force generated by the quadrotor; F
D
is the air friction; F
G
is the gravity of the quadrotor.
where F
i
(i = 1, 2, 3, 4) represents the lift force generated by the 4 rotors, N; C
T
is the resistance coefficient of the air; A
i
represents the disc area of the i-th rotor, m2; w
i
represents the rotation speed of the i-th rotor, rad/s; k
d
= diag (k
dx
, k
dy
, k
dz
) is the rotational resistance coefficient matrix.
According to force analysis, Newton’s second law and the dynamical equation, the linear motion equation is derived as:
The u1, u2, u3 and u4 are denoted as 4 input control quantities of the system for 4 axes [7]. According to the Newton-Euler equation for the rotation of rigid bodies, the angle acceleration of the 4 axes, with respect to the aircraft coordinate, can be derived as the following:
Based on the above translational and rotational motion equations of quadrotors, the non-linear equation of the quadrotors can be derived as:
where l is the distance between the centroid of the aircraft coordinate and the rotor center.
Target tracking algorithm of quadrotor aircrafts
The images with RGB format, which are transmitted from the quadrotor, are transformed to HSV format. Then the H, S and V channel images are processed by the bitwise and operation, which generates binary images of the target to be detected. After binary images are achieved, a breadth-first search algorithm is used to find all connected regions in the image. The Mean-Shift algorithm is utilized to calculate the centroid coordinate of the region. First, the zero-order moment of the region iscomputed:
Then, we calculate the first-order moment with respect to x and y:
The region centroid is:
Since camera imaging is a process in which objects are projected from a three-dimensional space to a two-dimensional surface, the real size of a specific object in the image cannot be distinguished due to the loss of depth information. In this study, a central perspective imaging model (CPIM) is adopted to establish the distance relationship between quadrotor aircrafts and targets. CPIM is shown inFig. 1.
Using the principle of similar triangles, we can project point P = (X, Y, Z)in the world coordinate to the image plane. Then, we can obtain the image coordinate p1 (x1, y1). The relationship is described as follows:
In this study, a dual loop controller is designed, based on the PID control algorithm, in order to realize the position and attitude control of the quadrotor, as shown in Fig. 2.
The classical PID controller is based on proportional, integral, derivative control, of which the control rule is described as follows:
(1) The PID algorithm for the position control loop can be derived as:
(2) The PID algorithm for the attitude control loop can be derived as:
The fuzzy PID controller is composed of two components, which are the PID controller and the fuzzy controller. The structure of the fuzzy controller consists of two inputs and three outputs. The input quantities are error e and error change rate ec, while the output quantities are the three coefficients of the PID controller, Δk p , Δk i and Δk d . The structure of the fuzzy PID controller is shown in Fig. 3.
The fuzzy separation number for the controller input e and ec are set to 7, which includes the NB, NM, NS, ZE, PS, PM and PB, which represent negative-big, negative-medium, negative-small, zero, positive-small, positive-medium and positive-big respectively. The domain of e and ec are {–1, –2/3, –1/3, 0, 1/3, 2/3, 1}, and the domain of output u is {–0.3, –0.2, –0.1, 0, 0.1, 0.2, 0.3}. Here put the membership function of e and ec, the Δk p , Δk i and Δk d respectively represented in a figure, as shown in Figs. 4 and 5.
Designing control rules of k p , k i and k d
According to the experience of engineering applications, the self-adjustment of parameters k
p
, k
i
and k
d
should satisfy the following adjustment rules under different values of e and ec: When e is relatively larger, a relatively larger k
p
should be used to accelerate the system response; a relatively smaller k
d
should be adopted to prevent differential gain. When e is medium, to reduce the overshoot of the system and ensure the response speed, k
p
should be decreased. k
i
and k
d
should be medium. When e is relatively smaller, to reduce the steady-state error, k
p
and k
i
should be relatively larger. k
d
should be appropriate to avoid the fluctuation of output responses around the predefined values and ensure the anti-jamming capability of the system.
In the fuzzy PID control, the fuzzy condition statements are multiplex conditional statements. The fuzzy control rules are listed in Tables 3.1, 3.2, and 3.3.
Output definition
The gravity method is used in this study to calculate the final output value of the fuzzy reasoning. The output u is calculated as follows:
According to the adjustment of k p , k i and k d , the output parameters of each channel can be controlled in real time.
Establishing experimental platform
In the experiment, the quadrotor transmits’ videos are captured by a front-end camera, which is attached to the upper computer through WIFI. The upper computer processes the transmitted videos in real time and calculates the coordinates of tracked targets. Then, the target coordinates are converted into control instructions for the quadrotor flight control. The control block diagram is shown in Fig. 6.
Under indoor conditions without wind, a fixed target is placed within the view field of the quadrotor aircraft. The result of the flight attitude adjustment, according to the quadrotor’s recognition of the target, is recorded, as shown in Fig. 7. After t = 4.32 s, the target appears at the center of the quadrotor image. The quadrotor hovers at the current position, which has a fixed relative distance to the target.
Establishing experimental platform
According to the established quadrotor dynamical model and the parameters of the quadrotor aircrafts, the simulation control system of quadrotor aircrafts is set up in the Matlab/Simulink. The designed Simulink block corresponding to the yaw angle channel is shown in Fig. 8.
In the yaw channel simulation, the given yaw angle is 0.8 rad. The ascending time of the traditional PID control is 0.56 s with overshoot. The time needed for a steady-state is 1.9 s with 0.2 rad of overshoot. However, the time for a steady-state of the fuzzy PID control is 1.02 s without overshoot. The simulation curve comparison of the yaw channel for the traditional PID and fuzzy PID is shown in Fig. 9. According to the comparison, the simulation performance of the fuzzy PID control is relatively better and more effective. In the roll and pitch channel simulation, it can still be concluded that the fuzzy PID control is relatively better and more effective.
However, in the real process of flying, the quadrotor is inevitably affected by gusts. At t = 2.5 s, an artificial impulse signal is added to each channel to simulate the effect of gusts. The amplitude of the impulse signal is 0.2 rad, with a duration of 0.01 s. The anti-jamming simulation curves for the yaw channel, roll channel and pitching channel are shown in Fig. 10.
As shown in Fig. 10, the traditional PID control for the yaw channel achieves a steady-state after 1.5 s. It is possible that shock happens during this process, with an amplitude of 0.04 rad. The fuzzy PID control reaches a steady-state after 0.65 s without shocks. It can be concluded that the fuzzy PID control has a stronger anti-jamming capability with a high response speed.
To verify the effectiveness of the fuzzy PID control in real applications, it is applied to control the target-following flight of the quadrotor aircrafts in the same outdoor, environmental condition. The trajectory of the target movement is also the bow-shaped path mentioned above. The time consumed for the target-following by the traditional PID control algorithm is longer than that consumed by the fuzzy PID control algorithm for the fixed path. The experimental results verify the conclusion drawn for the Matlab simulation. The results show that the system response speed of the fuzzy PID control is fast with high control precision. Figure 11 shows the ideal target-following flight trajectory; the flight trajectory controlled by traditional PID and the flight trajectory controlled by the fuzzy PID.
It is obvious from the trajectory curves in the figure that the target-following accuracy of the fuzzy PID control is high, which is close to the ideal trajectory with a small error. However, the traditional PID control method has a relatively larger error, with a severe bending trajectory. Also, the final point is far away from the goal, which demonstrates that the accuracy of the fuzzy PID control is higher.
Conclusions
In this paper, we proposed a fuzzy PID control method for quadrotor aircrafts that combines PID and the fuzzy control. In order to accelerate the response speed of the quadrotor flight control system and improve the anti-jamming capability for external, non-linear factors, this method can adjust k p , k i and k d parameters online in real time. The effectiveness of the control method is verified by establishing a Matlab/ Simulink control system. A real, target-following flight test on the Parrot AR Drone 2.0 quadrotor aircraft is carried out. Based on the experimental data, it is concluded that the proposed control method is better than the traditional PID control method.
In future work, we will further improve the performance of the whole system, and improve the real-time response, stability and anti-interference ability of the quadrotor flight control system by adopting a more advanced algorithm.
Footnotes
Acknowledgments
This work was supported by the Youth Science Fund Project No. 61305116 of China’s NSF.
