nass-simscape/kinematics/sample_pos_init.m

70 lines
1.2 KiB
Mathematica
Raw Normal View History

%%
clear; close all; clc;
%% Initialize simulation configuration
opts_sim = struct(...
'Tsim', 0.001 ...
);
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*(0/360)*ones(length(time_vector), 1);
% Ry = 2*pi*(3/360)*sin(2*pi*time_vector);
% Spindle
Rz = 2*pi*0*(time_vector);
% Rz = 2*pi*(190/360)*ones(length(time_vector), 1);
% Micro Hexapod
Dh = zeros(length(time_vector), 6);
% Gravity Compensator system
Dm = zeros(length(time_vector), 2);
Dm(:, 2) = pi;
opts_inputs = struct(...
'Ty', Ty, ...
'Ry', Ry, ...
'Rz', Rz, ...
'Dh', Dh, ...
'Dm', Dm ...
);
initializeInputs(opts_inputs);
%% 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));