Research on downhole pressure measurement technology based on PIC16F877 single chip microcomputer

Publisher:WhisperingGlowLatest update time:2012-06-19 Source: 电子设计工程 Keywords:PIC16F877 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
At present, the main electronic downhole pressure measurement system used in oil wells in China is the electronic pressure sensor, which has drift problems and low reliability due to the long-term operation of the electronic pressure sensor in a high temperature environment. At the same time, most of these instruments store the collected data in a memory, lacking the requirement for real-time measurement. The downhole pressure acquisition system introduced in this article is a new type of pressure measurement system, which mainly uses inert gas as the pressure transmission medium to complete the measurement of the wellhead gas pressure on the ground, and then calculates the pressure at the downhole pressure measuring point by the size of the wellhead pressure. Its main feature is that all measurements are carried out on the ground, avoiding the influence of the complex downhole environment on the measurement results, and also meeting the real-time requirements of the system.

1 Working principle of downhole pressure measurement system
The basic principle of the downhole pressure measurement system is Pascal's theorem. The entire casing equipment is lowered to the downhole pressure measuring point during pressure measurement. The ground can charge and discharge gas into the pressure transmission tube through a pressure pump. In order to maintain the gas-liquid balance of the well fluid and the high-pressure gas, the gas in the pressure transmission tube should be replenished regularly. According to Pascal's law, the pressure of the gas in the pressure transmission tube is equal to the pressure of the well fluid. The signal is collected into PIC16F877, and the pressure value in the well is calculated according to the corresponding algorithm in PIC16F877, and stored, displayed in real time and data replayed.

2 Hardware circuit design
The pressure detection system is mainly composed of the following parts, namely data acquisition circuit, data storage circuit, data display and data playback. The data acquisition circuit mainly uses PIC16F 877 microcontroller to collect pressure data in real time, and the storage circuit uses FLASH storage chip; the data display uses an intelligent display; the data playback uses RS-232 serial interface to play back the data stored in the flash chip to the computer. Figure 1 is the design block diagram of the pressure detection hardware circuit.

a.JPG


2.1 Selection of pressure sensor
Pressure measurement has always been restricted by pressure sensor technology. The accuracy of its measurement depends on the technical indicators of the pressure sensor. According to the design requirements of the pressure detection system, it was finally decided to use the HM10 high-precision piezoresistive pressure sensor produced by HeLM Company of Germany. This sensor uses the most sturdy and reliable pressure sensitive element, which is particularly suitable for field pressure measurement. The main performance indicators of HM10 are as follows:
1) Working temperature: -40~85℃
2) Shock: 100 g, 11 ms
3) Vibration: 10 gRMS. No change under 20~2 000 Hz conditions
4) Pressure range: -0.1 MPa~0~10 kPa…70 MPa[page]

2.2 Pressure acquisition circuit design
The data acquisition of the pressure detection system is mainly completed by the single-chip microcomputer PIC16F877. One of the requirements in the design of the pressure detection system is that the accuracy must reach 0.1% FS and the minimum acquisition interval is 1 s. In view of these two requirements, the high-precision multi-channel 24-bit chip ADS1226 is selected in the data acquisition circuit design, which has a data acquisition rate of 100SPS and meets the minimum data acquisition interval of 1 s.

b.JPG


Figure 2 is a connection diagram of the pressure acquisition circuit, where P3.0, P3.1, P3.2, and P3.3 are the I/O interfaces of the microcontroller, which are connected to the START, SCLK, DOUT, and MUX pins of ADS1226 respectively. P3.0 controls the start signal of ADS1226. When P3.0 outputs a high level, ADS1226 starts digital-to-analog conversion. When P3.2 inputs a low level, the A/D conversion is completed, and the converted data signal is transmitted to the PIC16F877 microcontroller along with SCLK. Since the pressure sensor HM10 outputs a current signal of 4 to 20 mA, and ADS1226 is a voltage acquisition chip, a current-to-voltage chip model ISO-A4-P3-04 is selected here. ISO-A4-P3-04 converts the current signal of 4 to 20 mA into a voltage signal of 0 to 5 V.
2.3 Data storage circuit design
During the downhole data measurement, there may be a large amount of raw data, which is a valuable information for the evaluation of the oil well status. Therefore, the data storage should be considered when designing the measurement system. This system uses a large-capacity Flash memory. The device adopts Samsung's CMOS floating gate technology and NAND storage structure, with a storage capacity of 64M×8 bits. In addition, there is a 2048k×8-bit free storage area. The typical time required for a write operation of 528 bytes per page is 200 μs, and the typical time required for an erase operation of 16 k bytes is only 2 ms. The data readout speed in each page is also very fast, with an average of only 50 ns per byte, which is equivalent to general SRAM. The 8-bit I/O port uses the method of address, data and command multiplexing. This can not only reduce the number of pins, but also make the interface circuit simple. The on-chip write controller can automatically perform write operations and erase functions, including necessary pulse generation, internal verification, etc., without the need for external microcontrollers, simplifying the difficulty of device programming control. Figure 3 shows the interface connection diagram between the MCU PIC16F877 and the Flash memory. The P5.0~P5.7 pins of the MCU are connected to the 8-bit I/O port of the Flash.

c.JPG

[page]

2.4 Data display circuit design
The pressure detection system uses a color intelligent display LCD screen. This series of displays uses an integrated CPU, built-in first-level Chinese character library (second-level character library is optional), and uses a standard instruction set to receive control commands and data through the RS232C interface or the printer parallel port. At the same time, in order to increase the communication speed, a 256-byte input buffer is set in the display. Before sending data, the DTR (serial port name on the LCD) signal should be checked first. If DTR is high (TTL), it means that the buffer is full and data should be sent after the DTR signal becomes low (TTL). That is, data is sent when DTR is low (TTL), and data transmission is stopped when DTR is high (TTL). If the amount of data in each group is less than 256 bytes, and there is enough interval between each group, it can be sent continuously without judging the DTR bit signal.
The pressure detection system uses a serial port when the processor communicates with the LCD screen. The P4.6 pin of the PIC16F877 is used as a general I/O port to directly connect to the serial interface of the LCD screen. The standard RS-232 only needs three pins: send, receive and ground (GND) when communicating, so the connection between the LCD display and the processor is very simple. However, since the maximum level that the PIC16F877 pin can withstand is 5.5 V, and the level of the serial interface is TTL level, a level conversion chip MAX3232 must be added when connecting these two devices. The specific connection method is shown in Figure 4. In the figure, YJ-RXD is the serial receiving interface of the LCD screen, P4.6 is the sending port of the PIC16F877, and MAX3232 plays a role in voltage conversion. Data playback mainly refers to playing back the data stored in the FLASH storage chip to the PC. The PC receives data using the serial port RS-232, which is connected through MAX3232, as shown in Figure 4, and will not be described here.

d.JPG



3 Software Design
The software design of this system is mainly the software design of the single-chip microcomputer system. The core CPU structure of PIC16F877 is designed according to the purpose of reduced instruction set and high transparent instructions. Therefore, the single-chip microcomputer development adopts an integrated development environment designed specifically for the PIC16F877 series of single-chip microcomputers, and programming adopts C language. PIC16F877 is used as the main CPU. PIC16F877 is mainly responsible for the collection of pressure data, system startup, collection data processing, data display and host computer data playback in the system. The main program flow chart of its software is shown in Figure 5.

e.JPG


In the whole pressure acquisition system, the PIC16F877 microcontroller is used to control the start of A/D conversion. The microcontroller collects 12 data in total, removes the maximum and minimum data, and takes the average value as a wellhead pressure value. According to the corresponding algorithm, the pressure at the measuring point and the oil layer pressure are calculated by the inlet pressure value, and then the three data are stored and displayed.

4 Conclusion
The pressure detection system designed in this paper has passed the test of the field experiment. The system is stable and reliable, and a large amount of data is collected. The accuracy of the measured pressure value is verified by changing the test conditions. Due to the long-term real-time monitoring of downhole pressure, the Flash memory can store 10 days of data, so the system needs to revisit the data after 10 days of continuous work and store it on the computer for subsequent reference. The downhole pressure detection system realizes pressure measurement by measuring the wellhead pressure to infer the bottomhole pressure, which avoids the complex environment downhole, thereby reducing the impact of the environment on the measurement. At the same time, the LCD screen is used to display the measured data in real time, meeting the requirements of real-time measurement.

Keywords:PIC16F877 Reference address:Research on downhole pressure measurement technology based on PIC16F877 single chip microcomputer

Previous article:Analytical solution of using PIC16F73 single chip microcomputer to generate SPWM wave to control UPS power inverter system
Next article:PIC microcontroller read/modify/write problems and solutions

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号