Design of Remote Terminal for Oil Well Data Collection Based on VxWorks

Publisher:TurquoiseLatest update time:2011-10-08 Keywords:RTU  CDMA  S3C4480X  MSP430  VxWorks Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
At present, the main task of oil production plants is to produce oil by pumping units. The distribution points of pumping units are wide and wide. They work in harsh environments and are easily damaged and destroyed by external forces. Frequent inspections are required, and the work intensity of personnel is high. At present, due to the lack of remote means, the production status of oil wells is in a post-processing state. When oil wells are abnormal or stolen, they cannot be handled in time, resulting in a large number of unknown losses. The remote terminal (RTU) based on the CD-MA communication channel makes full use of the existing computer network. Through on-site monitoring and data collection and transmission, it can meet the needs of remote monitoring of oil wells. The remote terminal can perform real-time and fully automatic online reading of parameters such as load, displacement, tubing back pressure, temperature, stroke frequency, working current, voltage, etc. during the operation of the oil well; when an abnormal situation occurs on site, the monitoring center can automatically issue relevant alarm information, and the dispatching room can send relevant personnel to handle the scene according to the alarm information. The collection of relevant data has been transformed from the traditional manual operation mode to the computer automatic operation mode, without manual intervention, thus saving manpower and improving work efficiency.


1 Monitoring system architecture and remote terminal functions
The monitoring system (as shown in Figure 1) is mainly composed of a monitoring center and a remote terminal. The remote terminal is responsible for collecting and sending data from the pumping unit. The monitoring center centrally monitors the data from each remote terminal. The remote terminal accesses the Internet through the CDMA channel to establish a connection with the monitoring center server. The monitoring center is the command center of the system. It can send various commands and information to the remote terminal on site, further process the received data, and send necessary information to various departments through the network. The
remote terminal monitors the three-phase voltage value, three-phase current value, pumping unit load, wellhead oil pipe back pressure, wellhead oil pipe temperature, etc.


2 Overall structural design of remote terminal
As shown in Figure 2, it is a block diagram of the RTU system architecture. According to the application requirements, the system is designed as a single-chip microcomputer plus an embedded processor. The MSP430F149 single-chip microcomputer is an ultra-low power 16-bit RISC mixed signal processor (Mixed Signal Processor) launched by Texas Instruments (TI). The processor has rich hardware resources, high processing speed and low power consumption. It has 8-way 12b ADC and dual UART, making it very suitable as the data acquisition processor of the terminal. $3C44. BOX is a 32-bit embedded processor with ARM7 as the core launched by Samsung. It has rich resources and low power consumption and low cost, which can meet the application needs of the terminal. The MSP430 single-chip microcomputer mainly completes the real-time data collection in this system. The data to be collected are: three-phase voltage and current data of the oil pump collected by the power sensor, the load of the oil pump arm, the temperature sensor analog signal, and the pressure and infrared sensor signals. The single-chip microcomputer sends the collected data to S3C44BOX through UART in the required data format. In this system, S3C44BOX performs certain data processing and completes wireless network connection and data transmission and reception by controlling the CDMA module. After starting up, S3c44BOX controls the CDMA module to first establish a data link with the monitoring center. After receiving the link information, the monitoring center can obtain the operation information of the oil well and receive the data information collected by the single-chip microcomputer at any time. When S3C44BOX receives the information of the single-chip microcomputer, it sends the data to the monitoring center through the CDMA network, or transmits the information sent by the monitoring center to the single-chip microcomputer. There are many tasks implemented on S3C44BOX and involve the PPP (Point to Point) protocol stack. In order to meet the real-time performance of the system, this terminal uses the vlxWorks embedded real-time operating system. The tasks to be completed by S3C44BOX are: (1) Receive data frames from MSP430; send control instructions to MSP430. (2) Process the data sent by MSP430 and use the load sensor data to calculate the rotation period of the oil production arm and extract the pumping unit indicator diagram. (3) Connect to the CDMA network. S3C44BOX sends AT commands to the CDMA module to control it to dial up PPP and establish an Internet connection. (4) After the PPP connection is established, the remote terminal and the monitoring center exchange data. (5) Monitor the power supply of the system. If a power failure occurs in the remote terminal, before the system is completely shut down (maintained by a large capacitor so that the system will not shut down immediately), the system will send a power failure alarm to the main station. (6) Processing of the system watchdog. Including software watchdog and hardware watchdog to ensure the reliability of the system. [page]







(7) Network support. With support for the local area network, it becomes convenient and fast to download the VxWorks application image to the FLASH memory during debugging, which facilitates the upgrade of the system software.
The remote terminal uses AnyDATA's DTGS-800 as the wireless communication module. The main features of this module are: using Qualcomm's 6050 chip; the frequency band is 800 MHz, supporting the CDMA2000 1XRTT standard; built-in TCP/IP protocol stack, etc. DTGS-800 is connected to S3C44BOX through U_ART, and S3C44BOX controls the CDMA module by sending AT commands.


3 Software Design of Remote Terminal
The software of the remote terminal is divided into MSP430 single-chip microcomputer program design and S3C44BOX program design.
3.1 MSP430 single-chip microcomputer program design
The MSP430 single-chip microcomputer is responsible for multiple data collection and data packaging and sending. The MSP430 single-chip microcomputer has dual UARTs. uART0 is used to transmit data to the upper computer ARM and receive instructions given by ARM; UARTl is connected to the power sensor through the RS 485 protocol. The digital output terminals TELSIG1 and TELSIG2 of the two infrared sensors are connected to the P5.0 and P5.1 general I/O ports of the MSP430 respectively. The analog signals output by the temperature sensor, pressure sensor and load sensor are connected to the A0, A1 and A4 ports of the single-chip microcomputer respectively after passing through their respective signal conditioning circuits. The analog-to-digital conversion of temperature, pressure and load signals is completed through the 12 b ADC built into the MSP430F149 single-chip microcomputer. The analog-to-digital conversion is sampled in the form of timed interrupts, and the sampling frequency of the original data is 50 kHz. The design idea of ​​the software adopts a fast process loop, calling each process based on the process flag as the judgment condition and executing related control. As shown in Figure 3, the count value of a loop counter is used to set the flags of all processes. In the timer interrupt service program with a period of 10 ms, the counter value is increased by 1. Each time TimeFlag() is executed, the counter value is compared with the count value corresponding to the scheduled execution time of each process to obtain the flag status of the process, so that each process can be executed in an orderly manner.

3.2 S3C44BOX Programming
The programming of S3C4480x involves the VxWorks operating system: modification of BSP (Board Support Package), tailoring of the operating system, and design of the application program.
BSP is a layer between the embedded system hardware and the operating system. It is part of the operating system and its main purpose is to support the operating system so that it can run better on the hardware. Most of the BSP programming process is to modify a certain BSP template. According to the hardware structure and software application requirements of this system, the modification of BSP needs to achieve the following goals:
(1) Implement operating system support for TFFS (True FLASH File System) file system. TFFS is a file system compatible with Vx-works. It provides a unified block device interface for a wide variety of FLASH storage devices. With TFFS, the reading and writing of FLASH storage devices by applications are just like their operations on disk devices with MS-DOS file system. After the file system is established, the remote terminal operation log, system configuration parameters, system calibration parameters, CDMA user name/password, etc. can be saved in the form of files.
(2) Implement support for the RTL8019 Ethernet control chip; implement access to the remote terminal's file system via FTP, so that the system application can be upgraded online and log files can be downloaded; implement Telnet, and the configuration parameters of the remote terminal can be modified through Telnet to maintain the remote terminal.
Figure 4 shows the main program flow of the VxWorks application. When Vx-Works completes startup, it enters the application. The main program of the application completes various initializations and the creation of each task, as well as the creation of a task-level watchdog.

System initialization includes initializing system parameters, adding CDMA device drivers to the device driver list using the iosDrvInstall() function, adding CDMA devices to the I/O system device list using iosDevAdd(), and hardware watchdog initialization. System parameter initialization includes log file checking, system configuration parameter loading, CDMA user name/password verification, etc. If there is no corresponding parameter file on the file system, create a file according to the default parameters. The hardware watchdog chip uses X5045. Initialize and set the reset time of the watchdog and start it. The reset time of the X5045 watchdog chip can only reach 1.4 s at most, and the VxWorks system startup time exceeds 1.4 s. In order to prevent the reset signal generated by X5045 from interrupting the startup of VxWorks, X5045 must be disabled before VxWorks starts, which requires modifying the BSP. Add code to disable X5045 reset at the beginning of the romStart() function in the bootIn-it.c file. [page]

SysclkC20nnect() maps the function ticklO ms() to the system clock interrupt of Vx-Works. The system timer interrupt cycle is set to 10 ms. In the tickloms() function, it is determined whether the software watchdog of each task has timed out. If it has timed out, the program enters an infinite loop and prints information about which task has an error, triggering a hardware watchdog reset.
CDMAconnectTask() establishes a PPP connection by sending AT commands to the CDMA module.
timeTask() completes the setting and reading of the CPU real-time clock module.
The CDMATask() process establishes a socket connection with the master station.
The commTask() process implements the data packet exchange between the remote terminal and the monitoring center, packages the data frames to be sent to the master station, reads the CDMA device data into the buffer, and parses the master station command. The
commTask430() process completes the data exchange between ARM and MSP430.
The dataTask() process processes the data uploaded from the MSP430, including calculating the rotation period of the oil drilling machine arm and extracting the oil drilling machine's indicator diagram through load data.
warnTask() implements real-time system alarms. The types of alarms include: load out of bounds, pressure out of bounds, temperature out of bounds, three-phase voltage out of bounds, three-phase current out of bounds, and infrared triggering. If the number of out-of-bounds exceeds the value set by the parameter during the detection, it is considered that an alarm is generated.
pwrWarnTask() performs alarm processing for power failure and incoming calls.
3.3 Network connection establishment of CDMA module
The terminal establishes a PPP connection to access the Internet through the CDMA module. PPP provides a standard method for transmitting multi-protocol data packets on point-to-point connections. PPP was originally designed to provide an encapsulation protocol for IP traffic transmission between two peer nodes. In the TCP-IP protocol suite, it is a data link layer protocol (the second layer in the OSI model) used for synchronous modulation connections, replacing the original non-standard second layer protocol, namely SLIP. PPP carries the link control protocol (LCP) and the network control protocol (NCP). In order to use the PPP protocol stack provided by VxWorks, the PPP component needs to be added to VxWorks, as shown in Figure 5.

VxWorks provides a structure of type PPP_OPTIONS to describe PPP parameters. You can configure PPP parameters by filling in the PPP_OPTIONS structure and passing the structure address to the pppInit() function. After successful initialization, PPP connects itself to the TCP/IP stack of Vxworks at the link layer. After the PPP dial-up connection is successfully established, all VxWorks IP network devices are available. At this time: the PPP connection is transparent to the user.
S3C44BOX uses AT commands to control the DTGS-800 CDMA module. AT commands are a set of commands invented by Hayes to control modems. They have become a de facto standard and are adopted by all modem manufacturers. Each command begins with the letter "AT". There are certain differences in AT commands for different models of modems. S3C44BOX sends AT commands to establish a communication link. The AT commands required for dialing are:
① Initiate a call ATD
is the target number. This command is performed before PPP is established. If CONNECT is returned, the data call is successfully established.
② Control the echo ATEx
control character to be echoed, if x=0, it will not be echoed; if x=1, it will be echoed.
The steps to establish a PPP connection are shown in Figure 6. The CDMA_Init() function fills in the PPP_OPTIONS structure and initializes the serial port used by the CDMA module. The dialed number is "#777" and the username and password are both "CARD". Use the pppInit() function provided by VxWorks to complete the initialization of PPP. The return value of pppInit() cannot indicate the status of the PPP connection, it can only return whether the connection is successfully initialized. To confirm the success of the connection establishment, use pppInfoGet(). When the status of IPCP (Internet Protocol Control Protocol) is "OPENED", it means that the PPP connection is successfully established.

4 Conclusion
The design and implementation of a data acquisition remote terminal based on VxWorks is introduced from the aspects of hardware and software. The core architecture of this remote terminal is not only suitable for remote data transmission and monitoring of oil wells, but also can be well applied in other fields, such as power monitoring, remote meter reading, industrial control, meteorological data acquisition, water ripple monitoring, water conservancy monitoring, earthquake detection, traffic information release, etc. It has strong engineering application value, especially suitable for the development of applications and application systems in the field of M2M (Machine to Machine). When it is necessary to make specific applications, it only needs to select the corresponding sensors according to the specific situation and make certain modifications to the hardware and software, so it has a wide range of application prospects.

Keywords:RTU  CDMA  S3C4480X  MSP430  VxWorks Reference address:Design of Remote Terminal for Oil Well Data Collection Based on VxWorks

Previous article:Design of phase difference meter based on FPGA average value principle
Next article:Research on the speed measurement method of high-speed industrial sewing machine

Recommended ReadingLatest update time:2024-11-17 00:03

MSP430 timer interrupt usage summary
I have been studying the timer of MSP430 for the past two days and found it quite troublesome. Here I record my learning experience: There is only TIMER A interrupt on MSP430G2211, so here we discuss TIMER A, TIMER B should be similar to TIMER A. For each timer, it has two interrupts, TIMERA0_VECTOR and TIMERA1_VECTOR.
[Microcontroller]
MSP430 Keyboard Program
// This sample program uses interrupt mode to get the keyboard key value and store it in the queue keybuff // This sample program does not display, // Pressing a key on the keyboard triggers the interrupt service routine of port P1, gets the key value of the keyboard, and saves it to the key value queue. // In othe
[Microcontroller]
Simple transplantation of printf function of msp430
I am working on a project based on TCS34725 RGB color sensor. The main control I use is MSP430. When debugging, I use 485 bus to send to the upper computer (computer or upper host computer). At first, I used the serial port sending function to send directly, but it was super inconvenient to display a lot of data, such
[Microcontroller]
Design of Audio Spectrum Analyzer Using MSP430 Processor
1 Introduction In actual radio and television transmission work, the entry test of new transmitters and the daily indicator test of transmitters all involve audio testing. The audio spectrum analyzer designed in this article measures the spectrum of audio signals from the perspective of signal source, thereby determin
[Test Measurement]
Design of Audio Spectrum Analyzer Using MSP430 Processor
Vehicle temperature control system based on GSM and CDMA
This paper introduces a remote intelligent vehicle temperature control system based on GSM and CDMA networks with a single-chip microcomputer as the core . When the temperature in a car parked under the scorching sun is too high or the light is too strong, this system will automatically send a prompt mes
[Microcontroller]
Vehicle temperature control system based on GSM and CDMA
Detailed explanation of MSP430FW427 non-magnetic water meter design
  1. Introduction to MSP430FW42x MCU   The MSP430FW42x series of microcontrollers is the latest dedicated MCU chip developed by TI for electronic flow and rotational motion detection. It perfectly combines ultra-low power MCU, rotation scanning interface (SCAN IF) and LCD display LCD driver module. The ultra-low pow
[Microcontroller]
Detailed explanation of MSP430FW427 non-magnetic water meter design
Analysis of the application of MSP430 microcontroller in flow detection
For traditional flow detection systems, most of them use electromagnetic sensors, which are easily affected by external magnetic fields and lead to incorrect flow measurement. MSP430 microcontroller, as an ultra-low power 16-bit mixed signal processor, has been increasingly widely used in flow detection. Therefore, th
[Power Management]
Analysis of the application of MSP430 microcontroller in flow detection
How to use microcontroller to implement caller ID decoding
   1. Introduction   With the expansion of urban water supply and urban pipe network, the original telemetry system of Xiamen Water Company is difficult to adapt to the production scheduling needs. A set of reliable and fast dispatching telemetry system is required. Taking into account the development status of domes
[Home Electronics]
Latest Test Measurement 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号