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.
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]
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.
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.
[page]
2.4 Data display circuit designThe 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.
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.
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.
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
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- How to connect the reed switch sensor to the microcontroller
- C2000 LaunchPad's SIC serial port sends data
- ssh network login
- What can damage the dp83848 chip? The reset pin is always low and the chip cannot start.
- The 200-meter line signal has irregular jumps after the op amp output
- 【GD32F307E-START】+ Completed driving LCD19264 display
- ESP32 port adds support for ESP32-S3
- TMS320C6000 Pipeline Overview
- Will the GaN RF market become more and more popular?
- The embedded operating system I know - to use it or not, that is indeed a question