diff --git a/disturbance-measurement/index.org b/disturbance-measurement/index.org index 5458f62..751120f 100644 --- a/disturbance-measurement/index.org +++ b/disturbance-measurement/index.org @@ -18,6 +18,8 @@ #+PROPERTY: header-args:matlab+ :output-dir figs :END: +* Experimental Setup + * Signal Processing ** Matlab Init :noexport:ignore: #+begin_src matlab :exports none :results silent :noweb yes @@ -33,19 +35,6 @@ Measurement =data_001.mat= corresponds to a measurement where the spindle is not data2 = load('mat/data_002.mat', 't', 'x1', 'x2'); #+end_src -** Pre-processing -#+begin_src matlab :results none - imax = min([length(data1.t), length(data2.t)]); - - data1.t = data1.t(1:imax); - data1.x1 = data1.x1(1:imax); - data1.x2 = data1.x2(1:imax); - - data2.t = data2.t(1:imax); - data2.x1 = data2.x1(1:imax); - data2.x2 = data2.x2(1:imax); -#+end_src - ** Time domain Data #+begin_src matlab :results none figure; @@ -67,17 +56,19 @@ Measurement =data_001.mat= corresponds to a measurement where the spindle is not #+begin_src matlab :results none dt = data1.t(2) - data1.t(1); Fs = 1/dt; - windows_psd = hanning(ceil(10/dt)); + + windows_psd = hanning(ceil(10*Fs)); #+end_src #+begin_src matlab :results none - [pxx1m, f] = pwelch(data1.x1, windows_psd, [], [], Fs); - [pxx1h, ~] = pwelch(data1.x2, windows_psd, [], [], Fs); + [pxx1m, f] = pwelch(data1.x1, windows_psd, [], [], Fs); f(1) = []; pxx1m(1) = []; + [pxx1h, ~] = pwelch(data1.x2, windows_psd, [], [], Fs); pxx1h(1) = []; - [pxx2m, ~] = pwelch(data2.x1, windows_psd, [], [], Fs); - [pxx2h, ~] = pwelch(data2.x2, windows_psd, [], [], Fs); + [pxx2m, ~] = pwelch(data2.x1, windows_psd, [], [], Fs); pxx2m(1) = []; + [pxx2h, ~] = pwelch(data2.x2, windows_psd, [], [], Fs); pxx2h(1) = []; #+end_src +** Some plots #+begin_src matlab :results none figure; hold on; @@ -120,3 +111,86 @@ Measurement =data_001.mat= corresponds to a measurement where the spindle is not set(gca, 'XScale', 'log'); xlabel('Frequency [Hz]'); ylabel('CAS [m]') #+end_src + +** Scaling to take into account the sensibility of the geophone and the voltage amplifier +The Geophone used are L22. Their sensibility is shown on figure [[fig:geophone_sensibility]]. + +#+begin_src matlab :results none + S0 = 88; % Sensitivity [V/(m/s)] + f0 = 2; % Cut-off frequnecy [Hz] + + S = S0*(s/2/pi/f0)/(1+s/2/pi/f0); +#+end_src + +We also take into account the gain of the electronics which is here set to be $60dB$. + +#+begin_src matlab :results none + G0_db = 60; % [dB] + + G0 = 10^(60/G0_db); % [abs] +#+end_src + +We divide the ASD measured (in $\text{V}/\sqrt{\text{Hz}}$) by the gain of the voltage amplifier to obtain the ASD of the voltage across the geophone. +We further divide the result by the sensibility of the Geophone to obtain the ASD of the velocity in $m/s/\sqrt{Hz}$. + +#+begin_src matlab :results none + scaling = 1./squeeze(abs(freqresp(G0*S, f, 'Hz'))); scaling(1) = 0; +#+end_src + +** Computation of the ASD of the velocity +#+begin_src matlab :results none + figure; + hold on; + plot(f, sqrt(pxx1h).*scaling); + plot(f, sqrt(pxx2h).*scaling); + hold off; + set(gca, 'xscale', 'log'); + set(gca, 'yscale', 'log'); + xlabel('Frequency [Hz]'); ylabel('ASD of the measured Velocity $\left[\frac{m/s}{\sqrt{Hz}}\right]$') + xlim([0.1, 500]); +#+end_src + +#+begin_src matlab :results none + figure; + hold on; + plot(f, (sqrt(pxx1).*scaling)./(2*pi*f)); + plot(f, (sqrt(pxx2).*scaling)./(2*pi*f)); + hold off; + set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); + xlabel('Frequency [Hz]'); ylabel('ASD of the displacement $\left[\frac{m}{\sqrt{Hz}}\right]$') + xlim([0.1, 500]); +#+end_src + +** RMS value of the difference between the two geophones +We also compute the Power Spectral Density of the difference between the two geophones. This is done in order to estimate the relative displacement of the sample with respect to the granite. +#+begin_src matlab :results none + [pxxd1, ~] = pwelch(data1.x2-data1.x1, windows_psd, [], [], Fs); pxxd1(1) = []; + [pxxd2, ~] = pwelch(data2.x2-data2.x1, windows_psd, [], [], Fs); pxxd2(1) = []; +#+end_src + +#+begin_src matlab :results none + figure; + hold on; + plot(f, (sqrt(pxxd1).*scaling)./(2*pi*f)); + plot(f, (sqrt(pxxd2).*scaling)./(2*pi*f)); + hold off; + set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); + xlabel('Frequency [Hz]'); ylabel('ASD of the displacement $\left[\frac{m}{\sqrt{Hz}}\right]$') + xlim([0.1, 500]); +#+end_src + +#+begin_src matlab :results none + psd_d1 = ((sqrt(pxxd1).*scaling)./(2*pi*f)).^2; + psd_d2 = ((sqrt(pxxd2).*scaling)./(2*pi*f)).^2; + + df = f(2) - f(1); + + figure; + hold on; + plot(f, sqrt(cumsum(df.*psd_d1, 'reverse'))); + plot(f, sqrt(cumsum(df.*psd_d2, 'reverse'))); + hold off; + set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); + xlabel('Frequency [Hz]'); ylabel('CAS $\left[m\right]$') + xlim([0.1, 500]); +#+end_src diff --git a/slip-ring-test/figs/.gitignore b/slip-ring-test/figs/.gitignore new file mode 100644 index 0000000..cd98c26 --- /dev/null +++ b/slip-ring-test/figs/.gitignore @@ -0,0 +1,3 @@ +*.tex +*.pdf +*.svg \ No newline at end of file diff --git a/slip-ring-test/figs/psd_noise.png b/slip-ring-test/figs/psd_noise.png new file mode 100644 index 0000000..182bfe6 Binary files /dev/null and b/slip-ring-test/figs/psd_noise.png differ diff --git a/slip-ring-test/index.html b/slip-ring-test/index.html index af7e9f8..6de5565 100644 Binary files a/slip-ring-test/index.html and b/slip-ring-test/index.html differ diff --git a/slip-ring-test/index.org b/slip-ring-test/index.org index 56de84a..304b38c 100644 --- a/slip-ring-test/index.org +++ b/slip-ring-test/index.org @@ -82,7 +82,7 @@ We now look at the difference between the signal directly measured by the ADC an #+begin_src matlab :results none figure; hold on; - plot(sr_on.t, sr_on.x1 - sr_on.x2, 'DisplayName', 'Slip-Ring - $\omega = 1rpm$'); + plot(sr_on.t, sr_on.x1 - sr_on.x2, 'DisplayName', 'Slip-Ring - $\omega = 1rpm$'); plot(sr_off.t, sr_off.x1 - sr_off.x2,'DisplayName', 'Slip-Ring off'); hold off; xlabel('Time [s]'); ylabel('Voltage [V]'); @@ -101,6 +101,41 @@ We now look at the difference between the signal directly measured by the ADC an #+RESULTS: fig:slipring_comp_signals [[file:figs/slipring_comp_signals.png]] +#+begin_src matlab :results none + dt = sr_on.t(2) - sr_on.t(1); + Fs = 1/dt; % [Hz] + + win = hanning(ceil(1*Fs)); +#+end_src + +#+begin_src matlab :results none + [pxx_on, f] = pwelch(sr_on.x1 - sr_on.x2, win, [], [], Fs); + [pxx_off, ~] = pwelch(sr_off.x1 - sr_off.x2, win, [], [], Fs); +#+end_src + +#+begin_src matlab :results none :exports none + figure; + hold on; + plot(f, sqrt(pxx_on), 'DisplayName', 'Slip-Ring - $\omega = 1rpm$'); + plot(f, sqrt(pxx_off),'DisplayName', 'Slip-Ring off'); + hold off; + set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); + xlabel('Frequency [Hz]'); ylabel('PSD $\left[\frac{V}{\sqrt{Hz}}\right]$'); + legend('Location', 'northeast'); + xlim([1, 500]); +#+end_src + +#+NAME: fig:psd_noise +#+HEADER: :tangle no :exports results :results value raw replace :noweb yes +#+begin_src matlab :var filepath="figs/psd_noise.pdf" :var figsize="wide-tall" :post pdf2svg(file=*this*, ext="png") + <> +#+end_src + +#+NAME: fig:psd_noise +#+CAPTION: ASD of the measured noise +#+RESULTS: fig:psd_noise +[[file:figs/psd_noise.png]] + * Conclusion #+begin_note *Remaining questions*: