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

30 lines
707 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]
t = data(:, end); % Time [s]
% strut_num = 6;
% save(sprintf('mat/frf_exc_iff_strut_%i_enc_plates_noise.mat', strut_num), 't', 'de', 'Vs', 'u', 'Va');
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))