first measurements

This commit is contained in:
Thomas Dehaeze 2021-02-16 16:53:50 +01:00
parent d7116e94ee
commit dee3acdce7
6 changed files with 66 additions and 5 deletions

View File

@ -1,4 +1,64 @@
%% Remove first second
Ts = t(2)-t(1);
t = t(ceil(1/Ts):end);
d = d(ceil(1/Ts):end);
dp = dp(ceil(1/Ts):end);
F = F(ceil(1/Ts):end);
t = t - t(1);
F = F - F(1);
%% LPf
s = tf('s');
G_lpf = 1/(1+s/2/pi/10);
F = lsim(G_lpf, F, t);
d = lsim(G_lpf, d, t);
dp = lsim(G_lpf, dp, t);
%%
figure; figure;
plot(F, d); plot(t, F);
figure;
hold on;
plot(t, d, 'DisplayName', 'Encoder');
plot(t, dp, 'DisplayName', 'Mahr')
hold off;
legend;
%%
t_start = 0.05;
t_end = 0.12;
d = d(t < t_end & t > t_start);
dp = dp(t < t_end & t > t_start);
F = F(t < t_end & t > t_start);
d = d - d(1);
dp = dp - dp(1);
F = F - F(1);
%%
figure;
plot(F, dp);
xlabel('Measured Force [N]'); xlabel('Measured Force [N]');
ylabel('Measured Displacement [um]'); ylabel('Measured Displacement [m]');
%%
sprintf('Stiffness is %.3f [N/mm]', abs(1e-3*(d\F)))
%%
figure;
hold on;
plot(F, d);
plot(F, F/(d\F));
hold off;
xlabel('Measured Force [N]');
ylabel('Measured Displacement [m]');
%%
figure;
hold on;
plot(dp, d);
hold off;
xlabel('Probe [m]');
ylabel('Encoder [m]');

Binary file not shown.

Binary file not shown.

View File

@ -10,7 +10,8 @@ data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data;
d = data(:, 1); d = data(:, 1);
F = data(:, 2); F = data(:, 2);
dp = data(:, 3);
t = data(:, end); t = data(:, end);
%% Save %% Save
save('mat/flex_1_x.mat', 't', 'd', 'F'); save('mat/meas_stiff_probe.mat', 't', 'd', 'dp', 'F');

View File

@ -2,5 +2,5 @@ Fs = 20e3; % [Hz]
Ts = 1/Fs; % [s] Ts = 1/Fs; % [s]
%% Gains %% Gains
Gf = 10; % [N/V] Gf = 50/4; % [N/V]
Gd = 10e-6; % [m/V] Gd = 1000e-6/3.333; % [m/V]