Numerical Simulation of the Motion of an Unmanned Aerial Vehicle

Unmanned aerial vehicles are used for research in many areas: photography and video shooting and so on. The development of unmanned aerial vehicles is directly related to the development of airspace. Today, a mathematical model is required that would describe the movement of such an aircraft with the purpose of predicting, correcting and optimizing it. The paper presents the results of a study of the controlled motion of an unmanned multi-rotor aircraft using the example of a quadrocopter. The study included the development of a law governing the apparatus and its modeling in the form of a software package. The structure of the autopilot, its main contours and parameters of these circuits are considered. After determining the necessary characteristics of the autopilot, modeling of the controlled motion of the quadrocopter in the execution environment was carried out.


Introduction
The aim of the presented work is the development of the law governing the multi-rotor unmanned aerial vehicle by the example of a quadrocopter providing motion to a given point, as well as the definition of the motion model implementing this law.The structure of the autopilot, the basic contours of the control system of the flight of the quadrocopter and the parameters of these circuits are considered [1,2].
After determining the necessary system characteristics, simulated Quadrocopter controlled motion in the Common Language Runtime (CLR) runtime in the Microsoft Visual Studio shell in C # is performed.
Solved in the process of research tasks: • formation of the shape of the autopilot of the quadrocopter; • development of a quadrocopter control law; • creating a mathematical model of the movement of the device; • correction of the motion model taking into account external disturbance -wind load; • development of a software package that implements the movement model.

Model description
Quadrocopter is an unmanned multi-rotor aircraft with four rotors [3].In the figure 1: • B i -the beams of the frame of the apparatus on which the engines are fixed; • D i -carrying DC motors; • v i -air propellers; • F i -traction forces created by propellers; The distance from the center of mass of the device to each of the four engines is the same and equal to r.The following assumptions are accepted: the device is symmetrical about the x and z axes, its frame and screws have absolute stiffness, each of the engines is at the end of the rod.
The frame of the device, formed by four rays, is the main support plane of the quadrocopter.Its angular position relative to the coordinate system is described by three angles -ψ k , ϑ k , γ k , which determine the rotation around the axes.The spatial position of the center of mass of the body is given by the linear coordinates x k , y k , and z k .

The forces acting on the quadrocopter
Basic coordinate systems in which the motion model is considered: the beginning of the starting point of the vehicle movement.The motion in it is described by the height above the surface (y = Ly = H), the longitudinal distance (Lx) and the lateral deviation (Lz); • Normal (NSC) OX G Y G Z G is a mobile nonrotating coordinate system, the origin is located in the center of mass of the device, the axes are aligned with the axes of the starting system.• Basic linked (BSC) OX 1 Y 1 Z 1 is a moving rotating coordinate system, the position relative to the normal system is determined by the Euler angles ϑ k, γ k and ψ k.In Figure 2 shows the forces acting on the device, the corresponding notations are introduced [4]: 0vector of total thrust along the axis OY 1 ; •     ,     ,    its projection on the axis of the normal coordinate system; •  ⃗  -velocity vector of the apparatus relative to the starting coordinate system; •  ∑  = ( +   )is the vector of the total force applied to the apparatus; • vector of gravity acting on the quadrocopter.(1) • Kinematic equations of motion of the center of mass of the apparatus in the starting coordinate system: (2) To determine the position of the apparatus in the starting coordinate system, the following relations were used: . (3) • Dynamic equations of motion of the device around the center of mass in the base coupled coordinate system: where   ,  moments of inertia and angular velocities of the apparatus relative to the axes of the base coordinate system.
• Kinematic equations of motion of the apparatus around the center of mass in the base coupled coordinate system: (5)

The moments and forces taken into account when designing a mathematical model
The forces forming the linear motion of the center of mass of an unmanned aerial vehicle, as well as the moments that form the rotational movement of the apparatus around the center of mass, are created by rotating the carrier propellers installed on the rotors of DC motors, and the moments of forces depend on the mutual relations between the thrust forces of each of the screws.Achieving the specified angular velocities of the screws is the task of speed stabilizing drives for the respective engines.
The following notations are accepted: • k vzcoefficient of viscosity of air; • c micoefficient of electromechanical gain; • c ei -electronic gain factor; • R ai , L aielectrical parameters of the motor winding; • J nithe moment of inertia of the rotating parts; • T ai = L ai /R aielectromagnetic time constant of the motor ; • M dviengine torque ; • M i∑torque applied to the screw ; •   1the reaction time of the engine ; • k di , k tgiscale factors of sensors ; • k kori , T korithe gain and the time constant of the correcting link.In order to meet the imposed conditions for creating a mathematical model of the movement of the device, it is necessary to take into account the following moments of forces acting on the device: Measured parameters that are used in the process of controlling the quadrocopter: ̇k, ̇ k , ̇ k , and w x ,w y and w z .They are available for measurement by sensors located on the machine itself.
The executive body responsible for the formation of force impacts in accordance with the commands of the control system is a system of four drives for stabilizing the speed of DC motors [8].

Numerical simulation of the obtained system
Numerical simulation of the controlled motion of a multirotor aircraft used the Common Language Runtime (CLR) runtime in the Microsoft Visual Studio shell in C #.
There are several restrictions: • since the speed of rotation of the screws does not change instantaneously and can not be too high due to physical reasons, the maximum speed (490 r / s) and the acceleration (500 r / s2) of this parameter are set; • each of the engines is considered a material point fixed to the weightless beam of the frame, and the apparatus itself is a ball, according to which moments of inertia were calculated by the formulas: • the Euler method with a base step of 0.0001 seconds was adopted as the integration method; • basic accuracy of arrival to the point -0,1 m; • the maximum permissible speed at which the device is considered to arrive at the point is 0.1 m / s • atmosphere model complies with GOST 4401-81 • some of the parameters (step, initial spatial position, specified spatial position, etc.) should be able to change in the user interface; • it is necessary to output the basic flight characteristics to a text file after the simulation is over.

Model analysis
A number of tests of the obtained model [6,7] were carried out.In the first one, a flight with a flight program is considered that assumes control of the motion along the OYG axis (from the point with coordinates 0.10.17 to the point with coordinates 0.25.17).The resulting flight parameters are shown in Figures 3-6.At the same time, no movement is observed along the OX G and OZ G axes, which allows to conclude that the autopilot is operating correctly when controlling the movement along the OY G axis.The model has the option of taking into account the effect of the wind constantly acting on the apparatus.The wind effect was determined by changing the speed of the quadrocopter, acting continuously along one of the axes.
For clarity, a flight program similar to the previous point was specified, but a constant counter-impact velocity along the X axis in the size of 0.5 m/s was added.The flight parameters under the condition of an external disturbance are shown in Fig. 11-14.

Conclusion
In the process of performing the presented work, all the tasks were fulfilled: • the shape of the autopilot of the quadrocopter is formed; • the law of quadrocopter control has been developed; • mathematical model of the movement of the apparatus for the case of an absolutely rigid design was created; • the model of movement is corrected taking into account external disturbance -wind load.Software tests with various programs and flight conditions were carried out, including taking into account external disturbance, the results of tests in the form of graphical dependencies are presented.Analysis of the flight simulation results allows us to conclude that the autopilot of the quadrocopter developed in the work does not require significant processing for operation under wind load conditions.This work is useful in minimizing the cost of designing a quadrocopter, and the use of a mathematical model is advisable when working on the on-board control system of the apparatus.

Fig. 2 .
Fig. 2. Scheme of forces acting on the deviceIn the projections on the axes of the corresponding coordinate systems, these forces [5] make it possible to obtain the relations given below.•Dynamic equations of motion of the center of mass of the apparatus in the starting coordinate system: cos γ  −   sin γ  ); γ̇ =   − tan ϑ  (  cos γ  −   sin γ  ) ; ϑ ̇ =   sin γ  +   cos γ  .

Fig. 3 .
Fig. 3. Dependence of the Y G coordinate on time with vertical flight of the device.

Fig. 7 .
Fig. 7. Dependence of coordinates on time in the space flight of the device

Fig. 11 .Fig. 12 .
Fig. 11.Dependence of coordinates on time in the space flight of the apparatus in the presence of disturbances (wind load) • the moment of forces  ⃗⃗ ∆ 21  1 around the axis OZ 1 , created by the difference in thrust of the engines 1 and 2. • the moment of forces  ⃗⃗ ∆ 34  1 around the axis OX 1 , created by the difference of the thrust of the engines 3 and 4. • the moment of forces  ⃗⃗ ∑  1 around the axis OY 1 , In the flight control system of the device, the control actions are aimed at changing the parameters    1 and    1 .The adjustable coordinates are x k , y k , and z k.The adjustable angles are ψ k , ϑ  , γ k The intermediate angles are θ k and φ k .