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.
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.
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.
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.
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.
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.
Previous article:Design of UAV altitude measurement system based on static pressure sensor MS5534B
Next article:Analysis of TinyOS wireless sensor network operating system
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MicroPython Hands-on (03) - Learn to boot up the computer with MaixPy from scratch
- [RVB2601 Creative Application Development] How to use font tools
- Why do we need LoRa and NB-IoT when we have GPRS?
- Recommend a network disk that supports automatic synchronization - TeraCLOUD, supports WebDav
- [AIoT Smart Smoke Detection System] SiPEED MAIX Bit K210 Development Board Hands-on Experience
- EEWORLD University Hall----Live Replay: ADI Energy Storage System Helps Build Electric Vehicle Fast Charging Stations
- Digital Temperature Servo Control System Based on Microcontroller
- [Perf-V Evaluation] Study and RTL Simulation Experiment of Hummingbird E203 Open Source SOC
- Very useful, a summary of RF dry goods (worth collecting)
- Work (II) Implementation of Linear and Nonlinear Signal Source Based on MCU + FPGA