Control of unmanned aerial vehicle modules based on inertial measurement system and MEMS sensor

. This article examines the effect of crosswind on the deflection of UAV cargo in free fall, taking into account the parameters of air resistance and drag coefficient. The displacement results are obtained graphically through simulation. The diagram of the module for stabilizing the load in free fall and the block diagram of the inertial measurement unit (IMU) are described. An analysis of navigation systems was carried out and an IMU was selected that allows the use of dead reckoning (DR) navigation. The principles of operation of inertial measuring microelectromechanical (MEMS) structures are considered. The principles of using IMU and how to configure MEMS sensor data are discussed. IMU accuracy testing has been carried out. A description of the principles of setting up and using a proportional-integral-derivative (PID) controller to control the angle of the stabilizer wing is presented. 3D simulations were performed for the case with and without the stabilization module. The presented results will be useful to UAV developers.


Introduction
Today, microcontroller accelerometers are widely used in aviation navigation, consumer electronics, mechanical engineering, medical, military and civilian industries [1][2][3][4].The use of additional modules is one of the methods for increasing the efficiency of cargo UAV control, because they can reduce response time or increase the convenience of working with the drone, which significantly increases the drone's movement time.Today there is no other improvement than the use of free-falling load stabilizers.There are systems for releasing cargo, but they are slow, because there are types of payloads that require a quick and accurate landing [3].IMUs can consist of one or more sensors that collect data designed to measure inertial motions in a specific reference frame.Acceleration, rotation speed are examples of data that can be obtained from the sensors contained in the IMU.IMUs can be found in a variety of smart devices, medical rehabilitation, general robotics, UAV control and navigation enhancement systems, sports devices, and virtual reality systems.Some engineering solutions and motion sensors have a number of limitations, such as systems that do not have a clear starting point.In such systems, it is difficult to track deviations from the starting point.To solve such problems, we present a distance measurement system based on a MEMS accelerometer.
The hardware structure of the system includes a data measurement module and data acquisition and data processing modules combined in one module.Due to the physical properties of the sensor, such a system can be used in small spaces, under large overloads and other unfavourable conditions.This paper describes a method for calibrating the system and proposes an algorithm for tracking deviations based on integration of acceleration.The fixed initial error caused by the sensor installation position is analyzed.The analysis shows that if this factor is not taken into account, the error will lead to a serious error.The drift of the sensor zero is taken into account and the construction of a quadratic function through Lagrange interpolation is used to smooth the signal.
To control the deviation, stabilization wings will be used using a PID controller.For a stabilization system, such deviations may occur due to external interference, such as gusts of wind, uncertainty in aerodynamic characteristics, etc., so the PID controller coefficients need to be reconfigured.
The controller observes the proportional angle error, its derivative and integral and produces input data calculated using three optimal gains, namely P, D and I for each observation case, thus allowing the system to function optimally over a wide range of configurations and interference conditions.
Article [5] addresses current issues in the development of a virtual angular accelerometer based on the integration of 4 MEMS IMU measurements.A backstepping controller design based on a virtual angular accelerometer is presented and its stability is analyzed using the Lyapunov function.A new method for self-calibration of a MEMS micrometre was proposed in [6].The authors show the effectiveness of calibration before using a MEMS micrometre and justify an effective way to improve its accuracy.In [7], an algorithmization of the process of estimating UAV orientation data based on a MEMS sensor by Kalman filtering was proposed.An assessment of the factors influencing information about the orientation of the UAV in static and dynamic operating conditions has been carried out.The approach proposed in [8] to the estimation of angular positions based on the IMU and the use of an artificial neural network.The authors focus on performance assessment using the mathematical apparatus of nonlinear autoregression.The article [9] presents two non-linear filtering methods for low-cost UAVs and estimates of measurement bias.The results of real-time tracking and evaluation experiments based on low-cost MEMS are presented.
The most common solutions available on the open market are those using a pendant unit with a separate electric motor, which, upon command from a remote control, drives the locking mechanism, which in turn releases the load.A more original system for dropping cargo is that does not require additional engines or electronics, using the ability of most drones to flip around its own longitudinal axis.Another type of device for releasing cargo from unmanned aerial vehicles are boxes with a movable bottom cover that can be opened and release the cargo contained in it.In this case, even special containers (cassettes) with parachutes attached to them can be used.The technique has been developed to improve the control of a cargo UAV by using a module for stabilizing cargo in free fall.Based on the developed methodology, a stabilization module system was built based on measurements using Inertial Navigation System (INS) and PID-control, which improves the control of a cargo UAV.
Cargo UAVs are quite productive at the current time during the war for the delivery of medical supplies and humanitarian missions, for the transportation and control of heavy equipment, commercial, agricultural, firefighting and undoubtedly military (see Fig. 1).

Concept of inertial navigation system 1.Development of a block diagram of a UAV cargo stabilization module in free fall
Before describing the main module for improving UAV control, one should consider the block diagram of the subsystem included in it.From Fig. 2 shows that the INS consists of inertial measurement units and a data processing unit.The inertial units of measurement include the following sensors: AS; gyroscope sensor [13,14].As sensors, we used the MPU6050 module, which contains a 3-axis AS and a 3-axis gyroscope sensor.After processing the values coming from the sensors, the INS must send to the data processing unit (DPU) of the module, such as the direction of movement and orientation in space.The structure of the load stabilization module in free fall, in turn, in addition to the above-mentioned system, includes a system for changing the angle of inclination of two control wings for the X and Y axes, Fig. 3.
From the diagram in Fig. 3 shows that the adjustment of the angle of inclination of the wings occurs using a PID controller, which, in its principle of operation, is similar to the UAV altitude hold controller.
The final angle value signal is transmitted to the actuator.We chose the SG90 servo motor as the actuator for the experiment.In the SolidWorks3D environment, the basic structure of the wing rotation mechanism for the X and Y axes was designed Fig. 4.
where ρ is the air flow density, U is the relative air flow velocity, A is the plate area, α is the angle of attack.Please note that the drag force D will result in braking and this will affect the time the load falls.The direction of the displacement and drag forces coincides with the normal vector of the plate, and this total force acts as the sum of the aerodynamic forces acting on the plate.We actually consider a set of blade slices as flat plates and use the above force equations.To obtain the total sum of the displacement and drag forces, the sum of the forces of all the wings of the module is used, in the proposed work 4 wings are considered.
In Fig. 5 graphically shows the results of a 2D simulation of the impact on the fall trajectory from the angle of the wings.The angle of inclination of the two wings is 17 degrees.It should be noted that the program code takes into account the area of the wings affected by the side wind.The impact of side wind was analyzed on the deviation from the point of impact using the example of the mathematical parameters of a box (20cmx20cm) with a payload weighing 1 kg.On Fig. 6 shows the dependence of the change in horizontal speed on the time during which the wind and the angle of the wings affect the cargo.
The part of the code (Python) responsible for the influence of drag forces, wind speed and wing angle on the trajectory is described below.To write the entire program, we have developed an algorithm.

Dead reckoning navigation method
We applied the DR navigation method.DR navigation is applied in relation to the starting point of reference [15,16].It is assumed that the object moves in a plane and does not change its direction of the db axis.That is, for a certain period of time TN for the calculation of ap and γh are considered constant.After time TN, both ap and γh are recalculated and a new cycle of dead calculation is performed.This process is shown in Fig. 7.The final expressions for determining the displacement:   ( + 1) =   () +   () ( + 1) =   () +   () DR can take into account the external force of the air flow, which leads to additional acceleration.Without an external accelerating force, the accelerometer will simply feel the gravity vector.

Principles of using and setting up an inertial system
The measurement system consists of a MEMS accelerometer, an AVR processor, a power supply module, and peripheral circuitry.The general structure of the system is shown in Fig. 8, it includes the following modules: system control module; data measurement module; power module.The control module uses the AVR processor.It includes a data receiving module and a data processing module (Fig. 8).The main job of the processor is to receive, calculate and transmit accelerometer data to a personal computer.The AVR microprocessor has the ability to perform floating point operations, which is necessary in this case.Data is received via the I2C interface, which separates the process of taking sensor readings and processing them.
The MEMS accelerometer (Fig. 9) can speed up a moving object in real time.Communication with the data receiving module is secured by the I2C bus, which includes the SCL (Serial Clock) clock line and the SDA (Serial Data) data line.

a b
Fig. 9. MEMS sensor coordinate system is the a and functional circuit of the accelerometer is the b.
In Fig. 9, b we present the functional circuit of the accelerometer.The analog signal created by the mass shift will be amplified, processed, demodulated, and low-pass filtered (LPF) before being converted to digital by the ADC.The serial digital bitstream from the ADC is then transferred to the FIFO buffer, which converts the serial signal into a parallel data stream.This parallel data stream can then be converted to one of the protocols such as I2C or SPI before further processing.
The connection diagram and the description of the outputs of the MPU6050 accelerometer are shown in Fig. 10 [15].To improve the operation of the accelerometer and gyroscope, we used an additional magnetometer sensor according to the connection diagram.We calibrated the MPU6050 with a custom-designed calibration cube that ensures position stability along each axis, thereby facilitating calibration and matching with gravity (accelerometer) and rotation around each axis (gyroscope), Fig. 11.Gyroscope calibration consists in calculating the offset for each axis.Each of the three axes of the gyroscope should read 0 degrees per second (°/s) when the sensor is not moving.Displacement can be measured by taking sensor readings at a standstill, and then using these values as an offset when reading gyroscope values.On Fig. 12 shows graphs of gyroscope values before and after calibration.We also calibrated the accelerometer values.A programmatic code was written for calibration and error detection.
The results of AS calibration are presented in Tab. 1.The average error is 0.95%, which is a good result in the case of stabilization of a freely falling weight.

Experimental results
For smoothing, we used the moving average method, a window of three points.The three acceleration points in each moving window can be plotted as a quadratic function using Lagrange interpolation [17].By calculating the definite integral of the quadratic function in the first two-time intervals in the window that opens, you can get acceleration.By moving the window, the speed can be obtained in the same way.Below is the derivation of the final formula for the algorithm.We have selected points in a sliding window at a specific point in time ( −1 ,  −1 ), (  ,   ) and ( +1 ,  +1 ).
The final formulas for determining the speed and increment of distance over time  −1 and   , can be obtained as follows: = ∫  ⋅  The PID controller calculates the "difference" value between the measured input signal and the desired setpoint.The controller tries to minimize the error by adjusting the output signal.Therefore, it is necessary to provide the PID controller [18] with sensor input and a desired value in order to tune a single variable that is related to the previous one.We adjusted the coefficients experimentally.A separate microprocessor was used for wing angle control and adjustment in order to reduce the load on the processor of the IMU system.a b The algorithm of the synthesized program code of the developed system for controlling the angle of inclination of the UAV wings is shown in Fig. 13 a.
As a result of the simulation, a 3D graph was obtained (Fig. 13, b).The Fig. 14 shows graphs of the dependence of the angle of rotation (radians) of the wings on time in seconds and the dependence of the change in speed along the X and Y axes (Fig. 15).After completing the steps above (5)(6), you can obtain the deviation value from the zero point.Fig. 16 shows a graph of one of the measurements, including acceleration, speed and displacement at a shift of 0.25 m.To compare the results of improved fall stabilization, a flat projection plot was created.A simulation of a hundred drops (cargo m=1kg, height h=200m) was performed in the case when the free-fall load stabilization module was used (Fig. 17, a) and a plot of a simulation of a hundred drops without a module (Fig. 17

Fig. 1 .
Fig. 1.Image of the appearance of a cargo UAV.

Fig. 3 .
Fig. 3. Structural diagram of the cargo stabilization module in free fall.

Fig. 4 .
Fig. 4. 3D model of the basic structure of the wing turning mechanism.

1. 2 1 )
Creating a simulation of the influence of the wing angle on the change in the trajectory of a body in free fall using the Python programming language The geometric model of the wings is chosen in the form of a plate.We used an approximation to analytical equations to obtain a real-time solution.When a flat plate moves at an angle in air, collisions between the plate and air molecules result in a change in momentum.The magnitude of the deflection force L and the force resistance D on a flat plate can be calculated as follows:  =  2  sin 2  ( =  2  sin (1 − cos )

Fig. 5 .
Fig. 5. Graph for assessing the effect of the angle of inclination of the wings on the trajectory of the fall of the cargo.

Fig. 6 .
Fig. 6.Graph of the influence of the angle of the wings on the change in the speed of deflection.

Fig. 14 .
Fig. 14.Dependences of the angle of rotation (radians) of the wings on time in seconds (wing in the X-projection).

Fig. 17 .
Fig. 17.Graph of cargo dumps using the stabilization module -a and cargo drops graph without stabilization module -b.