2019-05-10 16:06:43 +02:00
|
|
|
%% Clear Workspace and Close figures
|
2019-03-14 16:40:28 +01:00
|
|
|
clear; close all; clc;
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
%% Intialize Laplace variable
|
|
|
|
s = zpk('s');
|
|
|
|
|
|
|
|
% Load the processed data
|
|
|
|
|
2019-03-14 16:40:28 +01:00
|
|
|
load('./mat/spindle_data.mat', 'spindle');
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
% Plot X-Y-Z position with respect to Time - 1rpm
|
|
|
|
|
2019-03-14 16:40:28 +01:00
|
|
|
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'});
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
% Plot X-Y-Z position with respect to Time - 60rpm
|
|
|
|
% The measurements for the spindle turning at 60rpm are shown figure [[fig:spindle_xyz_60rpm]].
|
|
|
|
|
2019-03-14 16:40:28 +01:00
|
|
|
|
|
|
|
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'});
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
% Plot Synchronous and Asynchronous - 1rpm
|
2019-03-14 16:40:28 +01:00
|
|
|
|
|
|
|
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'});
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
% Plot Synchronous and Asynchronous - 60rpm
|
|
|
|
% The data is split into its Synchronous and Asynchronous part (figure [[fig:spindle_60rpm_sync_async]]). We then use the Asynchronous part for the analysis in the following sections as we suppose that we can deal with the synchronous part with feedforward control.
|
|
|
|
|
2019-03-14 16:40:28 +01:00
|
|
|
|
|
|
|
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'});
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
% Plot X against Y
|
2019-03-14 16:40:28 +01:00
|
|
|
|
|
|
|
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'});
|
|
|
|
|
2019-05-10 16:06:43 +02:00
|
|
|
% Plot X against Y - Asynchronous
|
2019-03-14 16:40:28 +01:00
|
|
|
|
|
|
|
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'});
|