#+TITLE: Encoder - Test Bench :DRAWER: #+LANGUAGE: en #+EMAIL: dehaeze.thomas@gmail.com #+AUTHOR: Dehaeze Thomas #+HTML_LINK_HOME: ../index.html #+HTML_LINK_UP: ../index.html #+HTML_HEAD: #+HTML_HEAD: #+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} #+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 #+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: #+begin_export html

This report is also available as a pdf.


#+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 * Experimental Setup <> 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 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 #+ATTR_LATEX: :width \linewidth #+caption: Side View of the encoder [[file:figs/IMG_20201023_153905.jpg]] #+name: fig:encoder_front_view #+caption: Front View of the encoder #+ATTR_LATEX: :width \linewidth [[file:figs/IMG_20201023_153914.jpg]] * Noise Spectral Density of the Encoder :PROPERTIES: :header-args:matlab+: :tangle matlab/encoder_noise.m :END: <> ** 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. Ideally, a mechanical part would clamp the two together, we here suppose that the APA is still enough to clamp the two together. ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> #+end_src #+begin_src matlab :exports none :results silent :noweb yes <> #+end_src ** Load Data The measurement data are loaded and the offset are removed using the =detrend= command. #+begin_src matlab load('int_enc_huddle_test.mat', 'interferometer', 'encoder', 't'); #+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]]. #+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]]). #+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. #+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. #+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 :PROPERTIES: :header-args:matlab+: :tangle matlab/dynamics_encoder.m :END: <> ** Introduction :ignore: Now the dynamics from the force actuator to the measurement by the encoder is identified. ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> #+end_src #+begin_src matlab :exports none :results silent :noweb yes <> #+end_src ** Load Data As usual, the measurement data are loaded. #+begin_src matlab load('int_enc_id_noise_bis.mat', 'interferometer', 'encoder', 'u', 't'); #+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. #+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. The excitation signal is shown in Figure [[fig:encoder_identification_excitation_time]]. #+begin_src matlab :exports none figure; plot(t, u); xlabel('Time [s]'); ylabel('Voltage [V]'); #+end_src #+begin_src matlab :tangle no :exports results :results file replace exportFig('figs/encoder_identification_excitation_time.pdf', 'width', 'wide', 'height', 'normal'); #+end_src #+name: fig:encoder_identification_excitation_time #+caption: Excitation Voltage #+RESULTS: [[file:figs/encoder_identification_excitation_time.png]] The measured motion by the interferometer and encoder is shown in Figure #+begin_src matlab :exports none figure; hold on; plot(t, interferometer, 'DisplayName', 'Interferometer'); plot(t, encoder, 'DisplayName', 'Encoder'); hold off; xlabel('Time [s]'); ylabel('Displacement [m]'); legend('location', 'southeast'); #+end_src #+begin_src matlab :tangle no :exports results :results file replace exportFig('figs/encoder_identification_motion.pdf', 'width', 'wide', 'height', 'normal'); #+end_src #+name: fig:encoder_identification_motion #+caption: Measured displacement by the encoder and interferometer #+RESULTS: [[file:figs/encoder_identification_motion.png]] ** 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. #+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. #+begin_src matlab :exports none figure; hold on; plot(f, co_i_est, '-', 'DisplayName', 'Interferometer') plot(f, co_e_est, '-', 'DisplayName', 'Encoder') set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin'); ylabel('Coherence'); xlabel('Frequency [Hz]'); hold off; xlim([0.5, 5e3]); legend('location', 'southwest'); #+end_src #+begin_src matlab :tangle no :exports results :results file replace exportFig('figs/identification_dynamics_coherence.pdf', 'width', 'wide', 'height', 'normal'); #+end_src #+name: fig:identification_dynamics_coherence #+caption: Obtained coherence for both the encoder and interferometer #+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]]. #+begin_src matlab :exports none figure; tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); ax1 = nexttile([2, 1]); hold on; plot(f, abs(tf_i_est), '-', 'DisplayName', 'Interferometer') plot(f, abs(tf_e_est), '-', 'DisplayName', 'Encoder') set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log'); ylabel('Amplitude'); set(gca, 'XTickLabel',[]); hold off; ylim([1e-7, 3e-4]); legend('location', 'southwest'); 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]'); hold off; 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 #+caption: Obtained dynamics from actuator voltage to displacement as measured by the interferometer and by the encoder #+RESULTS: [[file:figs/identification_dynamics_bode.png]] The second resonance at around 900Hz most likely corresponds to the resonance of either the ruler support or the head support.