Moved all the simulink files in each folders
This commit is contained in:
parent
d70c7cbe90
commit
9b2d91b464
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design" />
|
||||
</Category>
|
||||
</Info>
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info />
|
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design" />
|
||||
</Category>
|
||||
</Info>
|
@ -97,7 +97,7 @@ The performance of this undamped system will be compared with the damped system
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_id.slx'
|
||||
open('active_damping/matlab/sim_nano_station_id.slx')
|
||||
#+end_src
|
||||
|
||||
** Init
|
||||
@ -462,7 +462,7 @@ And the closed loop system is computed below.
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_id.slx'
|
||||
open('active_damping/matlab/sim_nano_station_id.slx')
|
||||
#+end_src
|
||||
|
||||
** Control Design
|
||||
@ -1001,7 +1001,7 @@ And the closed loop system is computed below.
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_id.slx'
|
||||
open('active_damping/matlab/sim_nano_station_id.slx')
|
||||
#+end_src
|
||||
|
||||
** Control Design
|
||||
@ -1514,7 +1514,7 @@ The obtained sensitivity to disturbances is shown in figure [[fig:dvf_1dof_sensi
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_id.slx'
|
||||
open('active_damping/matlab/sim_nano_station_id.slx')
|
||||
#+end_src
|
||||
|
||||
** Control Design
|
||||
|
@ -25,7 +25,7 @@
|
||||
#+PROPERTY: header-args:matlab+ :exports both
|
||||
#+PROPERTY: header-args:matlab+ :eval no-export
|
||||
#+PROPERTY: header-args:matlab+ :output-dir figs
|
||||
#+PROPERTY: header-args:matlab+ :tangle matlab/modal_frf_coh.m
|
||||
#+PROPERTY: header-args:matlab+ :tangle no
|
||||
#+PROPERTY: header-args:matlab+ :mkdirp yes
|
||||
|
||||
#+PROPERTY: header-args:shell :eval no-export
|
||||
@ -184,7 +184,7 @@ This file is divided in the following sections:
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_micro_station_disturbances.slx'
|
||||
open('disturbances/matlab/sim_micro_station_disturbances.slx')
|
||||
#+end_src
|
||||
|
||||
* Identification
|
||||
|
@ -1,343 +0,0 @@
|
||||
%% Clear Workspace and Close figures
|
||||
clear; close all; clc;
|
||||
|
||||
%% Intialize Laplace variable
|
||||
s = zpk('s');
|
||||
|
||||
open 'simscape/sim_micro_station_disturbances.slx'
|
||||
|
||||
% Identification
|
||||
% <<sec:identification>>
|
||||
|
||||
% The transfer functions from the disturbance forces to the relative velocity of the hexapod with respect to the granite are computed using the Simscape Model representing the experimental setup with the code below.
|
||||
|
||||
|
||||
%% Options for Linearized
|
||||
options = linearizeOptions;
|
||||
options.SampleTime = 0;
|
||||
|
||||
%% Name of the Simulink File
|
||||
mdl = 'sim_micro_station_disturbances';
|
||||
|
||||
%% Micro-Hexapod
|
||||
% Input/Output definition
|
||||
io(1) = linio([mdl, '/Dw'], 1, 'input'); % Ground Motion
|
||||
io(2) = linio([mdl, '/Fty'], 1, 'input'); % Parasitic force Ty
|
||||
io(3) = linio([mdl, '/Frz'], 1, 'input'); % Parasitic force Rz
|
||||
io(4) = linio([mdl, '/Dgm'], 1, 'output'); % Absolute motion - Granite
|
||||
io(5) = linio([mdl, '/Dhm'], 1, 'output'); % Absolute Motion - Hexapod
|
||||
io(6) = linio([mdl, '/Vm'], 1, 'output'); % Relative Velocity hexapod/granite
|
||||
|
||||
% Run the linearization
|
||||
G = linearize(mdl, io, 0);
|
||||
|
||||
% Input/Output names
|
||||
G.InputName = {'Dw', 'Fty', 'Frz'};
|
||||
G.OutputName = {'Dgm', 'Dhm', 'Vm'};
|
||||
|
||||
% Sensitivity to Disturbances
|
||||
% <<sec:sensitivity_disturbances>>
|
||||
|
||||
|
||||
freqs = logspace(0, 3, 1000);
|
||||
|
||||
figure;
|
||||
title('$D_w$ to $D$');
|
||||
hold on;
|
||||
plot(freqs, abs(squeeze(freqresp(G('Vm', 'Dw')/s, freqs, 'Hz'))), 'k-');
|
||||
hold off;
|
||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
|
||||
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
|
||||
|
||||
|
||||
|
||||
% #+NAME: fig:sensitivity_dist_gm
|
||||
% #+CAPTION: Sensitivity to Ground Motion ([[./figs/sensitivity_dist_gm.png][png]], [[./figs/sensitivity_dist_gm.pdf][pdf]])
|
||||
% [[file:figs/sensitivity_dist_gm.png]]
|
||||
|
||||
|
||||
|
||||
freqs = logspace(0, 3, 1000);
|
||||
|
||||
figure;
|
||||
title('$F_{ty}$ to $D$');
|
||||
hold on;
|
||||
plot(freqs, abs(squeeze(freqresp(G('Vm', 'Fty')/s, freqs, 'Hz'))), 'k-');
|
||||
hold off;
|
||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
|
||||
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
|
||||
|
||||
|
||||
|
||||
% #+NAME: fig:sensitivity_dist_fty
|
||||
% #+CAPTION: Sensitivity to vertical forces applied by the Ty stage ([[./figs/sensitivity_dist_fty.png][png]], [[./figs/sensitivity_dist_fty.pdf][pdf]])
|
||||
% [[file:figs/sensitivity_dist_fty.png]]
|
||||
|
||||
|
||||
|
||||
freqs = logspace(0, 3, 1000);
|
||||
|
||||
figure;
|
||||
title('$F_{rz}$ to $D$');
|
||||
hold on;
|
||||
plot(freqs, abs(squeeze(freqresp(G('Vm', 'Frz')/s, freqs, 'Hz'))), 'k-');
|
||||
hold off;
|
||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
|
||||
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
|
||||
|
||||
% Power Spectral Density of the effect of the disturbances
|
||||
% <<sec:psd_dist>>
|
||||
% The PSD of the relative velocity between the hexapod and the marble in $[(m/s)^2/Hz]$ are loaded for the following sources of disturbance:
|
||||
% - Slip Ring Rotation
|
||||
% - Scan of the translation stage (effect in the vertical direction and in the horizontal direction)
|
||||
|
||||
% Also, the Ground Motion is measured.
|
||||
|
||||
|
||||
gm = load('./disturbances/mat/psd_gm.mat', 'f', 'psd_gm', 'psd_gv');
|
||||
rz = load('./disturbances/mat/pxsp_r.mat', 'f', 'pxsp_r');
|
||||
tyz = load('./disturbances/mat/pxz_ty_r.mat', 'f', 'pxz_ty_r');
|
||||
tyx = load('./disturbances/mat/pxe_ty_r.mat', 'f', 'pxe_ty_r');
|
||||
|
||||
gm.f = gm.f(2:end);
|
||||
rz.f = rz.f(2:end);
|
||||
tyz.f = tyz.f(2:end);
|
||||
tyx.f = tyx.f(2:end);
|
||||
|
||||
gm.psd_gm = gm.psd_gm(2:end); % PSD of Ground Motion [m^2/Hz]
|
||||
gm.psd_gv = gm.psd_gv(2:end); % PSD of Ground Velocity [(m/s)^2/Hz]
|
||||
rz.pxsp_r = rz.pxsp_r(2:end); % PSD of Relative Velocity [(m/s)^2/Hz]
|
||||
tyz.pxz_ty_r = tyz.pxz_ty_r(2:end); % PSD of Relative Velocity [(m/s)^2/Hz]
|
||||
tyx.pxe_ty_r = tyx.pxe_ty_r(2:end); % PSD of Relative Velocity [(m/s)^2/Hz]
|
||||
|
||||
|
||||
|
||||
% We now compute the relative velocity between the hexapod and the granite due to ground motion.
|
||||
|
||||
gm.psd_rv = gm.psd_gm.*abs(squeeze(freqresp(G('Vm', 'Dw'), gm.f, 'Hz'))).^2;
|
||||
|
||||
|
||||
|
||||
% The Power Spectral Density of the relative motion/velocity of the hexapod with respect to the granite are shown in figures [[fig:dist_effect_relative_velocity]] and [[fig:dist_effect_relative_motion]].
|
||||
|
||||
% The Cumulative Amplitude Spectrum of the relative motion is shown in figure [[fig:dist_effect_relative_motion_cas]].
|
||||
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(gm.f, sqrt(gm.psd_rv), 'DisplayName', 'Ground Motion');
|
||||
plot(tyz.f, sqrt(tyz.pxz_ty_r), 'DisplayName', 'Ty');
|
||||
plot(rz.f, sqrt(rz.pxsp_r), 'DisplayName', 'Rz');
|
||||
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]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]);
|
||||
|
||||
|
||||
|
||||
% #+NAME: fig:dist_effect_relative_velocity
|
||||
% #+CAPTION: Amplitude Spectral Density of the relative velocity of the hexapod with respect to the granite due to different sources of perturbation ([[./figs/dist_effect_relative_velocity.png][png]], [[./figs/dist_effect_relative_velocity.pdf][pdf]])
|
||||
% [[file:figs/dist_effect_relative_velocity.png]]
|
||||
|
||||
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(gm.f, sqrt(gm.psd_rv)./(2*pi*gm.f), 'DisplayName', 'Ground Motion');
|
||||
plot(tyz.f, sqrt(tyz.pxz_ty_r)./(2*pi*tyz.f), 'DisplayName', 'Ty');
|
||||
plot(rz.f, sqrt(rz.pxsp_r)./(2*pi*rz.f), 'DisplayName', 'Rz');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD of the displacement $\left[\frac{m}{\sqrt{Hz}}\right]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]);
|
||||
|
||||
|
||||
|
||||
% #+NAME: fig:dist_effect_relative_motion
|
||||
% #+CAPTION: Amplitude Spectral Density of the relative displacement of the hexapod with respect to the granite due to different sources of perturbation ([[./figs/dist_effect_relative_motion.png][png]], [[./figs/dist_effect_relative_motion.pdf][pdf]])
|
||||
% [[file:figs/dist_effect_relative_motion.png]]
|
||||
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(gm.psd_rv./((2*pi*gm.f).^2))))), 'DisplayName', 'Ground Motion');
|
||||
plot(tyz.f, flip(sqrt(-cumtrapz(flip(tyz.f), flip(tyz.pxz_ty_r./((2*pi*tyz.f).^2))))), 'DisplayName', 'Ty');
|
||||
plot(rz.f, flip(sqrt(-cumtrapz(flip(rz.f), flip(rz.pxsp_r./((2*pi*rz.f).^2))))), 'DisplayName', 'Rz');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('CAS of the relative displacement $[m]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]); ylim([1e-11, 1e-6]);
|
||||
|
||||
% Compute the Power Spectral Density of the disturbance force
|
||||
% <<sec:psd_force_dist>>
|
||||
|
||||
% Now, from the extracted transfer functions from the disturbance force to the relative motion of the hexapod with respect to the granite (section [[sec:sensitivity_disturbances]]) and from the measured PSD of the relative motion (section [[sec:psd_dist]]), we can compute the PSD of the disturbance force.
|
||||
|
||||
|
||||
rz.psd_f = rz.pxsp_r./abs(squeeze(freqresp(G('Vm', 'Frz'), rz.f, 'Hz'))).^2;
|
||||
tyz.psd_f = tyz.pxz_ty_r./abs(squeeze(freqresp(G('Vm', 'Fty'), tyz.f, 'Hz'))).^2;
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
set(gca,'ColorOrderIndex',2);
|
||||
plot(tyz.f, sqrt(tyz.psd_f), 'DisplayName', 'F - Ty');
|
||||
plot(rz.f, sqrt(rz.psd_f), 'DisplayName', 'F - Rz');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD of the disturbance force $\left[\frac{F}{\sqrt{Hz}}\right]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]);
|
||||
|
||||
% Noise Budget
|
||||
% <<sec:noise_budget>>
|
||||
|
||||
% Now, from the compute spectral density of the disturbance sources, we can compute the resulting relative motion of the Hexapod with respect to the granite using the model.
|
||||
% We should verify that this is coherent with the measurements.
|
||||
|
||||
|
||||
% Power Spectral Density of the relative Displacement
|
||||
psd_gm_d = gm.psd_gm.*abs(squeeze(freqresp(G('Vm', 'Dw')/s, gm.f, 'Hz'))).^2;
|
||||
psd_ty_d = tyz.psd_f.*abs(squeeze(freqresp(G('Vm', 'Fty')/s, tyz.f, 'Hz'))).^2;
|
||||
psd_rz_d = rz.psd_f.*abs(squeeze(freqresp(G('Vm', 'Frz')/s, rz.f, 'Hz'))).^2;
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(gm.f, sqrt(psd_gm_d), 'DisplayName', 'Ground Motion');
|
||||
plot(tyz.f, sqrt(psd_ty_d), 'DisplayName', 'Ty');
|
||||
plot(rz.f, sqrt(psd_rz_d), 'DisplayName', 'Rz');
|
||||
plot(rz.f, sqrt(psd_gm_d + psd_ty_d + psd_rz_d), 'k--', 'DisplayName', 'tot');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD of the relative motion $\left[\frac{m}{\sqrt{Hz}}\right]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]);
|
||||
|
||||
|
||||
|
||||
% #+NAME: fig:psd_effect_dist_verif
|
||||
% #+CAPTION: Computed Effect of the disturbances on the relative displacement hexapod/granite ([[./figs/psd_effect_dist_verif.png][png]], [[./figs/psd_effect_dist_verif.pdf][pdf]])
|
||||
% [[file:figs/psd_effect_dist_verif.png]]
|
||||
|
||||
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_d)))), 'DisplayName', 'Ground Motion');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_ty_d)))), 'DisplayName', 'Ty');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_rz_d)))), 'DisplayName', 'Rz');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_d + psd_ty_d + psd_rz_d)))), 'k-', 'DisplayName', 'tot');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('Cumulative Amplitude Spectrum [m]')
|
||||
legend('location', 'northeast');
|
||||
xlim([2, 500]); ylim([1e-11, 1e-6]);
|
||||
|
||||
% Approximation
|
||||
% We approximate the PSD of the disturbance with the following transfer functions.
|
||||
|
||||
G_ty = 0.1*(s+634.3)*(s+283.7)/((s+2*pi)*(s+2*pi));
|
||||
G_rz = 0.5*(s+418.8)*(s+36.51)*(s^2 + 110.9*s + 3.375e04)/((s+0.7324)*(s+0.546)*(s^2 + 0.6462*s + 2.391e04));
|
||||
G_gm = 0.002*(s^2 + 3.169*s + 27.74)/(s*(s+32.73)*(s+8.829)*(s+7.983)^2);
|
||||
|
||||
|
||||
|
||||
% We compute the effect of these approximate disturbances on $D$.
|
||||
|
||||
% Power Spectral Density of the relative Displacement
|
||||
psd_gm_s = abs(squeeze(freqresp(G_gm*G('Vm', 'Dw')/s, gm.f, 'Hz'))).^2;
|
||||
psd_ty_s = abs(squeeze(freqresp(G_ty*G('Vm', 'Fty')/s, gm.f, 'Hz'))).^2;
|
||||
psd_rz_s = abs(squeeze(freqresp(G_rz*G('Vm', 'Frz')/s, gm.f, 'Hz'))).^2;
|
||||
|
||||
figure;
|
||||
ax1 = subplot(1, 2, 1);
|
||||
hold on;
|
||||
set(gca,'ColorOrderIndex',2);
|
||||
plot(gm.f, sqrt(psd_ty_d), 'DisplayName', 'F - Ty');
|
||||
plot(gm.f, sqrt(psd_rz_d), 'DisplayName', 'F - Rz');
|
||||
set(gca,'ColorOrderIndex',2);
|
||||
plot(gm.f, sqrt(psd_ty_s), '--', 'HandleVisibility', 'off');
|
||||
plot(gm.f, sqrt(psd_rz_s), '--', 'HandleVisibility', 'off');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD of the disturbance force $\left[\frac{F}{\sqrt{Hz}}\right]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]);
|
||||
|
||||
ax2 = subplot(1, 2, 2);
|
||||
hold on;
|
||||
plot(gm.f, sqrt(psd_gm_d), 'DisplayName', 'D - Gm');
|
||||
set(gca,'ColorOrderIndex',1);
|
||||
plot(gm.f, sqrt(psd_gm_s), '--', 'HandleVisibility', 'off');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('ASD of the ground displacement $\left[\frac{m}{\sqrt{Hz}}\right]$')
|
||||
legend('Location', 'southwest');
|
||||
xlim([2, 500]);
|
||||
|
||||
|
||||
|
||||
% #+NAME: fig:estimate_spectral_density_disturbances
|
||||
% #+CAPTION: Estimated spectral density of the disturbances ([[./figs/estimate_spectral_density_disturbances.png][png]], [[./figs/estimate_spectral_density_disturbances.pdf][pdf]])
|
||||
% [[file:figs/estimate_spectral_density_disturbances.png]]
|
||||
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_d)))), 'DisplayName', 'Gm');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_ty_d)))), 'DisplayName', 'Ty');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_rz_d)))), 'DisplayName', 'Rz');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_d + psd_ty_d + psd_rz_d)))), 'k-', 'DisplayName', 'tot');
|
||||
set(gca,'ColorOrderIndex',1);
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_s)))), '--', 'HandleVisibility', 'off');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_ty_s)))), '--', 'HandleVisibility', 'off');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_rz_s)))), '--', 'HandleVisibility', 'off');
|
||||
plot(gm.f, flip(sqrt(-cumtrapz(flip(gm.f), flip(psd_gm_s + psd_ty_s + psd_rz_s)))), 'k--', 'HandleVisibility', 'off');
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('Cumulative Amplitude Spectrum [m]')
|
||||
legend('location', 'northeast');
|
||||
xlim([2, 500]); ylim([1e-11, 1e-6]);
|
||||
|
||||
% Save
|
||||
% The PSD of the disturbance force are now saved for further noise budgeting when control is applied (the mat file is accessible [[file:mat/dist_psd.mat][here]]).
|
||||
|
||||
|
||||
dist_f = struct();
|
||||
|
||||
dist_f.f = gm.f; % Frequency Vector [Hz]
|
||||
|
||||
dist_f.psd_gm = gm.psd_gm; % Power Spectral Density of the Ground Motion [m^2/Hz]
|
||||
dist_f.psd_ty = tyz.psd_f; % Power Spectral Density of the force induced by the Ty stage in the Z direction [N^2/Hz]
|
||||
dist_f.psd_rz = rz.psd_f; % Power Spectral Density of the force induced by the Rz stage in the Z direction [N^2/Hz]
|
||||
|
||||
dist_f.G_gm = G_ty;
|
||||
dist_f.G_ty = G_rz;
|
||||
dist_f.G_rz = G_gm;
|
||||
|
||||
save('./disturbances/mat/dist_psd.mat', 'dist_f');
|
||||
|
||||
% Display Obtained Disturbances
|
||||
|
||||
initDisturbances();
|
||||
load('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't');
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(t, Dwx, 'DisplayName', 'Dw x');
|
||||
plot(t, Dwy, 'DisplayName', 'Dw y');
|
||||
plot(t, Dwz, 'DisplayName', 'Dw z');
|
||||
hold off;
|
||||
xlabel('Time [s]'); ylabel('Amplitude [m]');
|
||||
legend('location', 'north east');
|
||||
|
||||
figure;
|
||||
hold on;
|
||||
plot(t, Fty_x, 'DisplayName', 'Ty x');
|
||||
plot(t, Fty_z, 'DisplayName', 'Ty z');
|
||||
plot(t, Frz_z, 'DisplayName', 'Rz z');
|
||||
hold off;
|
||||
xlabel('Time [s]'); ylabel('Force [N]');
|
||||
legend('location', 'north east');
|
@ -55,7 +55,7 @@
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_tomo.slx'
|
||||
open('experiment_tomography/matlab/sim_nano_station_tomo.slx')
|
||||
#+end_src
|
||||
|
||||
* Initialize Experiment
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2019-12-11 mer. 17:33 -->
|
||||
<!-- 2019-12-12 jeu. 11:25 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Matlab Functions used for the NASS Project</title>
|
||||
@ -258,34 +258,33 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org05ce9cd">1. Functions</a>
|
||||
<li><a href="#orgac71426">1. Functions</a>
|
||||
<ul>
|
||||
<li><a href="#orgd234316">1.1. computePsdDispl</a></li>
|
||||
<li><a href="#orga7dcbe9">1.2. computeSetpoint</a></li>
|
||||
<li><a href="#org38afc80">1.3. converErrorBasis</a></li>
|
||||
<li><a href="#orge0e5103">1.4. generateDiagPidControl</a></li>
|
||||
<li><a href="#orga0abbff">1.5. identifyPlant</a></li>
|
||||
<li><a href="#orgd0e3a86">1.6. runSimulation</a></li>
|
||||
<li><a href="#org288e05d">1.7. Inverse Kinematics of the Hexapod</a></li>
|
||||
<li><a href="#org33a19ae">1.8. computeReferencePose</a></li>
|
||||
<li><a href="#orga30ed3e">1.1. computePsdDispl</a></li>
|
||||
<li><a href="#org164599d">1.2. computeSetpoint</a></li>
|
||||
<li><a href="#org0d7c91f">1.3. converErrorBasis</a></li>
|
||||
<li><a href="#orge57e769">1.4. generateDiagPidControl</a></li>
|
||||
<li><a href="#orgb953a5b">1.5. identifyPlant</a></li>
|
||||
<li><a href="#org442df30">1.6. Inverse Kinematics of the Hexapod</a></li>
|
||||
<li><a href="#orgce14673">1.7. computeReferencePose</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org05ce9cd" class="outline-2">
|
||||
<h2 id="org05ce9cd"><span class="section-number-2">1</span> Functions</h2>
|
||||
<div id="outline-container-orgac71426" class="outline-2">
|
||||
<h2 id="orgac71426"><span class="section-number-2">1</span> Functions</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
<a id="org1c061a7"></a>
|
||||
<a id="org8643823"></a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="outline-container-orgd234316" class="outline-3">
|
||||
<h3 id="orgd234316"><span class="section-number-3">1.1</span> computePsdDispl</h3>
|
||||
<div id="outline-container-orga30ed3e" class="outline-3">
|
||||
<h3 id="orga30ed3e"><span class="section-number-3">1.1</span> computePsdDispl</h3>
|
||||
<div class="outline-text-3" id="text-1-1">
|
||||
<p>
|
||||
<a id="orgabe5453"></a>
|
||||
<a id="orgeb6170e"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -321,11 +320,11 @@ This Matlab function is accessible <a href="../src/computePsdDispl.m">here</a>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orga7dcbe9" class="outline-3">
|
||||
<h3 id="orga7dcbe9"><span class="section-number-3">1.2</span> computeSetpoint</h3>
|
||||
<div id="outline-container-org164599d" class="outline-3">
|
||||
<h3 id="org164599d"><span class="section-number-3">1.2</span> computeSetpoint</h3>
|
||||
<div class="outline-text-3" id="text-1-2">
|
||||
<p>
|
||||
<a id="org879cac6"></a>
|
||||
<a id="org5f98a47"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -397,11 +396,11 @@ setpoint<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-hi
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org38afc80" class="outline-3">
|
||||
<h3 id="org38afc80"><span class="section-number-3">1.3</span> converErrorBasis</h3>
|
||||
<div id="outline-container-org0d7c91f" class="outline-3">
|
||||
<h3 id="org0d7c91f"><span class="section-number-3">1.3</span> converErrorBasis</h3>
|
||||
<div class="outline-text-3" id="text-1-3">
|
||||
<p>
|
||||
<a id="org1e357a7"></a>
|
||||
<a id="orgdf67397"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -539,11 +538,11 @@ error_nass = <span class="org-rainbow-delimiters-depth-1">[</span>dx; dy; dz; th
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orge0e5103" class="outline-3">
|
||||
<h3 id="orge0e5103"><span class="section-number-3">1.4</span> generateDiagPidControl</h3>
|
||||
<div id="outline-container-orge57e769" class="outline-3">
|
||||
<h3 id="orge57e769"><span class="section-number-3">1.4</span> generateDiagPidControl</h3>
|
||||
<div class="outline-text-3" id="text-1-4">
|
||||
<p>
|
||||
<a id="org0799e34"></a>
|
||||
<a id="org94ba4ce"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -574,11 +573,11 @@ This Matlab function is accessible <a href="../src/generateDiagPidControl.m">her
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orga0abbff" class="outline-3">
|
||||
<h3 id="orga0abbff"><span class="section-number-3">1.5</span> identifyPlant</h3>
|
||||
<div id="outline-container-orgb953a5b" class="outline-3">
|
||||
<h3 id="orgb953a5b"><span class="section-number-3">1.5</span> identifyPlant</h3>
|
||||
<div class="outline-text-3" id="text-1-5">
|
||||
<p>
|
||||
<a id="org348e5c9"></a>
|
||||
<a id="org2662524"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -670,84 +669,11 @@ This Matlab function is accessible <a href="../src/identifyPlant.m">here</a>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd0e3a86" class="outline-3">
|
||||
<h3 id="orgd0e3a86"><span class="section-number-3">1.6</span> runSimulation</h3>
|
||||
<div id="outline-container-org442df30" class="outline-3">
|
||||
<h3 id="org442df30"><span class="section-number-3">1.6</span> Inverse Kinematics of the Hexapod</h3>
|
||||
<div class="outline-text-3" id="text-1-6">
|
||||
<p>
|
||||
<a id="orgc58251f"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This Matlab function is accessible <a href="../src/runSimulation.m">here</a>.
|
||||
</p>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name"><span class="org-rainbow-delimiters-depth-1">[]</span></span> = <span class="org-function-name">runSimulation</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">sys_name</span>, <span class="org-variable-name">sys_mass</span>, <span class="org-variable-name">ctrl_type</span>, <span class="org-variable-name">act_damp</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
||||
<span class="org-matlab-cellbreak"><span class="org-comment">%% Load the controller and save it for the simulation</span></span>
|
||||
<span class="org-keyword">if</span> strcmp<span class="org-rainbow-delimiters-depth-1">(</span>ctrl_type, <span class="org-string">'cl'</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-type">&&</span> strcmp<span class="org-rainbow-delimiters-depth-1">(</span>act_damp, <span class="org-string">'none'</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
||||
K_obj = load<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">'./mat/K_fb.mat'</span><span class="org-rainbow-delimiters-depth-1">)</span>;
|
||||
K = K_obj.<span class="org-rainbow-delimiters-depth-1">(</span>sprintf<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">'K_%s_%s'</span>, sys_mass, sys_name)); <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
save<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">'./mat/controllers.mat'</span>, <span class="org-string">'K'</span><span class="org-rainbow-delimiters-depth-3">)</span>;
|
||||
<span class="org-keyword">elseif</span> strcmp<span class="org-rainbow-delimiters-depth-3">(</span>ctrl_type, <span class="org-string">'cl'</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-type">&&</span> strcmp<span class="org-rainbow-delimiters-depth-3">(</span>act_damp, <span class="org-string">'iff'</span><span class="org-rainbow-delimiters-depth-3">)</span>
|
||||
K_obj = load<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">'./mat/K_fb_iff.mat'</span><span class="org-rainbow-delimiters-depth-3">)</span>;
|
||||
K = K_obj.<span class="org-rainbow-delimiters-depth-3">(</span>sprintf<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">'K_%s_%s_iff'</span>, sys_mass, sys_name)); <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
save<span class="org-rainbow-delimiters-depth-5">(</span><span class="org-string">'./mat/controllers.mat'</span>, <span class="org-string">'K'</span><span class="org-rainbow-delimiters-depth-5">)</span>;
|
||||
<span class="org-keyword">elseif</span> strcmp<span class="org-rainbow-delimiters-depth-5">(</span>ctrl_type, <span class="org-string">'ol'</span><span class="org-rainbow-delimiters-depth-5">)</span>
|
||||
K = tf<span class="org-rainbow-delimiters-depth-5">(</span>zeros<span class="org-rainbow-delimiters-depth-6">(</span><span class="org-highlight-numbers-number">6</span><span class="org-rainbow-delimiters-depth-6">)</span><span class="org-rainbow-delimiters-depth-5">)</span>; <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
save<span class="org-rainbow-delimiters-depth-5">(</span><span class="org-string">'./mat/controllers.mat'</span>, <span class="org-string">'K'</span><span class="org-rainbow-delimiters-depth-5">)</span>;
|
||||
<span class="org-keyword">else</span>
|
||||
error<span class="org-rainbow-delimiters-depth-5">(</span><span class="org-string">'ctrl_type should be cl or ol'</span><span class="org-rainbow-delimiters-depth-5">)</span>;
|
||||
<span class="org-keyword">end</span>
|
||||
|
||||
<span class="org-matlab-cellbreak"><span class="org-comment">%% Active Damping</span></span>
|
||||
<span class="org-keyword">if</span> strcmp<span class="org-rainbow-delimiters-depth-5">(</span>act_damp, <span class="org-string">'iff'</span><span class="org-rainbow-delimiters-depth-5">)</span>
|
||||
K_iff_crit = load<span class="org-rainbow-delimiters-depth-5">(</span><span class="org-string">'./mat/K_iff_crit.mat'</span><span class="org-rainbow-delimiters-depth-5">)</span>;
|
||||
K_iff = K_iff_crit.<span class="org-rainbow-delimiters-depth-5">(</span>sprintf<span class="org-rainbow-delimiters-depth-6">(</span><span class="org-string">'K_iff_%s_%s'</span>, sys_mass, sys_name)); <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
save<span class="org-rainbow-delimiters-depth-7">(</span><span class="org-string">'./mat/controllers.mat'</span>, <span class="org-string">'K_iff'</span>, <span class="org-string">'-append'</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">elseif</span> strcmp<span class="org-rainbow-delimiters-depth-7">(</span>act_damp, <span class="org-string">'none'</span><span class="org-rainbow-delimiters-depth-7">)</span>
|
||||
K_iff = tf<span class="org-rainbow-delimiters-depth-7">(</span>zeros<span class="org-rainbow-delimiters-depth-8">(</span><span class="org-highlight-numbers-number">6</span><span class="org-rainbow-delimiters-depth-8">)</span><span class="org-rainbow-delimiters-depth-7">)</span>; <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
save<span class="org-rainbow-delimiters-depth-7">(</span><span class="org-string">'./mat/controllers.mat'</span>, <span class="org-string">'K_iff'</span>, <span class="org-string">'-append'</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">end</span>
|
||||
|
||||
<span class="org-matlab-cellbreak"><span class="org-comment">%%</span></span>
|
||||
<span class="org-keyword">if</span> strcmp<span class="org-rainbow-delimiters-depth-7">(</span>sys_name, <span class="org-string">'pz'</span><span class="org-rainbow-delimiters-depth-7">)</span>
|
||||
initializeNanoHexapod<span class="org-rainbow-delimiters-depth-7">(</span>struct<span class="org-rainbow-delimiters-depth-8">(</span><span class="org-string">'actuator'</span>, <span class="org-string">'piezo'</span><span class="org-rainbow-delimiters-depth-8">)</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">elseif</span> strcmp<span class="org-rainbow-delimiters-depth-7">(</span>sys_name, <span class="org-string">'vc'</span><span class="org-rainbow-delimiters-depth-7">)</span>
|
||||
initializeNanoHexapod<span class="org-rainbow-delimiters-depth-7">(</span>struct<span class="org-rainbow-delimiters-depth-8">(</span><span class="org-string">'actuator'</span>, <span class="org-string">'lorentz'</span><span class="org-rainbow-delimiters-depth-8">)</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">else</span>
|
||||
error<span class="org-rainbow-delimiters-depth-7">(</span><span class="org-string">'sys_name should be pz or vc'</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">end</span>
|
||||
|
||||
<span class="org-keyword">if</span> strcmp<span class="org-rainbow-delimiters-depth-7">(</span>sys_mass, <span class="org-string">'light'</span><span class="org-rainbow-delimiters-depth-7">)</span>
|
||||
initializeSample<span class="org-rainbow-delimiters-depth-7">(</span>struct<span class="org-rainbow-delimiters-depth-8">(</span><span class="org-string">'mass'</span>, <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-8">)</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">elseif</span> strcmp<span class="org-rainbow-delimiters-depth-7">(</span>sys_mass, <span class="org-string">'heavy'</span><span class="org-rainbow-delimiters-depth-7">)</span>
|
||||
initializeSample<span class="org-rainbow-delimiters-depth-7">(</span>struct<span class="org-rainbow-delimiters-depth-8">(</span><span class="org-string">'mass'</span>, <span class="org-highlight-numbers-number">50</span><span class="org-rainbow-delimiters-depth-8">)</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">else</span>
|
||||
error<span class="org-rainbow-delimiters-depth-7">(</span><span class="org-string">'sys_mass should be light or heavy'</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
<span class="org-keyword">end</span>
|
||||
|
||||
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the simulation</span></span>
|
||||
<span class="org-matlab-simulink-keyword">sim</span><span class="org-rainbow-delimiters-depth-7">(</span><span class="org-string">'sim_nano_station_ctrl.slx'</span><span class="org-rainbow-delimiters-depth-7">)</span>;
|
||||
|
||||
<span class="org-matlab-cellbreak"><span class="org-comment">%% Split the Dsample matrix into vectors</span></span>
|
||||
<span class="org-rainbow-delimiters-depth-7">[</span>Dx, Dy, Dz, Rx, Ry, Rz<span class="org-rainbow-delimiters-depth-7">]</span> = matSplit<span class="org-rainbow-delimiters-depth-7">(</span>Es.Data, <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-7">)</span>; <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
time = Dsample.Time; <span class="org-comment">%#</span><span class="org-comment"><span class="org-bold">ok</span></span>
|
||||
|
||||
<span class="org-matlab-cellbreak"><span class="org-comment">%% Save the result</span></span>
|
||||
filename = sprintf<span class="org-rainbow-delimiters-depth-7">(</span><span class="org-string">'sim_%s_%s_%s_%s'</span>, sys_mass, sys_name, ctrl_type, act_damp);
|
||||
save<span class="org-rainbow-delimiters-depth-8">(</span>sprintf<span class="org-rainbow-delimiters-depth-9">(</span><span class="org-string">'./mat/%s.mat'</span>, filename), ...
|
||||
<span class="org-string">'time'</span>, <span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>, <span class="org-string">'K'</span><span class="org-rainbow-delimiters-depth-9">)</span>;
|
||||
<span class="org-keyword">end</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org288e05d" class="outline-3">
|
||||
<h3 id="org288e05d"><span class="section-number-3">1.7</span> Inverse Kinematics of the Hexapod</h3>
|
||||
<div class="outline-text-3" id="text-1-7">
|
||||
<p>
|
||||
<a id="orgd4c4eda"></a>
|
||||
<a id="org7102666"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -779,11 +705,11 @@ This Matlab function is accessible <a href="src/inverseKinematicsHexapod.m">here
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org33a19ae" class="outline-3">
|
||||
<h3 id="org33a19ae"><span class="section-number-3">1.8</span> computeReferencePose</h3>
|
||||
<div class="outline-text-3" id="text-1-8">
|
||||
<div id="outline-container-orgce14673" class="outline-3">
|
||||
<h3 id="orgce14673"><span class="section-number-3">1.7</span> computeReferencePose</h3>
|
||||
<div class="outline-text-3" id="text-1-7">
|
||||
<p>
|
||||
<a id="org14f924b"></a>
|
||||
<a id="org11721fe"></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -876,7 +802,7 @@ This Matlab function is accessible <a href="src/computeReferencePose.m">here</a>
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: Dehaeze Thomas</p>
|
||||
<p class="date">Created: 2019-12-11 mer. 17:33</p>
|
||||
<p class="date">Created: 2019-12-12 jeu. 11:25</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -407,74 +407,6 @@ This Matlab function is accessible [[file:../src/identifyPlant.m][here]].
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** runSimulation
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/runSimulation.m
|
||||
:header-args:matlab+: :comments none :mkdirp yes :eval no
|
||||
:END:
|
||||
<<sec:runSimulation>>
|
||||
|
||||
This Matlab function is accessible [[file:../src/runSimulation.m][here]].
|
||||
|
||||
#+begin_src matlab
|
||||
function [] = runSimulation(sys_name, sys_mass, ctrl_type, act_damp)
|
||||
%% Load the controller and save it for the simulation
|
||||
if strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'none')
|
||||
K_obj = load('./mat/K_fb.mat');
|
||||
K = K_obj.(sprintf('K_%s_%s', sys_mass, sys_name)); %#ok
|
||||
save('./mat/controllers.mat', 'K');
|
||||
elseif strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'iff')
|
||||
K_obj = load('./mat/K_fb_iff.mat');
|
||||
K = K_obj.(sprintf('K_%s_%s_iff', sys_mass, sys_name)); %#ok
|
||||
save('./mat/controllers.mat', 'K');
|
||||
elseif strcmp(ctrl_type, 'ol')
|
||||
K = tf(zeros(6)); %#ok
|
||||
save('./mat/controllers.mat', 'K');
|
||||
else
|
||||
error('ctrl_type should be cl or ol');
|
||||
end
|
||||
|
||||
%% Active Damping
|
||||
if strcmp(act_damp, 'iff')
|
||||
K_iff_crit = load('./mat/K_iff_crit.mat');
|
||||
K_iff = K_iff_crit.(sprintf('K_iff_%s_%s', sys_mass, sys_name)); %#ok
|
||||
save('./mat/controllers.mat', 'K_iff', '-append');
|
||||
elseif strcmp(act_damp, 'none')
|
||||
K_iff = tf(zeros(6)); %#ok
|
||||
save('./mat/controllers.mat', 'K_iff', '-append');
|
||||
end
|
||||
|
||||
%%
|
||||
if strcmp(sys_name, 'pz')
|
||||
initializeNanoHexapod(struct('actuator', 'piezo'));
|
||||
elseif strcmp(sys_name, 'vc')
|
||||
initializeNanoHexapod(struct('actuator', 'lorentz'));
|
||||
else
|
||||
error('sys_name should be pz or vc');
|
||||
end
|
||||
|
||||
if strcmp(sys_mass, 'light')
|
||||
initializeSample(struct('mass', 1));
|
||||
elseif strcmp(sys_mass, 'heavy')
|
||||
initializeSample(struct('mass', 50));
|
||||
else
|
||||
error('sys_mass should be light or heavy');
|
||||
end
|
||||
|
||||
%% Run the simulation
|
||||
sim('sim_nano_station_ctrl.slx');
|
||||
|
||||
%% Split the Dsample matrix into vectors
|
||||
[Dx, Dy, Dz, Rx, Ry, Rz] = matSplit(Es.Data, 1); %#ok
|
||||
time = Dsample.Time; %#ok
|
||||
|
||||
%% Save the result
|
||||
filename = sprintf('sim_%s_%s_%s_%s', sys_mass, sys_name, ctrl_type, act_damp);
|
||||
save(sprintf('./mat/%s.mat', filename), ...
|
||||
'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Inverse Kinematics of the Hexapod
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/inverseKinematicsHexapod.m
|
||||
|
@ -77,7 +77,7 @@ We first define some parameters for the identification.
|
||||
The simulink file for the identification is =sim_micro_station_id.slx=.
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_micro_station_id.slx'
|
||||
open('identification/matlab/sim_micro_station_id.slx')
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
@ -140,7 +140,7 @@ save('./mat/id_micro_station.mat', 'G_ms');
|
||||
|
||||
** Simscape Model
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_micro_station_modal_analysis.slx'
|
||||
open('identification/matlab/sim_micro_station_modal_analysis.slx')
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
@ -230,7 +230,9 @@ hold off;
|
||||
initializeAxisc();
|
||||
#+end_src
|
||||
|
||||
** Center of Mass of each solid body
|
||||
** TODO Center of Mass of each solid body
|
||||
- [ ] Verify that this is coherent with the simscape and with the measurements
|
||||
|
||||
|
||||
| | granite bot | granite top | ty | ry | rz | hexa |
|
||||
|--------+-------------+-------------+------+------+------+------|
|
||||
@ -239,7 +241,7 @@ hold off;
|
||||
| Z [mm] | -1251 | -778 | -600 | -628 | -580 | -319 |
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_micro_station_modal_analysis_com.slx'
|
||||
open('identification/matlab/sim_micro_station_modal_analysis_com.slx')
|
||||
#+end_src
|
||||
|
||||
** Simscape Model
|
||||
@ -409,22 +411,8 @@ hold off;
|
||||
#+CAPTION: caption ([[./figs/identification_comp_top_stages.png][png]], [[./figs/identification_comp_top_stages.pdf][pdf]])
|
||||
[[file:figs/identification_comp_top_stages.png]]
|
||||
|
||||
* ZIP file containing the data and matlab files :ignore:
|
||||
#+begin_src bash :exports none :results none
|
||||
if [ matlab/identification_micro_station.m -nt data/identification_micro_station.zip ]; then
|
||||
cp matlab/identification_micro_station.m identification_micro_station.m;
|
||||
zip data/identification_micro_station \
|
||||
mat/data.mat \
|
||||
identification_micro_station.m
|
||||
rm identification_micro_station.m;
|
||||
fi
|
||||
#+end_src
|
||||
|
||||
#+begin_note
|
||||
All the files (data and Matlab scripts) are accessible [[file:data/identification_micro_station.zip][here]].
|
||||
#+end_note
|
||||
|
||||
* Matlab Init :noexport:ignore:
|
||||
* Other analysis
|
||||
** Matlab Init :noexport:ignore:
|
||||
#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
|
||||
<<matlab-dir>>
|
||||
#+end_src
|
||||
@ -433,15 +421,14 @@ hold off;
|
||||
<<matlab-init>>
|
||||
#+end_src
|
||||
|
||||
* Identification of the micro-station
|
||||
#+begin_src matlab
|
||||
simulinkproject('../');
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open sim_micro_station_id.slx
|
||||
open('identification/matlab/sim_micro_station_id.slx')
|
||||
#+end_src
|
||||
|
||||
* Plot the obtained transfer functions
|
||||
* Compare with the modal measurements
|
||||
* Modal Identification of the micro station
|
||||
** Plot the obtained transfer functions
|
||||
** Compare with the modal measurements
|
||||
** Modal Identification of the micro station
|
||||
|
@ -147,7 +147,7 @@ Otherwise, when the limbs' lengths derived yield complex numbers, then the posit
|
||||
**** Matlab Implementation
|
||||
We open the Simulink file.
|
||||
#+begin_src matlab
|
||||
open 'simscape/hexapod_tests.slx'
|
||||
open('kinematics/matlab/hexapod_tests.slx')
|
||||
#+end_src
|
||||
|
||||
We load the configuration and set a small =StopTime=.
|
||||
@ -182,7 +182,7 @@ We define the wanted position/orientation of the Hexapod under study.
|
||||
|
||||
We run the simulation.
|
||||
#+begin_src matlab
|
||||
sim('simscape/hexapod_tests.slx')
|
||||
sim('hexapod_tests.slx')
|
||||
#+end_src
|
||||
|
||||
And we verify that we indeed succeed to go to the wanted position.
|
||||
|
@ -96,7 +96,7 @@ The goal here is to perfectly move the station and verify that there is no misma
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_metrology.slx'
|
||||
open('positioning_error/matlab/sim_nano_station_metrology.slx')
|
||||
#+end_src
|
||||
|
||||
** Prepare the Simulation
|
||||
@ -160,7 +160,7 @@ No position error for now (perfect positioning).
|
||||
|
||||
And we run the simulation.
|
||||
#+begin_src matlab
|
||||
sim('simscape/sim_nano_station_metrology.slx');
|
||||
sim('sim_nano_station_metrology.slx');
|
||||
#+end_src
|
||||
|
||||
** Verify that the pose of the sample is the same as the computed one
|
||||
@ -246,7 +246,7 @@ We want to verify that we are able to measure this positioning error and convert
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_metrology.slx'
|
||||
open('positioning_error/matlab/sim_nano_station_metrology.slx')
|
||||
#+end_src
|
||||
|
||||
** Prepare the Simulation
|
||||
@ -308,7 +308,7 @@ Now we introduce some positioning error.
|
||||
|
||||
And we run the simulation.
|
||||
#+begin_src matlab
|
||||
sim('simscape/sim_nano_station_metrology.slx');
|
||||
sim('sim_nano_station_metrology.slx');
|
||||
#+end_src
|
||||
|
||||
** Compute the wanted pose of the sample in the NASS Base from the metrology and the reference
|
||||
@ -407,7 +407,7 @@ We now keep the wanted pose but we impose a displacement of the nano hexapod cor
|
||||
|
||||
And we run the simulation.
|
||||
#+begin_src matlab
|
||||
sim('simscape/sim_nano_station_metrology.slx');
|
||||
sim('sim_nano_station_metrology.slx');
|
||||
#+end_src
|
||||
|
||||
We keep the old computed computed reference pose ${}^W\bm{T}_r$ even though we have change the nano hexapod reference, but this is not a real wanted reference but rather a adaptation to reject the positioning errors.
|
||||
@ -497,7 +497,7 @@ Thus:
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_metrology.slx'
|
||||
open('positioning_error/matlab/sim_nano_station_metrology.slx')
|
||||
#+end_src
|
||||
|
||||
** Wanted Position of the Sample with respect to the Granite
|
||||
|
@ -1,56 +0,0 @@
|
||||
function [] = runSimulation(sys_name, sys_mass, ctrl_type, act_damp)
|
||||
%% Load the controller and save it for the simulation
|
||||
if strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'none')
|
||||
K_obj = load('./mat/K_fb.mat');
|
||||
K = K_obj.(sprintf('K_%s_%s', sys_mass, sys_name)); %#ok
|
||||
save('./mat/controllers.mat', 'K');
|
||||
elseif strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'iff')
|
||||
K_obj = load('./mat/K_fb_iff.mat');
|
||||
K = K_obj.(sprintf('K_%s_%s_iff', sys_mass, sys_name)); %#ok
|
||||
save('./mat/controllers.mat', 'K');
|
||||
elseif strcmp(ctrl_type, 'ol')
|
||||
K = tf(zeros(6)); %#ok
|
||||
save('./mat/controllers.mat', 'K');
|
||||
else
|
||||
error('ctrl_type should be cl or ol');
|
||||
end
|
||||
|
||||
%% Active Damping
|
||||
if strcmp(act_damp, 'iff')
|
||||
K_iff_crit = load('./mat/K_iff_crit.mat');
|
||||
K_iff = K_iff_crit.(sprintf('K_iff_%s_%s', sys_mass, sys_name)); %#ok
|
||||
save('./mat/controllers.mat', 'K_iff', '-append');
|
||||
elseif strcmp(act_damp, 'none')
|
||||
K_iff = tf(zeros(6)); %#ok
|
||||
save('./mat/controllers.mat', 'K_iff', '-append');
|
||||
end
|
||||
|
||||
%%
|
||||
if strcmp(sys_name, 'pz')
|
||||
initializeNanoHexapod(struct('actuator', 'piezo'));
|
||||
elseif strcmp(sys_name, 'vc')
|
||||
initializeNanoHexapod(struct('actuator', 'lorentz'));
|
||||
else
|
||||
error('sys_name should be pz or vc');
|
||||
end
|
||||
|
||||
if strcmp(sys_mass, 'light')
|
||||
initializeSample(struct('mass', 1));
|
||||
elseif strcmp(sys_mass, 'heavy')
|
||||
initializeSample(struct('mass', 50));
|
||||
else
|
||||
error('sys_mass should be light or heavy');
|
||||
end
|
||||
|
||||
%% Run the simulation
|
||||
sim('sim_nano_station_ctrl.slx');
|
||||
|
||||
%% Split the Dsample matrix into vectors
|
||||
[Dx, Dy, Dz, Rx, Ry, Rz] = matSplit(Es.Data, 1); %#ok
|
||||
time = Dsample.Time; %#ok
|
||||
|
||||
%% Save the result
|
||||
filename = sprintf('sim_%s_%s_%s_%s', sys_mass, sys_name, ctrl_type, act_damp);
|
||||
save(sprintf('./mat/%s.mat', filename), ...
|
||||
'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
|
||||
end
|
@ -643,7 +643,7 @@ Let's start by study the undamped system.
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
|
||||
#+end_src
|
||||
|
||||
** Init
|
||||
@ -1075,7 +1075,7 @@ It corresponds to the plant to control.
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
|
||||
#+end_src
|
||||
|
||||
** Control Design
|
||||
@ -1501,7 +1501,7 @@ In the Relative Motion Control (RMC), a derivative feedback is applied between t
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
|
||||
#+end_src
|
||||
|
||||
** Control Design
|
||||
@ -1936,7 +1936,7 @@ In the Relative Motion Control (RMC), a feedback is applied between the measured
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
|
||||
#+end_src
|
||||
|
||||
** Control Design
|
||||
@ -2236,7 +2236,7 @@ The model used for the Cedrat actuator is shown in figure [[fig:cedrat_schematic
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial_cedrat.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial_cedrat.slx')
|
||||
#+end_src
|
||||
|
||||
** Identification
|
||||
@ -2573,7 +2573,7 @@ All the controllers are set to 0.
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
|
||||
#+end_src
|
||||
|
||||
** Load the plants
|
||||
@ -2831,7 +2831,7 @@ It is important to note that the effect of direct forces applied to the sample a
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
open 'simscape/sim_nano_station_uniaxial.slx'
|
||||
open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
|
||||
#+end_src
|
||||
|
||||
** Init
|
||||
|
Loading…
Reference in New Issue
Block a user