test-bench-nano-hexapod/matlab/identif_save.m

35 lines
857 B
Mathematica
Raw Normal View History

2021-08-11 18:03:35 +02:00
%%
2021-06-07 19:00:29 +02:00
tg = slrt;
f = SimulinkRealTime.openFTP(tg);
mget(f, 'data/data.dat');
close(f);
2021-08-11 18:03:35 +02:00
%% And we load the data on the Workspace:
2021-06-07 19:00:29 +02:00
data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data;
2021-07-01 17:45:57 +02:00
de = data(:, 1:6); % Measurment displacement (encoder) [m]
Vs = data(:, 7:12); % Force Sensor [V]
u = data(:, 13:18); % Control Output [V]
Va = data(:, 19); % Excitation Signal [V]
2021-08-11 18:03:35 +02:00
Rx = data(:, 20:25); % Excitation Signal [V]
2021-07-01 17:45:57 +02:00
t = data(:, end); % Time [s]
%%
2021-08-11 18:03:35 +02:00
load('sim_data/Khac_iff_struts.mat', 'Khac_iff_struts');
load('sim_data/Kiff.mat', 'Kiff');
2021-06-07 19:00:29 +02:00
2021-07-01 17:45:57 +02:00
%%
2021-08-11 18:03:35 +02:00
save('mat/T_S_meas_Rz_3m_hac_svd_iff.mat', 't', 'de', 'Vs', 'u', 'Va', 'Rx', 'Kiff', 'Khac_iff_struts');
% save('mat/hac_iff_more_lead_nass_scan', 't', 'de', 'Vs', 'u', 'Va');
% %%
% load('mat/jacobian.mat', 'J');
%
% X = inv(J)*de';
% X = X';
%
% %%
% figure;
% plot3(X(:,1), X(:,2), X(:,3))