nass-simscape/uniaxial/index.org

1192 lines
43 KiB
Org Mode
Raw Normal View History

#+TITLE: Simscape Uniaxial Model
:DRAWER:
#+STARTUP: overview
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
#+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP: ../index.html
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/zenburn.css"/>
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/bootstrap.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/readtheorg.js"></script>
#+HTML_MATHJAX: align: center tagside: right font: TeX
#+PROPERTY: header-args:matlab :session *MATLAB*
#+PROPERTY: header-args:matlab+ :comments org
#+PROPERTY: header-args:matlab+ :results none
#+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+ :mkdirp yes
#+PROPERTY: header-args:shell :eval no-export
#+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/thesis/latex/}{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 raw replace :buffer no
#+PROPERTY: header-args:latex+ :eval no-export
#+PROPERTY: header-args:latex+ :exports both
#+PROPERTY: header-args:latex+ :mkdirp yes
#+PROPERTY: header-args:latex+ :output-dir figs
:END:
* Introduction :ignore:
The idea is to use the same model as the full Simscape Model but to restrict the motion only in the vertical direction.
This is done in order to more easily study the system and evaluate control techniques.
* Undamped System
** 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
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
#+begin_src matlab :tangle no
simulinkproject('../');
#+end_src
#+begin_src matlab
open 'simscape/sim_nano_station_uniaxial.slx'
#+end_src
** Init
We initialize all the stages with the default parameters.
The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
#+begin_src matlab
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
initializeNanoHexapod(struct('actuator', 'piezo'));
initializeSample(struct('mass', 50));
#+end_src
All the controllers are set to 0.
#+begin_src matlab
K = tf(0);
save('./mat/controllers.mat', 'K', '-append');
K_iff = tf(0);
save('./mat/controllers.mat', 'K_iff', '-append');
K_rmc = tf(0);
save('./mat/controllers.mat', 'K_rmc', '-append');
K_dvf = tf(0);
save('./mat/controllers.mat', 'K_dvf', '-append');
#+end_src
** Identification
#+begin_src matlab
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'sim_nano_station_uniaxial';
#+end_src
#+begin_src matlab
%% Input/Output definition
io(1) = linio([mdl, '/Dw'], 1, 'input'); % Ground Motion
io(2) = linio([mdl, '/Fs'], 1, 'input'); % Force applied on the sample
io(3) = linio([mdl, '/Fnl'], 1, 'input'); % Force applied by the NASS
io(4) = linio([mdl, '/Fdty'], 1, 'input'); % Parasitic force Ty
io(5) = linio([mdl, '/Fdrz'], 1, 'input'); % Parasitic force Rz
io(6) = linio([mdl, '/Dsm'], 1, 'output'); % Displacement of the sample
io(7) = linio([mdl, '/Fnlm'], 1, 'output'); % Force sensor in NASS's legs
io(8) = linio([mdl, '/Dnlm'], 1, 'output'); % Displacement of NASS's legs
io(9) = linio([mdl, '/Dgm'], 1, 'output'); % Absolute displacement of the granite
io(10) = linio([mdl, '/Vlm'], 1, 'output'); % Measured absolute velocity of the top NASS platform
#+end_src
#+begin_src matlab
%% Run the linearization
G = linearize(mdl, io, options);
G.InputName = {'Dw', ... % Ground Motion [m]
'Fs', ... % Force Applied on Sample [N]
'Fn', ... % Force applied by NASS [N]
'Fty', ... % Parasitic Force Ty [N]
'Frz'}; % Parasitic Force Rz [N]
G.OutputName = {'D', ... % Measured sample displacement x.r.t. granite [m]
'Fnm', ... % Force Sensor in NASS [N]
'Dnm', ... % Displacement Sensor in NASS [m]
'Dgm', ... % Asbolute displacement of Granite [m]
'Vlm'}; ... % Absolute Velocity of NASS [m/s]
#+end_src
** Sensitivity to Disturbances
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$D_w$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Dw'), freqs, 'Hz'))), 'k-');
% plot(freqs, abs(squeeze(freqresp(G('Dgm', 'Dw'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
subplot(2, 1, 2);
title('$F_s$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fs'), freqs, 'Hz'))), 'k-');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial-sensitivity-disturbances.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial-sensitivity-disturbances
#+CAPTION: Sensitivity to disturbances ([[./figs/uniaxial-sensitivity-disturbances.png][png]], [[./figs/uniaxial-sensitivity-disturbances.pdf][pdf]])
[[file:figs/uniaxial-sensitivity-disturbances.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$F_{ty}$ to $D$');
plot(freqs, abs(squeeze(freqresp(G('D', 'Fty'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
subplot(2, 1, 2);
title('$F_{rz}$ to $D$');
plot(freqs, abs(squeeze(freqresp(G('D', 'Frz'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial-sensitivity-force-dist.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial-sensitivity-force-dist
#+CAPTION: Sensitivity to disturbances ([[./figs/uniaxial-sensitivity-force-dist.png][png]], [[./figs/uniaxial-sensitivity-force-dist.pdf][pdf]])
[[file:figs/uniaxial-sensitivity-force-dist.png]]
** Plant
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial-plant.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial-plant
#+CAPTION: Bode plot of the Plant ([[./figs/uniaxial-plant.png][png]], [[./figs/uniaxial-plant.pdf][pdf]])
[[file:figs/uniaxial-plant.png]]
** Save
#+begin_src matlab
save('./uniaxial/mat/plants.mat', 'G');
#+end_src
* Integral Force Feedback
<<sec:iff>>
** Introduction :ignore:
** 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
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
#+begin_src matlab :tangle no
simulinkproject('../');
#+end_src
#+begin_src matlab
open 'simscape/sim_nano_station_uniaxial.slx'
#+end_src
** Control Design
#+begin_src matlab
load('./uniaxial/mat/plants.mat', 'G');
#+end_src
Let's look at the transfer function from actuator forces in the nano-hexapod to the force sensor in the nano-hexapod legs for all 6 pairs of actuator/sensor.
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(G('Fnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(G('Fnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_iff_plant.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_iff_plant
#+CAPTION: Transfer function from forces applied in the legs to force sensor ([[./figs/uniaxial_iff_plant.png][png]], [[./figs/uniaxial_iff_plant.pdf][pdf]])
[[file:figs/uniaxial_iff_plant.png]]
The controller for each pair of actuator/sensor is:
#+begin_src matlab
K_iff = -1000/s;
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(K_iff*G('Fnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(K_iff*G('Fnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_iff_open_loop.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_iff_open_loop
#+CAPTION: Loop Gain for the Integral Force Feedback ([[./figs/uniaxial_iff_open_loop.png][png]], [[./figs/uniaxial_iff_open_loop.pdf][pdf]])
[[file:figs/uniaxial_iff_open_loop.png]]
** Identification
Let's initialize the system prior to identification.
#+begin_src matlab
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
initializeNanoHexapod(struct('actuator', 'piezo'));
initializeSample(struct('mass', 50));
#+end_src
All the controllers are set to 0.
#+begin_src matlab
K = tf(0);
save('./mat/controllers.mat', 'K', '-append');
K_iff = -K_iff;
save('./mat/controllers.mat', 'K_iff', '-append');
K_rmc = tf(0);
save('./mat/controllers.mat', 'K_rmc', '-append');
K_dvf = tf(0);
save('./mat/controllers.mat', 'K_dvf', '-append');
#+end_src
#+begin_src matlab
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'sim_nano_station_uniaxial';
#+end_src
#+begin_src matlab
%% Input/Output definition
io(1) = linio([mdl, '/Dw'], 1, 'input'); % Ground Motion
io(2) = linio([mdl, '/Fs'], 1, 'input'); % Force applied on the sample
io(3) = linio([mdl, '/Fnl'], 1, 'input'); % Force applied by the NASS
io(4) = linio([mdl, '/Fdty'], 1, 'input'); % Parasitic force Ty
io(5) = linio([mdl, '/Fdrz'], 1, 'input'); % Parasitic force Rz
io(6) = linio([mdl, '/Dsm'], 1, 'output'); % Displacement of the sample
io(7) = linio([mdl, '/Fnlm'], 1, 'output'); % Force sensor in NASS's legs
io(8) = linio([mdl, '/Dnlm'], 1, 'output'); % Displacement of NASS's legs
io(9) = linio([mdl, '/Dgm'], 1, 'output'); % Absolute displacement of the granite
io(10) = linio([mdl, '/Vlm'], 1, 'output'); % Measured absolute velocity of the top NASS platform
#+end_src
#+begin_src matlab
%% Run the linearization
G_iff = linearize(mdl, io, options);
G_iff.InputName = {'Dw', ... % Ground Motion [m]
'Fs', ... % Force Applied on Sample [N]
'Fn', ... % Force applied by NASS [N]
'Fty', ... % Parasitic Force Ty [N]
'Frz'}; % Parasitic Force Rz [N]
G_iff.OutputName = {'D', ... % Measured sample displacement x.r.t. granite [m]
'Fnm', ... % Force Sensor in NASS [N]
'Dnm', ... % Displacement Sensor in NASS [m]
'Dgm', ... % Asbolute displacement of Granite [m]
'Vlm'}; ... % Absolute Velocity of NASS [m/s]
#+end_src
** Sensitivity to Disturbance
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$D_w$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Dw'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Dw'), freqs, 'Hz'))), 'k--', 'DisplayName', 'IFF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_s$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fs'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Fs'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_iff.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_iff
#+CAPTION: Sensitivity to disturbance once the IFF controller is applied to the system ([[./figs/uniaxial_sensitivity_dist_iff.png][png]], [[./figs/uniaxial_sensitivity_dist_iff.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_iff.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$F_{ty}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fty'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Fty'), freqs, 'Hz'))), 'k--', 'DisplayName', 'IFF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_{rz}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Frz'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Frz'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_stages_iff.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_stages_iff
#+CAPTION: Sensitivity to force disturbances in various stages when IFF is applied ([[./figs/uniaxial_sensitivity_dist_stages_iff.png][png]], [[./figs/uniaxial_sensitivity_dist_stages_iff.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_stages_iff.png]]
** Damped Plant
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Fn'), freqs, 'Hz'))), 'k--', 'DisplayName', 'IFF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
legend('location', 'northeast');
ax2 = subplot(2, 1, 2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_iff('D', 'Fn'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_plant_iff_damped.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_plant_iff_damped
#+CAPTION: Damped Plant after IFF is applied ([[./figs/uniaxial_plant_iff_damped.png][png]], [[./figs/uniaxial_plant_iff_damped.pdf][pdf]])
[[file:figs/uniaxial_plant_iff_damped.png]]
** Save
#+begin_src matlab
save('./uniaxial/mat/plants.mat', 'G_iff', '-append');
#+end_src
** Conclusion
#+begin_important
Integral Force Feedback:
#+end_important
* Relative Motion Control
<<sec:rmc>>
** Introduction :ignore:
In the Relative Motion Control (RMC), a derivative feedback is applied between the measured actuator displacement to the actuator force input.
** 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
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
#+begin_src matlab :tangle no
simulinkproject('../');
#+end_src
#+begin_src matlab
open 'simscape/sim_nano_station_uniaxial.slx'
#+end_src
** Control Design
#+begin_src matlab
load('./uniaxial/mat/plants.mat', 'G');
#+end_src
Let's look at the transfer function from actuator forces in the nano-hexapod to the measured displacement of the actuator for all 6 pairs of actuator/sensor.
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(G('Dnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(G('Dnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_rmc_plant.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_rmc_plant
#+CAPTION: Transfer function from forces applied in the legs to leg displacement sensor ([[./figs/uniaxial_rmc_plant.png][png]], [[./figs/uniaxial_rmc_plant.pdf][pdf]])
[[file:figs/uniaxial_rmc_plant.png]]
The Relative Motion Controller is defined below.
A Low pass Filter is added to make the controller transfer function proper.
#+begin_src matlab
K_rmc = s*50000/(1 + s/2/pi/10000);
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(K_rmc*G('Dnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(K_rmc*G('Dnm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_rmc_open_loop.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_rmc_open_loop
#+CAPTION: Loop Gain for the Integral Force Feedback ([[./figs/uniaxial_rmc_open_loop.png][png]], [[./figs/uniaxial_rmc_open_loop.pdf][pdf]])
[[file:figs/uniaxial_rmc_open_loop.png]]
** Identification
Let's initialize the system prior to identification.
#+begin_src matlab
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
initializeNanoHexapod(struct('actuator', 'piezo'));
initializeSample(struct('mass', 50));
#+end_src
And initialize the controllers.
#+begin_src matlab
K = tf(0);
save('./mat/controllers.mat', 'K', '-append');
K_iff = tf(0);
save('./mat/controllers.mat', 'K_iff', '-append');
K_rmc = -K_rmc;
save('./mat/controllers.mat', 'K_rmc', '-append');
K_dvf = tf(0);
save('./mat/controllers.mat', 'K_dvf', '-append');
#+end_src
#+begin_src matlab
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'sim_nano_station_uniaxial';
#+end_src
#+begin_src matlab
%% Input/Output definition
io(1) = linio([mdl, '/Dw'], 1, 'input'); % Ground Motion
io(2) = linio([mdl, '/Fs'], 1, 'input'); % Force applied on the sample
io(3) = linio([mdl, '/Fnl'], 1, 'input'); % Force applied by the NASS
io(4) = linio([mdl, '/Fdty'], 1, 'input'); % Parasitic force Ty
io(5) = linio([mdl, '/Fdrz'], 1, 'input'); % Parasitic force Rz
io(6) = linio([mdl, '/Dsm'], 1, 'output'); % Displacement of the sample
io(7) = linio([mdl, '/Fnlm'], 1, 'output'); % Force sensor in NASS's legs
io(8) = linio([mdl, '/Dnlm'], 1, 'output'); % Displacement of NASS's legs
io(9) = linio([mdl, '/Dgm'], 1, 'output'); % Absolute displacement of the granite
io(10) = linio([mdl, '/Vlm'], 1, 'output'); % Measured absolute velocity of the top NASS platform
#+end_src
#+begin_src matlab
%% Run the linearization
G_rmc = linearize(mdl, io, options);
G_rmc.InputName = {'Dw', ... % Ground Motion [m]
'Fs', ... % Force Applied on Sample [N]
'Fn', ... % Force applied by NASS [N]
'Fty', ... % Parasitic Force Ty [N]
'Frz'}; % Parasitic Force Rz [N]
G_rmc.OutputName = {'D', ... % Measured sample displacement x.r.t. granite [m]
'Fnm', ... % Force Sensor in NASS [N]
'Dnm', ... % Displacement Sensor in NASS [m]
'Dgm', ... % Asbolute displacement of Granite [m]
'Vlm'}; ... % Absolute Velocity of NASS [m/s]
#+end_src
** Sensitivity to Disturbance
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$D_w$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Dw'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Dw'), freqs, 'Hz'))), 'k--', 'DisplayName', 'RMC');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_s$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fs'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Fs'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_rmc.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_rmc
#+CAPTION: Sensitivity to disturbance once the RMC controller is applied to the system ([[./figs/uniaxial_sensitivity_dist_rmc.png][png]], [[./figs/uniaxial_sensitivity_dist_rmc.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_rmc.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$F_{ty}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fty'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Fty'), freqs, 'Hz'))), 'k--', 'DisplayName', 'RMC');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_{rz}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Frz'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Frz'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_stages_rmc.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_stages_rmc
#+CAPTION: Sensitivity to force disturbances in various stages when RMC is applied ([[./figs/uniaxial_sensitivity_dist_stages_rmc.png][png]], [[./figs/uniaxial_sensitivity_dist_stages_rmc.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_stages_rmc.png]]
** Damped Plant
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Fn'), freqs, 'Hz'))), 'k--', 'DisplayName', 'RMC');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
legend('location', 'northeast');
ax2 = subplot(2, 1, 2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_rmc('D', 'Fn'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_plant_rmc_damped.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_plant_rmc_damped
#+CAPTION: Damped Plant after RMC is applied ([[./figs/uniaxial_plant_rmc_damped.png][png]], [[./figs/uniaxial_plant_rmc_damped.pdf][pdf]])
[[file:figs/uniaxial_plant_rmc_damped.png]]
** Save
#+begin_src matlab
save('./uniaxial/mat/plants.mat', 'G_rmc', '-append');
#+end_src
** Conclusion
#+begin_important
Relative Motion Control:
#+end_important
* Direct Velocity Feedback
<<sec:dvf>>
** Introduction :ignore:
In the Relative Motion Control (RMC), a feedback is applied between the measured velocity of the platform to the actuator force input.
** 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
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
#+begin_src matlab :tangle no
simulinkproject('../');
#+end_src
#+begin_src matlab
open 'simscape/sim_nano_station_uniaxial.slx'
#+end_src
** Control Design
#+begin_src matlab
load('./uniaxial/mat/plants.mat', 'G');
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(G('Vlm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(G('Vlm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_dvf_plant.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_dvf_plant
#+CAPTION: Transfer function from forces applied in the legs to leg velocity sensor ([[./figs/uniaxial_dvf_plant.png][png]], [[./figs/uniaxial_dvf_plant.pdf][pdf]])
[[file:figs/uniaxial_dvf_plant.png]]
#+begin_src matlab
K_dvf = tf(5e4);
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
plot(freqs, abs(squeeze(freqresp(K_dvf*G('Vlm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
plot(freqs, 180/pi*angle(squeeze(freqresp(K_dvf*G('Vlm', 'Fn'), freqs, 'Hz'))), 'k-');
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_dvf_loop_gain.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_dvf_loop_gain
#+CAPTION: Transfer function from forces applied in the legs to leg velocity sensor ([[./figs/uniaxial_dvf_loop_gain.png][png]], [[./figs/uniaxial_dvf_loop_gain.pdf][pdf]])
[[file:figs/uniaxial_dvf_loop_gain.png]]
** Identification
Let's initialize the system prior to identification.
#+begin_src matlab
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
initializeNanoHexapod(struct('actuator', 'piezo'));
initializeSample(struct('mass', 50));
#+end_src
And initialize the controllers.
#+begin_src matlab
K = tf(0);
save('./mat/controllers.mat', 'K', '-append');
K_iff = tf(0);
save('./mat/controllers.mat', 'K_iff', '-append');
K_rmc = tf(0);
save('./mat/controllers.mat', 'K_rmc', '-append');
K_dvf = -K_dvf;
save('./mat/controllers.mat', 'K_dvf', '-append');
#+end_src
#+begin_src matlab
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'sim_nano_station_uniaxial';
#+end_src
#+begin_src matlab
%% Input/Output definition
io(1) = linio([mdl, '/Dw'], 1, 'input'); % Ground Motion
io(2) = linio([mdl, '/Fs'], 1, 'input'); % Force applied on the sample
io(3) = linio([mdl, '/Fnl'], 1, 'input'); % Force applied by the NASS
io(4) = linio([mdl, '/Fdty'], 1, 'input'); % Parasitic force Ty
io(5) = linio([mdl, '/Fdrz'], 1, 'input'); % Parasitic force Rz
io(6) = linio([mdl, '/Dsm'], 1, 'output'); % Displacement of the sample
io(7) = linio([mdl, '/Fnlm'], 1, 'output'); % Force sensor in NASS's legs
io(8) = linio([mdl, '/Dnlm'], 1, 'output'); % Displacement of NASS's legs
io(9) = linio([mdl, '/Dgm'], 1, 'output'); % Absolute displacement of the granite
io(10) = linio([mdl, '/Vlm'], 1, 'output'); % Measured absolute velocity of the top NASS platform
#+end_src
#+begin_src matlab
%% Run the linearization
G_dvf = linearize(mdl, io, options);
G_dvf.InputName = {'Dw', ... % Ground Motion [m]
'Fs', ... % Force Applied on Sample [N]
'Fn', ... % Force applied by NASS [N]
'Fty', ... % Parasitic Force Ty [N]
'Frz'}; % Parasitic Force Rz [N]
G_dvf.OutputName = {'D', ... % Measured sample displacement x.r.t. granite [m]
'Fnm', ... % Force Sensor in NASS [N]
'Dnm', ... % Displacement Sensor in NASS [m]
'Dgm', ... % Asbolute displacement of Granite [m]
'Vlm'}; ... % Absolute Velocity of NASS [m/s]
#+end_src
** Sensitivity to Disturbance
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$D_w$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Dw'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Dw'), freqs, 'Hz'))), 'k--', 'DisplayName', 'DVF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_s$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fs'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Fs'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_dvf.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_dvf
#+CAPTION: Sensitivity to disturbance once the DVF controller is applied to the system ([[./figs/uniaxial_sensitivity_dist_dvf.png][png]], [[./figs/uniaxial_sensitivity_dist_dvf.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_dvf.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$F_{ty}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fty'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Fty'), freqs, 'Hz'))), 'k--', 'DisplayName', 'DVF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_{rz}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Frz'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Frz'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_stages_dvf.pdf" :var figsize="full-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_stages_dvf
#+CAPTION: Sensitivity to force disturbances in various stages when DVF is applied ([[./figs/uniaxial_sensitivity_dist_stages_dvf.png][png]], [[./figs/uniaxial_sensitivity_dist_stages_dvf.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_stages_dvf.png]]
** Damped Plant
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Fn'), freqs, 'Hz'))), 'k--', 'DisplayName', 'DVF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
legend('location', 'northeast');
ax2 = subplot(2, 1, 2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_dvf('D', 'Fn'), freqs, 'Hz'))), 'k--');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_plant_dvf_damped.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_plant_dvf_damped
#+CAPTION: Damped Plant after DVF is applied ([[./figs/uniaxial_plant_dvf_damped.png][png]], [[./figs/uniaxial_plant_dvf_damped.pdf][pdf]])
[[file:figs/uniaxial_plant_dvf_damped.png]]
** Save
#+begin_src matlab
save('./uniaxial/mat/plants.mat', 'G_dvf', '-append');
#+end_src
** Conclusion
#+begin_important
Direct Velocity Feedback:
#+end_important
* Comparison of Active Damping Techniques
<<sec:comparison>>
** 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
#+begin_src matlab :exports none :results silent :noweb yes
<<matlab-init>>
#+end_src
#+begin_src matlab :tangle no
simulinkproject('../');
#+end_src
#+begin_src matlab
open 'simscape/sim_nano_station_uniaxial.slx'
#+end_src
** Load the plants
#+begin_src matlab
load('./uniaxial/mat/plants.mat', 'G', 'G_iff', 'G_rmc', 'G_dvf');
#+end_src
** Sensitivity to Disturbance
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$D_w$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Dw'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Dw'), freqs, 'Hz'))), 'k:', 'DisplayName', 'IFF');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Dw'), freqs, 'Hz'))), 'k--', 'DisplayName', 'RMC');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Dw'), freqs, 'Hz'))), 'k-.', 'DisplayName', 'DVF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_s$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fs'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Fs'), freqs, 'Hz'))), 'k:');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Fs'), freqs, 'Hz'))), 'k--');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Fs'), freqs, 'Hz'))), 'k-.');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_comp.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_comp
#+CAPTION: Sensitivity to disturbance - Comparison ([[./figs/uniaxial_sensitivity_dist_comp.png][png]], [[./figs/uniaxial_sensitivity_dist_comp.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_comp.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
subplot(2, 1, 1);
title('$F_{ty}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fty'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Fty'), freqs, 'Hz'))), 'k:', 'DisplayName', 'IFF');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Fty'), freqs, 'Hz'))), 'k--', 'DisplayName', 'RMC');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Fty'), freqs, 'Hz'))), 'k-.', 'DisplayName', 'DVF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
legend('location', 'northeast');
subplot(2, 1, 2);
title('$F_{rz}$ to $D$');
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Frz'), freqs, 'Hz'))), 'k-');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Frz'), freqs, 'Hz'))), 'k');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Frz'), freqs, 'Hz'))), 'k--');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Frz'), freqs, 'Hz'))), 'k-.');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_sensitivity_dist_stages_comp.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_sensitivity_dist_stages_comp
#+CAPTION: Sensitivity to force disturbances - Comparison ([[./figs/uniaxial_sensitivity_dist_stages_comp.png][png]], [[./figs/uniaxial_sensitivity_dist_stages_comp.pdf][pdf]])
[[file:figs/uniaxial_sensitivity_dist_stages_comp.png]]
** Damped Plant
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
hold on;
plot(freqs, abs(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-', 'DisplayName', 'OL');
plot(freqs, abs(squeeze(freqresp(G_iff('D', 'Fn'), freqs, 'Hz'))), 'k:', 'DisplayName', 'IFF');
plot(freqs, abs(squeeze(freqresp(G_rmc('D', 'Fn'), freqs, 'Hz'))), 'k--', 'DisplayName', 'RMC');
plot(freqs, abs(squeeze(freqresp(G_dvf('D', 'Fn'), freqs, 'Hz'))), 'k-.', 'DisplayName', 'DVF');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
legend('location', 'northeast');
ax2 = subplot(2, 1, 2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G('D', 'Fn'), freqs, 'Hz'))), 'k-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_iff('D', 'Fn'), freqs, 'Hz'))), 'k:');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_rmc('D', 'Fn'), freqs, 'Hz'))), 'k--');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_dvf('D', 'Fn'), freqs, 'Hz'))), 'k-.');
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
linkaxes([ax1,ax2],'x');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/uniaxial_plant_damped_comp.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:uniaxial_plant_damped_comp
#+CAPTION: Damped Plant - Comparison ([[./figs/uniaxial_plant_damped_comp.png][png]], [[./figs/uniaxial_plant_damped_comp.pdf][pdf]])
[[file:figs/uniaxial_plant_damped_comp.png]]
** Conclusion