encoder-test-bench/test-bench-encoder.org

360 lines
13 KiB
Org Mode
Raw Normal View History

2020-10-23 23:05:34 +02:00
#+TITLE: Encoder - Test Bench
:DRAWER:
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
2020-10-29 10:08:22 +01:00
#+HTML_LINK_HOME: ../index.html
#+HTML_LINK_UP: ../index.html
2020-11-12 10:16:50 +01:00
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
#+HTML_HEAD: <script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>
2020-10-23 23:05:34 +02:00
2021-02-02 19:16:41 +01:00
#+BIND: org-latex-image-default-option "scale=1"
#+BIND: org-latex-image-default-width ""
#+LaTeX_CLASS: scrreprt
#+LaTeX_CLASS_OPTIONS: [a4paper, 10pt, DIV=12, parskip=full]
#+LaTeX_HEADER_EXTRA: \input{preamble.tex}
2020-10-23 23:05:34 +02:00
#+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/tikz/org/}{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
#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png")
#+PROPERTY: header-args:matlab :session *MATLAB*
#+PROPERTY: header-args:matlab+ :tangle matlab/script.m
2020-10-23 23:05:34 +02:00
#+PROPERTY: header-args:matlab+ :comments org
#+PROPERTY: header-args:matlab+ :exports both
#+PROPERTY: header-args:matlab+ :results none
#+PROPERTY: header-args:matlab+ :eval no-export
#+PROPERTY: header-args:matlab+ :noweb yes
#+PROPERTY: header-args:matlab+ :mkdirp yes
#+PROPERTY: header-args:matlab+ :output-dir figs
:END:
2021-02-02 19:17:00 +01:00
#+begin_export html
<hr>
<p>This report is also available as a <a href="./test-bench-encoder.pdf">pdf</a>.</p>
<hr>
#+end_export
* Introduction :ignore:
In this document, we wish to study the use of an encoder in parallel with an Amplified Piezoelectric Actuator.
The document is divided into the following Sections:
- Section [[sec:experimental_setup]]: the test-bench used is described
- Section [[sec:encoder_noise]]: the noise spectral density of the encoder is estimated
- Section [[sec:dynamics_encoder]]: the dynamics from the amplified piezoelectric actuator to the encoder measured displacement is identified
2020-10-23 23:05:34 +02:00
* Experimental Setup
<<sec:experimental_setup>>
2020-10-23 23:05:34 +02:00
The experimental Setup is schematically represented in Figure [[fig:exp_setup_schematic]].
#+begin_note
Here are the equipment used in the test bench:
- Renishaw Resolution Encoder with 1nm resolution ([[file:doc/L-9517-9448-05-B_Data_sheet_RESOLUTE_BiSS_en.pdf][doc]])
- Attocube interferometer ([[file:doc/IDS3010.pdf][doc]])
- Cedrat Amplified Piezoelectric Actuator APA95ML ([[file:doc/APA95ML.pdf][doc]])
- Voltage Amplifier LA75B ([[file:doc/LA75B.pdf][doc]])
- Speedgoat IO131 with 16bits ADC and DAC ([[file:doc/IO130 IO131 OEM Datasheet.pdf][doc]])
#+end_note
2020-10-23 23:05:34 +02:00
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.
#+name: fig:exp_setup_schematic
#+caption: Schematic of the Experiment
[[file:figs/exp_setup_schematic.png]]
#+name: fig:encoder_side_view
#+ATTR_ORG: :width 300
2021-02-02 19:16:41 +01:00
#+ATTR_LATEX: :width \linewidth
2020-10-23 23:05:34 +02:00
#+caption: Side View of the encoder
[[file:figs/IMG_20201023_153905.jpg]]
#+name: fig:encoder_front_view
#+caption: Front View of the encoder
2021-02-02 19:16:41 +01:00
#+ATTR_LATEX: :width \linewidth
2020-10-23 23:05:34 +02:00
[[file:figs/IMG_20201023_153914.jpg]]
* Noise Spectral Density of the Encoder
2020-11-10 12:53:45 +01:00
:PROPERTIES:
:header-args:matlab+: :tangle matlab/encoder_noise.m
:END:
<<sec:encoder_noise>>
2020-10-23 23:05:34 +02:00
** Introduction :ignore:
The goal in this section is the estimate the noise of both the encoder and the intereferometer.
The actuator is not excited, thus the relative motion between the mass and the frame is as small as possible.
2020-10-25 09:06:14 +01:00
Ideally, a mechanical part would clamp the two together, we here suppose that the APA is still enough to clamp the two together.
2020-10-23 23:05:34 +02:00
** 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
** Load Data
The measurement data are loaded and the offset are removed using the =detrend= command.
2020-10-23 23:05:34 +02:00
#+begin_src matlab
2020-11-10 12:53:45 +01:00
load('int_enc_huddle_test.mat', 'interferometer', 'encoder', 't');
2020-10-23 23:05:34 +02:00
#+end_src
#+begin_src matlab
interferometer = detrend(interferometer, 0);
encoder = detrend(encoder, 0);
#+end_src
** Time Domain Results
The measurement of both the encoder and interferometer are shown in Figure [[fig:huddle_test_time_domain]].
2020-10-23 23:05:34 +02:00
#+begin_src matlab :exports none
figure;
hold on;
plot(t, encoder, 'DisplayName', 'Encoder')
plot(t, interferometer, 'DisplayName', 'Interferometer')
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
legend('location', 'northeast');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/huddle_test_time_domain.pdf', 'width', 'wide', 'height', 'normal');
#+end_src
#+name: fig:huddle_test_time_domain
#+caption: Huddle test - Time domain signals
#+RESULTS:
[[file:figs/huddle_test_time_domain.png]]
The raw signals are filtered with a Low Pass filter (defined below) such that we can see the low frequency motion (Figure [[fig:huddle_test_time_domain_filtered]]).
2020-10-23 23:05:34 +02:00
#+begin_src matlab
G_lpf = 1/(1 + s/2/pi/10);
#+end_src
#+begin_src matlab :exports none
figure;
hold on;
plot(t, lsim(G_lpf, encoder, t), 'DisplayName', 'Encoder')
plot(t, lsim(G_lpf, interferometer, t), 'DisplayName', 'Interferometer')
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
legend('location', 'northeast');
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/huddle_test_time_domain_filtered.pdf', 'width', 'wide', 'height', 'normal');
#+end_src
#+name: fig:huddle_test_time_domain_filtered
#+caption: Huddle test - Time domain signals filtered with a LPF at 10Hz
#+RESULTS:
[[file:figs/huddle_test_time_domain_filtered.png]]
** Frequency Domain Noise
The noise of the measurement (supposing there is no motion) is now translated in the frequency domain by computed the Amplitude Spectral Density.
2020-10-23 23:05:34 +02:00
#+begin_src matlab
Ts = 1e-4;
win = hann(ceil(10/Ts));
[p_i, f] = pwelch(interferometer, win, [], [], 1/Ts);
[p_e, ~] = pwelch(encoder, win, [], [], 1/Ts);
#+end_src
The comparison of the ASD of the encoder and interferometer are shown in Figure [[fig:huddle_test_asd]].
It is clear that although the encoder exhibit higher frequency noise, is it more stable at low frequency as the length of the beam path in the air is much smaller and thus changed of temperature/pressure/humity of the air has much smaller effect on the measured displacement.
2020-10-23 23:05:34 +02:00
#+begin_src matlab :exports none
figure;
hold on;
plot(f, sqrt(p_i), 'DisplayName', 'Interferometer');
plot(f, sqrt(p_e), 'DisplayName', 'Encoder');
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('ASD [$m/\sqrt{Hz}$]'); xlabel('Frequency [Hz]');
legend();
xlim([1e-1, 5e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/huddle_test_asd.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
#+name: fig:huddle_test_asd
#+caption: Amplitude Spectral Density of the signals during the Huddle test
#+RESULTS:
[[file:figs/huddle_test_asd.png]]
* Dynamics from Actuator to Encoder
2020-11-10 12:53:45 +01:00
:PROPERTIES:
:header-args:matlab+: :tangle matlab/dynamics_encoder.m
:END:
<<sec:dynamics_encoder>>
2020-10-23 23:05:34 +02:00
** Introduction :ignore:
Now the dynamics from the force actuator to the measurement by the encoder is identified.
2020-10-23 23:05:34 +02:00
** 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
** Load Data
As usual, the measurement data are loaded.
2020-10-23 23:05:34 +02:00
#+begin_src matlab
2020-11-10 12:53:45 +01:00
load('int_enc_id_noise_bis.mat', 'interferometer', 'encoder', 'u', 't');
2020-10-23 23:05:34 +02:00
#+end_src
The first 0.1 seconds are removed as it corresponds to transient behavior.
#+begin_src matlab
interferometer = interferometer(t>0.1);
encoder = encoder(t>0.1);
u = u(t>0.1);
t = t(t>0.1);
#+end_src
Finally the offset are removed using the =detrend= command.
2020-10-23 23:05:34 +02:00
#+begin_src matlab
interferometer = detrend(interferometer, 0);
encoder = detrend(encoder, 0);
u = detrend(u, 0);
#+end_src
** Excitation and Measured Signals
The excitation signal is a white noise filtered by a low pass filter to not excite too much the high frequency modes.
2020-10-23 23:05:34 +02:00
The excitation signal is shown in Figure [[fig:encoder_identification_excitation_time]].
2020-10-23 23:05:34 +02:00
#+begin_src matlab :exports none
figure;
plot(t, u);
xlabel('Time [s]'); ylabel('Voltage [V]');
2020-10-23 23:05:34 +02:00
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/encoder_identification_excitation_time.pdf', 'width', 'wide', 'height', 'normal');
2020-10-23 23:05:34 +02:00
#+end_src
#+name: fig:encoder_identification_excitation_time
2021-02-02 19:16:41 +01:00
#+caption: Excitation Voltage
2020-10-23 23:05:34 +02:00
#+RESULTS:
[[file:figs/encoder_identification_excitation_time.png]]
2020-10-23 23:05:34 +02:00
The measured motion by the interferometer and encoder is shown in Figure
2020-10-23 23:05:34 +02:00
#+begin_src matlab :exports none
figure;
hold on;
plot(t, interferometer, 'DisplayName', 'Interferometer');
plot(t, encoder, 'DisplayName', 'Encoder');
2020-10-23 23:05:34 +02:00
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
legend('location', 'southeast');
2020-10-23 23:05:34 +02:00
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/encoder_identification_motion.pdf', 'width', 'wide', 'height', 'normal');
2020-10-23 23:05:34 +02:00
#+end_src
#+name: fig:encoder_identification_motion
2021-02-02 19:16:41 +01:00
#+caption: Measured displacement by the encoder and interferometer
2020-10-23 23:05:34 +02:00
#+RESULTS:
[[file:figs/encoder_identification_motion.png]]
2020-10-23 23:05:34 +02:00
** Identification
Now the dynamics from the voltage sent to the voltage amplitude driving the APA95ML to the measured displacement by both the encoder and interferometer are computed.
2020-10-23 23:05:34 +02:00
#+begin_src matlab
Ts = 1e-4; % Sampling Time [s]
win = hann(ceil(10/Ts));
[tf_i_est, f] = tfestimate(u, interferometer, win, [], [], 1/Ts);
[co_i_est, ~] = mscohere(u, interferometer, win, [], [], 1/Ts);
[tf_e_est, ~] = tfestimate(u, encoder, win, [], [], 1/Ts);
[co_e_est, ~] = mscohere(u, encoder, win, [], [], 1/Ts);
#+end_src
The obtained coherence is shown in Figure [[fig:identification_dynamics_coherence]].
It is shown that the identification is good until 500Hz for the interferometer and until 1kHz for the encoder.
2020-10-23 23:05:34 +02:00
#+begin_src matlab :exports none
figure;
hold on;
plot(f, co_i_est, '-', 'DisplayName', 'Interferometer')
plot(f, co_e_est, '-', 'DisplayName', 'Encoder')
2020-10-23 23:05:34 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Coherence'); xlabel('Frequency [Hz]');
hold off;
xlim([0.5, 5e3]);
legend('location', 'southwest');
2020-10-23 23:05:34 +02:00
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/identification_dynamics_coherence.pdf', 'width', 'wide', 'height', 'normal');
2020-10-23 23:05:34 +02:00
#+end_src
#+name: fig:identification_dynamics_coherence
2021-02-02 19:16:41 +01:00
#+caption: Obtained coherence for both the encoder and interferometer
2020-10-23 23:05:34 +02:00
#+RESULTS:
[[file:figs/identification_dynamics_coherence.png]]
The compared dynamics as measured by the intereferometer and encoder are shown in Figure [[fig:identification_dynamics_bode]].
2020-10-23 23:05:34 +02:00
#+begin_src matlab :exports none
figure;
tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
2020-10-23 23:05:34 +02:00
ax1 = nexttile([2, 1]);
2020-10-23 23:05:34 +02:00
hold on;
plot(f, abs(tf_i_est), '-', 'DisplayName', 'Interferometer')
plot(f, abs(tf_e_est), '-', 'DisplayName', 'Encoder')
2020-10-23 23:05:34 +02:00
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
ylabel('Amplitude'); set(gca, 'XTickLabel',[]);
hold off;
ylim([1e-7, 3e-4]);
legend('location', 'southwest');
2020-10-23 23:05:34 +02:00
ax2 = nexttile;
hold on;
plot(f, 180/pi*angle(tf_i_est), '-')
plot(f, 180/pi*angle(tf_e_est), '-')
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
2021-02-02 19:16:41 +01:00
hold off;
2020-10-23 23:05:34 +02:00
yticks(-360:90:360);
axis padded 'auto x'
linkaxes([ax1,ax2], 'x');
xlim([0.5, 5e3]);
#+end_src
#+begin_src matlab :tangle no :exports results :results file replace
exportFig('figs/identification_dynamics_bode.pdf', 'width', 'wide', 'height', 'tall');
#+end_src
#+name: fig:identification_dynamics_bode
2021-02-02 19:16:41 +01:00
#+caption: Obtained dynamics from actuator voltage to displacement as measured by the interferometer and by the encoder
2020-10-23 23:05:34 +02:00
#+RESULTS:
[[file:figs/identification_dynamics_bode.png]]
2020-10-29 09:59:29 +01:00
The second resonance at around 900Hz most likely corresponds to the resonance of either the ruler support or the head support.