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

35 lines
857 B
Matlab

%%
tg = slrt;
f = SimulinkRealTime.openFTP(tg);
mget(f, 'data/data.dat');
close(f);
%% And we load the data on the Workspace:
data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data;
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]
Rx = data(:, 20:25); % Excitation Signal [V]
t = data(:, end); % Time [s]
%%
load('sim_data/Khac_iff_struts.mat', 'Khac_iff_struts');
load('sim_data/Kiff.mat', 'Kiff');
%%
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))