Minor changes

This commit is contained in:
Thomas Dehaeze 2019-07-05 11:40:22 +02:00
parent 5859b27b34
commit b29287e10b
5 changed files with 31 additions and 80 deletions

View File

@ -1,8 +1,9 @@
#+TITLE: Measurements made by Marc Lessourd on the 17th of November 2017 - Matlab
:drawer:
:DRAWER:
#+LATEX_CLASS: cleanreport
#+LaTeX_CLASS_OPTIONS: [tocnp, secbreak, minted]
#+STARTUP: overview
#+PROPERTY: header-args:matlab :session *MATLAB*
#+PROPERTY: header-args:matlab+ :comments org
#+PROPERTY: header-args:matlab+ :exports both
@ -78,17 +79,17 @@ Measurement is in V?
channel = 12;
figure;
ax1 = subaxis(3,1,1);
ax1 = subplot(3,1,1);
plot(freq_frf, abs(frf_hexa_y(:, channel)))
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ax2 = subaxis(3,1,2);
ax2 = subplot(3,1,2);
plot(freq_frf, mod(180/pi*phase(frf_hexa_y(:, channel))+180, 360)-180)
set(gca, 'Xscale', 'log');
ylim([-180 180]);
yticks([-180:90:180]);
ax3 = subaxis(3,1,3);
ax3 = subplot(3,1,3);
plot(freq_frf, coh_hexa_y(:, channel))
set(gca, 'Xscale', 'log');
@ -99,10 +100,10 @@ Measurement is in V?
#+begin_src matlab :exports none :results none
figure;
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
plot(freq_frf, abs(frf_marble_z(:, 4)))
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log')
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
plot(freq_frf, mod(180/pi*phase(frf_marble_z(:, 4))+180, 360)-180)
linkaxes([ax1,ax2],'x');
ylim([-180 180]);

View File

@ -568,7 +568,7 @@ And we compare all the signals (figures [[fig:psd_sample_comp_lpf]] and [[fig:ps
*** Vibrations on the marble
Now we plot the same curves for the geophone located on the marble.
#+begin_src matlab :results none
#+begin_src matlab
[px_of, f] = pwelch(d_of(:, 1), win, [], [], Fs);
[px_ty, ~] = pwelch(d_ty(:, 1), win, [], [], Fs);
[px_ry, ~] = pwelch(d_ry(:, 1), win, [], [], Fs);
@ -578,7 +578,7 @@ Now we plot the same curves for the geophone located on the marble.
#+end_src
And we compare the Amplitude Spectral Densities (figures [[fig:psd_marble_comp_lpf]] and [[fig:psd_marble_comp_lpf_high_freq]])
#+begin_src matlab :results none
#+begin_src matlab
figure;
hold on;
plot(f, sqrt(px_of), 'DisplayName', 'All OFF');
@ -623,6 +623,28 @@ And we compare the Amplitude Spectral Densities (figures [[fig:psd_marble_comp_l
#+RESULTS: fig:psd_marble_comp_lpf_high_freq
[[file:figs/psd_marble_comp_lpf_high_freq.png]]
** Cumulative Amplitude Spectrum
#+begin_src matlab
figure;
hold on;
plot(f(2:end), sqrt(cumsum(px_of(2:end)./(2*pi*f(2:end)).^2).*(f(2)-f(1))), 'DisplayName', 'All OFF');
plot(f(2:end), sqrt(cumsum(px_ty(2:end)./(2*pi*f(2:end)).^2).*(f(2)-f(1))), 'DisplayName', 'Ty ON');
plot(f(2:end), sqrt(cumsum(px_ry(2:end)./(2*pi*f(2:end)).^2).*(f(2)-f(1))), 'DisplayName', 'Ry ON');
plot(f(2:end), sqrt(cumsum(px_sr(2:end)./(2*pi*f(2:end)).^2).*(f(2)-f(1))), 'DisplayName', 'S-R ON');
plot(f(2:end), sqrt(cumsum(px_rz(2:end)./(2*pi*f(2:end)).^2).*(f(2)-f(1))), 'DisplayName', 'Rz ON');
plot(f(2:end), sqrt(cumsum(px_he(2:end)./(2*pi*f(2:end)).^2).*(f(2)-f(1))), 'DisplayName', 'Hexa ON');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude Spectral Density $\left[\frac{m}{\sqrt{Hz}}\right]$')
xlim([0.1, 500]);
legend('Location', 'northeast');
#+end_src
#+begin_src matlab
#+end_src
** Conclusion
#+begin_important
- The Ty stage induces vibrations of the marble and at the sample location above 100Hz

Binary file not shown.

View File

@ -1,72 +0,0 @@
%%
clear; close all; clc;
%% Load Measurement Data
spindle_1rpm_table = readtable('../../Measurements/Spindle/10turns_1rpm_icepap.txt');
spindle_60rpm_table = readtable('../../Measurements/Spindle/10turns_60rpm_IcepapFIR.txt');
disp(spindle_1rpm_table(1, :));
spindle_1rpm = table2array(spindle_1rpm_table);
spindle_60rpm = table2array(spindle_60rpm_table);
%% Convert Signals from [deg] to [sec]
speed_1rpm = 360/60; % [deg/sec]
spindle_1rpm(:, 1) = spindle_1rpm(:, 2)/speed_1rpm; % From position [deg] to time [s]
speed_60rpm = 360/1; % [deg/sec]
spindle_60rpm(:, 1) = spindle_60rpm(:, 2)/speed_60rpm; % From position [deg] to time [s]
%% Convert Signals
% scaling = 1/80000; % 80 mV/um
scaling = 1e-6; % [um] to [m]
spindle_1rpm(:, 3:end) = scaling*spindle_1rpm(:, 3:end); % [V] to [m]
spindle_1rpm(:, 3:end) = spindle_1rpm(:, 3:end)-mean(spindle_1rpm(:, 3:end)); % Remove mean
spindle_60rpm(:, 3:end) = scaling*spindle_60rpm(:, 3:end); % [V] to [m]
spindle_60rpm(:, 3:end) = spindle_60rpm(:, 3:end)-mean(spindle_60rpm(:, 3:end)); % Remove mean
%% Ts and Fs for both measurements
Ts_1rpm = spindle_1rpm(end, 1)/(length(spindle_1rpm(:, 1))-1);
Fs_1rpm = 1/Ts_1rpm;
Ts_60rpm = spindle_60rpm(end, 1)/(length(spindle_60rpm(:, 1))-1);
Fs_60rpm = 1/Ts_60rpm;
%% Find Noise of the ADC [m/sqrt(Hz)]
data = spindle_1rpm(:, 5);
dV_1rpm = min(abs(data(1) - data(data ~= data(1))));
noise_1rpm = dV_1rpm/sqrt(12*Fs_1rpm/2);
data = spindle_60rpm(:, 5);
dV_60rpm = min(abs(data(50) - data(data ~= data(50))));
noise_60rpm = dV_60rpm/sqrt(12*Fs_60rpm/2);
%% Save all the data under spindle struct
spindle.rpm1.time = spindle_1rpm(:, 1);
spindle.rpm1.deg = spindle_1rpm(:, 2);
spindle.rpm1.Ts = Ts_1rpm;
spindle.rpm1.Fs = 1/Ts_1rpm;
spindle.rpm1.x = spindle_1rpm(:, 3);
spindle.rpm1.y = spindle_1rpm(:, 4);
spindle.rpm1.z = spindle_1rpm(:, 5);
spindle.rpm1.adcn = noise_1rpm;
spindle.rpm60.time = spindle_60rpm(:, 1);
spindle.rpm60.deg = spindle_60rpm(:, 2);
spindle.rpm60.Ts = Ts_60rpm;
spindle.rpm60.Fs = 1/Ts_60rpm;
spindle.rpm60.x = spindle_60rpm(:, 3);
spindle.rpm60.y = spindle_60rpm(:, 4);
spindle.rpm60.z = spindle_60rpm(:, 5);
spindle.rpm60.adcn = noise_60rpm;
%% Compute Asynchronous data
for direction = {'x', 'y', 'z'}
spindle.rpm1.([direction{1}, 'async']) = getAsynchronousError(spindle.rpm1.(direction{1}), 10);
spindle.rpm60.([direction{1}, 'async']) = getAsynchronousError(spindle.rpm60.(direction{1}), 10);
end
%% Save data
save('./mat/spindle_data.mat', 'spindle');