phd-test-bench-apa/matlab/test_apa_1_basic_meas.m

288 lines
11 KiB
Mathematica
Raw Normal View History

2024-03-21 18:47:00 +01:00
%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
%% Path for functions, data and scripts
addpath('./src/'); % Path for scripts
addpath('./mat/'); % Path for data
%% Colors for the figures
colors = colororder;
% Geometrical Measurements
% <<sec:test_apa_geometrical_measurements>>
% To measure the flatness of the two mechanical interfaces of the APA300ML, a small measurement bench is installed on top of a metrology granite with very good flatness.
% As shown in Figure ref:fig:test_apa_flatness_setup, the APA is fixed to a clamp while a measuring probe[fn:3] is used to measure the height of 4 points on each of the APA300ML interfaces.
% From the X-Y-Z coordinates of the measured 8 points, the flatness is estimated by best fitting[fn:4] a plane through all the points.
% #+name: fig:test_apa_flatness_setup
% #+attr_latex: :width 0.4\linewidth
% #+caption: Measurement setup for flatness estimation of the two mechanical interfaces
% [[file:figs/test_apa_flatness_setup.png]]
%% Measured height for all the APA at the 8 locations
apa1 = 1e-6*[0, -0.5 , 3.5 , 3.5 , 42 , 45.5, 52.5 , 46];
apa2 = 1e-6*[0, -2.5 , -3 , 0 , -1.5 , 1 , -2 , -4];
apa3 = 1e-6*[0, -1.5 , 15 , 17.5 , 6.5 , 6.5 , 21 , 23];
apa4 = 1e-6*[0, 6.5 , 14.5 , 9 , 16 , 22 , 29.5 , 21];
apa5 = 1e-6*[0, -12.5, 16.5 , 28.5 , -43 , -52 , -22.5, -13.5];
apa6 = 1e-6*[0, -8 , -2 , 5 , -57.5, -62 , -55.5, -52.5];
apa7 = 1e-6*[0, 9 , -18.5, -30 , 31 , 46.5, 16.5 , 7.5];
apa = {apa1, apa2, apa3, apa4, apa5, apa6, apa7};
%% X-Y positions of the measurements points
W = 20e-3; % Width [m]
L = 61e-3; % Length [m]
d = 1e-3; % Distance from border [m]
l = 15.5e-3; % [m]
pos = [[-L/2 + d, W/2 - d];
[-L/2 + l - d, W/2 - d];
[-L/2 + l - d, -W/2 + d];
[-L/2 + d, -W/2 + d];
[L/2 - l + d, W/2 - d];
[L/2 - d, W/2 - d];
[L/2 - d, -W/2 + d];
[L/2 - l + d, -W/2 + d]]';
%% Using fminsearch to find the best fitting plane
apa_d = zeros(1, 7); % Measured flatness of the APA
for i = 1:7
fun = @(x)max(abs(([pos; apa{i}]-[0;0;x(1)])'*([x(2:3);1]/norm([x(2:3);1]))));
x0 = [0;0;0];
[x, min_d] = fminsearch(fun,x0);
apa_d(i) = min_d;
end
% Stroke Measurement
% <<sec:test_apa_stroke_measurements>>
% The goal is here to verify that the stroke of the APA300ML is as specified in the datasheet.
% To do so, one side of the APA is fixed to the granite, and a displacement probe[fn:2] is located on the other side as shown in Figure ref:fig:test_apa_stroke_bench.
% Then, the voltage across the two actuator stacks is varied from $-20\,V$ to $150\,V$ using a DAC and a voltage amplifier.
% Note that the voltage is here slowly varied as the displacement probe has a very low measurement bandwidth (see Figure ref:fig:test_apa_stroke_bench, left).
% #+name: fig:test_apa_stroke_bench
% #+caption: Bench to measured the APA stroke
% #+attr_latex: :width 0.9\linewidth
% [[file:figs/test_apa_stroke_bench.jpg]]
% The measured APA displacement is shown as a function of the applied voltage in Figure ref:fig:test_apa_stroke_result, right.
% Typical hysteresis curves for piezoelectric stack actuators can be observed.
% The measured stroke is approximately $250\,\mu m$ when using only two of the three stacks, which is enough for the current application.
% This is even above what is specified as the nominal stroke in the data-sheet ($304\,\mu m$, therefore $\approx 200\,\mu m$ if only two stacks are used).
% It is clear from Figure ref:fig:test_apa_stroke_result that "APA 3" has an issue compared to the other units.
% This confirms the abnormal electrical measurements made in Section ref:sec:test_apa_electrical_measurements.
% This unit was send sent back to Cedrat and a new one was shipped back.
% From now on, only the six APA that behave as expected will be used.
%% Load the measured strokes
load('meas_apa_stroke.mat', 'apa300ml_2s')
%% Results of the measured APA stroke
figure;
tiledlayout(1, 2, 'TileSpacing', 'Compact', 'Padding', 'None');
% Generated voltage across the two piezoelectric stack actuators to estimate the stroke of the APA300ML
ax1 = nexttile();
plot(apa300ml_2s{1}.t - apa300ml_2s{1}.t(1), 20*apa300ml_2s{1}.V, 'k-')
xlabel('Time [s]'); ylabel('Voltage [V]')
ylim([-20, 160])
% Measured displacement as a function of the applied voltage
ax2 = nexttile();
hold on;
for i = 1:7
plot(20*apa300ml_2s{i}.V, 1e6*apa300ml_2s{i}.d, 'DisplayName', sprintf('APA %i', i))
end
hold off;
xlabel('Voltage [V]'); ylabel('Displacement [$\mu m$]')
legend('location', 'southwest', 'FontSize', 8)
xlim([-20, 150]); ylim([-250, 0]);
% X-Bending Mode
% The vibrometer is setup to measure the X-bending motion is shown in Figure ref:fig:test_apa_meas_setup_X_bending.
% The APA is excited with an instrumented hammer having a solid metallic tip.
% The impact point is on the back-side of the APA aligned with the top measurement point.
% #+name: fig:test_apa_meas_setup_X_bending
% #+caption: X-Bending measurement setup
% #+attr_latex: :width 0.7\linewidth
% [[file:figs/test_apa_meas_setup_X_bending.jpg]]
% The data is loaded.
%% Load Data
bending_X = load('apa300ml_bending_X_top.mat');
% The configuration (Sampling time and windows) for =tfestimate= is done:
%% Spectral Analysis setup
Ts = bending_X.Track1_X_Resolution; % Sampling Time [s]
Nfft = floor(1/Ts);
win = hanning(Nfft);
Noverlap = floor(Nfft/2);
% The transfer function from the input force to the output "rotation" (difference between the two measured distances).
%% Compute the transfer function from applied force to measured rotation
[G_bending_X, f] = tfestimate(bending_X.Track1, bending_X.Track2, win, Noverlap, Nfft, 1/Ts);
% The result is shown in Figure ref:fig:test_apa_meas_freq_bending_x.
% The can clearly observe a nice peak at 280Hz, and then peaks at the odd "harmonics" (third "harmonic" at 840Hz, and fifth "harmonic" at 1400Hz).
%% Plot the transfer function
figure;
hold on;
plot(f, abs(G_bending_X), 'k-');
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 2e3]); ylim([1e-5, 2e-1]);
text(280, 5.5e-2,{'280Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
text(840, 2.0e-3,{'840Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
text(1400, 7.0e-3,{'1400Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
% Y-Bending Mode
% The setup to measure the Y-bending is shown in Figure ref:fig:test_apa_meas_setup_Y_bending.
% The impact point of the instrumented hammer is located on the back surface of the top interface (on the back of the 2 measurements points).
% #+name: fig:test_apa_meas_setup_Y_bending
% #+caption: Y-Bending measurement setup
% #+attr_latex: :width 0.7\linewidth
% [[file:figs/test_apa_meas_setup_Y_bending.jpg]]
% The data is loaded, and the transfer function from the force to the measured rotation is computed.
%% Load Data
bending_Y = load('apa300ml_bending_Y_top.mat');
%% Compute the transfer function
[G_bending_Y, ~] = tfestimate(bending_Y.Track1, bending_Y.Track2, win, Noverlap, Nfft, 1/Ts);
% The results are shown in Figure ref:fig:test_apa_meas_freq_bending_y.
% The main resonance is at 412Hz, and we also see the third "harmonic" at 1220Hz.
%% Plot the transfer function
figure;
hold on;
plot(f, abs(G_bending_Y), 'k-');
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 2e3]); ylim([1e-5, 3e-2])
text(412, 1.5e-2,{'412Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
text(1218, 1.5e-2,{'1220Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
% Z-Torsion Mode
% Finally, we measure the Z-torsion resonance as shown in Figure ref:fig:test_apa_meas_setup_torsion_bis.
% The excitation is shown on the other side of the APA, on the side to excite the torsion motion.
% #+name: fig:test_apa_meas_setup_torsion_bis
% #+caption: Z-Torsion measurement setup
% #+attr_latex: :width 0.7\linewidth
% [[file:figs/test_apa_meas_setup_torsion_bis.jpg]]
% The data is loaded, and the transfer function computed.
%% Load Data
torsion = load('apa300ml_torsion_left.mat');
%% Compute transfer function
[G_torsion, ~] = tfestimate(torsion.Track1, torsion.Track2, win, Noverlap, Nfft, 1/Ts);
% The results are shown in Figure ref:fig:test_apa_meas_freq_torsion_z.
% We observe a first peak at 267Hz, which corresponds to the X-bending mode that was measured at 280Hz.
% And then a second peak at 415Hz, which corresponds to the X-bending mode that was measured at 412Hz.
% A third mode at 800Hz could correspond to this torsion mode.
%% Plot the transfer function
figure;
hold on;
plot(f, abs(G_torsion), 'k-');
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 2e3]); ylim([1e-5, 2e-2])
text(415, 4.3e-3,{'415Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
text(267, 8e-4,{'267Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
text(800, 6e-4,{'800Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
% #+name: fig:test_apa_meas_freq_torsion_z
% #+caption: Obtained FRF for the Z-torsion
% #+RESULTS:
% [[file:figs/test_apa_meas_freq_torsion_z.png]]
% In order to verify that, the APA is excited on the top part such that the torsion mode should not be excited.
%% Load data
torsion = load('apa300ml_torsion_top.mat');
%% Compute transfer function
[G_torsion_top, ~] = tfestimate(torsion.Track1, torsion.Track2, win, Noverlap, Nfft, 1/Ts);
% The two FRF are compared in Figure ref:fig:test_apa_meas_freq_torsion_z_comp.
% It is clear that the first two modes does not correspond to the torsional mode.
% Maybe the resonance at 800Hz, or even higher resonances. It is difficult to conclude here.
%% Plot the two transfer functions
figure;
hold on;
plot(f, abs(G_torsion), 'k-', 'DisplayName', 'Left excitation');
plot(f, abs(G_torsion_top), '-', 'DisplayName', 'Top excitation');
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 2e3]); ylim([1e-5, 2e-2])
text(415, 4.3e-3,{'415Hz'},'VerticalAlignment','bottom','HorizontalAlignment','center')
text(267, 8e-4,{'267Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
text(800, 2e-3,{'800Hz'}, 'VerticalAlignment', 'bottom','HorizontalAlignment','center')
legend('location', 'northwest');
% Compare
% The three measurements are shown in Figure ref:fig:test_apa_meas_freq_compare.
figure;
hold on;
plot(f, abs(G_torsion), 'DisplayName', 'Torsion');
plot(f, abs(G_bending_X), 'DisplayName', 'Bending - X');
plot(f, abs(G_bending_Y), 'DisplayName', 'Bending - Y');
hold off;
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude');
xlim([50, 2e3]); ylim([1e-5, 1e-1]);
legend('location', 'southeast');