diff --git a/disturbance-measurement/analysis.m b/disturbance-measurement/analysis.m new file mode 100644 index 0000000..831e4ef --- /dev/null +++ b/disturbance-measurement/analysis.m @@ -0,0 +1,14 @@ +data1 = load('mat/data_001.mat', 't', 'x1', 'x2'); +data2 = load('mat/data_002.mat', 't', 'x1', 'x2'); + +figure; +hold on; +plot(data1.t, data1.x1); +plot(data2.t, data2.x1); +hold off; + +figure; +hold on; +plot(data1.t, data1.x2); +plot(data2.t, data2.x2); +hold off;s \ No newline at end of file diff --git a/disturbance-measurement/disturbance_measurement.slx b/disturbance-measurement/disturbance_measurement.slx new file mode 100644 index 0000000..cc75c1f Binary files /dev/null and b/disturbance-measurement/disturbance_measurement.slx differ diff --git a/disturbance-measurement/mat/data_001.mat b/disturbance-measurement/mat/data_001.mat new file mode 100644 index 0000000..e3f758a Binary files /dev/null and b/disturbance-measurement/mat/data_001.mat differ diff --git a/disturbance-measurement/mat/data_002.mat b/disturbance-measurement/mat/data_002.mat new file mode 100644 index 0000000..788f17a Binary files /dev/null and b/disturbance-measurement/mat/data_002.mat differ diff --git a/disturbance-measurement/readme.org b/disturbance-measurement/readme.org new file mode 100644 index 0000000..4256f63 --- /dev/null +++ b/disturbance-measurement/readme.org @@ -0,0 +1,8 @@ +Measurement: +- one geophone on the marble +- one geophone at the sample position + +Every stage is powered on. + +|data_001.mat|nothing is turning| +|data_002.mat|spindle is turning at 1rpm| \ No newline at end of file diff --git a/disturbance-measurement/run_test.m b/disturbance-measurement/run_test.m new file mode 100644 index 0000000..dec7dd8 --- /dev/null +++ b/disturbance-measurement/run_test.m @@ -0,0 +1,49 @@ +tg = slrt; + +%% TODO - Build this application if updated + +%% +if tg.Connected == "Yes" + if tg.Status == "stopped" + %% Load the application + tg.load('disturbance_measurement'); + + %% Run the application + tg.start; + pause(300); + tg.stop; + + %% Load the data + f = SimulinkRealTime.openFTP(tg); + cd(f, 'data/disturbance_measurement/'); + mget(f, 'data_001.dat', 'data'); + close(f); + end +end + +data = SimulinkRealTime.utils.getFileScopeData('data/data_001.dat').data; + +size(data) + +t = data(:, end); +x1 = data(:, 1); +x2 = data(:, 2); + +save('mat/data_002.mat', 't', 'x1', 'x2'); + +%% Plot the data +figure; +hold on; +plot(t, x1); +plot(t, x2); +hold off +xlabel('Time [s]'); +ylabel('Voltage [V]'); + +%% +figure; +hold on; +plot(t, x1-x2); +hold off +xlabel('Time [s]'); +ylabel('Voltage [V]'); diff --git a/disturbance-measurement/setup.m b/disturbance-measurement/setup.m new file mode 100644 index 0000000..e69de29 diff --git a/slip-ring-test/setup.m b/slip-ring-test/setup.m index c79fd69..b822ec3 100644 --- a/slip-ring-test/setup.m +++ b/slip-ring-test/setup.m @@ -1 +1,8 @@ Ts = 1e-3; % [s] + +%% +% tg = slrt; +% f = SimulinkRealTime.openFTP(tg); +% cd(f, 'data/'); +% mkdir(f, 'disturbance-measurement'); +% close(f); \ No newline at end of file