2018-10-07 22:07:21 +02:00
|
|
|
|
%%
|
|
|
|
|
clear; close all; clc;
|
|
|
|
|
|
|
|
|
|
%% Initialize simulation configuration
|
|
|
|
|
opts_sim = struct(...
|
2018-10-25 11:00:30 +02:00
|
|
|
|
'Tsim', 1 ...
|
2018-10-07 22:07:21 +02:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
initializeSimConf(opts_sim);
|
|
|
|
|
|
|
|
|
|
%% Initialize Inputs
|
|
|
|
|
load('./mat/sim_conf.mat', 'sim_conf')
|
|
|
|
|
|
|
|
|
|
time_vector = 0:sim_conf.Ts:sim_conf.Tsim;
|
|
|
|
|
|
|
|
|
|
% Translation Stage
|
2018-10-25 11:00:30 +02:00
|
|
|
|
ty = 0*ones(length(time_vector), 1);
|
2018-10-07 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
% Tilt Stage
|
2018-10-25 11:00:30 +02:00
|
|
|
|
ry = 2*pi*(0/360)*ones(length(time_vector), 1);
|
2018-10-24 15:08:23 +02:00
|
|
|
|
% ry = 2*pi*(3/360)*sin(2*pi*time_vector);
|
2018-10-07 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
% Spindle
|
|
|
|
|
rz = 2*pi*1*(time_vector);
|
2018-10-24 15:08:23 +02:00
|
|
|
|
% rz = 2*pi*(190/360)*ones(length(time_vector), 1);
|
2018-10-07 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
% Micro Hexapod
|
|
|
|
|
u_hexa = zeros(length(time_vector), 6);
|
|
|
|
|
|
|
|
|
|
% Gravity Compensator system
|
|
|
|
|
mass = zeros(length(time_vector), 2);
|
2018-10-24 15:08:23 +02:00
|
|
|
|
mass(:, 2) = pi;
|
2018-10-07 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
opts_inputs = struct(...
|
|
|
|
|
'ty', ty, ...
|
|
|
|
|
'ry', ry, ...
|
|
|
|
|
'rz', rz, ...
|
|
|
|
|
'u_hexa', u_hexa, ...
|
|
|
|
|
'mass', mass ...
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
initializeInputs(opts_inputs);
|
|
|
|
|
|
|
|
|
|
%% Initialize SolidWorks Data
|
2018-10-12 13:22:29 +02:00
|
|
|
|
initializeSolids();
|
2018-10-07 22:07:21 +02:00
|
|
|
|
|
|
|
|
|
%% Initialize Ground
|
|
|
|
|
initializeGround();
|
|
|
|
|
|
|
|
|
|
%% Initialize Granite
|
|
|
|
|
initializeGranite();
|
|
|
|
|
|
|
|
|
|
%% Initialize Translation stage
|
|
|
|
|
initializeTy();
|
|
|
|
|
|
|
|
|
|
%% Initialize Tilt Stage
|
|
|
|
|
initializeRy();
|
|
|
|
|
|
|
|
|
|
%% Initialize Spindle
|
|
|
|
|
initializeRz();
|
|
|
|
|
|
|
|
|
|
%% Initialize Hexapod Sym<EFBFBD>trie
|
|
|
|
|
initializeMicroHexapod();
|
|
|
|
|
|
|
|
|
|
%% Initialize Center of Gravity compensation
|
|
|
|
|
initializeAxisc();
|
|
|
|
|
|
|
|
|
|
%% Initialize NASS
|
|
|
|
|
initializeNanoHexapod(struct('actuator', 'piezo'));
|
|
|
|
|
|
|
|
|
|
%% Initialize Sample
|
|
|
|
|
initializeSample(struct('mass', 20));
|