Design of temperature difference crude oil flow sensor based on MSP430F2132

Publisher:温暖阳光Latest update time:2014-11-03 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
    With the improvement of people's living standards, the use of cars is becoming more and more common, and the demand for energy is increasing. Oil is one of the important energy sources. The output of oil produced by oil wells has also become a key issue for oil field leaders. The oil production of oil wells can be expressed by flow rate, and the process of obtaining oil well flow rate is called oil well metering. Accurate and timely measurement of oil wells not only has important guiding significance for oil field managers to formulate oil well production plans and improve oil well production efficiency, but also provides a certain reference for market managers to regulate the price of refined oil. The traditional glass tube liquid production method not only has high labor intensity, but also has large measurement errors, poor real-time performance, and low efficiency. It is far from meeting the requirements of real-time, reliability, and accuracy of oil well metering. With the development of science and technology, a variety of crude oil flow sensors have appeared on the market, such as Coriolis, ultrasonic, turbine, float, vortex, volumetric, nuclear, etc. However, due to the complex physical properties of crude oil, the parameters such as viscosity, specific gravity, and water content are different, resulting in the diversity, specificity, and price difference of flow measurement sensors today. Most of the products currently on the market have various deficiencies. For example, the Coriolis mass flow sensor is the flow sensor with the highest flow measurement accuracy, but it is expensive and not suitable for promotion; the ultrasonic sensor is complicated to install and difficult to maintain; the vortex flow sensor is limited in applicable environment and has low measurement accuracy. Therefore, crude oil flow sensors that are universal in various environments, simple in structure, low in cost and high in reliability will be favored.

1 Design Principle
    This system designs a temperature difference flow sensor based on the basic laws of thermodynamics. Its principle is based on the thermodynamic endothermic law, that is:
    Q=c*m*(t2-t1)
    Q is the heat provided by the heating device, c and m are the specific heat capacity and mass of the heated material, respectively, and t1 and t2 are the temperatures before and after the material is heated. For a specific substance, c is a fixed value. If Q is constant, the larger m is, the smaller "t2-t1". The oil-water ratio of each well is almost unchanged over a period of time. The specific heat capacity c of crude oil with a certain oil-water ratio can be regarded as a fixed value. According to this law
, a constant power heating device is designed to provide a constant amount of heat Q within a certain period of time. After the crude oil enters the heating device, constant power heating begins. The temperature t1 before heating and the temperature t2 after heating are measured respectively, and the temperature change "t2-t1" before and after heating can be calculated. Since the heat Q supplied by the device is also fixed, the faster the flow rate of the crude oil, the larger the m, and the smaller the temperature difference "t2-t1" of the crude oil at the outlet of the measuring device relative to the inlet. On the contrary, the greater the temperature difference.
    Based on this, a test device is established, a temperature difference flow sensor is designed, and a high-precision volumetric flow meter is used to perform the following calibration test to obtain the specific relationship between the temperature difference and the flow rate: a certain flow rate of the crude oil is fixed, and the initial temperature is measured at the inlet of the heating device by the temperature difference flow sensor. After heating by a constant power heating rod, the temperature after heating is measured at the outlet, and the flow rate under the temperature difference is measured by the volumetric flow meter; the flow rate is changed and the above test operation is repeated. In this way, the temperature difference between the outlet and the inlet corresponding to different flow rates can be obtained. Therefore, Matlab can be used to fit the temperature difference-flow curve. For the oil wells with this oil-water ratio, the temperature differential flow sensor only needs to measure the temperature before and after the heating device, and the liquid production can be calculated according to the fitting formula. The temperature difference-flow relationship of different oil-water ratios is fitted through experiments, and the liquid production of oil wells with various oil-water ratios can be calculated. Therefore, for each oil well, the temperature differential flow sensor only needs to measure the temperature before and after the heating device, and the liquid production can be calculated according to the fitted temperature difference-flow relationship.
    During on-site installation, the crude oil is heated by the heat generated by the constant power heating rod powered by 220V AC. In order to ensure that the heating device can provide constant power heat, a voltage stabilizer is used in front of the heating device to keep the voltage at both ends of the heating rod constant at 220V.

2 System Hardware Design
2.1 Overall Scheme Design
    The overall structure diagram of the temperature differential flow sensor is shown in Figure 1.

a.jpg


    The temperature differential flow sensor is mainly composed of a single-chip microcomputer module, a parameter acquisition module, a memory module, a clock module, a heating control module, a wireless module and a power module.
2.2 Single-chip microcomputer module design
    The single-chip microcomputer module uses TI's single-chip microcomputer MSP430F2132 as a microprocessor. It is a 16-bit ultra-low power single-chip microcomputer with a high processing speed. Its operating voltage is 1.8-3.6V. When running under the clock condition of 1MHz, the chip current is about 200-400μA, and the minimum power consumption in the clock shutdown mode is only 0.1μA; the startup time of 6μs can make the startup faster; it integrates a watchdog, a low-power real-time clock (RTC), and multiple serial input interfaces, including UART, IIC bus and SPI bus; it has 5 power saving modes and can be awakened by RTC and external interrupts. Its rich internal resources not only reduce the area of ​​the circuit board, but also reduce the cost of the sensor. The MSP430F2132 interface circuit is shown in Figure 2.

b.jpg


    The single-chip microcomputer module controls the reading and storage of the data of the parameter acquisition module; controls the start and stop of wireless communication, sends data to the wireless module through the serial port, and receives data from the wireless module; controls the start and stop of the heating module; reads and sets the clock module through the I2C bus. The standard JTAG simulation interface provided by TI can be used to realize the simulation debugging of the program.
2.3 Parameter acquisition module
    The temperature acquisition module mainly uses the temperature sensor to collect the inlet temperature and outlet temperature of the heating device. The digital temperature sensor DS18B20 produced by DALLAS is selected to realize temperature acquisition. Its interface for communication with the single-chip microcomputer is simple, only one line is needed to connect, and the measurement accuracy is high. The inlet temperature acquisition circuit is shown in Figure 3. The temperature measurement circuit at the outlet is the same as the inlet circuit. The three outlet temperature sensors and the single-chip microcomputer interfaces are TEM01, TEMO2 and TEMO3 respectively.

c.jpg


2.4 Design of heating control module
    The heating device is only turned on when the flow is measured and is turned off at other times. The heating control module is used to start and stop the heating device. The single chip microcomputer controls the high and low levels of the control signal PCT to control the MOSP tube on and off, thereby realizing the on and off of the alternating current of the heating device. The circuit diagram is shown in Figure 4. [page]

d.jpg


    In order to prevent the interference signal of 220V AC strong current electrical appliances from affecting the control signal of the heating device, a photoelectric coupler is used to isolate weak current from strong current. The load capacity of the photoelectric coupler is limited, and a thyristor can be used to control the on and off of the AC load.
2.5 Design of other modules The
    circuit of the real-time clock module and the memory module is shown in Figure 5.

e.jpg


    The real-time clock module and memory module use the highly integrated FM3130, which integrates 64kb ferroelectric non-volatile RAM and real-time clock in one package, sharing a common interface, and can access the real-time clock and memory through independent two-wire devices. The memory is in bytes, with a total of 8192 addresses. Unlike other non-volatile memory technologies, the memory in FM3130 provides an effective unlimited number of writes. RTC is a timing device that is permanently powered by a battery or capacitor and can be calibrated by software to provide higher accuracy. It can also provide various types of alarm interrupt functions such as every second, every minute, every hour or every day. FM3130 communicates with the microcontroller through the I2C bus.
    When there is a DC power supply on the circuit board, the clock unit is powered by the power supply on the circuit board. When the circuit board power supply cannot be supplied, it is powered by the backup battery BT-bak. Since the interrupt pin of FM3130 is open-drain and the interrupt signal is valid at a low level, a pull-up is added to the interrupt pin to make it at a high level when there is no interrupt signal.
    The wireless transmission uses the ultra-low power consumption micro-power wireless data transmission module APC240, which is a new generation of multi-channel embedded wireless data transmission module. It can set multiple channels with a step of 1kHz and a maximum transmission power of 10mW. It uses efficient cyclic interleaving error correction and detection coding, and its coding gain is as high as nearly 3dBm. The error correction capability and coding efficiency have reached the leading level in the industry, and truly realize transparent connection. The wireless module interface circuit is shown in Figure 6.

f.jpg



3. Software Design
    The main program flow chart is shown in Figure 7.

g.jpg


    Initialization includes I/O initialization, serial port initialization, interrupt initialization, FM3130 initialization and watchdog initialization. Complete the initial state setting of each port of MSP430F2132, the baud rate of serial port communication, the interrupt time setting of FM3130 and the initial storage address search of the memory.
    In the main program, set the FM3130 to interrupt at the hour every hour, and set the working mark to 3 after the interruption. After the main program detects that the working mark is 3, it starts the heating device to heat, reads the time of the real-time clock, and sets the working mark to 1. After detecting that the working mark is set to 1, measure the temperature at the inlet and outlet of the heating device. And turn on the timer of MSP430F2132, interrupt for 10s at a time, and collect flow parameters every 10s. After each collection is completed, MSP430F2132 calculates the flow according to the fitting formula. Finally, the measurement results and the initial time of this measurement period are stored in the memory of FM3130, and transmitted to the remote measurement and control terminal of each oil field through the wireless module, and the measurement results are transmitted to the data management center using other devices. After measuring the parameters for 10 minutes, turn off the heating device, set the working mark to 4, wait for the next real-time clock hourly interrupt, and start the measurement. The wireless module can also receive command information sent by the remote measurement and control terminal. After receiving the interrupt, set the working mark to 2. The single-chip microcomputer performs different operations according to different commands. The wireless module receiving interrupt flow chart is shown in Figure 8.

4 Measurement data and analysis
    The temperature differential flow sensor was installed on an oil well of an oil production team in Daqing Oilfield for trial use. The comparison of the temperature differential flow meter measurement data and the volumetric flow meter measurement data is shown in Table 1.

h.jpg


    Among them, S is the standard flow measured by the volumetric flowmeter, C is the flow measured by the temperature differential flow sensor, and d is the measurement error. It can be seen from Table 1 that the measurement error of the temperature differential flow sensor is within 10%, which can meet the measurement requirements of the oil field. Practice has proved that the temperature differential flow sensor has low cost and high accuracy, realizes the automatic measurement of oil wells, and can be promoted for use.

Reference address:Design of temperature difference crude oil flow sensor based on MSP430F2132

Previous article:Design of a reflective infrared heart rate detector
Next article:Development and application of remote download technology based on CAN

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号