# Balance Control of Brushless Direct Current Motor Driven Two-Rotor UAV
## 1 Introduction  
In recent years, UAVs have been widely used in logistics, surveillance and warning systems, geographic information systems, fire extinguishing, and agricultural pest control [1; 2; 3]. The modeling of UAVs, with an ever-increasing scope of use, has recently been the subject of many scientific studies. The modeling enables the determination of the system reliability of UAVs and the study of their behaviour under different operating conditions. In the literature, the two-rotor balance system is also referred to as the Seesaw [4; 5; 6]. The two-rotor balance system is used primarily for the analysis of multi-rotor systems and is important as the basis of UAV systems [6]. Therefore, two-rotor systems are used for the study of the 2R-UAV balance System. The effectiveness of the control structure used determines how well two-rotor and multi-rotor UAVs operate [7]. Thus, research has been conducted to enhance the two-rotor system's balance control. An example of a 2R-UAV for load carrying operations is given in Figure 1.  
Brushless Direct Current Motor (BLDCM) is one of the most preferred motor types in recent years due to its superior abilities, such as operating at high torque and speed, high efficiency, noiseless operation, long lifespan and minimal maintenance because brush and collector structures are not required [2; 8]. It is commonly used in numerous industries, including aerospace, robotics, automotive, white goods, healthcare, and space, as as a result of these outstanding qualities [2; 9]. Thus, BLDCMs were used in this study to drive the 2R-UAV system. In the literature, UAVs are typically controlled by classical PID and 2-DOF PID controllers, which have been successfully applied in control systems recently [3; 10; 11]. Additionally, artificial intelligence-based controller structures are also used to control UAVs [12; 13; 14]. In this study, unlike the control structures commonly used in the literature, an AF 2-DOF PID controller, which is a combination of 2-DOF PID and artificial intelligence and fuzzy logic control methods, was used for the 2R-UAV's balance control. The outcomes were compared with those of classical PID and 2-DOF PID controllers in order to assess the effectiveness of the AF 2-DOF PID controller. Also, in this study, differing from the studies in the literature, the speeds of the BLDCMs used as the drive elements, as well as the balance angle, were controlled in a closed loop, and the control performance of the balance angle was improved. Under identical settings, the parameters of the classical and 2-DOF PID controllers utilized in the study were determined using the Particle Swarm Optimization (PSO) technique, which has been commonly used to determine controller parameters in current research [2; 15; 16; 17]. To examine the real-time performance of the controllers used in the study on a microprocessor, the Co-Simulation structure of the system was created using the STM32F4 microprocessor and MATLAB/Simulink. The performance of classical and 2-DOF PID, and AF 2-DOF PID controllers was comparatively examined using Co-Simulation results. Upon analysing the simulation results, we observed that the 2R-UAV balance system was steadily controlled by the classical PID, 2-DOF PID and suggested AF 2-DOF PID controllers. However, we observed that the AF 2-DOF PID controller that is suggested in this study showed a better performance than the other controllers used in the study, especially under variable operating conditions, demonstrating adaptive features. The manuscript is structured as follows, in six different sections: in Section 2, the Simulink model of the BLDCM is presented, and detailed mathematical modeling is provided. In Section 3, the mathematical model and control structures of the 2R-UAV system are presented. In Section 4, the Co-Simulation structure and test setup of the 2R-UAV balance system are presented. Co-Simulation results of the 2R-UAV balance system according to different controllers are presented and discussed in Section 5.