introduction
At present, most intelligent instruments have adopted certain flow compensation technology, but the process of establishing the mathematical model of compensation is not very comprehensive, and the measurement accuracy is still not high. In view of this situation, this paper, based on the traditional flow measurement compensation idea, uses the MSP430 microcontroller to develop a calculation software package with the water and steam thermodynamics industrial formula IAPWS-IF97 as the core in the measurement of steam flow, so that the compensation accuracy of the flow meter is still greatly improved when the working conditions change over a wide range. At the same time, because this type of microcontroller has a rich low-power mode and powerful computing power, it not only improves the compensation accuracy, but also reduces the cost.
1 Analysis of steam flow measurement and density compensation methods
The differential pressure flowmeter is the main instrument for measuring steam flow at present. Its flow is calculated according to the mathematical model in GB/T 2624-93 Flow measurement throttling device, using orifice plate, nozzle and venturi tube to measure the flow of fluid filling a circular tube. When the steam working conditions change, we should make flow compensation according to the steam density. To make density compensation for steam flow, the steam density must be detected in real time.
Water vapor used in engineering is mostly in the state of just leaving the liquid state or close to the liquid state. Its properties are very different from those of ideal gas and should be regarded as real gas. The physical properties of water vapor are much more complicated than those of ideal gas, so it cannot be described by simple mathematical formulas. At present, there are several main methods for determining water vapor density commonly used in smart instruments.
1.1 Lookup table method
vPut the water vapor density table into the instrument, and find the corresponding density value from the table according to the temperature and pressure of the working conditions. This method can obtain high compensation accuracy, but the amount of data is huge and requires a lot of storage space. When using the data table, you must first determine whether it is saturated steam or superheated steam, and then check different data tables; in addition, the variables in the data table are discontinuous quantities with a certain step length. For the data between two points, it is necessary to obtain it through mathematical interpolation processing, and the interpolation formula of the binary function is not simple.
1.2 Formula calculation method
The density of saturated water vapor is a univariate function of temperature or pressure, that is, ρ=f(T) or ρ=f(P). In current intelligent instruments, the density of saturated water vapor is usually calculated by fitting the function with the help of a saturated water vapor density table according to the requirements of the range and accuracy, and an analytical expression that meets the accuracy requirements is obtained.
The situation of superheated steam is relatively complicated. Its density is a binary function of temperature and pressure, that is, ρ=f(P, T). After long-term exploration, there are many research results on its analytical function. The superheated steam density calculation formula commonly used in engineering is mainly as follows:
(1) Experimental fitting formula
There are many empirical formulas for calculating superheated steam. Formula (1) is a fitting formula given in the literature [1]:
The error of formula (1) is ±0.22% in the temperature range of 200-570°C and the pressure range of 0.5-11.5 MPa.
(2) Ukanovich formula
The Ukanovich formula is a relatively good fitting formula. The superheated steam within 250℃ has a good degree of agreement with the table (the deviation is about 0.1%). In the range of 250-300℃, the deviation is large near the saturation line, up to 1%; in the range of 300-350℃, the deviation near the saturation line can reach 6%. Because the formula is relatively simple, it is better to use it within 250℃.
1.3 IAPWS-IF97 formula
The new industrial standard for thermodynamic properties of water and steam, "IAPWS-1997 Industrial Formulas", includes all equations for calculating thermodynamic properties of water and steam. This formula is an international standard confirmed by the International Association for the Properties of Water and Steam (IAPWS) at its annual meeting in Erlange, Germany in 1997.
The IAPWS-IF97 formula divides the different states of water and water vapor into five regions, each with a different calculation formula. The most commonly used in industry are superheated steam and saturated steam with a pressure below 16.65 MPa and a temperature below 600°C, which belong to the second region of the IAPWS-IF97 formula. Therefore, we only need to use the equation group provided in the second region for calculation. The following is the formula for calculating the specific volume of steam in the second region given in the literature [3]:
In the formula: p is pressure, MPa; v is specific volume, m3/kg; T is temperature, K; R is the gas constant of water, 0.461 526 kJ·Kg-1·K-1; ni, Ii, Ji are formula coefficients, which can be provided by the data table and placed in the memory of the single-chip microcomputer. [page]
From this, the density of water vapor in the commonly used industrial range can be calculated as:
It can be seen that the application of formula (8) only requires the installation of temperature and pressure transmitters, and it is not necessary to determine whether it is saturated steam or superheated steam for accurate measurement. For situations where it is determined to be saturated steam, it is only necessary to measure the temperature or pressure, and use the equation group given in the fourth area of the IAPWS-IF97 formula to calculate the saturated pressure or saturated temperature, and then substitute it into the above formula to accurately calculate the saturated steam density.
The uncertainty of the specific volume of water and water vapor in the single-phase region (region 1-3) calculated by IAPWS-IF97 is about ±0.05%, so it can fully meet the accuracy requirements of general industrial calculations. At present, there are some software for calculating steam properties compiled on PCs using the IAPWS-IF97 formula.
2 System Design
From the above analysis, it can be seen that the use of IAPWS-IF97 formula does not require a large amount of memory space, and the steam density calculated within the commonly used industrial range (pressure below 16.65 MPa, temperature below 600°C) meets international standards, and is the preferred formula for steam density compensation. However, its application in intelligent instruments with single-chip microcomputer as the core has not been reported so far. The author has made some explorations in this regard, and realized density compensation based on IAPSW-IF97 formula in intelligent differential pressure flowmeter based on single-chip microcomputer. The results show that when the working conditions change over a wide range, the density compensation accuracy of steam flow measurement is effectively improved.
2.1 Hardware Design
The hardware circuit schematic diagram of the instrument is shown in Figure 1. The sensor detects the differential pressure signal △pi before and after the fluid passes through the throttling device, the fluid static pressure signal pi and the fluid temperature signal ti upstream of the throttling device, which are converted by the 12-bit A/D converter built into the single-chip microcomputer. The conversion result is calculated and compensated by the CPU in real time according to a certain mathematical model to obtain the instantaneous flow value and the cumulative flow value. The calculation results are saved and displayed on the LCD, and pulse output and 4-20 mA analog output can also be achieved through peripheral circuits.
The instrument system microprocessor is the single-chip MSP430F149 produced by TI in the United States. The single-chip adopts a 16-bit RISC instruction structure, has rich addressing modes and powerful computing and processing capabilities, and two sets of clock modules with a frequency of up to 8 MHz, which can meet the needs of computing speed in the instrument; MSP430F149 also has a 60 kb + 256-byte Flash memory, which can use the JTAG interface or the on-chip BOOTROM to download and debug programs. The instrument program and the data to be saved share this memory space, and no external memory is required, which reduces the cost of the instrument.
In order to accurately measure and save the power-off time, the instrument is connected to the DS1302 real-time clock chip to provide an accurate clock to make up for the defect that the MSP430 series microcontroller does not have a real-time clock module. The real-time clock chip is connected to the microcontroller in a three-wire serial input/output manner, which is easy to operate. The instrument display uses the LCM141 dedicated LCD display module, which is a double-line 14-bit 8-segment LCD display module. It contains drive and control circuits and serial communication interfaces, which can be easily interfaced with the microcontroller. Combined with the keyboard circuit, it can complete user parameters, factory parameter settings, switching of different measurement functions, and online calibration of pressure and differential pressure sensors.
2.2 Software design and calculation speed analysis
The flow meter software mainly consists of initialization module, parameter setting and display module, signal acquisition module, flow calculation module, flow output module and power-off protection module. The software fully embodies the structured programming concept, adopts modular design method, and is written in C language. It has strong portability and can easily increase or decrease corresponding functions according to site requirements.
The flow chart of the instrument main program is shown in Figure 2. The software workflow adopts a loop flag driven method, that is, the main program runs in a large loop. When the corresponding flag bit of each module is set, the module is executed; otherwise, the module is skipped and the next module is queried whether to execute.
In the flow calculation module, since the IAPWS-IF97 density compensation formula is relatively complex and requires a large amount of calculation, the calculation of different parameters in the formula is designed as a subroutine, which is called by the main program according to different processes to improve the efficiency of program operation. After a large amount of data testing, when the temperature and pressure are known, it takes about 550,000 clock cycles to calculate the superheated steam density; if only the pressure or temperature is known, it takes about 560,000 clock cycles to calculate the saturated steam density. The system clock used in this system is 4 MHz, and it only takes 150 ms to complete a steam density calculation. Even if the time consumed by input signal sampling and display output is added, it can be controlled within 500 ms. Its computing speed can fully meet the design requirements. Since the MSP430F149 microcontroller has a large memory and program storage area, 32-bit floating point numbers are used in density calculation to ensure measurement accuracy.
[page]
3 Density compensation accuracy
The following is an evaluation of the accuracy of the instrument density compensation for two different situations: superheated water steam and saturated water steam. For superheated water steam with a temperature of 230℃ to 600℃ and a pressure of 0.1 MPa to 16 MPa, the result calculated by the instrument is compared with the corresponding density value in the density table every 20℃; for saturated water steam with a temperature of 150℃ to 350℃, the result calculated by the instrument is compared with the corresponding density value in the density table every 10℃. The relative error is defined as:
Where: ρ′i is the density value calculated by the instrument; ρi is the corresponding density value in the density table.
After calculation, the relative error distribution diagram is shown in Figure 3(a) and 3(b). In the figure, the horizontal axis is temperature and the vertical axis is the absolute value of relative error. Figure 3(a) is the relative error distribution diagram of saturated water vapor density. It can be seen from the figure that the maximum absolute value of the relative error is 0.1%, but it only accounts for a small part. Most errors are concentrated within 0.09%, and the average relative error is 0.05%. Figure 3(b) is the relative error distribution diagram of superheated water vapor density. From the relative error curves under different pressures in the figure, it can be seen that in the range of 350℃~470℃, the relative error increases rapidly with the increase of temperature; in the range of 470℃~590℃, the relative error does not change much with the increase of temperature, but increases with the increase of pressure; the maximum absolute value of the relative error is 0.17%, but it only occurs when the pressure is high. Most errors are concentrated within 0.1%, and the average relative error is 0.08%.
4 Conclusion
This paper uses a single-chip microcomputer to develop the IAPWS-IF97 water and steam physical property calculation software package, and realizes density compensation in the steam flow meter with a single-chip microcomputer as the core. By calculating the data within the commonly used industrial water vapor range, the average relative error of saturated steam density is less than 0.05%, and the average relative error of superheated steam density is less than 0.08%, which proves that it has a high compensation accuracy when the working conditions change over a wide range, and significantly improves the accuracy of measurement.
References:
[1]. MSP430 datasheet http://www.dzsc.com/datasheet/MSP430_490166.html.
[2]. MSP430F149 datasheet http://www.dzsc.com/datasheet/MSP430F149_4.html.
[3]. RISC datasheet http://www.dzsc.com/datasheet/RISC_1189725.html.
[4]. DS1302 datasheet http://www.dzsc.com/datasheet/DS1302_1055954.html.
Previous article:MCU controls wind-solar hybrid independent power supply system
Next article:A fast and reliable routing for wireless sensor networks
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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
- Gated Clock.rar
- Battery explosion problem
- What is the difference between a thermocouple and a RTD?
- EEWORLD University Hall----Live playback: Bidirectional CLLLC resonance, dual active bridge (DAB) reference design
- Online Upgrade Method of DSP Application Program Based on Serial Communication
- What is output impedance? What is impedance matching?
- [Unboxing and document display of the ACM32F070 capacitive touch development board]
- Importance of CMTI parameter for isolation driver selection
- Gold - Sand - Wafers - Artwork - Qorvo Semiconductor
- Programmable sensor-specific detection MCU CS88F313