Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 6, No. 3, 2023 26 Optimization of Landing Attitude Stability for Quadrotor Drones Yang Xiao1, a 1China University of Geosciences, Wuhan, Hubei, 430074, China a20171000715xy@gmail.com Abstract: During the regular landing process of drones, they are often susceptible to the impact of ground effect and wind disturbances, which results in an inability to maintain parallelism with the ground. Drones are subjected to various types of wind disturbances during landing. Therefore, this study aims to analyze and model the varying characteristics of wind speed under natural conditions and introduce it as environmental noise into the system to evaluate the performance of the control algorithm. The goal of this research is to mitigate the impact of wind disturbances, such as oscillations during the landing process. By maintaining the pitch angle within 20%, we can ensure the drone lands quickly and accurately. In terms of algorithm, this research improves upon the existing PID (Proportional-Integral-Derivative) algorithm control for landing, and adopts a modified fuzzy PID algorithm, which can effectively enhance the control performance and response time of the drone. Keywords: Quadrotor drone, Attitude control, Fuzzy PID algorithm. 1. Introduction With the continuous development of drone technology, the pivotal role of quadcopters in various fields is increasingly being underscored. Quadcopters, when contrasted with traditional drones, are found to possess advantages such as convenient takeoff and landing, easy portability, and low cost. These merits contribute to their widespread application in both industrial and everyday contexts. Nonetheless, due to the complexity of the environments wherein drones are operational, several factors, including wind disturbance, narrow terrains, and ground effects, may pose challenges to their operation. Of particular importance is maintaining a stable posture during the landing process. The parallelism of the drone's body to the ground during landing is of paramount concern, as any significant deviation can lead to damage and property loss. Consequently, the issue of maintaining a stable posture during the landing process has emerged as a critical area of research. Many intelligent control algorithms for the posture control of drones, such as fuzzy control [1], backstepping [2], and sliding mode control [3], have been proposed by researchers. Nevertheless, the complex floating-point computations and matrix operations required by these intelligent algorithms prove burdensome for the microcomputers onboard most drones, thus making it difficult to meet the real-time flight attitude control requirements. Additionally, when applied to control nonlinear systems, the accuracy and anti-interference capability of PID control cannot be guaranteed [4,5]. This limitation arises from the fact that the control effect of the PID controller is determined by the proportional, integral, and derivative factors of the deviation, making it ill-suited for complex control objects and harsh environments. An advanced PID algorithm with the ability to automatically adjust parameters is needed to enable swift adaptation of the drone to the environment. In light of the above-stated challenges, a fuzzy PID control method is utilized to design the controller in this paper. The effectiveness of this approach is verified through MATLAB simulation. 2. Principles of Drone Mathematical Modeling 2.1. Kinematics and Mathematical Modeling of Drones An “X”-structured drone is selected as the research object, and an inertial coordinate system ‘I’ and a body coordinate system ‘b’ are established, as shown in Figure 1. The X-axis of the inertial coordinate system points east, the Y-axis points north, and the Z-axis is perpendicular to the XOY plane, pointing upwards (away from the earth’s center). Figure 1. Structural Diagram There is the following transformation relationship between the inertial coordinate system ‘I’ and the body coordinate system ‘b’: R R ψ, θ, φ 𝑐 𝑐 𝑠 𝑠 𝑐 𝑐 𝑐 𝑐 𝑠 𝑐 𝑠 𝑠 𝑐 𝑠 𝑠 𝑠 𝑐 𝑐 𝑐 𝑐 𝑠 𝑐 𝑠 𝑐 𝑠 𝑠 𝑐 𝑐 𝑐 1 Assuming that the propeller flapping characteristics are disregarded, the quadrotor drone can be considered a uniformly symmetrical rigid body. By applying Newton’s 27 second law, one can derive the translational motion equation for the quadrotor drone: M x y z R 0 0 ∑ kkω R γ R v 0 0 Mg 2 ‘M’ denotes the drone’s mass while ∑ kkω symbolizes the thrust furnished by the propeller. Γ_t is the translational air drag coefficient, and R(γ_t (R^T v^i)) characterizes the translational air drag as observed in the inertial coordinate system. The collective external torque exerted on the quadrotor drone is represented as follows: ∑ 𝑀 𝛾 𝛺 𝛼𝑘𝑈 𝛼𝑘𝑈 𝛼𝑈 𝛾 𝛺 𝛼𝑘 𝜔 𝜔 𝜔 𝜔 𝛼𝑘 𝜔 𝜔 𝜔 𝜔 𝛼 𝜔 𝜔 𝜔 𝜔 3 Within this context, γ signifies the rotational air drag coefficient, and represents the angular velocity in the body coordinate system. In the inertial coordinate system, Euler’s angular velocity can be expressed as Ω φθψ . A certain relationship is established between Euler angles and the body angular velocity, which is presented below: 𝑝 𝑞 𝑟 𝜑 𝜓𝑠𝑖𝑛𝜃 𝜃𝑐𝑜𝑠𝜑 𝜓𝑠𝑖𝑛𝜑𝑐𝑜𝑠𝜃 𝜃𝑠𝑖𝑛𝜑 𝜓𝑐𝑜𝑠𝜑𝑐𝑜𝑠𝜃 4 Summarizing the above equation yields ⎩ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎧ 𝑥 𝐶 𝐶 𝐶 𝑆 𝑆 ∑ 𝑘𝜔 𝛾 𝑅 𝑣 𝑦 𝐶 𝐶 𝐶 𝐶 𝐶 ∑ 𝑘𝜔 𝛾 𝑅 𝑣 𝑧 ∑ 𝑘𝜔 𝛾 𝑅 𝑣 𝑔 𝑝 𝜑 𝜓𝑠𝑖𝑛𝜃 𝑞 𝜃𝑐𝑜𝑠𝜑 𝜓𝑠𝑖𝑛𝜑𝑐𝑜𝑠𝜃 𝑟 𝜃𝑠𝑖𝑛𝜑 𝜓𝑐𝑜𝑠𝜑𝑐𝑜𝑠𝜃 𝑝 𝑞𝑟 𝑈 𝑝 𝑞𝑈 𝑞 𝑝𝑟 𝑈 𝑞 𝑝𝑈 𝑟 𝑝𝑞 𝑈 𝑟 5 3. Model and Design Requirements of this Study The state equation of a certain aircraft’s longitudinal short- period motion is as follows: 𝑋 𝐴𝑋 𝐵𝑈 𝑌 𝐶𝑋 (6) Here,𝑋 𝛼 𝑞 𝜃 ,𝑌 𝛼 𝑞 𝜃 ,𝑈 𝛿 ; α represents the angle of attack,q represents the pitch rate,θ represents the pitch angle, 𝛿 represents the elevator deflection angle.The state parameter matrix of the aircraft in a certain state is: 𝐴 -0.56989 1 0 -2.49155 -1.14357 0 0 1 0 ,𝐵 -0.0293 2.2683 0 ,𝐶 1 0 0 0 1 0 0 0 1 (7) Utilizing a fuzzy PID controller, a sophisticated closed- loop flight control system is designed to efficiently track and maintain the pitch attitude. Following this, an exhaustive analysis is conducted on the design results, which includes computations for the overshoot and adjustment time related to the pitch angle. (1) Identification of model parameters pertinent to the drone. (2) Formulation of the fuzzy control rules. (3) Construction and debugging of a simulation program, grounded on the tuning principle, utilizing MATLAB. (4) Implementation of the program, utilizing a step signal as the input, followed by the recording of the associated simulation data and curves. (5) Iterative process of modifying the fuzzy control rules and repeating step 4. (6) Detailed analysis of the data and control curves. 4. Fuzzy Control Design Process 4.1. Fuzzy PID: An Overview Fuzzy PID controllers may exist in a variety of structural forms; however, their operational principles exhibit essential uniformity. They draw upon the foundational principles and methodologies of fuzzy mathematics, encapsulating the conditions and operations of rules in the form of fuzzy sets. These fuzzy control rules, along with other pertinent information, are archived in the knowledge database of the computer. Subsequently, the computer employs fuzzy reasoning, based on the real-time responses of the system, to achieve an optimal adjustment of PID parameters [6]. The adaptive fuzzy PID controller uses the error 𝑒 and error 𝑒𝑐 change as its inputs, thereby meeting the demands for self-tuning 𝑒 𝑒𝑐 of PID parameters at varying time points. The incorporation of fuzzy control rules for online modifications of PID parameters results in the formation of an adaptive fuzzy PID controller. 4.2. Principle of Control The calibration of Proportional Integral Derivative (PID) parameters necessitates a nuanced understanding of the functional roles and interconnected dynamics of these parameters at different instances. The mechanism underpinning the fuzzy self-tuning PID is essentially built upon the PID control algorithm. This method calculates the present system error and the rate of error change, applies fuzzy rules for the purpose of fuzzy inference, and subsequently modifies parameters through referring to the fuzzy matrix table. 28 At its core, the design of fuzzy control seeks to encapsulate the technical expertise and practical hands-on experience of engineering professionals. The goal is to establish an appropriate fuzzy rule table, and to create a system of fuzzy control that separately adjusts the three parameters 𝑘 、𝑘 、𝑘 and based on experiential knowledge. The spectrum of system error 𝑒 and rate of error 𝑒𝑐 change is delineated as the discourse domain on the fuzzy set 𝑒, 𝑒𝑐 5, 4, 3, 2, 1,0,1,2,3,4,5 (8) Its fuzzy subset is𝑒, 𝑒𝑐 𝑁𝐵, 𝑁𝑀, 𝑁𝑆, 𝑍𝑂, 𝑃𝑆, 𝑃𝑀, 𝑃𝐵 , with elements of the subset respectively symbolizing negative large, negative medium, negative small, zero, positive small, positive medium, and positive large. Under the assumption that 𝑒 、 𝑒𝑐 and 𝑘 、 𝑘 、 𝑘 all abide by the normal distribution, the degree of membership for each fuzzy subset can be determined. Based on the membership value table of each fuzzy subset and the fuzzy adjustment rule model for each parameter, a PID parameter fuzzy adjustment matrix table is designed through fuzzy synthesis inference. This table is subsequently employed to identify the revised parameter and perform computations using the subsequent formula. 𝑘 𝑘 ′ 𝑒, 𝑒𝑐 𝑘 𝑘 ′ 𝛥𝑘 𝑘 𝑘 ′ 𝑒, 𝑒𝑐 𝑘 𝑘 ′ 𝛥𝑘 𝑘 𝑘 ′ 𝑒, 𝑒𝑐 𝑘 𝑘 ′ 𝛥𝑘 (9) In this formulation, the parameters 𝑘 、𝑘 、𝑘 denote those specific to the Proportional Integral Derivative (PID) controller, while 𝑘 ′ 、 𝑘 ′ 、 𝑘 ′ represents the initial parameters of 𝑘 、 𝑘 、 𝑘 , procured via conventional methodologies. During the process of online operation, the microcomputer measurement and control system perpetually surveils the output response value of the system, executing real-time calculations of both deviation and the rate of change in deviation. Subsequently, these values are subjected to a process of fuzzification to derive 𝑒、𝑒𝑐. By consulting the fuzzy adjustment matrix, the adjustment magnitudes for the three parameters 𝑘 、𝑘 、𝑘 can be ascertained, thereby concluding the tuning process. On the control surface, check whether the expected value is close to the center of the fuzzy control output conclusion space. If it exceeds 20%, it is necessary to readjust the rules, membership functions, or fuzzy operations to optimize the fuzzy controller. 5. Simulink Simulation Design 5.1. Simulation Design Figure 2. Simulation Structure Diagram of the Control System Figure 3. Subsystem Structure Diagram of the Fuzzy Controller 29 In this diagram, the internal structure of the fuzzy control subsystem "fuzzy" is shown in Figure 3 [7,8].The input signal is a step signal: r=10 rad. 5.2. Simulation Results and Analysis The overshoot of the pitch angle X is 13.9%,The adjustment time ts is 1.04s,The values of kp、ki、kd are 13, 5, and 2.29 respectively Figure 4. Given and output response curve of pitch angle X Figure 5. Response curve of the pitch rate q 6. Conclusion The settling time and overshoot of the unit step response for pitch angle have been markedly reduced, resulting in a transition process that is substantially smoother. The peak value of the pitch rate has also seen a decrement, which has invariably improved the aircraft's performance. Throughout its operation, the fuzzy PID parameters are adjusted online autonomously and continuously. The impact of fuzzy rules on the system is profound; aptly selected fuzzy rules can yield desirable dynamic properties. The development of these fuzzy rules is predicated on established engineering experience. The fuzzy PID control methodology is particularly suitable for nonlinear systems, distinguished by its convenient operation, adjustable parameters, and high practical utility. It also demonstrates remarkable performance in terms of interference rejection, boasting a robust capability for online self-adjustment of parameters. It showcases effectiveness against ongoing interference and noise, which thereby enhances the overall quality of the control system. It exhibits pronounced adaptive capacity and robustness, further highlighting its strength in control applications. References [1] SHEIKHPOUR S, SHOURAKI S. (2013) A Model—Based Fuzzy Controller Using the Parellel Distributed Compensation Method for Quadrotor Attitude Stabilization. The 21st Iranian Conference on Electrical Engineering (ICEE). 1—6. [2] Zhao Yuanwei, Lu Jingchao. (2013) Modeling and control of quadrotor aircraft based on reverse step method. Science, Technology and Engineering, 34:10425—10430. [3] Zhang Ximing, Qu Shiru, Ma Zhiqiang. (2014) Design and simulation of fuzzy sliding mode controller for quadrotor aircraft.Flight mechanics, 5:427—431. [4] SALIH A L. MOGHAwEMIM, MOHAMED H A F, et a1. (2010) Modeling and PID Control Design for Quadrotor Unnamed Air Vehicle. The IEEE International Conference on Automation Quality and Testing Robotics (AQTR). [5] PANG Y P. (2011) Design of Quadrotor and Research of Stability Control. University of Science and Technology of China, Beijing. [6] Liu Jinkun. (2004) Advanced PID control MATLAB simulation. Publishing House of Electronics Industry, Beijing. [7] Gu Shengjie, Liu Chunjuan. (2004) Nonlinear system simulation based on fuzzy self-tuning PID controller. Journal of Lanzhou Jiaotong University, Vol 23 No.3 [8] Xiao Qijun, Li Shengyong. (2005) Fuzzy self-tuning PID controller design and MATLAB simulation analysis. Computer simulation. Vol 22 No.9.