Design of Barometric Altimeter Based on Single Chip Microcomputer

Publisher:SparklingMelodyLatest update time:2011-08-25 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: The design of digital pressure altimeter based on C8051F353 single chip microcomputer is completed by using highly integrated piezoresistive silicon pressure sensor and modular design method. The measurement accuracy is optimized and improved by using segmented interpolation method through simulation software, and the intelligence of digital pressure altimeter is realized. Experiments show that the pressure altimeter designed in this paper can significantly improve the measurement accuracy, which is very suitable for small aircraft with requirements on volume and power consumption, and can also be used on ground instruments for atmospheric data collection.
Keywords: pressure sensor; error compensation; C8051F353; nonlinear correction

Height is the vertical distance from the carrier to a certain reference horizontal plane, which is an important basis for navigation. Pressure sensor is an important component of pressure altimeter. The signal conditioning circuit calibration and compensation circuit of traditional pressure sensor are complex and have poor stability. They cannot be directly used for computer digital processing, nor are they easy to integrate in portable devices. This pressure altimeter measurement system uses a micro piezoresistive sensor. Through the measurement of static pressure, the single chip microcomputer performs digital filtering after analog/digital conversion, and the function solves the current absolute height of the carrier, which has high accuracy and anti-interference ability.

1 Design of the altitude measurement system
Atmospheric pressure is numerically equal to the weight of the entire air column from the altitude to the upper boundary of the atmosphere. Therefore, ideally, atmospheric pressure and altitude have a one-to-one correspondence. Near sea level, the air pressure drops by about 0.7 kPa for every 100 m increase in altitude. Since air is compressible, atmospheric pressure and altitude have a nonlinear relationship.
The functional relationship between altitude and air pressure is relatively complex. If the pressure formula is copied to make a circuit, the circuit will become very complex and very difficult to implement in reality. Therefore, when designing the altimeter, the altitude can be divided into sections and the data can be solved separately.
1.1 Theoretical basis for the design of barometric altimeter
The relationship model between air pressure and altitude: H=T0/L×(P/P0)∧(1/(N-1))(approximate formula). Based on the standard sea level: T0=288.15K; P0=101.325kPa; N=5.2558 8; L=-0.006 5℃/m, the calculation results can be seen in Table 1. From the data in the table, it can be seen that the error caused by the drift of the sensor has different effects on the high end and the low end. In order to improve the measurement accuracy, this point should be considered during design. According to the air pressure formula, it can be concluded that the pressure change range within the range of 0 to 6 000 m is 47.18 to 101.325 kPa. Based on this, the range of the silicon piezoresistive sensor can be determined. In order to make full use of the accuracy of the sensor, the range of the silicon piezoresistive sensor should be as close to the measurement range as possible.

a.JPG


1.2 Hardware design of altimeter
The hardware structure consists of micro silicon piezoresistive sensor, single chip microcomputer, A/D conversion, precision reference voltage, display driver module, serial communication module, power supply module and other parts. The selection of components mainly considers the design accuracy and volume power consumption, and leaves a certain margin.
1.2.1 Single chip microcomputer
Data processing requires small size and low power consumption, with 16-bit ADC and temperature sensor inside. The C8051F353 single chip microcomputer is selected here. It is a mixed signal system-on-chip microcomputer chip newly launched by Silicon Labs in the United States. It can work in the temperature range of -40~+85℃, 28-pin LQFP package, and has a programmable gain amplifier (PGA) with a maximum amplification of 128. It is very suitable for multi-channel analog data acquisition system.
1.2.2 Piezoresistive sensor
The pressure sensor occupies a core position in the barometer. When designing, the pressure sensor can be selected according to several performance indicators such as measurement accuracy, measurement range, temperature compensation, and measurement of absolute pressure value. The range of the selected sensor should be consistent with the measurement range as much as possible, so as to reduce the error under the same accuracy conditions. The sensor is the MPX2100D absolute pressure sensor of Freescale Corporation with a small size, and the range is 100-0 kPa. The linearity is ±0.25% FS. The full-scale output is 40 mV (10 V power supply). It uses a single X-type resistor formed by ion implantation and laser trimmed to replace the Wheatstone bridge composed of four resistors, avoiding the error caused by the mismatch of the four resistors.
1.2.3 ADC chip
Select the number of bits and accuracy of the A/D converter according to the range and resolution. The number of bits N of the ADC chip is calculated according to the formula N≥log2(1+Umax/Umin) (where: Umax is the full-scale input voltage of the ADC chip; Umin is the minimum voltage that the ADC chip can distinguish). In order to achieve a pressure altitude resolution of more than 1 m, the number of bits of the A/D converter must be more than 15 bits. In order to simplify the circuit and reduce the size, the A/D converter here uses the 16-bit ADC0 of C8051F353. The reference voltage uses the 2.5 V reference inside the microcontroller. The internal voltage reference is enabled by setting the ADOEN bit in the ADCOMD register to "1" and the ADOVREF bit in the ADCOCF register to "0". When in use, 0.1μF and 4.7μF bypass capacitors should be connected between VREF and AGND.
1.2.4 Display communication circuit
Since the connection of using 4 single LEDs for display is relatively complicated, and the port driving capability of the microcontroller is difficult to guarantee, a special driver chip is selected here. The display driver uses the MAX7219 with a programmable 8-bit SPI serial LED interface. The serial communication circuit is mainly used to realize the communication between the system and the host computer, and uses the UART serial bus of the C8051F353 microcontroller to communicate with the host computer through the level conversion of the SP3 232 chip. Works at 9 600 b/s, 1 start bit, 8 data bits, 1 stop bit, odd parity.
1.2.5 Power supply and anti-interference design
Low voltage dropout regulator LM1117A is used to power the microprocessor and other circuits respectively. The reference voltage source MAX6350 is used to stabilize the power supply of the pressure sensor to ensure the stability of the sensor output. The reference voltage is divided and used as the voltage reference of the C8051F353 microcontroller. When designing the PCB board, each chip has a power decoupling circuit. The analog and digital are wired separately. In order to avoid distortion of the signal generated by the sensor before entering the A/D sampling and reduce the power consumption of the sensor, a filter is connected to the input end of the ADC to reduce noise and act as a buffer to isolate the front and back stages to avoid the influence of other circuits on ADC sampling. The instrument is powered by dry batteries and there is no problem of power supply or power grid interference. However, it will inevitably be affected by natural discharge interference and discharge interference of other electrical equipment when used on site. In order not to add too many hardware shielding measures, the design adopts an improved average filter algorithm in software.

1.3 Software design of altimeter
The software design process is shown in Figure 1. It adopts a modular structure to facilitate debugging. It includes initialization subroutine, sampling data processing, A/D conversion subroutine, pressure compensation subroutine, data processing subroutine, altitude calculation subroutine, communication subroutine, display subroutine and other parts.

b.JPG


Although the indicated airspeed within the measurement range is a single-valued function of the atmospheric dynamic pressure, its functional relationship is relatively complex. If it is directly calculated by a single-chip microcomputer using equations (1) and (2), floating-point operations are required, which will occupy more computer resources. This design selects the linear interpolation method to calculate the indicated airspeed. A simple and easy-to-implement linear function is used to replace the original complex function, namely: y=yi+ki(x-xi). In the formula: yi, xi, ki represent the pressure altitude value of the i-th interpolation point, the atmospheric static pressure value, and the slope of the interpolation line segment, respectively. The number of interpolation points can be determined by the error formula of linear interpolation:
c.JPG
Where: M = max(f"(x)); δ is the calculation accuracy. According to the calculation accuracy δ required by the system, the step length h = xi + 1-xi is calculated, and the number of segments of the curve interpolation n = 60 is obtained. The corresponding pressure altitude value, atmospheric static pressure value and slope of the interpolation line segment of each interpolation point are calculated in advance, and the data of the correction point is obtained. According to a certain rule, a table is formed and stored in the internal ROM of the microcontroller. The collected data is first compared with the data of the correction point to find the segment where the data is located, and then the corresponding yi, xi, ki of the segment are substituted into the segment interpolation formula to calculate, and the pressure altitude value can be solved. In this way, the sampling frequency can be increased while ensuring accuracy.
The C8051F353 microcontroller is equipped with a temperature sensor. The temperature sensor system consists of two diodes with different temperature characteristics and two constant current sources. The two channels are connected to the input of the ADC through the analog multiplexer of the ADC. The temperature sensor system works in differential mode. This paper uses the temperature sensor inside the C8051F353 microcontroller to sample the temperature and correct the output of the sensor to further improve the output accuracy.
According to the principle of piezoresistive pressure sensor, the measured pressure size P is linearly related to the sensor output voltage U. That is, the relationship between the two parameters is: P=aU+b. Since the zero position and sensitivity of the sensor will drift with temperature, the coefficients a and b will also change with temperature, that is, the coefficients a and b are functions of temperature. First, through multiple sampling and calibration, the standard pressure source provides grouped standard pressure, and records the output voltage value of the sensor at a certain temperature, that is, multiple groups (Pi, Ui), i=0, 1, 2,..., n, and then uses the least squares method for curve fitting. In order to make the total d.JPG error The minimum, we can use Q to find the partial derivatives of a and b, set these two partial derivatives to zero, and then solve the equation to get the coefficients (at, bt) corresponding to a certain temperature. Where t = -10℃, 0℃, 10℃, ..., 50℃. The relationship between the pressure size P and the output voltage U is:
f.JPG

Then, the Newton interpolation method is used to interpolate and correct the relationship between pressure P and voltage U according to the temperature parameter t provided by the temperature sensor. According to the interpolation polynomial:
h.JPG
According to the relationship between pressure P and voltage U after a certain temperature correction, the actual pressure value P can be calculated from the measured voltage U.

2 Experimental results and error analysis
Since the maximum error of the sensor is at the highest end of the measured value, if the error of this segment meets the design requirements, the other segments can meet the requirements. The results are shown in Table 2. Since possible software and hardware errors were excluded in the simulation stage, the subsequent PCB plate making and overall debugging were very smooth. Due to the existence of electromagnetic interference and temperature drift in the actual circuit, the overall error is slightly larger than the simulation. For the sensor with the largest error source, it has been individually calibrated and compensated. Finally, the measurement system has an error of less than 1m in the altitude range of -300 to +6 000m.

i.JPG


For altitude, the system measurement error mainly comes from three errors: sensor, amplifier circuit and converter. The root mean square method can be expressed as:
j.JPG
To reduce the system error, these three errors must be reduced separately. Among them, the error of the amplifier circuit is mainly determined by the accuracy of the resistors used in the amplifier circuit, the performance of the integrated operational amplifier and the structure of the circuit. A well-designed and adjusted amplifier circuit can make this error very small and basically negligible. The ADC error is mainly its integral nonlinearity error, differential nonlinearity error, offset error, full-scale error and offset temperature coefficient error. The error of modern amplifier circuits and ADC errors are much smaller than the error of sensors. Therefore, the system error is mainly determined by the error of the sensor. If you want to further improve the measurement accuracy, you can use a higher-precision sensor.

3 Conclusion
This altimeter avoids the mechanical error caused by mechanical components and makes full use of the internal resources of the C8051F353 microcontroller. It has the characteristics of small size, high accuracy and intelligent error compensation, and is particularly suitable for use on small aircraft. It has good practicality and is suitable for occasions that require real-time altitude information. It can complete the real-time measurement and display of various altitude parameters on the carrier. It has a serial communication module that can not only display the measured value of the machine, but also send it to the atmospheric data computer through the serial port to realize data recording and monitoring. It has broad application prospects.

Reference address:Design of Barometric Altimeter Based on Single Chip Microcomputer

Previous article:Electric Scooter Controller Based on AVR Microcontroller
Next article:Design of single-phase remote fee control smart meter based on single-chip microcomputer and semiconductor

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号