Renamed one folder. Add analysis of vibrations when rotating

This commit is contained in:
2019-05-13 13:22:11 +02:00
parent ab2f2fae08
commit 7ae17e7a60
70 changed files with 839 additions and 5 deletions

View File

@@ -0,0 +1,70 @@
% Matlab Init :noexport:ignore:
current_dir='/home/thomas/MEGA/These/meas/slip-ring-test/';
%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
% Load data
% We load the data of the z axis of two geophones.
sr_off = load('mat/data_001.mat', 't', 'x1', 'x2');
sr_on = load('mat/data_002.mat', 't', 'x1', 'x2');
% Analysis
% Let's first look at the signal produced by the DAC (figure [[fig:random_signal]]).
figure;
hold on;
plot(sr_on.t, sr_on.x1);
hold off;
xlabel('Time [s]'); ylabel('Voltage [V]');
xlim([0 10]);
% #+NAME: fig:random_signal
% #+CAPTION: Random signal produced by the DAC
% #+RESULTS: fig:random_signal
% [[file:figs/random_signal.png]]
% We now look at the difference between the signal directly measured by the ADC and the signal that goes through the slip-ring (figure [[fig:slipring_comp_signals]]).
figure;
hold on;
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]');
xlim([0 10]);
legend('Location', 'northeast');
% #+NAME: fig:slipring_comp_signals
% #+CAPTION: Alteration of the signal when the slip-ring is turning
% #+RESULTS: fig:slipring_comp_signals
% [[file:figs/slipring_comp_signals.png]]
dt = sr_on.t(2) - sr_on.t(1);
Fs = 1/dt; % [Hz]
win = hanning(ceil(1*Fs));
[pxx_on, f] = pwelch(sr_on.x1 - sr_on.x2, win, [], [], Fs);
[pxx_off, ~] = pwelch(sr_off.x1 - sr_off.x2, win, [], [], Fs);
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]); ylim([1e-5, 1e-3])

View File

@@ -0,0 +1,87 @@
% Matlab Init :noexport:ignore:
current_dir='/home/thomas/MEGA/These/meas/slip-ring-test/';
%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
% Load data
% We load the data of the z axis of two geophones.
sr_off = load('mat/data_008.mat', 'data'); sr_off = sr_off.data;
sr_on = load('mat/data_009.mat', 'data'); sr_on = sr_on.data;
sr_6r = load('mat/data_010.mat', 'data'); sr_6r = sr_6r.data;
sr_60r = load('mat/data_011.mat', 'data'); sr_60r = sr_60r.data;
% Time Domain
% We plot the time domain data for the direct measurement (figure [[fig:sr_direct_time]]) and for the signal going through the slip-ring (figure [[fig:sr_slipring_time]]);
figure;
hold on;
plot(sr_60r(:, 3), sr_60r(:, 1), 'DisplayName', '60rpm');
plot(sr_6r(:, 3), sr_6r(:, 1), 'DisplayName', '6rpm');
plot(sr_on(:, 3), sr_on(:, 1), 'DisplayName', 'ON');
plot(sr_off(:, 3), sr_off(:, 1), 'DisplayName', 'OFF');
hold off;
xlabel('Time [s]'); ylabel('Voltage [V]');
legend('Location', 'northeast');
% #+NAME: fig:sr_direct_time
% #+CAPTION: Direct measurement
% #+RESULTS: fig:sr_direct_time
% [[file:figs/sr_direct_time.png]]
figure;
hold on;
plot(sr_60r(:, 3), sr_60r(:, 2), 'DisplayName', '60rpm');
plot(sr_6r(:, 3), sr_6r(:, 2), 'DisplayName', '6rpm');
plot(sr_on(:, 3), sr_on(:, 2), 'DisplayName', 'ON');
plot(sr_off(:, 3), sr_off(:, 2), 'DisplayName', 'OFF');
hold off;
xlabel('Time [s]'); ylabel('Voltage [V]');
legend('Location', 'northeast');
% Frequency Domain
% We first compute some parameters that will be used for the PSD computation.
dt = sr_off(2, 3)-sr_off(1, 3);
Fs = 1/dt; % [Hz]
win = hanning(ceil(10*Fs));
% Then we compute the Power Spectral Density using =pwelch= function.
[pxdir, f] = pwelch(sr_off(:, 1), win, [], [], Fs);
[pxoff, ~] = pwelch(sr_off(:, 2), win, [], [], Fs);
[pxon, ~] = pwelch(sr_on(:, 2), win, [], [], Fs);
[px6r, ~] = pwelch(sr_6r(:, 2), win, [], [], Fs);
[px60r, ~] = pwelch(sr_60r(:, 2), win, [], [], Fs);
% And we plot the ASD of the measured signals (figure [[fig:sr_psd_compare]]);
figure;
hold on;
plot(f, sqrt(pxoff), 'DisplayName', 'OFF');
plot(f, sqrt(pxon), 'DisplayName', 'ON');
plot(f, sqrt(px6r), 'DisplayName', '6rpm');
plot(f, sqrt(px60r), 'DisplayName', '60rpm');
plot(f, sqrt(pxdir), 'k-', 'DisplayName', 'Direct');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the measured Voltage $\left[\frac{V}{\sqrt{Hz}}\right]$')
legend('Location', 'northeast');
xlim([0.1, 500]);

View File

@@ -0,0 +1,57 @@
% Matlab Init :noexport:ignore:
current_dir='/home/thomas/MEGA/These/meas/slip-ring-test/';
%% Go to current Directory
cd(current_dir);
%% Initialize ans with org-babel
ans = 0;
%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
% Load data
% We load the data of the z axis of two geophones.
d8 = load('mat/data_018.mat', 'data'); d8 = d8.data;
d9 = load('mat/data_019.mat', 'data'); d9 = d9.data;
% Analysis - Time Domain
% First, we compare the time domain signals for the two experiments (figure [[fig:slipring_time]]).
figure;
hold on;
plot(d9(:, 3), d9(:, 2), 'DisplayName', 'Slip-Ring');
plot(d8(:, 3), d8(:, 2), 'DisplayName', 'Wire');
hold off;
xlabel('Time [s]'); ylabel('Voltage [V]');
xlim([0, 50]);
legend('location', 'northeast');
% Analysis - Frequency Domain
% We then compute the Power Spectral Density of the two signals and we compare them (figure [[fig:slipring_asd]]).
dt = d8(2, 3) - d8(1, 3);
Fs = 1/dt;
win = hanning(ceil(1*Fs));
[pxx8, f] = pwelch(d8(:, 2), win, [], [], Fs);
[pxx9, ~] = pwelch(d9(:, 2), win, [], [], Fs);
figure;
hold on;
plot(f, sqrt(pxx9), 'DisplayName', 'Slip-Ring');
plot(f, sqrt(pxx8), 'DisplayName', 'Wire');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude Spectral Density $\left[\frac{V}{\sqrt{Hz}}\right]$')
xlim([1, 500]);
legend('Location', 'southwest');

View File

@@ -0,0 +1,193 @@
% Matlab Init :noexport:ignore:
current_dir='/home/thomas/MEGA/These/meas/slip-ring-test/';
%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
% Load data
% We load the data of the z axis of two geophones.
sr_off = load('mat/data_012.mat', 'data'); sr_off = sr_off.data;
sr_on = load('mat/data_013.mat', 'data'); sr_on = sr_on.data;
% Time Domain
% We compare the signal when the Slip-Ring is OFF (figure [[fig:sr_geophone_time_off]]) and when it is ON (figure [[fig:sr_geophone_time_on]]).
figure;
hold on;
plot(sr_off(:, 3), sr_off(:, 1), 'DisplayName', 'Direct');
plot(sr_off(:, 3), sr_off(:, 2), 'DisplayName', 'Slip-Ring');
hold off;
legend('Location', 'northeast');
xlabel('Time [s]');
ylabel('Voltage [V]');
% #+NAME: fig:sr_geophone_time_off
% #+CAPTION: Comparison of the time domain signals when the slip-ring is OFF
% #+RESULTS: fig:sr_geophone_time_off
% [[file:figs/sr_geophone_time_off.png]]
figure;
hold on;
plot(sr_on(:, 3), sr_on(:, 1), 'DisplayName', 'Direct');
plot(sr_on(:, 3), sr_on(:, 2), 'DisplayName', 'Slip-Ring');
hold off;
legend('Location', 'northeast');
xlabel('Time [s]');
ylabel('Voltage [V]');
% Frequency Domain
% We first compute some parameters that will be used for the PSD computation.
dt = sr_off(2, 3)-sr_off(1, 3);
Fs = 1/dt; % [Hz]
win = hanning(ceil(10*Fs));
% Then we compute the Power Spectral Density using =pwelch= function.
% Direct measure
[pxdoff, ~] = pwelch(sr_off(:, 1), win, [], [], Fs);
[pxdon, ~] = pwelch(sr_on(:, 1), win, [], [], Fs);
% Slip-Ring measure
[pxsroff, f] = pwelch(sr_off(:, 2), win, [], [], Fs);
[pxsron, ~] = pwelch(sr_on(:, 2), win, [], [], Fs);
% Finally, we compare the Amplitude Spectral Density of the signals (figure [[fig:sr_geophone_asd]]);
figure;
hold on;
plot(f, sqrt(pxdoff), 'DisplayName', 'Direct - OFF');
plot(f, sqrt(pxsroff), 'DisplayName', 'Slip-Ring - OFF');
plot(f, sqrt(pxdon), 'DisplayName', 'Direct - ON');
plot(f, sqrt(pxsron), 'DisplayName', 'Slip-Ring - ON');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the measured Voltage $\left[\frac{V}{\sqrt{Hz}}\right]$')
legend('Location', 'northeast');
xlim([0.1, 500]);
% #+NAME: fig:sr_geophone_asd
% #+CAPTION: Comparison of the Amplitude Spectral Sensity
% #+RESULTS: fig:sr_geophone_asd
% [[file:figs/sr_geophone_asd.png]]
xlim([100, 500]);
% Load data
% We load the data of the z axis of two geophones.
sr_lpf_off = load('mat/data_016.mat', 'data'); sr_lpf_off = sr_lpf_off.data;
sr_lpf_on = load('mat/data_017.mat', 'data'); sr_lpf_on = sr_lpf_on.data;
% Time Domain
% We compare the signal when the Slip-Ring is OFF (figure [[fig:sr_lpf_geophone_time_off]]) and when it is ON (figure [[fig:sr_lpf_geophone_time_on]]).
figure;
hold on;
plot(sr_lpf_off(:, 3), sr_lpf_off(:, 1), 'DisplayName', 'Direct');
plot(sr_lpf_off(:, 3), sr_lpf_off(:, 2), 'DisplayName', 'Slip-Ring');
hold off;
legend('Location', 'northeast');
xlabel('Time [s]');
ylabel('Voltage [V]');
% #+NAME: fig:sr_lpf_geophone_time_off
% #+CAPTION: Comparison of the time domain signals when the slip-ring is OFF
% #+RESULTS: fig:sr_lpf_geophone_time_off
% [[file:figs/sr_lpf_geophone_time_off.png]]
figure;
hold on;
plot(sr_lpf_on(:, 3), sr_lpf_on(:, 1), 'DisplayName', 'Direct');
plot(sr_lpf_on(:, 3), sr_lpf_on(:, 2), 'DisplayName', 'Slip-Ring');
hold off;
legend('Location', 'northeast');
xlabel('Time [s]');
ylabel('Voltage [V]');
% Frequency Domain
% We first compute some parameters that will be used for the PSD computation.
dt = sr_lpf_off(2, 3)-sr_lpf_off(1, 3);
Fs = 1/dt; % [Hz]
win = hanning(ceil(10*Fs));
% Then we compute the Power Spectral Density using =pwelch= function.
% Direct measure
[pxd_lpf_off, ~] = pwelch(sr_lpf_off(:, 1), win, [], [], Fs);
[pxd_lpf_on, ~] = pwelch(sr_lpf_on(:, 1), win, [], [], Fs);
% Slip-Ring measure
[pxsr_lpf_off, f] = pwelch(sr_lpf_off(:, 2), win, [], [], Fs);
[pxsr_lpf_on, ~] = pwelch(sr_lpf_on(:, 2), win, [], [], Fs);
% Finally, we compare the Amplitude Spectral Density of the signals (figure [[fig:sr_lpf_geophone_asd]]);
figure;
hold on;
plot(f, sqrt(pxd_lpf_off), 'DisplayName', 'Direct - OFF');
plot(f, sqrt(pxsr_lpf_off), 'DisplayName', 'Slip-Ring - OFF');
plot(f, sqrt(pxd_lpf_on), 'DisplayName', 'Direct - ON');
plot(f, sqrt(pxsr_lpf_on), 'DisplayName', 'Slip-Ring - ON');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the measured Voltage $\left[\frac{V}{\sqrt{Hz}}\right]$')
legend('Location', 'northeast');
xlim([0.1, 500]);
% #+NAME: fig:sr_lpf_geophone_asd
% #+CAPTION: Comparison of the Amplitude Spectral Sensity
% #+RESULTS: fig:sr_lpf_geophone_asd
% [[file:figs/sr_lpf_geophone_asd.png]]
xlim([100, 500]);
% Comparison of with and without LPF
figure;
hold on;
plot(f, sqrt(pxdon), 'DisplayName', 'Direct - ON');
plot(f, sqrt(pxsron), 'DisplayName', 'Slip-Ring - ON');
plot(f, sqrt(pxd_lpf_on), 'DisplayName', 'Direct - ON - LPF');
plot(f, sqrt(pxsr_lpf_on), 'DisplayName', 'Slip-Ring - ON - LPF');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('ASD of the measured Voltage $\left[\frac{V}{\sqrt{Hz}}\right]$')
legend('Location', 'northeast');
xlim([0.1, 500]);