Abstract: This article introduces the design of a high-precision altitude acquisition system based on DSP and BMP085 digital barometric sensor for drones, and tests and analyzes the actual operational data of the system to achieve altitude measurement and transmission. The focus is on the design and implementation of the software and hardware at the system acquisition end, detailing the design requirements for both software and hardware. This system features low power consumption, simple structure, high precision, strong anti-interference capability, and can reduce the impact of environmental factor changes. The measurement system uses the Kalman filter algorithm to correct the measurement data for more accurate calculation of relative altitude.
1 System Working Principle and Hardware Structure
The hardware part of the DSP-based drone altitude acquisition system mainly includes three parts: pressure and temperature acquisition, data processing, and data transmission. The system uses a pressure and temperature sensor to collect the pressure and temperature values of the drone, sends them to the drone’s processor, and uses wireless transmission to send them to the ground control center. The relative altitude value is calculated using formulas, and the data is corrected through the Kalman filter algorithm to obtain a more accurate altitude value, facilitating ground station personnel to control the drone to operate at a safe and reliable flight altitude.
1.1 Overall Framework of the System
The overall structure of the DSP-based drone altitude acquisition system is shown in Figure 1. The hardware part of the system consists of a BMP085 digital barometric sensor, TMS320F2812 DSP, wireless transmission module, power module, and other peripheral circuits. The TMS320F2812 controller connects to the BMP085 barometric sensor via the I/O port simulating the I2C bus. The BMP085 barometric sensor obtains the pressure and temperature values in real-time and sends them to the controller for processing through the I/O port. The pressure and temperature data are transmitted in real-time to the drone’s ground station through the drone’s wireless transmission module. After receiving the data, the ground station calculates the corresponding altitude value based on the relationship between pressure and altitude, compensates for the altitude value, and uses the Kalman filter algorithm for data correction, followed by storage and sending control commands to the flight control center to adjust the drone’s attitude, thereby controlling the altitude and ensuring smoother flight of the drone.
1.2 Hardware Selection of the System
The TMS320F2812 digital signal processor is the latest 32-bit fixed-point DSP controller launched by TI, one of the most advanced processors in the control field. Its frequency reaches up to 150 MHz, greatly improving the control precision and chip processing capability of the control system; the data processing bit has also increased from 16-bit fixed-point to 32-bit fixed-point. The highlight is its EVA, EVB event manager and a supporting 12-bit 16-channel A/D data acquisition, supporting JTAG boundary scan interface; it has 8 KB of internal ROM memory and 128 KB of internal Flash memory, three 32-bit CPU timers; the serial communication peripherals mainly include one SPI serial interface, two SCI serial interfaces, and enhanced controller area network communication interface Ecan2.0B; 56 configurable general-purpose I/O pins; it has low-power mode and power-saving mode; the external I/O port voltage is 3.3V, core voltage is 1.8V, and Flash programming voltage is 3.3V; it comes in a 179-pin BGA package and a 176-pin LQFP package.
To meet the system’s overload resistance requirements, the BMP085 barometric sensor based on MEMS from Bosch is used. The BMP085 features a powerful 8-pin ceramic leadless chip carrier (LCC) ultra-thin package with a pressure measurement range of 30 kPa to 110 kPa (equivalent to -500 m to 9,000 m), and an absolute accuracy of up to 0.03 hPa (0.25 m). The temperature measurement range is from -40℃ to +85℃. The BMP085 transmits uncompensated temperature and pressure values; to obtain compensated temperature and pressure values, compensation can be performed using the standard data stored in the BMP085’s EEPROM. The EEPROM stores 176 individual standard data bits, which are used for temperature and pressure compensation, and the 176 bits of EEPROM are divided into 11 words, each 16 bits, totaling 11 calibration coefficients, with each device module having its own unique calibration coefficients.
1.3 Internal Framework of the DSP System
Since the pressure sensor data is transmitted to the DSP via the I2C bus, and the TMS320F2812 lacks an I2C bus interface, the I/O of the TMS320F2812 simulates the I2C bus here. The wireless transceiver module sends data to the drone’s ground station via SPI, so the system must have both SPI and I/O to receive and send data to complete the overall design of the system. The DSP internally contains both parts, and it is only necessary to call these modules and configure the parameters to transmit data with the external interface module, as shown in Figure 2.
2 Software Design of the System
The software design program of the measurement system is based on Keil uVision4 and written in C language. The design approach is from top to bottom, using a modular design scheme, mainly including three subprogram modules: system and initialization, I/O port simulating I2C communication, and Kalman filter algorithm data correction. The main program operates in a loop, and the system workflow diagram is shown in Figure 3.
2.1 I/O Port Simulating I2C Communication
The I/O port simulating I2C communication is mainly used for communication between the TMS320F2812 and BMP085. After setting up the I/O port simulating I2C communication, the controller pre-reads the 11 compensation coefficients from the BMP085’s EEPROM, facilitating subsequent temperature compensation calculations. The DSP sends a start signal to the BMP085 sensor, initiating the sensor’s pressure and temperature measurements. Upon receiving the start signal from the DSP, the BMP085 sensor begins measuring the current pressure and temperature. After a conversion time of 4.5 ms, the DSP uses the I2C interface to read the measured pressure and temperature from the BMP085 sensor and performs temperature compensation based on the obtained compensation coefficients.
The drone was completed during the summer vacation of 2011, and after remote-controlled test flights, it can carry a load of up to 2.5 kg, with flight duration sufficient for general patrol tasks. The cabin space is relatively ample, with an installable volume of 7 cm×8 cm×9 cm; considering this, the hardware circuit board is designed in a plug-in format.
The BMP085 digital pressure sensor provides a reference formula for pressure-altitude conversion. Using this formula along with the pressure value collected by the sensor can yield a good altitude measurement, and the value obtained after Kalman filtering is even more accurate.
The pressure-altitude formula is as follows:
Altitude=44 330[1-(P-P0)(1/5.255)]
Where Altitude is the altitude value in meters, P0 is the standard atmospheric pressure value, and P is the atmospheric pressure value at a certain altitude.
The overall test results are shown in Table 1, comparing the altitude measurement results of this device with theoretical values. Due to limited experimental conditions, the altitude measurement range is set from 0 to 500 m.
As shown in Table 1, the maximum error value calculated by the system within the measurement range is 0.52 m, and the systematic error is generally less than 1 m. The errors in the pressure altitude acquisition system are mainly caused by sensor errors, circuit errors, and calculation errors. The system ensures high-precision measurement results through sensor calibration, temperature compensation, software filtering, and calculation of the altitude formula, thus meeting the altitude measurement requirements.
The high-precision altitude acquisition testing system designed using the BMP085 atmospheric pressure sensor and the TMS320F2812 DSP, through a simple circuit and effective software filtering algorithm, demonstrates good stability and high precision, suitable for multifunctional needs such as high precision, small size, and portability, with a broad application prospect in practical life.