test-bench-nano-hexapod/matlab/identif_save.m
2021-06-08 17:31:16 +02:00

34 lines
1.0 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]
Va = data(:, 13); % Excitation Voltage [V]
t = data(:, end); % Time [s]
% And we save this to a =mat= file:
strut_number = 6;
% save(sprintf('mat/frf_data_exc_strut_%i_noise.mat', strut_number), 't', 'Va', 'Vs', 'de');
% save(sprintf('mat/frf_data_exc_strut_%i_noise_lf.mat', strut_number), 't', 'Va', 'Vs', 'de');
% save(sprintf('mat/frf_data_exc_strut_%i_sweep.mat', strut_number), 't', 'Va', 'Vs', 'de');
save(sprintf('mat/frf_data_exc_strut_%i_noise_hf.mat', strut_number), 't', 'Va', 'Vs', 'de');
% save(sprintf('mat/frf_data_exc_strut_%i_add_mass_closed_circuit.mat', strut_number), 't', 'Va', 'Vs', 'de');