Correct stupid error

This commit is contained in:
Thomas Dehaeze 2020-04-17 14:32:08 +02:00
parent 6522211e01
commit 00452e0a49
19 changed files with 1835 additions and 2096 deletions

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-04-17 ven. 14:10 -->
<!-- 2020-04-17 ven. 14:32 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Decentralize control to add virtual mass</title>
<meta name="generator" content="Org mode" />
@ -37,24 +36,19 @@
<div id="text-table-of-contents">
<ul>
<li><a href="#org982b263">1. Initialization</a></li>
<li><a href="#org35a3822">2. Identification</a>
<ul>
<li><a href="#org33f35d2">2.1. Identification of the transfer function from \(\tau\) to \(d\mathcal{L}\)</a></li>
<li><a href="#org6663ed2">2.2. Identification of the Primary plant without virtual add of mass</a></li>
</ul>
</li>
<li><a href="#org35a3822">2. Identification</a></li>
<li><a href="#orgd6fc719">3. Adding Virtual Mass in the Leg&rsquo;s Space</a>
<ul>
<li><a href="#orgc37faa7">3.1. Plant</a></li>
<li><a href="#org4ae3263">3.2. Controller Design</a></li>
<li><a href="#orgb270293">3.3. Identification of the Primary Plant</a></li>
<li><a href="#org9ed2d4c">3.1. Plant</a></li>
<li><a href="#org4f03a34">3.2. Controller Design</a></li>
<li><a href="#org2fe0ce0">3.3. Identification of the Primary Plant</a></li>
</ul>
</li>
<li><a href="#orgc9131d0">4. Adding Virtual Mass in the Task Space</a>
<ul>
<li><a href="#org9ed2d4c">4.1. Plant</a></li>
<li><a href="#org4f03a34">4.2. Controller Design</a></li>
<li><a href="#org2fe0ce0">4.3. Identification of the Primary Plant</a></li>
<li><a href="#orga27c9a0">4.1. Plant</a></li>
<li><a href="#orgcbce41a">4.2. Controller Design</a></li>
<li><a href="#orgca1f525">4.3. Identification of the Primary Plant</a></li>
</ul>
</li>
</ul>
@ -82,6 +76,14 @@ initializeController(<span class="org-string">'type'</span>, <span class="org-st
</pre>
</div>
<p>
The nano-hexapod has the following leg&rsquo;s stiffness and damping.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeNanoHexapod(<span class="org-string">'k'</span>, 1e5, <span class="org-string">'c'</span>, 2e2);
</pre>
</div>
<p>
We set the stiffness of the payload fixation:
</p>
@ -95,16 +97,6 @@ We set the stiffness of the payload fixation:
<div id="outline-container-org35a3822" class="outline-2">
<h2 id="org35a3822"><span class="section-number-2">2</span> Identification</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-org33f35d2" class="outline-3">
<h3 id="org33f35d2"><span class="section-number-3">2.1</span> Identification of the transfer function from \(\tau\) to \(d\mathcal{L}\)</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-matlab">K = tf(zeros(6));
Kdvf = tf(zeros(6));
</pre>
</div>
<p>
We identify the system for the following payload masses:
</p>
@ -114,25 +106,17 @@ We identify the system for the following payload masses:
</div>
<p>
The nano-hexapod has the following leg&rsquo;s stiffness and damping.
Identification of the transfer function from \(\tau\) to \(d\mathcal{L}\).
Identification of the Primary plant without virtual add of mass
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeNanoHexapod(<span class="org-string">'k'</span>, 1e5, <span class="org-string">'c'</span>, 2e2);
</pre>
</div>
</div>
</div>
<div id="outline-container-org6663ed2" class="outline-3">
<h3 id="org6663ed2"><span class="section-number-3">2.2</span> Identification of the Primary plant without virtual add of mass</h3>
</div>
</div>
<div id="outline-container-orgd6fc719" class="outline-2">
<h2 id="orgd6fc719"><span class="section-number-2">3</span> Adding Virtual Mass in the Leg&rsquo;s Space</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-orgc37faa7" class="outline-3">
<h3 id="orgc37faa7"><span class="section-number-3">3.1</span> Plant</h3>
<div id="outline-container-org9ed2d4c" class="outline-3">
<h3 id="org9ed2d4c"><span class="section-number-3">3.1</span> Plant</h3>
<div class="outline-text-3" id="text-3-1">
<div id="org98e7ba8" class="figure">
@ -143,8 +127,8 @@ The nano-hexapod has the following leg&rsquo;s stiffness and damping.
</div>
</div>
<div id="outline-container-org4ae3263" class="outline-3">
<h3 id="org4ae3263"><span class="section-number-3">3.2</span> Controller Design</h3>
<div id="outline-container-org4f03a34" class="outline-3">
<h3 id="org4f03a34"><span class="section-number-3">3.2</span> Controller Design</h3>
<div class="outline-text-3" id="text-3-2">
<div class="org-src-container">
<pre class="src src-matlab">Kdvf = 10<span class="org-type">*</span>s<span class="org-type">^</span>2<span class="org-type">/</span>(1<span class="org-type">+</span>s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>500)<span class="org-type">^</span>2<span class="org-type">*</span>eye(6);
@ -160,8 +144,8 @@ The nano-hexapod has the following leg&rsquo;s stiffness and damping.
</div>
</div>
<div id="outline-container-orgb270293" class="outline-3">
<h3 id="orgb270293"><span class="section-number-3">3.3</span> Identification of the Primary Plant</h3>
<div id="outline-container-org2fe0ce0" class="outline-3">
<h3 id="org2fe0ce0"><span class="section-number-3">3.3</span> Identification of the Primary Plant</h3>
<div class="outline-text-3" id="text-3-3">
<div id="orgd49505e" class="figure">
@ -184,8 +168,8 @@ The nano-hexapod has the following leg&rsquo;s stiffness and damping.
<h2 id="orgc9131d0"><span class="section-number-2">4</span> Adding Virtual Mass in the Task Space</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-org9ed2d4c" class="outline-3">
<h3 id="org9ed2d4c"><span class="section-number-3">4.1</span> Plant</h3>
<div id="outline-container-orga27c9a0" class="outline-3">
<h3 id="orga27c9a0"><span class="section-number-3">4.1</span> Plant</h3>
<div class="outline-text-3" id="text-4-1">
<p>
Let&rsquo;s look at the transfer function from \(\bm{\mathcal{F}}\) to \(d\bm{\mathcal{X}}\):
@ -201,8 +185,8 @@ Let&rsquo;s look at the transfer function from \(\bm{\mathcal{F}}\) to \(d\bm{\m
</div>
</div>
<div id="outline-container-org4f03a34" class="outline-3">
<h3 id="org4f03a34"><span class="section-number-3">4.2</span> Controller Design</h3>
<div id="outline-container-orgcbce41a" class="outline-3">
<h3 id="orgcbce41a"><span class="section-number-3">4.2</span> Controller Design</h3>
<div class="outline-text-3" id="text-4-2">
<div class="org-src-container">
<pre class="src src-matlab">KmX = (s<span class="org-type">^</span>2<span class="org-type">*</span>1<span class="org-type">/</span>(1<span class="org-type">+</span>s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>500)<span class="org-type">^</span>2<span class="org-type">*</span>diag([1 1 50 0 0 0]));
@ -223,8 +207,8 @@ Let&rsquo;s look at the transfer function from \(\bm{\mathcal{F}}\) to \(d\bm{\m
</div>
</div>
<div id="outline-container-org2fe0ce0" class="outline-3">
<h3 id="org2fe0ce0"><span class="section-number-3">4.3</span> Identification of the Primary Plant</h3>
<div id="outline-container-orgca1f525" class="outline-3">
<h3 id="orgca1f525"><span class="section-number-3">4.3</span> Identification of the Primary Plant</h3>
<div class="outline-text-3" id="text-4-3">
<div id="orge1df87b" class="figure">
@ -245,7 +229,7 @@ Let&rsquo;s look at the transfer function from \(\bm{\mathcal{F}}\) to \(d\bm{\m
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-04-17 ven. 14:10</p>
<p class="date">Created: 2020-04-17 ven. 14:32</p>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 223 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 236 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -37,62 +37,66 @@
initializeController('type', 'hac-dvf');
#+end_src
We set the stiffness of the payload fixation:
#+begin_src matlab
Kp = 1e8; % [N/m]
#+end_src
* Identification
** Identification of the transfer function from $\tau$ to $d\mathcal{L}$
#+begin_src matlab
K = tf(zeros(6));
Kdvf = tf(zeros(6));
#+end_src
We identify the system for the following payload masses:
#+begin_src matlab
Ms = [1, 10, 50];
#+end_src
#+begin_src matlab :exports none
Gm = {zeros(length(Ms), 1)};
#+end_src
The nano-hexapod has the following leg's stiffness and damping.
#+begin_src matlab
initializeNanoHexapod('k', 1e5, 'c', 2e2);
#+end_src
We set the stiffness of the payload fixation:
#+begin_src matlab
Kp = 1e8; % [N/m]
#+end_src
#+begin_src matlab :exports none
K = tf(zeros(6));
Kdvf = tf(zeros(6));
#+end_src
* Identification
We identify the system for the following payload masses:
#+begin_src matlab
Ms = [1, 10, 50];
#+end_src
Identification of the transfer function from $\tau$ to $d\mathcal{L}$.
#+begin_src matlab :exports none
Gm = {zeros(length(Ms), 1)};
%% Name of the Simulink File
mdl = 'nass_model';
%% Input/Output definition
clear io; io_i = 1;
io(io_i) = linio([mdl, '/Controller'], 1, 'openinput'); io_i = io_i + 1; % Actuator Inputs
io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; % Force Sensors
#+end_src
io(io_i) = linio([mdl, '/Controller'], 1, 'openinput'); io_i = io_i + 1;
io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1;
#+begin_src matlab :exports none
for i = 1:length(Ms)
initializeSample('mass', Ms(i), 'freq', sqrt(Kp/Ms(i))/2/pi*ones(6,1));
initializeReferences('Rz_type', 'rotating-not-filtered', 'Rz_period', Ms(i));
%% Run the linearization
G_dvf = linearize(mdl, io);
G_dvf.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'};
G_dvf.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'};
Gm(i) = {G_dvf};
G = linearize(mdl, io);
G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'};
G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'};
Gm(i) = {G};
end
#+end_src
** Identification of the Primary plant without virtual add of mass
Identification of the Primary plant without virtual add of mass
#+begin_src matlab :exports none
G_x = {zeros(length(Ms), 1)};
G_l = {zeros(length(Ms), 1)};
#+end_src
#+begin_src matlab :exports none
load('mat/stages.mat', 'nano_hexapod');
%% Name of the Simulink File
mdl = 'nass_model';
%% Input/Output definition
clear io; io_i = 1;
io(io_i) = linio([mdl, '/Controller'], 1, 'input'); io_i = io_i + 1; % Actuator Inputs
io(io_i) = linio([mdl, '/Tracking Error'], 1, 'output', [], 'En'); io_i = io_i + 1; % Position Errror
for i = 1:length(Ms)
initializeSample('mass', Ms(i), 'freq', sqrt(Kp/Ms(i))/2/pi*ones(6,1));
initializeReferences('Rz_type', 'rotating-not-filtered', 'Rz_period', Ms(i));
@ -224,7 +228,7 @@ exportFig('figs/virtual_mass_loop_gain_L.pdf', 'width', 'full', 'height', 'full'
%% Run the linearization
G = linearize(mdl, io);
G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'};
G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'};
G.OutputName = {'Ex', 'Ey', 'Ez', 'Erx', 'Ery', 'Erz'};
Gx = -G*inv(nano_hexapod.J');
@ -238,7 +242,7 @@ exportFig('figs/virtual_mass_loop_gain_L.pdf', 'width', 'full', 'height', 'full'
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 5000);
freqs = logspace(0, 3, 1000);
figure;
@ -320,7 +324,7 @@ exportFig('figs/virtual_mass_L_primary_plant_X.pdf', 'width', 'full', 'height',
[[file:figs/virtual_mass_L_primary_plant_X.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 5000);
freqs = logspace(0, 3, 1000);
figure;
@ -413,7 +417,7 @@ Let's look at the transfer function from $\bm{\mathcal{F}}$ to $d\bm{\mathcal{X}
yticks([-360:90:360]);
legend('location', 'northeast');
ax1 = subplot(2, 2, 2);
ax3 = subplot(2, 2, 2);
hold on;
for i = 1:length(Ms)
set(gca,'ColorOrderIndex',i);
@ -423,7 +427,7 @@ Let's look at the transfer function from $\bm{\mathcal{F}}$ to $d\bm{\mathcal{X}
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 2, 4);
ax4 = subplot(2, 2, 4);
hold on;
for i = 1:length(Ms)
set(gca,'ColorOrderIndex',i);
@ -437,7 +441,7 @@ Let's look at the transfer function from $\bm{\mathcal{F}}$ to $d\bm{\mathcal{X}
yticks([-360:90:360]);
legend('location', 'northeast');
linkaxes([ax1,ax2],'x');
linkaxes([ax1,ax2,ax3,ax4],'x');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
@ -476,9 +480,9 @@ exportFig('figs/virtual_mass_plant_X.pdf', 'width', 'full', 'height', 'full')
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ylabel('Loop Gain'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 2, 3);
ax3 = subplot(2, 2, 3);
hold on;
for i = 1:length(Ms)
LmX = GmX{i}*KmX;
@ -492,11 +496,11 @@ exportFig('figs/virtual_mass_plant_X.pdf', 'width', 'full', 'height', 'full')
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-270, 90]);
ylim([-180, 180]);
yticks([-360:90:360]);
legend('location', 'northeast');
legend('location', 'southwest');
ax1 = subplot(2, 2, 2);
ax2 = subplot(2, 2, 2);
hold on;
for i = 1:length(Ms)
LmX = GmX{i}*KmX;
@ -505,9 +509,9 @@ exportFig('figs/virtual_mass_plant_X.pdf', 'width', 'full', 'height', 'full')
end
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
ylabel('Loop Gain'); set(gca, 'XTickLabel',[]);
ax2 = subplot(2, 2, 4);
ax4 = subplot(2, 2, 4);
hold on;
for i = 1:length(Ms)
LmX = GmX{i}*KmX;
@ -518,11 +522,11 @@ exportFig('figs/virtual_mass_plant_X.pdf', 'width', 'full', 'height', 'full')
hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
ylim([-270, 90]);
ylim([-180, 180]);
yticks([-360:90:360]);
legend('location', 'northeast');
legend('location', 'southwest');
linkaxes([ax1,ax2],'x');
linkaxes([ax1,ax2,ax3,ax4],'x');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
@ -579,7 +583,7 @@ exportFig('figs/virtual_mass_loop_gain_X.pdf', 'width', 'full', 'height', 'full'
#+end_src
#+begin_src matlab :exports none
freqs = logspace(0, 3, 5000);
freqs = logspace(0, 3, 1000);
figure;
@ -661,7 +665,7 @@ exportFig('figs/virtual_mass_X_primary_plant_X.pdf', 'width', 'full', 'height',
[[file:figs/virtual_mass_X_primary_plant_X.png]]
#+begin_src matlab :exports none
freqs = logspace(0, 3, 5000);
freqs = logspace(0, 3, 1000);
figure;