Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 9, No. 2 2024 44 Classical PID Control of A Quadcopter UAV Under Variable Load Conditions Haoyang Zhao1, a 1College of Mechatronics and Vehicle Engineering, East China Jiaotong University, Nanchang, 330013, China azhy18612713011@outlook.com Abstract: In recent years, the application of UAVs has become more and more extensive, resulting in a number of special operation UAVs. Quadrotor aerial robots have become one of the most popular vehicles at home and abroad because of their small size, light weight, simple structure, low cost, low requirements for takeoff and landing, and good maneuverability. UAVs are required to perform different tasks in the current complex environment, so variable loads are inevitable, and the stability of the UAV body is especially important when performing variable loads, and there are many ways to help and verify the attitude of the UAV during flight. In this paper, in order to more intuitively see the self-generated stability of the UAV under variable load conditions, the dynamics model of the UAV will be established first, and the simulation results show that the movement of the UAV has a very good stability. However, in the previous research, it is not possible to visualize the stability and flight state of the UAV when it is flying under variable load, this paper will make the UAV keep its own flight stability under two kinds of loads through the PID design model. At the same time, the function of the UAV's own mass change during flight is found, and the design function is used to show the stability curve of the UAV when it flies with its own changing mass. Through the final simulation and calculation, the experiment found that through the PID control, the flight state of the UAV when flying with variable load can be observed more intuitively, and the stability state of the UAV when flying can also be observed. Keywords: Quadcopter UAV, Classical PID control, Variable loads. 1. UAV Power Model Figure 1. Axis Definitions PID modeling through quadcopter UAV dynamics formulation This paper use a quadcopter UAV and set the earth as the reference system and place the origin at the center of the UAV to produce the above figure. The flight of the UAV provides lift through four propellers to maintain a safe altitude while flying, and different motions are achieved through different rotational speeds of the four propellers. The motion of the UAV is categorized into roll, pitch and yaw where the roll rate is P, roll angle is Ξ¦, pitch rate is q, pitch angle is ΞΈ, yaw rate is r, yaw angle is Ξ¨. to want the UAV to hover in the air it needs the total thrust Ft to be all the way with its own gravity and Ft = F1+F2+F3+F4. the angular equation of motion of the UAV can be derived when the UAV is unaffected by any other situation 𝐼π‘₯𝑝 = (𝐼𝑦 – 𝐼𝑧) π‘žπ‘Ÿ + πœπ‘ (1) πΌπ‘¦π‘ž= (𝐼𝑧 – 𝐼π‘₯) π‘π‘Ÿ + πœπ‘ž (2) πΌπ‘§π‘Ÿ = (𝐼π‘₯ – 𝐼𝑦) π‘π‘ž + 𝜏r (3) where 𝜏 is the moment denoting the product of the force arm and force from the starting point of the UAV coordinates to the propeller, 𝐼π‘₯, 𝐼𝑦 , and 𝐼𝑧 is the rotational inertia of the UAV in the x,y,z plane. This leads to the equations of motion of the UAV, which are modeled on the PID based on the physical equations. 2. Flight Design and PID Control [5] Figure 2. PID control 45 There are many ways to control the flight of UAV, it can be a low-cost way to realize the flight control of quadcopter UAV hanging load system by using on-board sensors and calculators for the purpose of the experimental platform, especially the visual measurement platform for observing the hanging, as well as the position and suppression of pendulum controllers, and the feasibility of the low-cost flight system is proved through simulation and flight experiments. [1] The second one can model the dynamics of the quadcopter UAV, based on which, a suitable reference coordinate system is selected, the coupling relationship between the suspended weight and the quadcopter UAV is analyzed, and finally the Newton-Eule method is used to obtain the dynamic model of the variable-load suspended rotor UAV. Then, the controller was designed by using the feedback linearization control method for the above dynamics model. The position tracking control of the variable-load suspended rotor UAV is realized by using the outer-loop position controller and inner-loop attitude controller with the position and yaw angle of the UAV specified. [2] Stability control can also be performed by the derived UAV dynamics model with robotic arm using conventional PID control algorithm and expert PID control algorithm respectively. The model is built in Matlab/Simulink and simulation experiments are conducted to compare the superiority and robustness of the two control algorithms. [3] Finally, the attitude control of UAV carrying different loads can also be studied, and the main research contents are as follows: (1) Establishment of mathematical model: To study the attitude control of UAV, the first step is to establish the dynamics model of UAV, firstly, the appropriate reference coordinate system is selected and the conversion matrix between each coordinate system is given, and then the relevant Newtonian kinematics formulas are utilized to establish the After that, the dynamics and kinematics equations of the multi-rotor UAV are established by using Newton's kinematics equations. Finally, taking into account the different types of loads carried by the UAV, the dynamic equations of the multi-rotor UAV with different loads are derived. (2) Attitude controller design: this paper designs two different controllers for comparison: firstly, it designs the multi-rotor UAV attitude controller based on PID control, considers the effects of different loads on the attitude of the UAV, and designs several sets of simulation experiments to verify the effectiveness of the controller. [4] This article uses the classical PID control method, which is a common control method in quadcopter UAVs. It is a control system that is controlled by the proportionality, integration and differentiation of the error generated by comparing the information collected from the real-time data of the controlled object with the given value. It is used to regulate the attitude (i.e., the angle of the vehicle) and the altitude of the UAV in order to achieve a stable and smooth flight. Attitude control of a quadcopter UAV typically uses three PID controllers corresponding to pitch, roll and yaw angles. Each controller receives the error signal between the target angle and the actual angle and calculates the controller outputs to adjust the rotational speeds of the four motors to control the attitude of the vehicle. The proportional term controls the magnitude of the error signals, the integral term controls the accumulation of the error signals, and the differential term controls the rate of change of the error signals. The principle of PID control is based on the idea of feedback control, in which the controller outputs are continuously adjusted to make the attitude or altitude of the vehicle as close as possible to the target value. The basic idea is that at each time step, the error signal is computed and the controller output is calculated based on the weights of the proportional, integral and differential terms. These weights usually need to be manually adjusted in order to achieve optimal control in different environments and application scenarios. All of the above studies have done a good job of demonstrating the stability of the UAV while in flight, but it is not possible to visualize the state curves while in flight. To show the flight curve, we use the UAV power model with simulink to design the flight model of the UAV and simulate the reality by changing the function and function value in the model. So change the mass of the UAV in flight to realize the variable load of the UAV. In simulink the mass m of the UAV is changed to a matrix so that the mass of the UAV is changed to achieve variable load, due to the change in m the angular velocity and the angle of rotation of the UAV at different moments is also changed, so a variable i is introduced with a for loop to reflect the change of two physical quantities under the change of m. In real life, the variable load of the vehicle can be roughly categorized into two cases, which are persistent variable load and sudden mass variable load, and this paper discuss these two cases separately. (1) Finding the UAV variable load as a function of mass when changing the UAV mass continuously. In order for the UAV to reflect the variable load curve with continuity within the function, the matrix of m is introduced such that the initial value is 0.5kg, the interval is 0.01s, and the final value is 1.5kg, and these data can be expressed as the UAV's m under the continuity change without (2) Mass change function of the UAV in a certain time in the case of abrupt changes After getting persistent change in the state of the UAV change the value of the m matrix of the UAV, in the case of the initial value of 0.5 kg at an interval of 0.5 s final value of 1.5 kg, the resulting data can be seen in the state of the UAV in the case of a sudden change in its own mass. 3. Simulation Results The flight status of the quadrotor UAV with variable load is shown in Fig 3and Fig 4. Figure three is the flight state of the UAV in the case of continuous variable load, in every 0.01s the mass change can be seen that the UAV fluctuation but every moment through the adjustment makes the UAV in all aspects of the flight is smooth, there is no loss of control, can be very good to continue to fly. Figure 4 shows the flight status of the UAV in the case of sudden change of load, in the case of the change of mass every 0.5 seconds, it can be seen that the flight status of the UAV fluctuates greatly, but then the UAV can quickly return to a smooth flight. Through experiments using UAV flight models it can be found that, the UAV can quickly adjust the flight state, so that it has been flying smoothly without losing control, which also proves that the model can be visualized to observe that the UAV will not affect the stability of the UAV's flight because of the changes in its own mass when it changes loads. 46 Figure 3. Continuous Variable Load Figure 4. Shows the mutation load 4. Conclusion This paper establishes an approach for UAV flight state detection with variable load. The power model of UAV flight is established through MATLAB/Simulink, and the flight curves of two variable loads are demonstrated through the design, and the curves can intuitively detect the state of the UAV, and detect the stability of the UAV's fuselage in the case of variable load, which provides evidence for the stability of the UAV. It makes the variable load flight of the quadrotor UAV more intuitive, which provides convenience for the subsequent research on the variable load of the quadrotor UAV. References [1] Huang Z.H. (2022). Flight control and realization of quadrotor UAV with suspended load. Engineering Science and Technology β…‘ Series 1-2 [2] Wu Y.Z. (2021) Research on adaptive fuzzy self-immunity control of variable load UAV. Engineering Science and Technology β…‘ Series 1-2 [3] Chen B. (2022) Research on modeling and cooperative control method of quadrotor unmanned aircraft system with robotic arm. Engineering Science and Technology β…‘ Series . 1 [4] Guo SJ. (2018) Attitude stabilization control of multi-rotor UAV with variable loads. Engineering Science and Technology β…‘ Series . 1 [5] Developer Community. 2021. An article to understand the PID control algorithm. https://cloud.tencent.com/