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

35 lines
1.1 KiB
Matlab

% =frf_save.m= - Save Data
% :PROPERTIES:
% :header-args: :tangle matlab/frf_save.m
% :END:
% First, we get data from the Speedgoat:
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); % Measured voltage (force sensor) [V]
u = data(:, 13:18); % DAC Voltage (command) [V]
Vexc = data(:, 19); % Excitation Voltage [V]
t = data(:, end); % Time [s]
% And we save this to a =mat= file:
strut_number = 6;
save(sprintf('mat/iff_strut_%i_noise_g_400.mat', strut_number), 't', 'u', 'Vs', 'Vexc', 'de');
% save(sprintf('mat/frf_data_exc_strut_%i_noise_lf.mat', strut_number), 't', 'u', 'Vs', 'de');
% save(sprintf('mat/frf_data_exc_strut_%i_sweep.mat', strut_number), 't', 'u', 'Vs', 'de');
% save(sprintf('mat/iff_strut_%i_noise_hf.mat', strut_number), 't', 'u', 'Vs', 'de');
% save(sprintf('mat/frf_data_exc_strut_%i_add_mass_closed_circuit.mat', strut_number), 't', 'u', 'Vs', 'de');