74 lines
1.8 KiB
Matlab
74 lines
1.8 KiB
Matlab
%%
|
|
clear; close all; clc;
|
|
|
|
%% Load Spindle Data
|
|
load('./mat/spindle_data.mat', 'spindle');
|
|
|
|
%% Plot X-Y-Z position with respect to Time
|
|
figure;
|
|
hold on;
|
|
plot(spindle.rpm1.time, spindle.rpm1.x);
|
|
plot(spindle.rpm1.time, spindle.rpm1.y);
|
|
plot(spindle.rpm1.time, spindle.rpm1.z);
|
|
hold off;
|
|
xlabel('Time [s]'); ylabel('Amplitude [m]');
|
|
legend({'tx - 1rpm', 'ty - 1rpm', 'tz - 1rpm'});
|
|
|
|
exportFig('spindle_xyz_1rpm', 'wide-normal');
|
|
|
|
%% Plot X-Y-Z position with respect to Time
|
|
figure;
|
|
hold on;
|
|
plot(spindle.rpm60.time, spindle.rpm60.x);
|
|
plot(spindle.rpm60.time, spindle.rpm60.y);
|
|
plot(spindle.rpm60.time, spindle.rpm60.z);
|
|
hold off;
|
|
xlabel('Time [s]'); ylabel('Amplitude [m]');
|
|
legend({'tx - 60rpm', 'ty - 60rpm', 'tz - 60rpm'});
|
|
|
|
exportFig('spindle_xyz_60rpm', 'normal-normal');
|
|
|
|
%%
|
|
figure;
|
|
hold on;
|
|
plot(spindle.rpm1.time, spindle.rpm1.x);
|
|
plot(spindle.rpm1.time, spindle.rpm1.xasync);
|
|
hold off;
|
|
xlabel('Time [s]'); ylabel('Amplitude [m]');
|
|
legend({'tx - 1rpm - Sync', 'tx - 1rpm - Async'});
|
|
|
|
exportFig('spindle_1rpm_sync_async', 'normal-normal');
|
|
|
|
%%
|
|
figure;
|
|
hold on;
|
|
plot(spindle.rpm60.time, spindle.rpm60.x);
|
|
plot(spindle.rpm60.time, spindle.rpm60.xasync);
|
|
hold off;
|
|
xlabel('Time [s]'); ylabel('Amplitude [m]');
|
|
legend({'tx - 60rpm - Sync', 'tx - 60rpm - Async'});
|
|
|
|
exportFig('spindle_60rpm_sync_async', 'wide-normal');
|
|
|
|
%% Plot X against Y
|
|
figure;
|
|
hold on;
|
|
plot(spindle.rpm1.x, spindle.rpm1.y);
|
|
plot(spindle.rpm60.x, spindle.rpm60.y);
|
|
hold off;
|
|
xlabel('X Amplitude [m]'); ylabel('Y Amplitude [m]');
|
|
legend({'1rpm', '60rpm'});
|
|
|
|
exportFig('spindle_xy_1_60rpm', 'normal-normal');
|
|
|
|
%% Plot X against Y
|
|
figure;
|
|
hold on;
|
|
plot(spindle.rpm1.xasync, spindle.rpm1.yasync);
|
|
plot(spindle.rpm60.xasync, spindle.rpm60.yasync);
|
|
hold off;
|
|
xlabel('X Amplitude [m]'); ylabel('Y Amplitude [m]');
|
|
legend({'1rpm', '60rpm'});
|
|
|
|
exportFig('spindle_xy_1_60rpm_async', 'normal-normal');
|