Work on Control (HAC-LAC) + Models

This commit is contained in:
2020-03-13 17:40:22 +01:00
parent 493268638b
commit fab78b6527
78 changed files with 5395 additions and 2475 deletions

View File

@@ -4,7 +4,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>
<!-- 2020-02-25 mar. 18:21 -->
<!-- 2020-03-13 ven. 17:39 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Identification of the disturbances</title>
@@ -202,50 +202,28 @@
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.js"></script>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
// @license-end
</script>
<script>
MathJax = {
@@ -276,6 +254,7 @@ for the JavaScript code in this tag.
<li><a href="#Compute-the-Power-Spectral-Density-of-the-disturbance-force">5. Compute the Power Spectral Density of the disturbance force</a></li>
<li><a href="#Noise-Budget">6. Noise Budget</a></li>
<li><a href="#Save">7. Save</a></li>
<li><a href="#org9a1d0a9">8. Error motion of the Sample without Control</a></li>
</ul>
</div>
</div>
@@ -318,7 +297,7 @@ This file is divided in the following sections:
<li>Section <a href="#org71da6bd">6</a>: with the computed PSD, the noise budget of the system is done</li>
</ul>
<div id="outline-container-orgd6383a2" class="outline-2">
<div id="outline-container-Simscape-Model" class="outline-2">
<h2 id="Simscape-Model"><span class="section-number-2">1</span> Simscape Model</h2>
<div class="outline-text-2" id="text-Simscape-Model">
<p>
@@ -363,7 +342,7 @@ initializeSample(<span class="org-string">'type'</span>, <span class="org-string
</div>
</div>
<div id="outline-container-orgab57d7a" class="outline-2">
<div id="outline-container-Identification" class="outline-2">
<h2 id="Identification"><span class="section-number-2">2</span> Identification</h2>
<div class="outline-text-2" id="text-Identification">
<p>
@@ -416,7 +395,7 @@ G.OutputName = {<span class="org-string">'Vm'</span>};
</div>
</div>
<div id="outline-container-org26913fc" class="outline-2">
<div id="outline-container-Sensitivity-to-Disturbances" class="outline-2">
<h2 id="Sensitivity-to-Disturbances"><span class="section-number-2">3</span> Sensitivity to Disturbances</h2>
<div class="outline-text-2" id="text-Sensitivity-to-Disturbances">
<p>
@@ -448,7 +427,7 @@ G.OutputName = {<span class="org-string">'Vm'</span>};
</div>
</div>
<div id="outline-container-org627e5cf" class="outline-2">
<div id="outline-container-Power-Spectral-Density-of-the-effect-of-the-disturbances" class="outline-2">
<h2 id="Power-Spectral-Density-of-the-effect-of-the-disturbances"><span class="section-number-2">4</span> Power Spectral Density of the effect of the disturbances</h2>
<div class="outline-text-2" id="text-Power-Spectral-Density-of-the-effect-of-the-disturbances">
<p>
@@ -465,10 +444,10 @@ Also, the Ground Motion is measured.
</p>
<div class="org-src-container">
<pre class="src src-matlab">gm = load(<span class="org-string">'./disturbances/mat/psd_gm.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'psd_gm'</span>, <span class="org-string">'psd_gv'</span>);
rz = load(<span class="org-string">'./disturbances/mat/pxsp_r.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'pxsp_r'</span>);
tyz = load(<span class="org-string">'./disturbances/mat/pxz_ty_r.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'pxz_ty_r'</span>);
tyx = load(<span class="org-string">'./disturbances/mat/pxe_ty_r.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'pxe_ty_r'</span>);
<pre class="src src-matlab">gm = load(<span class="org-string">'./mat/psd_gm.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'psd_gm'</span>);
rz = load(<span class="org-string">'./mat/pxsp_r.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'pxsp_r'</span>);
tyz = load(<span class="org-string">'./mat/pxz_ty_r.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'pxz_ty_r'</span>);
tyx = load(<span class="org-string">'./mat/pxe_ty_r.mat'</span>, <span class="org-string">'f'</span>, <span class="org-string">'pxe_ty_r'</span>);
</pre>
</div>
@@ -512,7 +491,7 @@ The Cumulative Amplitude Spectrum of the relative motion is shown in figure <a h
</div>
</div>
<div id="outline-container-orge27c71b" class="outline-2">
<div id="outline-container-Compute-the-Power-Spectral-Density-of-the-disturbance-force" class="outline-2">
<h2 id="Compute-the-Power-Spectral-Density-of-the-disturbance-force"><span class="section-number-2">5</span> Compute the Power Spectral Density of the disturbance force</h2>
<div class="outline-text-2" id="text-Compute-the-Power-Spectral-Density-of-the-disturbance-force">
<p>
@@ -538,7 +517,7 @@ tyz.psd_f = tyz.pxz_ty_r<span class="org-type">./</span>abs(squeeze(freqresp(G(<
</div>
</div>
<div id="outline-container-org844ca42" class="outline-2">
<div id="outline-container-Noise-Budget" class="outline-2">
<h2 id="Noise-Budget"><span class="section-number-2">6</span> Noise Budget</h2>
<div class="outline-text-2" id="text-Noise-Budget">
<p>
@@ -567,11 +546,11 @@ We should verify that this is coherent with the measurements.
</div>
</div>
<div id="outline-container-org800eaed" class="outline-2">
<div id="outline-container-Save" class="outline-2">
<h2 id="Save"><span class="section-number-2">7</span> Save</h2>
<div class="outline-text-2" id="text-Save">
<p>
The PSD of the disturbance force are now saved for further analysis (the mat file is accessible <a href="mat/dist_psd.mat">here</a>).
The PSD of the disturbance force are now saved for further analysis.
</p>
<div class="org-src-container">
@@ -583,7 +562,114 @@ dist_f.psd_gm = gm.psd_gm; <span class="org-comment">% Power Spectral Density of
dist_f.psd_ty = tyz.psd_f; <span class="org-comment">% Power Spectral Density of the force induced by the Ty stage in the Z direction [N^2/Hz]</span>
dist_f.psd_rz = rz.psd_f; <span class="org-comment">% Power Spectral Density of the force induced by the Rz stage in the Z direction [N^2/Hz]</span>
save(<span class="org-string">'./disturbances/mat/dist_psd.mat'</span>, <span class="org-string">'dist_f'</span>);
save(<span class="org-string">'./mat/dist_psd.mat'</span>, <span class="org-string">'dist_f'</span>);
</pre>
</div>
</div>
</div>
<div id="outline-container-org9a1d0a9" class="outline-2">
<h2 id="org9a1d0a9"><span class="section-number-2">8</span> Error motion of the Sample without Control</h2>
<div class="outline-text-2" id="text-8">
<div class="org-src-container">
<pre class="src src-matlab">initializeGround();
initializeGranite(<span class="org-string">'Foffset'</span>, <span class="org-constant">false</span>);
initializeTy(<span class="org-string">'Foffset'</span>, <span class="org-constant">false</span>);
initializeRy(<span class="org-string">'Foffset'</span>, <span class="org-constant">false</span>);
initializeRz(<span class="org-string">'Foffset'</span>, <span class="org-constant">false</span>);
initializeMicroHexapod(<span class="org-string">'Foffset'</span>, <span class="org-constant">false</span>);
initializeAxisc(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>);
initializeMirror(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>);
</pre>
</div>
<p>
The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeNanoHexapod(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>);
initializeSample(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>, <span class="org-string">'mass'</span>, 50);
</pre>
</div>
<p>
We set the references and disturbances to zero.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeReferences();
initializeDisturbances();
</pre>
</div>
<p>
We set the controller type to Open-Loop.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
</pre>
</div>
<p>
And we put some gravity.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeSimscapeConfiguration(<span class="org-string">'gravity'</span>, <span class="org-constant">false</span>);
</pre>
</div>
<p>
We do not need to log any signal.
</p>
<div class="org-src-container">
<pre class="src src-matlab">initializeLoggingConfiguration(<span class="org-string">'log'</span>, <span class="org-string">'all'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">initializePosError(<span class="org-string">'error'</span>, <span class="org-constant">false</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">load(<span class="org-string">'mat/conf_simulink.mat'</span>);
<span class="org-matlab-simulink-keyword">set_param</span>(<span class="org-variable-name">conf_simulink</span>, <span class="org-string">'StopTime'</span>, <span class="org-string">'1'</span>);
</pre>
</div>
<p>
We simulate the model.
</p>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-matlab-simulink-keyword">sim</span>(<span class="org-string">'nass_model'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab"><span class="org-type">figure</span>;
subplot(1, 2, 1);
hold on;
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(<span class="org-type">:</span>, 1), <span class="org-string">'DisplayName'</span>, <span class="org-string">'X'</span>);
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(<span class="org-type">:</span>, 2), <span class="org-string">'DisplayName'</span>, <span class="org-string">'Y'</span>);
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(<span class="org-type">:</span>, 3), <span class="org-string">'DisplayName'</span>, <span class="org-string">'Z'</span>);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>);
ylabel(<span class="org-string">'Position error [m]'</span>);
legend();
subplot(1, 2, 2);
hold on;
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(<span class="org-type">:</span>, 4));
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(<span class="org-type">:</span>, 5));
plot(simout.Em.Eg.Time, simout.Em.Eg.Data(<span class="org-type">:</span>, 6));
hold off;
xlabel(<span class="org-string">'Time [s]'</span>);
ylabel(<span class="org-string">'Orientation error [rad]'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">Eg = simout.Em.Eg;
save(<span class="org-string">'./mat/motion_error_ol.mat'</span>, <span class="org-string">'Eg'</span>);
</pre>
</div>
</div>
@@ -591,7 +677,7 @@ save(<span class="org-string">'./disturbances/mat/dist_psd.mat'</span>, <span cl
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-02-25 mar. 18:21</p>
<p class="date">Created: 2020-03-13 ven. 17:39</p>
</div>
</body>
</html>