Update active damping analysis: add IFF + HPF

This commit is contained in:
Thomas Dehaeze 2020-01-20 17:20:50 +01:00
parent c5bb46c184
commit fe26a724f1
31 changed files with 715 additions and 288 deletions

File diff suppressed because it is too large Load Diff

View File

@ -265,7 +265,7 @@ And we save them for further analysis.
end end
hold off; hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [(m/s)/N]'); set(gca, 'XTickLabel',[]); ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2); ax2 = subplot(2, 1, 2);
hold on; hold on;
@ -510,6 +510,63 @@ We save the controller for further analysis.
save('./active_damping/mat/K_iff.mat', 'K_iff'); save('./active_damping/mat/K_iff.mat', 'K_iff');
#+end_src #+end_src
*** IFF with High Pass Filter
#+begin_src matlab
w_hpf = 2*pi*10; % Cut-off frequency for the high pass filter [rad/s]
w_lpf = 2*pi*200; % Cut-off frequency for the low pass filter [rad/s]
K_iff = 2*pi*200/s * (s/w_hpf)/(s/w_hpf + 1) * 1/(s/w_lpf + 1);
#+end_src
The corresponding loop gains are shown in figure [[fig:iff_hpf_open_loop]].
#+begin_src matlab :exports none
freqs = logspace(0, 3, 1000);
figure;
ax1 = subplot(2, 1, 1);
hold on;
for i=1:6
plot(freqs, abs(squeeze(freqresp(K_iff*G_iff(['Fnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz'))));
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2);
hold on;
for i=1:6
plot(freqs, 180/pi*angle(squeeze(freqresp(K_iff*G_iff(['Fnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz'))));
end
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/iff_hpf_open_loop.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:iff_hpf_open_loop
#+CAPTION: Loop Gain for the Integral Force Feedback with an High pass filter ([[./figs/iff_hpf_open_loop.png][png]], [[./figs/iff_hpf_open_loop.pdf][pdf]])
[[file:figs/iff_hpf_open_loop.png]]
We create the diagonal controller and we add a minus sign as we have a positive
feedback architecture.
#+begin_src matlab
K_iff = -K_iff*eye(6);
#+end_src
We save the controller for further analysis.
#+begin_src matlab
save('./active_damping/mat/K_iff_hpf.mat', 'K_iff');
#+end_src
** TODO Identification of the damped plant :noexport: ** TODO Identification of the damped plant :noexport:
*** Initialize the Simulation *** Initialize the Simulation
We initialize all the stages with the default parameters. We initialize all the stages with the default parameters.
@ -768,7 +825,7 @@ However, it increases coupling at low frequency (figure [[fig:plant_iff_coupling
[[file:figs/plant_iff_coupling.png]] [[file:figs/plant_iff_coupling.png]]
** Tomography Experiment ** Tomography Experiment
*** Initialize the Simulation *** Simulation with IFF Controller
We initialize elements for the tomography experiment. We initialize elements for the tomography experiment.
#+begin_src matlab #+begin_src matlab
prepareTomographyExperiment(); prepareTomographyExperiment();
@ -780,7 +837,6 @@ We set the IFF controller.
save('./mat/controllers.mat', 'K_iff', '-append'); save('./mat/controllers.mat', 'K_iff', '-append');
#+end_src #+end_src
*** Simulation
We change the simulation stop time. We change the simulation stop time.
#+begin_src matlab #+begin_src matlab
load('mat/conf_simscape.mat'); load('mat/conf_simscape.mat');
@ -799,29 +855,86 @@ Finally, we save the simulation results for further analysis
save('./active_damping/mat/tomo_exp.mat', 'En_iff', 'Eg_iff', '-append'); save('./active_damping/mat/tomo_exp.mat', 'En_iff', 'Eg_iff', '-append');
#+end_src #+end_src
*** Simulation with IFF Controller with added High Pass Filter
We initialize elements for the tomography experiment.
#+begin_src matlab
prepareTomographyExperiment();
#+end_src
We set the IFF controller with the High Pass Filter.
#+begin_src matlab
load('./active_damping/mat/K_iff_hpf.mat', 'K_iff');
save('./mat/controllers.mat', 'K_iff', '-append');
#+end_src
We change the simulation stop time.
#+begin_src matlab
load('mat/conf_simscape.mat');
set_param(conf_simscape, 'StopTime', '3');
#+end_src
And we simulate the system.
#+begin_src matlab
sim('sim_nass_active_damping');
#+end_src
Finally, we save the simulation results for further analysis
#+begin_src matlab
En_iff_hpf = En;
Eg_iff_hpf = Eg;
save('./active_damping/mat/tomo_exp.mat', 'En_iff_hpf', 'Eg_iff_hpf', '-append');
#+end_src
*** Compare with Undamped system *** Compare with Undamped system
We load the results of tomography experiments. We load the results of tomography experiments.
#+begin_src matlab #+begin_src matlab
load('./active_damping/mat/tomo_exp.mat', 'En', 'En_iff'); load('./active_damping/mat/tomo_exp.mat', 'En', 'En_iff', 'En_iff_hpf');
#+end_src
#+begin_src matlab
t = linspace(0, 3, length(En(:,1))); t = linspace(0, 3, length(En(:,1)));
#+end_src #+end_src
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; hold on;
plot(t, En(:,1), 'DisplayName', '$\epsilon_{x}$') plot(En(:,1), En(:,2), 'DisplayName', '$\epsilon_{x,y}$ - OL')
plot(t, En(:,2), 'DisplayName', '$\epsilon_{y}$') plot(En_iff(:,1), En_iff(:,2), 'DisplayName', '$\epsilon_{x,y}$ - IFF')
plot(t, En(:,3), 'DisplayName', '$\epsilon_{z}$') plot(En_iff_hpf(:,1), En_iff_hpf(:,2), 'DisplayName', '$\epsilon_{x,y}$ - IFF + HPF')
set(gca,'ColorOrderIndex',1); xlabel('X Motion [m]'); ylabel('Y Motion [m]');
plot(t, En_iff(:,1), '--', 'DisplayName', '$\epsilon_{x}$ - IFF')
plot(t, En_iff(:,2), '--', 'DisplayName', '$\epsilon_{y}$ - IFF')
plot(t, En_iff(:,3), '--', 'DisplayName', '$\epsilon_{z}$ - IFF')
hold off;
legend('location', 'northwest'); legend('location', 'northwest');
xlabel('Time [s]'); ylabel('Position Error [m]'); #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/nass_act_damp_iff_sim_tomo_xy.pdf" :var figsize="small-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:nass_act_damp_iff_sim_tomo_xy
#+CAPTION: Position Error during tomography experiment - XY Motion ([[./figs/nass_act_damp_iff_sim_tomo_xy.png][png]], [[./figs/nass_act_damp_iff_sim_tomo_xy.pdf][pdf]])
[[file:figs/nass_act_damp_iff_sim_tomo_xy.png]]
#+begin_src matlab :exports none
figure;
ax1 = subplot(3, 1, 1);
hold on;
plot(t, En(:,1), 'DisplayName', '$\epsilon_{x}$')
plot(t, En_iff(:,1), 'DisplayName', '$\epsilon_{x}$ - IFF')
plot(t, En_iff_hpf(:,1), 'DisplayName', '$\epsilon_{x}$ - IFF + HPF')
legend('location', 'southwest');
ax2 = subplot(3, 1, 2);
hold on;
plot(t, En(:,2), 'DisplayName', '$\epsilon_{y}$')
plot(t, En_iff(:,2), 'DisplayName', '$\epsilon_{y}$ - IFF')
plot(t, En_iff_hpf(:,2), 'DisplayName', '$\epsilon_{y}$ - IFF + HPF')
legend('location', 'southwest');
ylabel('Position Error [m]');
ax3 = subplot(3, 1, 3);
hold on;
plot(t, En(:,3), 'DisplayName', '$\epsilon_{z}$')
plot(t, En_iff(:,3), 'DisplayName', '$\epsilon_{z}$ - IFF')
plot(t, En_iff_hpf(:,3), 'DisplayName', '$\epsilon_{z}$ - IFF + HPF')
legend('location', 'northwest');
xlabel('Time [s]');
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
@ -835,18 +948,30 @@ We load the results of tomography experiments.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
ax1 = subplot(3, 1, 1);
hold on; hold on;
plot(t, En(:,4), 'DisplayName', '$\epsilon_{\theta_x}$') plot(t, En(:,4), 'DisplayName', '$\epsilon_{\theta_x}$')
plot(t, En_iff(:,4), 'DisplayName', '$\epsilon_{\theta_x}$ - IFF')
plot(t, En_iff_hpf(:,4), 'DisplayName', '$\epsilon_{\theta_x}$ - IFF + HPF')
legend('location', 'northwest');
ax2 = subplot(3, 1, 2);
hold on;
plot(t, En(:,5), 'DisplayName', '$\epsilon_{\theta_y}$') plot(t, En(:,5), 'DisplayName', '$\epsilon_{\theta_y}$')
plot(t, En_iff(:,5), 'DisplayName', '$\epsilon_{\theta_y}$ - IFF')
plot(t, En_iff_hpf(:,5), 'DisplayName', '$\epsilon_{\theta_y}$ - IFF + HPF')
legend('location', 'southwest');
ylabel('Position Error [rad]');
ax3 = subplot(3, 1, 3);
hold on;
plot(t, En(:,6), 'DisplayName', '$\epsilon_{\theta_z}$') plot(t, En(:,6), 'DisplayName', '$\epsilon_{\theta_z}$')
set(gca,'ColorOrderIndex',1); plot(t, En_iff(:,6), 'DisplayName', '$\epsilon_{\theta_z}$ - IFF')
plot(t, En_iff(:,4), '--', 'DisplayName', '$\epsilon_{\theta_x}$ - IFF') plot(t, En_iff_hpf(:,6), 'DisplayName', '$\epsilon_{\theta_z}$ - IFF + HPF')
plot(t, En_iff(:,5), '--', 'DisplayName', '$\epsilon_{\theta_y}$ - IFF')
plot(t, En_iff(:,6), '--', 'DisplayName', '$\epsilon_{\theta_z}$ - IFF')
hold off;
xlim([0.5,inf]);
legend(); legend();
xlabel('Time [s]'); ylabel('Position Error [rad]'); xlabel('Time [s]');
linkaxes([ax1,ax2,ax3],'x');
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
@ -1261,16 +1386,42 @@ We load the results of tomography experiments.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; hold on;
plot(t, En(:,1), 'DisplayName', '$\epsilon_{x}$') plot(En(:,1), En(:,2), 'DisplayName', '$\epsilon_{x,y}$ - OL')
plot(t, En(:,2), 'DisplayName', '$\epsilon_{y}$') plot(En_dvf(:,1), En_dvf(:,2), 'DisplayName', '$\epsilon_{x,y}$ - DVF')
plot(t, En(:,3), 'DisplayName', '$\epsilon_{z}$') xlabel('X Motion [m]'); ylabel('Y Motion [m]');
set(gca,'ColorOrderIndex',1);
plot(t, En_dvf(:,1), '--', 'DisplayName', '$\epsilon_{x}$ - DVF')
plot(t, En_dvf(:,2), '--', 'DisplayName', '$\epsilon_{y}$ - DVF')
plot(t, En_dvf(:,3), '--', 'DisplayName', '$\epsilon_{z}$ - DVF')
hold off;
legend(); legend();
xlabel('Time [s]'); ylabel('Position Error [m]'); #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/nass_act_damp_dvf_sim_tomo_xy.pdf" :var figsize="small-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:nass_act_damp_dvf_sim_tomo_xy
#+CAPTION: Position Error during tomography experiment - XY Motion ([[./figs/nass_act_damp_dvf_sim_tomo_xy.png][png]], [[./figs/nass_act_damp_dvf_sim_tomo_xy.pdf][pdf]])
[[file:figs/nass_act_damp_dvf_sim_tomo_xy.png]]
#+begin_src matlab :exports none
figure;
ax1 = subplot(3, 1, 1);
hold on;
plot(t, En(:,1), 'DisplayName', '$\epsilon_{x}$')
plot(t, En_dvf(:,1), 'DisplayName', '$\epsilon_{x}$ - DVF')
legend();
ax2 = subplot(3, 1, 2);
hold on;
plot(t, En(:,2), 'DisplayName', '$\epsilon_{y}$')
plot(t, En_dvf(:,2), 'DisplayName', '$\epsilon_{y}$ - DVF')
legend();
ylabel('Position Error [m]');
ax3 = subplot(3, 1, 3);
hold on;
plot(t, En(:,3), 'DisplayName', '$\epsilon_{z}$')
plot(t, En_dvf(:,3), 'DisplayName', '$\epsilon_{z}$ - DVF')
legend();
xlabel('Time [s]');
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
@ -1284,18 +1435,27 @@ We load the results of tomography experiments.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
ax1 = subplot(3, 1, 1);
hold on; hold on;
plot(t, En(:,4), 'DisplayName', '$\epsilon_{\theta_x}$') plot(t, En(:,4), 'DisplayName', '$\epsilon_{\theta_x}$')
plot(t, En(:,5), 'DisplayName', '$\epsilon_{\theta_y}$') plot(t, En_dvf(:,4), 'DisplayName', '$\epsilon_{\theta_x}$ - DVF')
plot(t, En(:,6), 'DisplayName', '$\epsilon_{\theta_z}$')
set(gca,'ColorOrderIndex',1);
plot(t, En_dvf(:,4), '--', 'DisplayName', '$\epsilon_{\theta_x}$ - DVF')
plot(t, En_dvf(:,5), '--', 'DisplayName', '$\epsilon_{\theta_y}$ - DVF')
plot(t, En_dvf(:,6), '--', 'DisplayName', '$\epsilon_{\theta_z}$ - DVF')
hold off;
xlim([0.5,inf]);
legend(); legend();
xlabel('Time [s]'); ylabel('Position Error [rad]');
ax2 = subplot(3, 1, 2);
hold on;
plot(t, En(:,5), 'DisplayName', '$\epsilon_{\theta_y}$')
plot(t, En_dvf(:,5), 'DisplayName', '$\epsilon_{\theta_y}$ - DVF')
legend();
ylabel('Position Error [rad]');
ax3 = subplot(3, 1, 3);
hold on;
plot(t, En(:,6), 'DisplayName', '$\epsilon_{\theta_z}$')
plot(t, En_dvf(:,6), 'DisplayName', '$\epsilon_{\theta_z}$ - DVF')
legend();
xlabel('Time [s]');
linkaxes([ax1,ax2,ax3],'x');
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
@ -1336,7 +1496,7 @@ Direct Velocity Feedback:
#+end_note #+end_note
** Introduction :ignore: ** Introduction :ignore:
In Inertial Control, a feedback is applied between the measured *absolute* velocity of the platform to the actuator force input. In Inertial Control, a feedback is applied between the measured *absolute* motion (velocity or acceleration) of the platform to the actuator force input.
** Matlab Init :noexport: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) #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
@ -1380,7 +1540,7 @@ Let's look at the transfer function from actuator forces in the nano-hexapod to
end end
hold off; hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); ylabel('Amplitude [$\frac{m/s^2}{N}$]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 1, 2); ax2 = subplot(2, 1, 2);
hold on; hold on;
@ -1409,7 +1569,7 @@ Let's look at the transfer function from actuator forces in the nano-hexapod to
The controller is defined below and the obtained loop gain is shown in figure [[fig:ine_open_loop_gain]]. The controller is defined below and the obtained loop gain is shown in figure [[fig:ine_open_loop_gain]].
#+begin_src matlab #+begin_src matlab
K_ine = 1e3/(1+s/(2*pi*100)); K_ine = 1e4/(1+s/(2*pi*100));
#+end_src #+end_src
#+begin_src matlab :exports none #+begin_src matlab :exports none
@ -1688,19 +1848,46 @@ We load the results of tomography experiments.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
hold on; hold on;
plot(t, En(:,1), 'DisplayName', '$\epsilon_{x}$') plot(En(:,1), En(:,2), 'DisplayName', '$\epsilon_{x,y}$ - OL')
plot(t, En(:,2), 'DisplayName', '$\epsilon_{y}$') plot(En_ine(:,1), En_ine(:,2), 'DisplayName', '$\epsilon_{x,y}$ - Inertial')
plot(t, En(:,3), 'DisplayName', '$\epsilon_{z}$') xlabel('X Motion [m]'); ylabel('Y Motion [m]');
set(gca,'ColorOrderIndex',1);
plot(t, En_ine(:,1), '--', 'DisplayName', '$\epsilon_{x}$ - Inertial')
plot(t, En_ine(:,2), '--', 'DisplayName', '$\epsilon_{y}$ - Inertial')
plot(t, En_ine(:,3), '--', 'DisplayName', '$\epsilon_{z}$ - Inertial')
hold off;
legend(); legend();
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/nass_act_damp_ine_sim_tomo_trans.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/nass_act_damp_ine_sim_tomo_xy.pdf" :var figsize="small-normal" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>
#+end_src
#+NAME: fig:nass_act_damp_ine_sim_tomo_xy
#+CAPTION: Position Error during tomography experiment - XY Motion ([[./figs/nass_act_damp_ine_sim_tomo_xy.png][png]], [[./figs/nass_act_damp_ine_sim_tomo_xy.pdf][pdf]])
[[file:figs/nass_act_damp_ine_sim_tomo_xy.png]]
#+begin_src matlab :exports none
figure;
ax1 = subplot(3, 1, 1);
hold on;
plot(t, En(:,1), 'DisplayName', '$\epsilon_{x}$')
plot(t, En_ine(:,1), 'DisplayName', '$\epsilon_{x}$ - Inertial')
legend();
ax2 = subplot(3, 1, 2);
hold on;
plot(t, En(:,2), 'DisplayName', '$\epsilon_{y}$')
plot(t, En_ine(:,2), 'DisplayName', '$\epsilon_{y}$ - Inertial')
legend();
ylabel('Position Error [m]');
ax3 = subplot(3, 1, 3);
hold on;
plot(t, En(:,3), 'DisplayName', '$\epsilon_{z}$')
plot(t, En_ine(:,3), 'DisplayName', '$\epsilon_{z}$ - Inertial')
legend();
xlabel('Time [s]');
#+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/nass_act_damp_ine_sim_tomo_trans.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -1710,21 +1897,31 @@ We load the results of tomography experiments.
#+begin_src matlab :exports none #+begin_src matlab :exports none
figure; figure;
ax1 = subplot(3, 1, 1);
hold on; hold on;
plot(t, En(:,4), 'DisplayName', '$\epsilon_{\theta_x}$') plot(t, En(:,4), 'DisplayName', '$\epsilon_{\theta_x}$')
plot(t, En(:,5), 'DisplayName', '$\epsilon_{\theta_y}$') plot(t, En_ine(:,4), 'DisplayName', '$\epsilon_{\theta_x}$ - Inertial')
plot(t, En(:,6), 'DisplayName', '$\epsilon_{\theta_z}$')
set(gca,'ColorOrderIndex',1);
plot(t, En_ine(:,4), '--', 'DisplayName', '$\epsilon_{\theta_x}$ - Inertial')
plot(t, En_ine(:,5), '--', 'DisplayName', '$\epsilon_{\theta_y}$ - Inertial')
plot(t, En_ine(:,6), '--', 'DisplayName', '$\epsilon_{\theta_z}$ - Inertial')
hold off;
xlim([0.5,inf]);
legend(); legend();
ax2 = subplot(3, 1, 2);
hold on;
plot(t, En(:,5), 'DisplayName', '$\epsilon_{\theta_y}$')
plot(t, En_ine(:,5), 'DisplayName', '$\epsilon_{\theta_y}$ - Inertial')
legend();
ylabel('Position Error [rad]');
ax3 = subplot(3, 1, 3);
hold on;
plot(t, En(:,6), 'DisplayName', '$\epsilon_{\theta_z}$')
plot(t, En_ine(:,6), 'DisplayName', '$\epsilon_{\theta_z}$ - Inertial')
legend();
xlabel('Time [s]');
linkaxes([ax1,ax2,ax3],'x');
#+end_src #+end_src
#+HEADER: :tangle no :exports results :results none :noweb yes #+HEADER: :tangle no :exports results :results none :noweb yes
#+begin_src matlab :var filepath="figs/nass_act_damp_ine_sim_tomo_rot.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") #+begin_src matlab :var filepath="figs/nass_act_damp_ine_sim_tomo_rot.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>> <<plt-matlab>>
#+end_src #+end_src
@ -2017,12 +2214,70 @@ Inertial Control:
*** Frequency Domain *** Frequency Domain
#+begin_src matlab #+begin_src matlab
Ts = t(1); % Sample Time for the Data [s] Ts = t(2)-t(1); % Sample Time for the Data [s]
n_av = 8; n_av = 8;
han_win = hanning(ceil(length(En(:, 1))/n_av)); han_win = hanning(ceil(length(En(:, 1))/n_av));
[pdx, f] = pwelch(Ern(:, 1), han_win, [], [], 1/Ts); [pxx, f] = pwelch(En(:, 1), han_win, [], [], 1/Ts);
[pxx_ine, ~] = pwelch(En_ine(:, 1), han_win, [], [], 1/Ts);
[pxx_dvf, ~] = pwelch(En_dvf(:, 1), han_win, [], [], 1/Ts);
[pxx_iff, ~] = pwelch(En_iff(:, 1), han_win, [], [], 1/Ts);
[pyy, ~] = pwelch(En(:, 2), han_win, [], [], 1/Ts);
[pyy_ine, ~] = pwelch(En_ine(:, 2), han_win, [], [], 1/Ts);
[pyy_dvf, ~] = pwelch(En_dvf(:, 2), han_win, [], [], 1/Ts);
[pyy_iff, ~] = pwelch(En_iff(:, 2), han_win, [], [], 1/Ts);
[pzz, ~] = pwelch(En(:, 3), han_win, [], [], 1/Ts);
[pzz_ine, ~] = pwelch(En_ine(:, 3), han_win, [], [], 1/Ts);
[pzz_dvf, ~] = pwelch(En_dvf(:, 3), han_win, [], [], 1/Ts);
[pzz_iff, ~] = pwelch(En_iff(:, 3), han_win, [], [], 1/Ts);
[prx, ~] = pwelch(En(:, 4), han_win, [], [], 1/Ts);
[prx_ine, ~] = pwelch(En_ine(:, 4), han_win, [], [], 1/Ts);
[prx_dvf, ~] = pwelch(En_dvf(:, 4), han_win, [], [], 1/Ts);
[prx_iff, ~] = pwelch(En_iff(:, 4), han_win, [], [], 1/Ts);
[pry, ~] = pwelch(En(:, 5), han_win, [], [], 1/Ts);
[pry_ine, ~] = pwelch(En_ine(:, 5), han_win, [], [], 1/Ts);
[pry_dvf, ~] = pwelch(En_dvf(:, 5), han_win, [], [], 1/Ts);
[pry_iff, ~] = pwelch(En_iff(:, 5), han_win, [], [], 1/Ts);
[prz, ~] = pwelch(En(:, 6), han_win, [], [], 1/Ts);
[prz_ine, ~] = pwelch(En_ine(:, 6), han_win, [], [], 1/Ts);
[prz_dvf, ~] = pwelch(En_dvf(:, 6), han_win, [], [], 1/Ts);
[prz_iff, ~] = pwelch(En_iff(:, 6), han_win, [], [], 1/Ts);
#+end_src
#+begin_src matlab
figure;
hold on;
plot(f, prx_ine, 'DisplayName', 'Inertial')
plot(f, prx_dvf, 'DisplayName', 'DVF')
plot(f, prx_iff, 'DisplayName', 'IFF')
plot(f, prx, 'k--', 'DisplayName', 'Undamped')
hold off;
xlabel('Frequency [Hz]');
ylabel('Power Spectral Density [$m^2/Hz$]');
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
legend('location', 'northeast');
xlim([1, 500]);
#+end_src
#+begin_src matlab
figure;
hold on;
plot(f, pxx_ine, 'DisplayName', 'Inertial')
plot(f, pxx_dvf, 'DisplayName', 'DVF')
plot(f, pxx_iff, 'DisplayName', 'IFF')
plot(f, pxx, 'k--', 'DisplayName', 'Undamped')
hold off;
xlabel('Frequency [Hz]');
ylabel('Power Spectral Density [$m^2/Hz$]');
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
legend('location', 'northeast');
xlim([1, 500]);
#+end_src #+end_src
* Useful Functions * Useful Functions
@ -2036,11 +2291,18 @@ Inertial Control:
This Matlab function is accessible [[file:src/prepareTomographyExperiment.m][here]]. This Matlab function is accessible [[file:src/prepareTomographyExperiment.m][here]].
*** Function Description *** Function Description
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab #+begin_src matlab
function [] = prepareTomographyExperiment(args) function [] = prepareTomographyExperiment(args)
#+end_src #+end_src
*** Optional Parameters *** Optional Parameters
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab #+begin_src matlab
arguments arguments
args.nass_actuator char {mustBeMember(args.nass_actuator,{'piezo', 'lorentz'})} = 'piezo' args.nass_actuator char {mustBeMember(args.nass_actuator,{'piezo', 'lorentz'})} = 'piezo'
@ -2050,6 +2312,9 @@ This Matlab function is accessible [[file:src/prepareTomographyExperiment.m][her
#+end_src #+end_src
*** Initialize the Simulation *** Initialize the Simulation
:PROPERTIES:
:UNNUMBERED: t
:END:
We initialize all the stages with the default parameters. We initialize all the stages with the default parameters.
#+begin_src matlab #+begin_src matlab
initializeGround(); initializeGround();

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
figs/iff_hpf_open_loop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 109 KiB

BIN
figs/plant_G_cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.