70 lines
1.2 KiB
Mathematica
70 lines
1.2 KiB
Mathematica
|
%%
|
|||
|
clear; close all; clc;
|
|||
|
|
|||
|
%% Initialize simulation configuration
|
|||
|
opts_sim = struct(...
|
|||
|
'Tsim', 2 ...
|
|||
|
);
|
|||
|
|
|||
|
initializeSimConf(opts_sim);
|
|||
|
|
|||
|
%% Initialize Inputs
|
|||
|
load('./mat/sim_conf.mat', 'sim_conf')
|
|||
|
|
|||
|
time_vector = 0:sim_conf.Ts:sim_conf.Tsim;
|
|||
|
|
|||
|
% Translation Stage
|
|||
|
ty = 0*ones(length(time_vector), 1);
|
|||
|
|
|||
|
% Tilt Stage
|
|||
|
ry = 2*pi*(3/360)*ones(length(time_vector), 1);
|
|||
|
|
|||
|
% Spindle
|
|||
|
rz = 2*pi*1*(time_vector);
|
|||
|
|
|||
|
% Micro Hexapod
|
|||
|
u_hexa = zeros(length(time_vector), 6);
|
|||
|
|
|||
|
% Gravity Compensator system
|
|||
|
mass = zeros(length(time_vector), 2);
|
|||
|
|
|||
|
opts_inputs = struct(...
|
|||
|
'ty', ty, ...
|
|||
|
'ry', ry, ...
|
|||
|
'rz', rz, ...
|
|||
|
'u_hexa', u_hexa, ...
|
|||
|
'mass', mass ...
|
|||
|
);
|
|||
|
|
|||
|
initializeInputs(opts_inputs);
|
|||
|
|
|||
|
%% Initialize SolidWorks Data
|
|||
|
initializeSmiData();
|
|||
|
|
|||
|
%% 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));
|