encoder-test-bench/index.html
2020-10-25 09:06:14 +01:00

356 lines
14 KiB
HTML

<?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-10-25 dim. 09:06 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Encoder - Test Bench</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<link rel="stylesheet" type="text/css" href="./css/zenburn.css"/>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.js"></script>
<script>MathJax = {
tex: {
tags: 'ams',
macros: {bm: ["\\boldsymbol{#1}",1],}
}
};
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<div id="content">
<h1 class="title">Encoder - Test Bench</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org62e3fd3">1. Experimental Setup</a></li>
<li><a href="#org12a748d">2. Huddle Test</a>
<ul>
<li><a href="#orgcc6a5f5">2.1. Load Data</a></li>
<li><a href="#org38dca56">2.2. Time Domain Results</a></li>
<li><a href="#orgb3db033">2.3. Frequency Domain Noise</a></li>
</ul>
</li>
<li><a href="#org99db9f6">3. Comparison Interferometer / Encoder</a>
<ul>
<li><a href="#org1d63b9a">3.1. Load Data</a></li>
<li><a href="#org185e20d">3.2. Time Domain Results</a></li>
<li><a href="#org04cd372">3.3. Difference between Encoder and Interferometer as a function of time</a></li>
<li><a href="#org0271741">3.4. Difference between Encoder and Interferometer as a function of position</a></li>
</ul>
</li>
<li><a href="#orga08d704">4. Identification</a>
<ul>
<li><a href="#orgaa05248">4.1. Load Data</a></li>
<li><a href="#org0d4f0cd">4.2. Identification</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org62e3fd3" class="outline-2">
<h2 id="org62e3fd3"><span class="section-number-2">1</span> Experimental Setup</h2>
<div class="outline-text-2" id="text-1">
<p>
The experimental Setup is schematically represented in Figure <a href="#org4fd66dc">1</a>.
</p>
<p>
The mass can be vertically moved using the amplified piezoelectric actuator.
The displacement of the mass (relative to the mechanical frame) is measured both by the interferometer and by the encoder.
</p>
<div id="org4fd66dc" class="figure">
<p><img src="figs/exp_setup_schematic.png" alt="exp_setup_schematic.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Schematic of the Experiment</p>
</div>
<div id="orge37bdbc" class="figure">
<p><img src="figs/IMG_20201023_153905.jpg" alt="IMG_20201023_153905.jpg" />
</p>
<p><span class="figure-number">Figure 2: </span>Side View of the encoder</p>
</div>
<div id="org168fd7f" class="figure">
<p><img src="figs/IMG_20201023_153914.jpg" alt="IMG_20201023_153914.jpg" />
</p>
<p><span class="figure-number">Figure 3: </span>Front View of the encoder</p>
</div>
</div>
</div>
<div id="outline-container-org12a748d" class="outline-2">
<h2 id="org12a748d"><span class="section-number-2">2</span> Huddle Test</h2>
<div class="outline-text-2" id="text-2">
<p>
The goal in this section is the estimate the noise of both the encoder and the intereferometer.
</p>
<p>
Nothing is then to the actuator such that the relative motion between the mass and the frame is as small as possible.
Ideally, a mechanical part would clamp the two together, we here suppose that the APA is still enough to clamp the two together.
</p>
</div>
<div id="outline-container-orgcc6a5f5" class="outline-3">
<h3 id="orgcc6a5f5"><span class="section-number-3">2.1</span> Load Data</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-matlab">load(<span class="org-string">'mat/int_enc_huddle_test.mat'</span>, <span class="org-string">'interferometer'</span>, <span class="org-string">'encoder'</span>, <span class="org-string">'t'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">interferometer = detrend(interferometer, 0);
encoder = detrend(encoder, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-org38dca56" class="outline-3">
<h3 id="org38dca56"><span class="section-number-3">2.2</span> Time Domain Results</h3>
<div class="outline-text-3" id="text-2-2">
<div id="org1e8928d" class="figure">
<p><img src="figs/huddle_test_time_domain.png" alt="huddle_test_time_domain.png" />
</p>
<p><span class="figure-number">Figure 4: </span>Huddle test - Time domain signals</p>
</div>
<div class="org-src-container">
<pre class="src src-matlab">G_lpf = 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>10);
</pre>
</div>
<div id="org831d12c" class="figure">
<p><img src="figs/huddle_test_time_domain_filtered.png" alt="huddle_test_time_domain_filtered.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Huddle test - Time domain signals filtered with a LPF at 10Hz</p>
</div>
</div>
</div>
<div id="outline-container-orgb3db033" class="outline-3">
<h3 id="orgb3db033"><span class="section-number-3">2.3</span> Frequency Domain Noise</h3>
<div class="outline-text-3" id="text-2-3">
<div class="org-src-container">
<pre class="src src-matlab">Ts = 1e<span class="org-type">-</span>4;
win = hann(ceil(10<span class="org-type">/</span>Ts));
[p_i, f] = pwelch(interferometer, win, [], [], 1<span class="org-type">/</span>Ts);
[p_e, <span class="org-type">~</span>] = pwelch(encoder, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
<div id="orgd4d1e96" class="figure">
<p><img src="figs/huddle_test_asd.png" alt="huddle_test_asd.png" />
</p>
<p><span class="figure-number">Figure 6: </span>Amplitude Spectral Density of the signals during the Huddle test</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org99db9f6" class="outline-2">
<h2 id="org99db9f6"><span class="section-number-2">3</span> Comparison Interferometer / Encoder</h2>
<div class="outline-text-2" id="text-3">
<p>
The goal here is to make sure that the interferometer and encoder measurements are coherent.
We may see non-linearity in the interferometric measurement.
</p>
</div>
<div id="outline-container-org1d63b9a" class="outline-3">
<h3 id="org1d63b9a"><span class="section-number-3">3.1</span> Load Data</h3>
<div class="outline-text-3" id="text-3-1">
<div class="org-src-container">
<pre class="src src-matlab">load(<span class="org-string">'mat/int_enc_comp.mat'</span>, <span class="org-string">'interferometer'</span>, <span class="org-string">'encoder'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">interferometer = detrend(interferometer, 0);
encoder = detrend(encoder, 0);
u = detrend(u, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-org185e20d" class="outline-3">
<h3 id="org185e20d"><span class="section-number-3">3.2</span> Time Domain Results</h3>
<div class="outline-text-3" id="text-3-2">
<div id="orgf56a137" class="figure">
<p><img src="figs/int_enc_one_cycle.png" alt="int_enc_one_cycle.png" />
</p>
<p><span class="figure-number">Figure 7: </span>One cycle measurement</p>
</div>
<div id="org3adb535" class="figure">
<p><img src="figs/int_enc_one_cycle_error.png" alt="int_enc_one_cycle_error.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Difference between the Encoder and the interferometer during one cycle</p>
</div>
</div>
</div>
<div id="outline-container-org04cd372" class="outline-3">
<h3 id="org04cd372"><span class="section-number-3">3.3</span> Difference between Encoder and Interferometer as a function of time</h3>
<div class="outline-text-3" id="text-3-3">
<div class="org-src-container">
<pre class="src src-matlab">Ts = 1e<span class="org-type">-</span>4;
d_i_mean = reshape(interferometer, [2<span class="org-type">/</span>Ts floor(Ts<span class="org-type">/</span>2<span class="org-type">*</span>length(interferometer))]);
d_e_mean = reshape(encoder, [2<span class="org-type">/</span>Ts floor(Ts<span class="org-type">/</span>2<span class="org-type">*</span>length(encoder))]);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>5; <span class="org-comment">% [rad/s]</span>
xi = 0.7;
G_lpf = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">/</span>w0<span class="org-type">*</span>s <span class="org-type">+</span> s<span class="org-type">^</span>2<span class="org-type">/</span>w0<span class="org-type">^</span>2);
d_err_mean = reshape(lsim(G_lpf, encoder <span class="org-type">-</span> interferometer, t), [2<span class="org-type">/</span>Ts floor(Ts<span class="org-type">/</span>2<span class="org-type">*</span>length(encoder))]);
d_err_mean = d_err_mean <span class="org-type">-</span> mean(d_err_mean);
</pre>
</div>
<div id="orgd16ecc5" class="figure">
<p><img src="figs/int_enc_error_mean_time.png" alt="int_enc_error_mean_time.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Difference between the two measurement in the time domain, averaged for all the cycles</p>
</div>
</div>
</div>
<div id="outline-container-org0271741" class="outline-3">
<h3 id="org0271741"><span class="section-number-3">3.4</span> Difference between Encoder and Interferometer as a function of position</h3>
<div class="outline-text-3" id="text-3-4">
<p>
Compute the mean of the interferometer measurement corresponding to each of the encoder measurement.
</p>
<div class="org-src-container">
<pre class="src src-matlab">[e_sorted, <span class="org-type">~</span>, e_ind] = unique(encoder);
i_mean = zeros(length(e_sorted), 1);
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(e_sorted)</span>
i_mean(<span class="org-constant">i</span>) = mean(interferometer(e_ind <span class="org-type">==</span> <span class="org-constant">i</span>));
<span class="org-keyword">end</span>
i_mean_error = (i_mean <span class="org-type">-</span> e_sorted);
</pre>
</div>
<div id="org81096af" class="figure">
<p><img src="figs/int_enc_error_mean_position.png" alt="int_enc_error_mean_position.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Difference between the two measurement as a function of the measured position by the encoder, averaged for all the cycles</p>
</div>
<p>
The period of the non-linearity seems to be \(1.53 \mu m\) which corresponds to the wavelength of the Laser.
</p>
<div class="org-src-container">
<pre class="src src-matlab">win_length = 1530; <span class="org-comment">% length of the windows (corresponds to 1.53 um)</span>
num_avg = floor(length(e_sorted)<span class="org-type">/</span>win_length); <span class="org-comment">% number of averaging</span>
i_init = ceil((length(e_sorted) <span class="org-type">-</span> win_length<span class="org-type">*</span>num_avg)<span class="org-type">/</span>2); <span class="org-comment">% does not start at the extremity</span>
e_sorted_mean_over_period = mean(reshape(i_mean_error(i_init<span class="org-type">:</span>i_init<span class="org-type">+</span>win_length<span class="org-type">*</span>num_avg<span class="org-type">-</span>1), [win_length num_avg]), 2);
</pre>
</div>
<div id="orgd460333" class="figure">
<p><img src="figs/int_non_linearity_period_wavelength.png" alt="int_non_linearity_period_wavelength.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Non-Linearity of the Interferometer over the period of the wavelength</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orga08d704" class="outline-2">
<h2 id="orga08d704"><span class="section-number-2">4</span> Identification</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-orgaa05248" class="outline-3">
<h3 id="orgaa05248"><span class="section-number-3">4.1</span> Load Data</h3>
<div class="outline-text-3" id="text-4-1">
<div class="org-src-container">
<pre class="src src-matlab">load(<span class="org-string">'mat/int_enc_id_noise_bis.mat'</span>, <span class="org-string">'interferometer'</span>, <span class="org-string">'encoder'</span>, <span class="org-string">'u'</span>, <span class="org-string">'t'</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">interferometer = detrend(interferometer, 0);
encoder = detrend(encoder, 0);
u = detrend(u, 0);
</pre>
</div>
</div>
</div>
<div id="outline-container-org0d4f0cd" class="outline-3">
<h3 id="org0d4f0cd"><span class="section-number-3">4.2</span> Identification</h3>
<div class="outline-text-3" id="text-4-2">
<div class="org-src-container">
<pre class="src src-matlab">Ts = 1e<span class="org-type">-</span>4; <span class="org-comment">% Sampling Time [s]</span>
win = hann(ceil(10<span class="org-type">/</span>Ts));
</pre>
</div>
<div class="org-src-container">
<pre class="src src-matlab">[tf_i_est, f] = tfestimate(u, interferometer, win, [], [], 1<span class="org-type">/</span>Ts);
[co_i_est, <span class="org-type">~</span>] = mscohere(u, interferometer, win, [], [], 1<span class="org-type">/</span>Ts);
[tf_e_est, <span class="org-type">~</span>] = tfestimate(u, encoder, win, [], [], 1<span class="org-type">/</span>Ts);
[co_e_est, <span class="org-type">~</span>] = mscohere(u, encoder, win, [], [], 1<span class="org-type">/</span>Ts);
</pre>
</div>
<div id="org0157819" class="figure">
<p><img src="figs/identification_dynamics_coherence.png" alt="identification_dynamics_coherence.png" />
</p>
</div>
<div id="org4b89965" class="figure">
<p><img src="figs/identification_dynamics_bode.png" alt="identification_dynamics_bode.png" />
</p>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
<p class="date">Created: 2020-10-25 dim. 09:06</p>
</div>
</body>
</html>