Developing a LWD Embedded Processing Unit Based on CompactRIO

  Read in   |   Print Print

"Easy-to-use NI LabVIEW greatly helped developers focus on the development of a mud pulse processing algorithm and depth measurement algorithm."

- Di'nan Jiang, China Oilfield Services Limited

The Challenge:
Developing an embedded processing unit that runs a powerful and reliable signal processing algorithm filtering out ambient noise to recover the original signal from the down-hole Logging While Drilling (LWD) instruments with limited resources and time.

The Solution:
Using NI LabVIEW software and CompactRIO hardware to develop a LWD embedded processing unit (EPU) that acquires and processes signals from the depth encoder and the mud pressure, in-slip, hook-load, and pump stroke sensors installed in the rig site.

Di'nan Jiang - China Oilfield Services Limited
Songwei Zhang - China Oilfield Services Limited
Huatao Lu - China Oilfield Services Limited

For years, down hole data transfer has been the bottleneck of LWD technology development. Mud pulse telemetry is one of the most mature data transfer techniques used today. The LWD surface system has two major tasks: to acquire and process the mud pulse signal from the mud pressure sensor before decoding to the raw data, and to measure the hole and bit depth in real time by counting the encoder pulses with the hook-load or in-slip sensor. We developed an LWD EPU based on CompactRIO to meet our data acquisition and processing requirements. CompactRIO has the powerful data processing features, real-time performance, rapid development, and strong reliability needed to free engineers up to focus on the mud pulse processing and depth measuring algorithms. The LWD EPU completed the surface loop,, down-hole loop, and actual drilling experiments, accumulating hundreds of hours running time, with no faults or errors.


LWD technology is key in oil exploration and development, but is monopolized by a few international companies. In the domestic (China) LWD and related direction drilling service markets, particularly in the offshore market, foreign technology dominates. In recent years, the foreign drilling equipments purchased by domestic companies add up to hundreds of millions of RMB every year. A set of LWD instruments, including gammas, resistivity, neutron density, and measurement while drilling (MWD), costs more than 40 million RMB. Purchasing and maintenance of the equipment is expensive and the technology and the market are highly restricted. This situation hampers oil and gas exploration in China, especially offshore exploration. It also restricts the development of related companies. With further exploration and development of deepwater oil resources needed, this problem is becoming increasingly serious.

If the research and development project can be successfully deployed, China will have its own independent intellectual property (IP) LWD technologies and equipments. Compared with importing equipment, this greatly reduces cost and provides strong support for the development and exploration of offshore, especially deepwater oil and gas resources, and the growth of domestic oil service companies.

Positive Mud Pulse Encoding Technology

The positive pulse signal is generated by the lift valve partially blocking the mud flow in the cylinder, which forces the pressure to rise. When the lift valve returns to its original position, the pressure returns to its original state, as shown in Figure 1.

Figure 1. Positive Pulse Signal Generator

The positive mud pulse encoding is the method that encodes data by adjusting the interval between mud pulses. The raw data is encoded in the pulse intervals and, different pulse intervals contain different data, as shown in Figure 2.

Figure 2. Positive Pulse Encoding Based on Pulse Interval

Data = (Interval - MIN_TIME) / BIT_TIME

The formula above indicates that the bigger the encoded data, the longer the interval, and vice versa.

In an actual physical system, we need to define some parameters. Minimal interval (MIN_TIME) corresponds to the encoded data of value 0. The pressure signal down hole is different from the pressure signal on the surface due to noises. We define bit width (BIT_WIDTH) to correct the transfer errors. If an interval pulse falls in a bit width window, we consider it a valid pulse, regardless of the deviation. The actual pulse position matches the theoretical pulse position in the bit width.

System Construction

The LWD EPU is the core of the LWD surface system and undertakes multiple measurement and system communication tasks at the same time. The EPU acquires depth, mud pressure, hook-load, in-slip, and pump-stroke signals and passes them through the isolated barriers and the signal conditioning device. The signals are then converted by the CompactRIO data acquisition (DAQ) device. The data is collected and pre-processed by the field-programmable gate array (FPGA), processed by the CPU, and transferred to the host PC. Meanwhile, using the CompactRIO as a transit, the host PC communicates with the DDU and DBC through the RS485 bus and drive bypass valve to send the commands down hole. Figure 3 illustrates the system architecture.


Figure 3. LWD Ground System Architecture

Mud Pulse Signal Filtering and Decoding

In the rig site, mud pulse signals are acquired by the pressure sensor installed on the cylinder. The mud pulse signal that comes from down hole to the surface mixes with background noise. This noise can be caused by the periodic reciprocating motion of the mud pump and vibration of general drilling operations. In the EPU, the acquired mud pulse waveform data is processed by finite impulse response (FIR), adaptive filtering, wavelet analysis, and correlation processing to obtain a clean pulse signal waveform. By accurately determining the pulse position and calculating consecutive pulse intervals, we can decode the raw data.

Depth Measurement

The drilling depth is measured by accumulating the movement of the hook. Besides measuring the hook position, we also need to know if the drilling tool is going up or down and if it has out slip or in slip.

To determine if the drilling tool is out slip, the hook load is measured and compared with the threshold. If it is higher than the threshold, it’s considered out slip; otherwise, it is in slip. However, vibrations can cause the measured hook load value to jitter severely during the drilling process. If the drilling depth is shallow and the drilling tool is not very heavy, the threshold is close to the hook load when in slip. The severe jitter can easily cause the measured hook load value to go above the threshold and provide inaccurate information.

To eliminate the influence of vibration, the measured hook load value needs to be filtered. The filtering algorithm requires effective filtering with low latency. The two sides are contradictory to each other. Synthesizing the characteristics of FIR, infinite impulse response (IIR), mean filtering, and median filtering, an effective filtering algorithm was developed using an FPGA filter module that measures depth accurately.


The EPU works well during the surface loop, down-hole loop, and actual drilling experiments, accumulating hundreds of hours of running and successfully verifying its reliability and real-time performance. It achieved the following performance metrics:

1. Transfer rate: up to 3.0 bit/s, the highest rate within domestic technologies

2. Error rate: less than 1 percent during the experiment process

3. Reliability: The EPU works stably during the experiments. The algorithm runs properly, with no system crashes.


According to our experimental validation, the EPU based on CompactRIO achieved the performance goals we sought and we were impressed with its rugged and reliable performance. During the development, the easy-to-use NI LabVIEW software greatly helped developers focus on the development of the mud pulse processing algorithm and the depth measurement algorithm.

Author Information:
Di'nan Jiang
China Oilfield Services Limited

Bookmark and Share

Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community

Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI