Move files to matlab folder

This commit is contained in:
2020-11-12 10:14:52 +01:00
parent a4d25b24cf
commit 80f3c9aa67
30 changed files with 204 additions and 1391 deletions

View File

@@ -4,6 +4,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
freqs = logspace(1, 3, 1000);
% Load Plant

View File

@@ -4,6 +4,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
freqs = logspace(0, 3, 1000);
% Load Plant

View File

@@ -4,6 +4,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
% Effect of the Sercalo angle error on the measured distance by the Attocube
% <<sec:sercalo_angle_error>>
% To simplify, we suppose that the Newport mirror is a flat mirror (instead of a concave one).
@@ -179,6 +181,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
% Coprime Factorization
load('mat/plant.mat', 'sys', 'Gi', 'Zc', 'Ga', 'Gc', 'Gn', 'Gd');
@@ -191,6 +195,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
% Load Plant
load('mat/plant.mat', 'G');
@@ -233,6 +239,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
freqs = logspace(0, 2, 1000);
% Load Plant
@@ -283,6 +291,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
fs = 1e4;
% Data Load and pre-processing
@@ -515,14 +525,14 @@ Unvm = mean(reshape(uv.Unv, [fs floor(length(uv.t)/fs)]),2);
figure;
ax1 = subplot(1, 2, 1);
hold on;
plot(uh.Unh, uh.Va);
plot(uh.Unh, uh.Vaf);
plot(Unhm, Vahm)
hold off;
xlabel('$V_{n,h}$ [V]'); ylabel('$V_a$ [m]');
ax2 = subplot(1, 2, 2);
hold on;
plot(uv.Unv, uv.Va);
plot(uv.Unv, uv.Vaf);
plot(Unvm, Vavm)
hold off;
xlabel('$V_{n,v}$ [V]'); ylabel('$V_a$ [m]');
@@ -536,17 +546,16 @@ linkaxes([ax1,ax2],'xy');
% [[file:figs/repeat_plot_raw.png]]
figure;
ax1 = subplot(1, 2, 1);
hold on;
plot(uh.Unh, 1e9*(uh.Va - repmat(Vahm, length(uh.t)/length(Vahm),1)));
plot(uh.Unh, 1e9*(uh.Vaf - repmat(Vahm, length(uh.t)/length(Vahm),1)));
hold off;
xlabel('$V_{n,h}$ [V]'); ylabel('$V_a$ [nm]');
ax2 = subplot(1, 2, 2);
hold on;
plot(uv.Unv, 1e9*(uv.Va - repmat(Vavm, length(uv.t)/length(Vavm),1)));
plot(uv.Unv, 1e9*(uv.Vaf - repmat(Vavm, length(uv.t)/length(Vavm),1)));
hold off;
xlabel('$V_{n,v}$ [V]'); ylabel('$V_a$ [nm]');
@@ -562,7 +571,7 @@ ylim([-100 100]);
% We also plot the displacement measured during the huddle test.
% All the signals are shown on Fig. [[]].
% All the signals are shown on Fig. [[fig:non-repeatability-parts]].
Vphm = mean(reshape(uh.Vph/freqresp(Gd(1,1), 0), [fs floor(length(uh.t)/fs)]),2);
@@ -582,6 +591,16 @@ ht = load('./mat/data_huddle_test_3.mat', 't', 'Va');
htm = 1e9*ht.Va(1:length(Vaheq)) - repmat(mean(1e9*ht.Va(1:length(Vaheq))), length(uh.t)/length(Vaheq),1);
figure;
hold on;
plot(uh.Unh, 1e9*(uh.Va - repmat(Vahm, length(uh.t)/length(Vahm),1)), 'DisplayName', 'Measured Non-Repeatability');
plot(uh.Unh, 1e9*ht.Va(1:length(Vaheq))-mean(1e9*ht.Va(1:length(Vaheq))), 'DisplayName', 'Huddle Test');
plot(uh.Unh, 1e9*Vaheq, 'DisplayName', 'Due to Sercalo Angle Error');
hold off;
xlabel('$V_{n,h}$ [V]'); ylabel('$V_a$ [nm]');
ylim([-100 100]);
legend();
figure;
ax1 = subplot(1, 2, 1);
hold on;
@@ -602,3 +621,71 @@ legend('location', 'northeast');
linkaxes([ax1,ax2],'xy');
ylim([-100 100]);
% Results with a low pass filter
% We filter the data with a first order low pass filter with a crossover frequency of $\omega_0$.
w0 = 10; % [Hz]
G_lpf = 1/(1 + s/2/pi/w0);
uh.Vaf = lsim(G_lpf, uh.Va, uh.t);
uv.Vaf = lsim(G_lpf, uv.Va, uv.t);
% Processing
% First, we get the mean value as measured by the interferometer for each value of the Newport angle.
Vahm = mean(reshape(uh.Vaf, [fs floor(length(uh.t)/fs)]),2);
Unhm = mean(reshape(uh.Unh, [fs floor(length(uh.t)/fs)]),2);
Vavm = mean(reshape(uv.Vaf, [fs floor(length(uv.t)/fs)]),2);
Unvm = mean(reshape(uv.Unv, [fs floor(length(uv.t)/fs)]),2);
% #+RESULTS:
% | Va - Horizontal [nm rms] | Va - Vertical [nm rms] |
% |--------------------------+------------------------|
% | 22.9 | 13.9 |
figure;
ax1 = subplot(1, 2, 1);
hold on;
plot(uh.Unh, uh.Vaf);
plot(Unhm, Vahm)
hold off;
xlabel('$V_{n,h}$ [V]'); ylabel('$V_a$ [m]');
ax2 = subplot(1, 2, 2);
hold on;
plot(uv.Unv, uv.Vaf);
plot(Unvm, Vavm)
hold off;
xlabel('$V_{n,v}$ [V]'); ylabel('$V_a$ [m]');
linkaxes([ax1,ax2],'xy');
% #+NAME: fig:repeat_plot_raw
% #+CAPTION: Repeatability of the measurement ([[./figs/repeat_plot_lpf.png][png]], [[./figs/repeat_plot_lpf.pdf][pdf]])
% [[file:figs/repeat_plot_lpf.png]]
figure;
ax1 = subplot(1, 2, 1);
hold on;
plot(uh.Unh, 1e9*(uh.Vaf - repmat(Vahm, length(uh.t)/length(Vahm),1)));
hold off;
xlabel('$V_{n,h}$ [V]'); ylabel('$V_a$ [nm]');
ax2 = subplot(1, 2, 2);
hold on;
plot(uv.Unv, 1e9*(uv.Vaf - repmat(Vavm, length(uv.t)/length(Vavm),1)));
hold off;
xlabel('$V_{n,v}$ [V]'); ylabel('$V_a$ [nm]');
linkaxes([ax1,ax2],'xy');
ylim([-60 60]);

View File

@@ -4,6 +4,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
% Load Data
ht_1 = load('./mat/data_huddle_test_1.mat', 't', 'Vph', 'Vpv', 'Va');
@@ -43,36 +45,53 @@ ht_2 = ht_s{2};
ht_3 = ht_s{3};
ht_4 = ht_s{4};
% Filter data with low pass filter
% We filter the data with a first order low pass filter with a crossover frequency of $\omega_0$.
w0 = 50; % [Hz]
G_lpf = 1/(1 + s/2/pi/w0);
ht_1.Vaf = lsim(G_lpf, ht_1.Va, ht_1.t);
ht_2.Vaf = lsim(G_lpf, ht_2.Va, ht_2.t);
ht_3.Vaf = lsim(G_lpf, ht_3.Va, ht_3.t);
ht_4.Vaf = lsim(G_lpf, ht_4.Va, ht_4.t);
% Time domain plots
figure;
ax1 = subplot(2, 2, 1)
ax1 = subplot(2, 2, 1);
hold on;
plot(ht_1.t, 1e9*ht_1.Va);
plot(ht_1.t, 1e9*ht_1.Vaf);
hold off;
ylabel('Displacement [nm]');
set(gca, 'XTickLabel',[]);
title('OL');
ax2 = subplot(2, 2, 2)
ax2 = subplot(2, 2, 2);
hold on;
plot(ht_2.t, 1e9*ht_2.Va);
plot(ht_2.t, 1e9*ht_2.Vaf);
hold off;
set(gca, 'XTickLabel',[]);
set(gca, 'YTickLabel',[]);
title('OL + CU');
ax3 = subplot(2, 2, 3)
ax3 = subplot(2, 2, 3);
hold on;
plot(ht_3.t, 1e9*ht_3.Va);
plot(ht_3.t, 1e9*ht_3.Vaf);
hold off;
xlabel('Time [s]');
ylabel('Displacement [nm]');
title('CL + CU');
ax4 = subplot(2, 2, 4)
ax4 = subplot(2, 2, 4);
hold on;
plot(ht_4.t, 1e9*ht_4.Va);
plot(ht_4.t, 1e9*ht_4.Vaf);
hold off;
xlabel('Time [s]');
set(gca, 'YTickLabel',[]);

BIN
matlab/mat/K_diag.mat Normal file

Binary file not shown.

BIN
matlab/mat/K_newport.mat Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
matlab/mat/data_rep_1.mat Normal file

Binary file not shown.

BIN
matlab/mat/data_rep_h.mat Normal file

Binary file not shown.

BIN
matlab/mat/data_rep_v.mat Normal file

Binary file not shown.

BIN
matlab/mat/data_uch.mat Normal file

Binary file not shown.

BIN
matlab/mat/data_ucv.mat Normal file

Binary file not shown.

BIN
matlab/mat/data_unh.mat Normal file

Binary file not shown.

BIN
matlab/mat/data_unv.mat Normal file

Binary file not shown.

BIN
matlab/mat/plant.mat Normal file

Binary file not shown.

View File

@@ -4,6 +4,8 @@ clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
addpath('./mat/');
fs = 1e4;
Ts = 1/fs;
freqs = logspace(1, 3, 1000);
@@ -123,6 +125,8 @@ legend();
% #+name: tab:gain_4qd
% #+attr_latex: :environment tabularx :width 0.5\linewidth :align lX
% #+attr_latex: :center t :booktabs t :float t
% #+caption: Identified Gain of the 4 quadrant diode
% #+RESULTS:
% | Horizontal [V/rad] | Vertical [V/rad] |