2021-06-01 23:16:49 +02:00
|
|
|
% =frf_save.m= - Save Data
|
2021-06-01 13:05:36 +02:00
|
|
|
% :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;
|
|
|
|
|
2021-06-01 18:24:01 +02:00
|
|
|
da = data(:, 1); % Excitation Voltage (input of PD200) [V]
|
|
|
|
de = data(:, 2); % Measured voltage (force sensor) [V]
|
|
|
|
Vs = data(:, 3); % Measurment displacement (encoder) [m]
|
|
|
|
Va = data(:, 4); % Measurement displacement (attocube) [m]
|
2021-06-01 13:05:36 +02:00
|
|
|
t = data(:, end); % Time [s]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% And we save this to a =mat= file:
|
|
|
|
apa_number = 1;
|
2021-06-03 18:00:04 +02:00
|
|
|
% leg_number = 4;
|
2021-06-01 13:05:36 +02:00
|
|
|
|
2021-06-03 18:00:04 +02:00
|
|
|
save(sprintf('mat/frf_data_leg_coder_%i_noise.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da');
|
|
|
|
% save(sprintf('mat/frf_data_leg_coder_%i_sweep.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da');
|
|
|
|
% save(sprintf('mat/frf_data_leg_coder_%i_noise_hf.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da');
|
|
|
|
% save(sprintf('mat/frf_data_leg_coder_%i_add_mass_closed_circuit.mat', apa_number), 't', 'Va', 'Vs', 'de', 'da');
|