Design of UAV altitude measurement system based on static pressure sensor MS5534B

Publisher:代码漫游者Latest update time:2011-04-15 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

Traditionally, the altitude measurement of drones has always used static pressure sensors as a sensing method. Through the pressure difference diaphragm box sensing the atmospheric static pressure, the atmospheric pressure is converted into an analog signal output, thereby calculating the actual altitude value. Since the change in atmospheric pressure is closely related to the change in altitude, it is also closely related to the actual local temperature. However, most static pressure sensors do not take into account the impact of actual temperature on atmospheric pressure when they are designed. This results in a large deviation between the actual output static pressure value and the true value, thus affecting the accurate calculation of altitude.

In view of the above shortcomings, this paper proposes to use the MS5534B high-sensitivity static pressure sensor with temperature compensation and calibration coefficient as the sensor device for UAV altitude measurement. At the same time, considering the actual situation that the computing power of the UAV flight control processor is insufficient, a linear algorithm of piecewise fitting curve is proposed to realize the UAV altitude calculation with higher accuracy.

2. System hardware design

2.1 Characteristics of MS5534B

MS5534B is a low-voltage, low-power, high-precision pressure measurement module, which contains a piezoresistive pressure sensor and a 15-bit ADC integrated module with digital output function. It can provide 16-bit digital information of air pressure and temperature, and the pressure measurement range is 10-1100mbar with a resolution of 0.1mbar. In addition, the sensor has six software calibration coefficients, the absolute pressure accuracy is +/-1.5mbar, the relative accuracy is +/-0.5mbar, and no other peripheral modules are required. The interface is simple and the circuit connection is convenient. The module is very small, with a plane size of 9mmX9mm and a thickness of only 3.7mm. It can be used in an environment of -40°C to +125°C. The internal structure of the module is shown in Figure 1.

MS5534B internal module structure diagram www.elecfans.com


2.2 System composition and interface connection

The altitude sensor system based on MS5534B mainly consists of two parts: (1) MS5534B air pressure data acquisition unit; (2) ARM7 microprocessor unit. The main function of MS5534B is to convert the uncompensated air pressure analog voltage output measured by the piezoresistive pressure sensor into a 16-bit absolute air pressure value D1, and output a 16-bit absolute temperature value D2. The flight control system uses the ARM7 32-bit microprocessor core. Due to its fast computing speed and rich peripheral interface resources, the MS5534B is directly connected to it through a standard SPI interface, which simplifies the circuit design and improves real-time performance.

The communication between the ARM7 microprocessor and the pressure sensor is completed through the standard SPI interface. DOUT and DIN are digital output and input pins respectively, SCLK is the serial data clock, and MCLK is the system clock with a main frequency of 32.768kHZ, which is provided by the microprocessor. The reference voltage of the MS5534B digital output is the 3V power supply voltage. The external 4.7uF tantalum capacitor should be as close to the MS5534B as possible to ensure the power supply stability and conversion accuracy during data conversion. The actual module and pin distribution diagram are shown in Figure 2.

Module physical object and pin distribution diagram www.elecfans.com

3. System software design

3.1 System Software Design Process

Each MS5534B has a four-word calibration data unique to the module when it leaves the factory, which is stored in a 64-bit PROM. After initialization, the ARM7 microprocessor reads Word1~Word4 from the MS5534B through the serial port, and then converts it into 6 calibration compensation coefficients C1~C6 using the logical shift operation method. The ARM7 microprocessor continuously reads the absolute pressure value D1 and temperature value D2 from the MS5534B, and then calculates the relative pressure value P in combination with the calibration compensation coefficient, determines whether it is within the valid range, performs low-pass filtering on the effective value, and finally converts it into an altitude value according to the broken line method. The altitude value is transmitted to the ground station in real time through the wireless data transmission module connected to the flight control system, so that the flight altitude of the aircraft can be grasped in real time, and any unexpected situations can be handled in time. The software flow chart 3 of the altitude measurement system based on MS5534B is shown below.

Software flow chart of the height measurement system of MS5534B www.elecfans.com

3.2 Broken line linear fitting method to convert air pressure value into altitude value

In practical applications, the relationship between atmospheric pressure and altitude is nonlinear. The traditional method is to make a data table of the air pressure value and the corresponding altitude value, and use the table lookup method. If it is accurate to 1m, tens of thousands of data are required, which requires a huge storage space and is time-consuming. In addition, since the microprocessor in the flight control system is not very capable of a large number of floating-point operations, and the flight control system has high requirements for real-time performance, in order to save precious storage space, this system design uses the broken line method for linear fitting. The basic idea of ​​the broken line linear fitting method is to divide the approximated function curve into multiple interval area values ​​according to the change situation. In order to improve the accuracy and shorten the calculation time, different slope linear segments can be used to represent the curve segments in each interval domain value according to the accuracy requirements. The error analysis of the fitting principle is shown in Figure 4.

Based on a large amount of experimental data and theoretical derivation, the fitting formula (1) is obtained:

Where alti represents the altitude (0.1m), pres represents the air pressure (mbar), and j,i represent the line interval coefficient. Within different i,j value ranges, the conversion from atmospheric pressure to altitude is linear, which improves the conversion time. The error is periodic and within a small range. Dividing the normal working altitude range into different segments will result in different high-precision values. A segmented list of i,j is shown in Table 1.

According to the data in the above table, Matlab is used to fit the curve obtained by the atmospheric pressure to height conversion equation. The fitting effect is very good. The simulation results are shown in Figure 5 below.

In order to further improve the accuracy, the non-equidistant segmentation method can be used to correct the distance between the interval points according to the rate of change of the function curve shape. The distance is smaller in the part with large curvature change, and larger in the area with flatter curve.

Figure 6 is a schematic diagram of the height error between the altitude obtained by Matlab simulation line fitting method and the standard atmospheric pressure in my country at an altitude of -700m to 8000m. The maximum height error is +/-5m at -700m to 8000m, and the error is within +/-3m at -100 to 1000m, which is suitable for the height requirements of small UAVs.

Height error diagram www.elecfans.com

4. Conclusion

The above-mentioned barometric altitude measurement system based on MS5534B was applied to the self-developed UAV autopilot, and the test results in multiple actual flight missions were good, and the positioning height was accurate. Aiming at the characteristics of the small UAV autopilot microprocessor with weak floating-point computing capability and high real-time requirements, this paper proposes a broken line linear fitting method, which reduces a large number of floating-point operations, improves computing efficiency, and saves precious RAM storage space, which is suitable for the autopilot of small UAVs.

Reference address:Design of UAV altitude measurement system based on static pressure sensor MS5534B

Previous article:Design of UAV altitude measurement system based on static pressure sensor MS5534B
Next article:Analysis of TinyOS wireless sensor network operating system

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号