commit fe269b02b4cbbdeec6bb3165a924038d659681b1 Author: Thomas Dehaeze Date: Mon Jun 7 19:00:29 2021 +0200 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8394d13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,52 @@ +auto/ +*.tex +*.bbl +*.synctex.gz +.auctex-auto/ +_minted* + +# Emacs +auto/ + +# Simulink Real Time +*bio.m +*pt.m +*ref.m +*ri.m +*xcp.m +*.mldatx +*.slxc +*.xml +*_slrt_rtw/ + +# data +data/ + +# Windows default autosave extension +*.asv + +# OSX / *nix default autosave extension +*.m~ + +# Compiled MEX binaries (all platforms) +*.mex* + +# Packaged app and toolbox files +*.mlappinstall +*.mltbx + +# Generated helpsearch folders +helpsearch*/ + +# Simulink code generation folders +slprj/ +sccprj/ + +# Matlab code generation folders +codegen/ + +# Simulink autosave extension +*.autosave + +# Octave session info +octave-workspace diff --git a/doc/APA300ML.pdf b/doc/APA300ML.pdf new file mode 100644 index 0000000..b7d2f01 Binary files /dev/null and b/doc/APA300ML.pdf differ diff --git a/doc/Catalog-CPL190290.pdf b/doc/Catalog-CPL190290.pdf new file mode 100644 index 0000000..a0096ad Binary files /dev/null and b/doc/Catalog-CPL190290.pdf differ diff --git a/doc/IO131-OEM-Datasheet.pdf b/doc/IO131-OEM-Datasheet.pdf new file mode 100644 index 0000000..44c23de Binary files /dev/null and b/doc/IO131-OEM-Datasheet.pdf differ diff --git a/doc/L-9517-9678-05-A_Data_sheet_VIONiC_series_en.pdf b/doc/L-9517-9678-05-A_Data_sheet_VIONiC_series_en.pdf new file mode 100644 index 0000000..13193ba Binary files /dev/null and b/doc/L-9517-9678-05-A_Data_sheet_VIONiC_series_en.pdf differ diff --git a/doc/L-9517-9862-01-C_Data_sheet_RKLC_EN.pdf b/doc/L-9517-9862-01-C_Data_sheet_RKLC_EN.pdf new file mode 100644 index 0000000..54891ee Binary files /dev/null and b/doc/L-9517-9862-01-C_Data_sheet_RKLC_EN.pdf differ diff --git a/doc/RS250S.pdf b/doc/RS250S.pdf new file mode 100644 index 0000000..fa3fc34 Binary files /dev/null and b/doc/RS250S.pdf differ diff --git a/index.html b/index.html new file mode 120000 index 0000000..940abb9 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +test-bench-nano-hexapod.html \ No newline at end of file diff --git a/matlab/identif_analyze.m b/matlab/identif_analyze.m new file mode 100644 index 0000000..c757ff2 --- /dev/null +++ b/matlab/identif_analyze.m @@ -0,0 +1,89 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./src/'); + +% Test with one APA + +%% Load measurement data for APA number 1 +load(sprintf('mat/frf_data_%i_sweep_lf.mat', 2), 't', 'Va', 'Vs', 'de', 'da'); + +% Compute transfer functions: + +Ts = (t(end) - t(1))/(length(t)-1); +Fs = 1/Ts; + +win = hanning(ceil(1*Fs)); % Hannning Windows + +[G_dvf, f] = tfestimate(Va, de, win, [], [], 1/Ts); +[G_d, ~] = tfestimate(Va, da, win, [], [], 1/Ts); +[G_iff, ~] = tfestimate(Va, Vs, win, [], [], 1/Ts); + +[coh_dvf, ~] = mscohere(Va, de, win, [], [], 1/Ts); +[coh_d, ~] = mscohere(Va, da, win, [], [], 1/Ts); +[coh_iff, ~] = mscohere(Va, Vs, win, [], [], 1/Ts); + +%% +figure; +hold on; +plot(f, coh_dvf); +plot(f, coh_d); +plot(f, coh_iff); +hold off; +set(gca, 'XScale', 'log'); + +%% +figure; +tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile; +hold on; +plot(f, abs(G_dvf)); +plot(f, abs(G_d)); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude $V_{out}/V_{in}$ [V/V]'); set(gca, 'XTickLabel',[]); +hold off; + +ax2 = nexttile; +hold on; +plot(f, 180/pi*angle(G_dvf)); +plot(f, 180/pi*angle(G_d)); +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); + +linkaxes([ax1,ax2],'x'); +xlim([5, 5e3]); + +figure; +tiledlayout(2, 1, 'TileSpacing', 'None', 'Padding', 'None'); + +ax1 = nexttile; +plot(f, abs(G_iff)); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude $V_{out}/V_{in}$ [V/V]'); set(gca, 'XTickLabel',[]); +hold off; + +ax2 = nexttile; +plot(f, 180/pi*angle(G_iff)); +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +xlabel('Frequency [Hz]'); ylabel('Phase [deg]'); +hold off; +yticks(-360:90:360); + +linkaxes([ax1,ax2],'x'); +xlim([0.1, 10]); + +% Comparison of all APA + +%% Load all the measurements +meas_data = {}; +for i = 1:7 + meas_data(i) = {load(sprintf('mat/frf_data_%i.mat', i), 't', 'Va', 'Vs', 'de', 'da')}; +end diff --git a/matlab/identif_data.mat b/matlab/identif_data.mat new file mode 100644 index 0000000..6641245 Binary files /dev/null and b/matlab/identif_data.mat differ diff --git a/matlab/identif_measure.slx b/matlab/identif_measure.slx new file mode 100644 index 0000000..0ccd370 Binary files /dev/null and b/matlab/identif_measure.slx differ diff --git a/matlab/identif_model.slx b/matlab/identif_model.slx new file mode 100644 index 0000000..2d41f4c Binary files /dev/null and b/matlab/identif_model.slx differ diff --git a/matlab/identif_save.m b/matlab/identif_save.m new file mode 100644 index 0000000..08c4083 --- /dev/null +++ b/matlab/identif_save.m @@ -0,0 +1,35 @@ +% =frf_save.m= - Save Data +% :PROPERTIES: +% :header-args: :tangle matlab/frf_save.m +% :END: + +% First, we get data from the Speedgoat: + +tg = slrt; + +f = SimulinkRealTime.openFTP(tg); +mget(f, 'data/data.dat'); +close(f); + + + +% And we load the data on the Workspace: + +data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data; + +da = data(:, 1); % Excitation Voltage (input of PD200) [V] +de = data(:, 2); % Measured voltage (force sensor) [V] +Vs = data(:, 3); % Measurment displacement (encoder) [m] +Va = data(:, 4); % Measurement displacement (attocube) [m] +t = data(:, end); % Time [s] + + + +% And we save this to a =mat= file: +apa_number = 1; +% leg_number = 4; + +save(sprintf('mat/frf_data_leg_coder_%i_noise.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da'); +% save(sprintf('mat/frf_data_leg_coder_%i_sweep.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da'); +% save(sprintf('mat/frf_data_leg_coder_%i_noise_hf.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da'); +% save(sprintf('mat/frf_data_leg_coder_%i_add_mass_closed_circuit.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da'); diff --git a/matlab/identif_setup.m b/matlab/identif_setup.m new file mode 100644 index 0000000..3ab2da0 --- /dev/null +++ b/matlab/identif_setup.m @@ -0,0 +1,84 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +addpath('./src/'); + +%% Simulation configuration +Fs = 10e3; % Sampling Frequency [Hz] +Ts = 1/Fs; % Sampling Time [s] + +%% Data record configuration +Trec_start = 5; % Start time for Recording [s] +Trec_dur = 100; % Recording Duration [s] + +Tsim = 2*Trec_start + Trec_dur; % Simulation Time [s] + +%% Shaped Noise +V_noise = generateShapedNoise('Ts', 1/Fs, ... + 'V_mean', 3.25, ... + 't_start', Trec_start, ... + 'exc_duration', Trec_dur, ... + 'smooth_ends', true, ... + 'V_exc', 0.05/(1 + s/2/pi/10)); + +%% Sweep Sine +gc = 0.1; +xi = 0.5; +wn = 2*pi*94.3; + +% Notch filter at the resonance of the APA +G_sweep = 0.2*(s^2 + 2*gc*xi*wn*s + wn^2)/(s^2 + 2*xi*wn*s + wn^2); + +V_sweep = generateSweepExc('Ts', Ts, ... + 'f_start', 10, ... + 'f_end', 400, ... + 'V_mean', 3.25, ... + 't_start', Trec_start, ... + 'exc_duration', Trec_dur, ... + 'sweep_type', 'log', ... + 'V_exc', G_sweep*1/(1 + s/2/pi/500)); + +%% High Frequency Shaped Noise +[b,a] = cheby1(10, 2, 2*pi*[300 2e3], 'bandpass', 's'); +wL = 0.005*tf(b, a); + +V_noise_hf = generateShapedNoise('Ts', 1/Fs, ... + 'V_mean', 3.25, ... + 't_start', Trec_start, ... + 'exc_duration', Trec_dur, ... + 'smooth_ends', true, ... + 'V_exc', wL); + +%% Sinus excitation with increasing amplitude +V_sin = generateSinIncreasingAmpl('Ts', 1/Fs, ... + 'V_mean', 3.25, ... + 'sin_ampls', [0.1, 0.2, 0.4, 1, 2, 4], ... + 'sin_period', 1, ... + 'sin_num', 5, ... + 't_start', Trec_start, ... + 'smooth_ends', true); + +%% Select the excitation signal +V_exc = timeseries(V_noise(2,:), V_noise(1,:)); + +%% Plot +figure; +tiledlayout(1, 2, 'TileSpacing', 'Normal', 'Padding', 'None'); + +ax1 = nexttile; +plot(V_exc(1,:), V_exc(2,:)); +xlabel('Time [s]'); ylabel('Amplitude [V]'); + +ax2 = nexttile; +win = hanning(floor(length(V_exc)/8)); +[pxx, f] = pwelch(V_exc(2,:), win, 0, [], Fs); +plot(f, pxx) +xlabel('Frequency [Hz]'); ylabel('Power Spectral Density [$V^2/Hz$]'); +set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); +xlim([1, Fs/2]); ylim([1e-10, 1e0]); + +%% Save data that will be loaded in the Simulink file +save('./frf_data.mat', 'Fs', 'Ts', 'Tsim', 'Trec_start', 'Trec_dur', 'V_exc'); diff --git a/matlab/speedgoat_IO318_100k_CI_01585.mat b/matlab/speedgoat_IO318_100k_CI_01585.mat new file mode 100644 index 0000000..094402c Binary files /dev/null and b/matlab/speedgoat_IO318_100k_CI_01585.mat differ diff --git a/test-bench-nano-hexapod.html b/test-bench-nano-hexapod.html new file mode 100644 index 0000000..479ade8 --- /dev/null +++ b/test-bench-nano-hexapod.html @@ -0,0 +1,57 @@ + + + + + + +Nano-Hexapod - Test Bench + + + + + + +
+ UP + | + HOME +
+

Nano-Hexapod - Test Bench

+
+

Table of Contents

+ +
+
+

This report is also available as a pdf.

+
+ +
+

1 Test-Bench Description

+
+
+

+Here are the documentation of the equipment used for this test bench: +

+
    +
  • Voltage Amplifier: PiezoDrive PD200
  • +
  • Amplified Piezoelectric Actuator: Cedrat APA300ML
  • +
  • DAC/ADC: Speedgoat IO313
  • +
  • Encoder: Renishaw Vionic and used Ruler
  • +
  • Interferometers: Attocube
  • +
+ +
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2021-06-07 lun. 19:00

+
+ + diff --git a/test-bench-nano-hexapod.org b/test-bench-nano-hexapod.org new file mode 100644 index 0000000..6eed63a --- /dev/null +++ b/test-bench-nano-hexapod.org @@ -0,0 +1,58 @@ +#+TITLE: Nano-Hexapod - Test Bench +:DRAWER: +#+LANGUAGE: en +#+EMAIL: dehaeze.thomas@gmail.com +#+AUTHOR: Dehaeze Thomas + +#+HTML_LINK_HOME: ../index.html +#+HTML_LINK_UP: ../index.html + +#+HTML_HEAD: +#+HTML_HEAD: + +#+BIND: org-latex-image-default-option "scale=1" +#+BIND: org-latex-image-default-width "" + +#+LaTeX_CLASS: scrreprt +#+LaTeX_CLASS_OPTIONS: [a4paper, 10pt, DIV=12, parskip=full] +#+LaTeX_HEADER_EXTRA: \input{preamble.tex} + +#+PROPERTY: header-args:matlab :session *MATLAB* +#+PROPERTY: header-args:matlab+ :comments org +#+PROPERTY: header-args:matlab+ :exports both +#+PROPERTY: header-args:matlab+ :results none +#+PROPERTY: header-args:matlab+ :eval no-export +#+PROPERTY: header-args:matlab+ :noweb yes +#+PROPERTY: header-args:matlab+ :mkdirp yes +#+PROPERTY: header-args:matlab+ :output-dir figs + +#+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/tikz/org/}{config.tex}") +#+PROPERTY: header-args:latex+ :imagemagick t :fit yes +#+PROPERTY: header-args:latex+ :iminoptions -scale 100% -density 150 +#+PROPERTY: header-args:latex+ :imoutoptions -quality 100 +#+PROPERTY: header-args:latex+ :results file raw replace +#+PROPERTY: header-args:latex+ :buffer no +#+PROPERTY: header-args:latex+ :tangle no +#+PROPERTY: header-args:latex+ :eval no-export +#+PROPERTY: header-args:latex+ :exports results +#+PROPERTY: header-args:latex+ :mkdirp yes +#+PROPERTY: header-args:latex+ :output-dir figs +#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png") +:END: + +#+begin_export html +
+

This report is also available as a pdf.

+
+#+end_export + +* Test-Bench Description + +#+begin_note +Here are the documentation of the equipment used for this test bench: +- Voltage Amplifier: PiezoDrive [[file:doc/PD200-V7-R1.pdf][PD200]] +- Amplified Piezoelectric Actuator: Cedrat [[file:doc/APA300ML.pdf][APA300ML]] +- DAC/ADC: Speedgoat [[file:doc/IO131-OEM-Datasheet.pdf][IO313]] +- Encoder: Renishaw [[file:doc/L-9517-9678-05-A_Data_sheet_VIONiC_series_en.pdf][Vionic]] and used [[file:doc/L-9517-9862-01-C_Data_sheet_RKLC_EN.pdf][Ruler]] +- Interferometers: Attocube +#+end_note