Skip to content

Latest commit

 

History

History
161 lines (114 loc) · 6.74 KB

fft-spectrum-plugin.md

File metadata and controls

161 lines (114 loc) · 6.74 KB
description
Live plugin-spectrum provides pipes functions to calculate the FFT of a time-domain signal helping to identify problems that are better seen in the frequency domain

FFT spectrum

Introduction

The plugin-spectrum it is a Live plugin that provides pipes functions to analyse signals in the frequency domain using FFT (Fast Fourier Transform).

Signal processing of plugin-spectrum from time domain to frequency domain with FFT

Some of the benefits of frequency analysis are improved well safety monitoring and issue prevention:

Benefits of analyse signal in frequency domain

Drilling systems are subject to torsional, axial, and lateral vibrations that are excited by bit-rock or by drillstring-formation interaction forces. These oscillations can be distinguished by mode shape and frequency. High-frequency torsional oscillations have natural modes reaching 400 Hz. Stick/slip oscillations are characterized by low frequencies usually below 1 Hz and affect the entire drill-string.

Drilling modes of vibration: lateral, longitudinal and torsional

The next table shows the frequency ranges of common vibration interaction forces and modes:

Mechanism Mode of vibration Frequency range
Stick-Slip Torsional 0-5Hz
Bit Bounce Axial 1-10Hz
Bit Chatter Lateral 50-350Hz+
Bit Whirl Lateral/Torsional 5-100Hz
BHA Whirl Lateral/Torsional 5-20Hz
Modal Coupling Axial/Lateral/Torsional 0-20Hz

The stick-slip phenomenon is most typically related to higher compressive strength formations related to torsional vibration (0-5Hz). When drilling with too low RPM or too high WOB (weight on bit), the drill string may enter the stick-slip window:

Drilling efficiency diagram and stick slip window

Live FFT

The signal.FFT() pipes function receives a double array of timestamp series, a double array of signal, the sampling rate of signal and a boolean convertToDecibel that flags whether or not to convert the output magnitude to decibel:

Pipe function to calculate FFT

The example below shows generated sine wave signals in the left charts and their FFTs to the right. The first with one harmonic, the second with three harmonics increasing amplitudes, and the third with noised sine signal.

Generated sine harmonic signals with calculated FFT

With a Cartesian chart, it is possible to plot the FFT signal based on the example query below. It is also possible to replace the generated signal with a real signal:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item 
=> times, 20*sin(2/10*pi()*times) as sin every item
=> signal.FFT(times, sin, 1,false) as fftResultData 
over last 20 min every 1 min 

=> fftResultData:json():jsonparse() as result 
=> result->magnitudes:seq as mag, result->frequencies:seq as freq 
=> @for range(freq:len()) as i, mag, freq => mag[i] as y, freq[i] as x
=> @set '#106621' as color => @set 1 as lineWidth
=> @set true as __clear

The next images show each example with its related FFT:

Left: sine wave with 10 seconds period. Right output with 0.1Hz peak frequency

In a temporal chart with the query bellow it is possible to generate a sine signal:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item
=> sin(2/10*pi()*times) as sin every item

Example of generated sine

In a Cartesian chart with the query bellow it is possible to generate the fft of the sine signal:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item
=> times, sin(2/10*pi()*times) as sin every item
=> signal.FFT(times, sin, 1,false) as fftResultData 
over last 10 min every 1 min

=> fftResultData:json():jsonparse() as result
=> result->magnitudes:seq as mag, result->frequencies:seq as freq
=> @for range(freq:len()) as i, mag, freq
=> mag[i] as y, freq[i] as x

=> @set '#106621' as __color
=> @set 1 as __lineWidth
=> @set true as __clear

FFT calculated based on generated sine signal

In a temporal chart with the query bellow it is possible to generate sine with harmonics:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item
=> sin(2/10*pi()*times) + 2*sin(3/10*pi()*times)  
+ 3*sin(4/10*pi()*times) as sin every item

Sine signal generated with harmonics

In a Cartesian chart with the query bellow it is possible to generate the FFT of the harmonics sine signal:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item
=> times, sin(2/10*pi()*times) + 2*sin(3/10*pi()*times)  + 
3*sin(4/10*pi()*times) as sin every item

=> signal.FFT(times, sin, 1,false) as fftResultData over all every 10 min
=> fftResultData:json():jsonparse() as result
=> result->magnitudes:seq as mag, result->frequencies:seq as freq
=> @for range(freq:len()) as i, mag, freq
=> mag[i] as y, freq[i] as x

=> @set '#106621' as __color
=> @set 1 as __lineWidth
=> @set true as __clear

FFT calculated with harmonics

In a temporal chart with the query bellow it is possible to generate sine with noise:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item
=> 20*sin(2/10*pi()*times) +20*random() as sin every item

Sine signal generated with noise

In a Cartesian chart with the query bellow it is possible to generate the FFT of the noised sine signal:

=> over last 10 min every sec 
=> count() as times, random() as rand over all every item
=> times, 20*sin(2/10*pi()*times) +20*random() as sin every item


=> signal.FFT(times, sin, 1,false) as fftResultData over all every 10 min
=> fftResultData:json():jsonparse() as result
=> result->magnitudes:seq as mag, result->frequencies:seq as freq
=> @for range(freq:len()) as i, mag, freq
=> mag[i] as y, freq[i] as x

=> @set '#106621' as __color
=> @set 1 as __lineWidth
=> @set true as __clear

FFT calculated based on noised sine