| The quadrotor belongs to the category of multi-rotor aircraft in the rotorcraft.Its light mechanical structure,small size,flexible movement,strong adaptability,and low investment correspond to high returns.The above advantages make it outstanding in both military and civilian fields.The thesis takes quadrotor aircraft as the research goal,selects STM32 as the core control chip to design a quadrotor aircraft,and completes the test flight of the quadrotor aircraft indoors.This article mainly carried out the following research work:First,a brief introduction to the three quadrotor airframe structures involved in the article,and the establishment of a geographic coordinate system on the earth’s surface,and a fuselage coordinate system on the quadrotor,the definition of attitude angle is introduced through the conversion relationship between the two coordinate systems.Then the three methods of representing the attitude angle of the four rotors are introduced,including Euler angle method,directional cosine matrix method,and quaternion method,and the conversion relationship between the three is deduced,and their solving principles are analyzed.For comparison,the quaternion method was finally used to solve the attitude angle.The basic motion principle of the four-rotor aircraft is analyzed.According to the aerodynamic characteristics of the aircraft,a mathematical model of the four-rotor is built.Based on the built mathematical model,the data fusion algorithm and attitude control algorithm are studied in depth,and the complementary The filtering algorithm is elaborated.For the different characteristics of the gyroscope and accelerometer in the attitude acquisition module,the complementary filter is designed based on the complementary filtering algorithm.The angle/angle velocity cascade PID double closed-loop control algorithm is designed in the attitude controller to ensure that the body can respond quickly and reach the desired position in time under the control of the oil rod.With the help of Matlab software,a simulation model of the four-rotor control system is built in the Simulink module,and the operation results of the model are simulated,and the reliability of the control system constructed in this paper is verified by observing the simulation output waveform.Finally,based on the mathematical model and controller,the circuit schematics of power supply,voltage regulation,signal acquisition,communication and other modules are drawn through Altium Designer software,and the components in the above circuits are laid out to produce a PCB circuit board.After the completion of the construction of the experimental platform,the voltage signal test of the attitude data acquisition circuit,communication circuit,and motor drive circuit was focused to ensure that the four-rotor can operate normally when powered on.The overall scheme design and algorithm flow of the flight control system are expounded.The programming of IIC,SPI communication protocol and control algorithm is completed based on Keil software.Analysis of the attitude data collected by the upper computer during the simulation of take-off and fixed-height flight of the quadcopter,the tuning of the PID parameters of the quadcopter,the completion of the test flight in the laboratory environment,and the feasibility of the hardware and software design in this paper And achieved the expected design goals. |