Share this

Temperature-compensated drone altitude sensor

2026-04-06 05:12:46 · · #1
Abstract: This paper introduces a pressure sensor MS5534B module suitable for small UAVs, analyzes its characteristics and data processing process, and discusses its design in the hardware and software system of UAVs in detail. In order to reduce the large number of floating-point operations of microprocessors and save valuable storage space, a piecewise linear fitting algorithm and two piecewise interval coefficients are proposed to replace the traditional query method when converting standard air pressure values ​​to altitude values. The piecewise linear fitting algorithm is simulated using Matlab based on a large amount of data, which meets the design requirements and is successfully applied in a small UAV. Keywords: UAV; sensor; piecewise linear fitting; air pressure altitude conversion 1. Introduction The altitude measurement of UAVs has traditionally used static pressure sensors as the sensing means. Through the sensing of atmospheric static pressure by its differential pressure diaphragm, the atmospheric pressure is converted into an analog signal output, thereby calculating the actual altitude value [1]. Since atmospheric pressure changes are closely related to altitude changes and local actual temperature, most static pressure sensors do not consider the influence of actual temperature on atmospheric pressure in their design, which causes a large deviation between the actual output static pressure value and the true value, thus affecting the accurate calculation of altitude [2]. In response to 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 of insufficient computing power of UAV flight control processor, a linear algorithm of piecewise fitting curve is proposed to realize the UAV altitude calculation with high accuracy. 2. System hardware design 2.1 Characteristics of MS5534B MS5534B is a low-voltage, low-power, high-precision pressure measurement module, which includes 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, with a pressure measurement range of 10 to 1100 mbar and a resolution of 0.1 mbar. In addition, the sensor has six software calibration coefficients, with an absolute pressure accuracy of +/-1.5mbar and a relative accuracy of +/-0.5mbar. It does not require any other external modules, has a simple interface, and is easy to connect to the circuit. The module is very small, with a planar size of 9mm x 9mm and a thickness of only 3.7mm. It can be used in environments from -40°C to +125°C [3]. The internal structure diagram of the module is shown in Figure 1. [align=center] Figure 1 Internal structure diagram of the module[/align] 2.2 System composition and interface connection The height 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 digital absolute air pressure value D1, and at the same time output a 16-bit absolute temperature value D2. The flight control system uses the ARM7 microprocessor core with a 32-bit microprocessor. Due to its fast computing speed and rich peripheral interface resources, the MS5534B is directly connected to it through the standard SPI interface, which simplifies the circuit design and improves the real-time performance. The communication between the ARM7 microprocessor and the barometric pressure sensor is completed through the standard SPI interface [4]. DOUT and DIN are the 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 for the digital output of MS5534B is the 3V power supply voltage. The external 4.7uF tantalum capacitor should be as close as possible to MS5534B to ensure the power supply stability and conversion accuracy during data conversion. The physical object and pin distribution diagram of the module are shown in Figure 2. [align=center] Figure 2 Physical object and pin distribution diagram[/align] 3. System software design 3.1 System software design process Each MS5534B has a unique four-word calibration data for the module when it leaves the factory, which is stored in a 64-bit PROM. After initialization, the ARM7 microprocessor reads Word1 to Word4 from the MS5534B via the serial port, and then converts them into six calibration compensation coefficients C1 to C6 using a logic shift operation. The ARM7 microprocessor continuously reads the absolute air pressure value D1 and temperature value D2 from the MS5534B, and then calculates the relative air pressure value P in combination with the calibration compensation coefficients. It determines whether the value is within the effective range, performs low-pass filtering on the effective value, and finally converts it into an altitude value using the piecewise linear 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 as to monitor the flight altitude of the aircraft in real time and deal with any unexpected situations in a timely manner [5]. The software flowchart of the altitude measurement system based on MS5534B is shown in Figure 3. [align=center] Figure 3 System Workflow Diagram[/align] 3.2 Converting Air Pressure Values ​​into Altitude Values ​​Using the Piece Line Linear Fitting Method In practical applications, the relationship between atmospheric pressure and altitude is nonlinear [6]. The traditional method is to make a data table of air pressure values ​​and corresponding altitude values ​​and use the lookup table method. If the accuracy is 1m, tens of thousands of data points are required, which requires a huge amount of storage space and takes a long time. In addition, since the microprocessor in the flight control system is not very strong in handling a large number of floating-point operations, and the flight control system has high real-time requirements, in order to save valuable storage space, this system design uses the piecewise linear method for linear fitting [7]. The basic idea of ​​the piecewise linear fitting method is to divide the approximated function curve into multiple interval regions according to the change. In order to improve accuracy and shorten the calculation time, different slope linear segments can be used to represent the curve segments in each interval region according to the accuracy requirements. The error analysis of the fitting principle is shown in Figure 4. [align=center] Figure 4 Error analysis diagram of fitting principle[/align] Based on a large amount of experimental data and theoretical derivation, the fitting formula (1) (1) Where, alti represents altitude (0.1m), pres represents air pressure (mbar), j, i represent the interval coefficient of the broken line. In different ranges of i, j values, the conversion of atmospheric pressure to altitude is linear, which increases the conversion time. The error is periodic and within a small range. Dividing the normal working altitude range into different segments will yield different high-precision values. A segmentation list of i, j is shown in Table 1. [align=center] Table 1 List of interval coefficients i, j for broken line fitting[/align] Based on the data in the table above, Matlab is used to fit the curve obtained by the equation of atmospheric pressure to altitude[8]. The fitting effect is very good, and the simulation results are shown in Figure 5 below. [align=center] Figure 5 Effect diagram of the fitted curve of the broken line method[/align] 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 magnitude of the rate of change of the function curve shape. For areas with large curvature changes, a smaller distance is used, while for areas with gentler curves, a larger distance is used. [align=center]Figure 6 Error Analysis Diagram of Piece-Line Method and Actual Altitude[/align] Figure 6 shows the altitude error between the elevation obtained by the piece-line fitting method using Matlab simulation and the standard atmospheric pressure in China, at altitudes of -700m to 8000m. The maximum altitude error is +/-5m at -700m to 8000m, while the error is within +/-3m at -100m to 1000m, which is suitable for the altitude requirements of small UAVs. 4. Conclusion The above-mentioned barometric altitude measurement system based on MS5534B was applied to the self-developed UAV autopilot. The system performed well in multiple actual flight missions, achieving accurate altitude positioning. This paper addresses the characteristics of small UAV autopilots, such as limited floating-point computing power and high real-time requirements, by proposing a piece-line linear fitting method. This method reduces a large number of floating-point operations, improves computational efficiency, and saves valuable RAM storage space, making it suitable for autopilots of small UAVs. References [1] Shen Anyu et al. Automatic Flight Control System [M]. National Defense Industry Press, 2003: 95-99. [2] Zhao Peng et al. Design and Implementation of UAV Flight System Based on AT91m55800 [J]. Microcomputer Information, Vol. 21, No. 4, 2005: 9-10. [3] Using MS5534 for altimeters and barometers. http://www.intersema.ch/site/technical [EB/OL]. [4] Qiushi Technology. Navigation of Typical Module Design Examples of Single-Chip Microcomputer [M]. Beijing: Posts & Telecom Press, 2005: 166-170. [5] Hu Shousong. Automatic Control Principles [M]. Science Press, 2001: 241-245. [6] Qian Yiji. Aerodynamics [M]. Beijing University of Aeronautics and Astronautics Press, 2005: 247-250. [7] Pan Xinmin et al. Microcomputer Control Technology [M]. Electronic Industry Press, 2005: 261-263. [8] Wei Kexin et al. MATLAB Language and Automatic Control System Design [M]. Machinery Industry Press, 2004: 73-75.
Read next

CATDOLL 139CM Luisa Silicone Doll

Height: 139 Silicone Weight: 25kg Shoulder Width: 33cm Bust/Waist/Hip: 61/56/69cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22