Thomas Dehaeze
65e246ff4c
Change the tomography experiment simulation Add simulink "matlab function" to compute the position error
20 KiB
20 KiB
Tomography Experiment
- Introduction
- Simscape Model
- Tomography Experiment with no disturbances
- With Perturbations
- Tomography
Introduction ignore
Simscape Model
The simulink file to do tomography experiments is sim_nano_station_tomo.slx
.
open('experiment_tomography/matlab/sim_nano_station_tomo.slx')
We load the shared simulink configuration and we set the StopTime
.
load('mat/conf_simscape.mat');
set_param(conf_simscape, 'StopTime', '5');
We first initialize all the stages.
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
initializeNanoHexapod(struct('actuator', 'piezo'));
initializeSample(struct('mass', 1));
Tomography Experiment with no disturbances
Simulation Setup
We initialize the reference path for all the stages. All stage is set to its zero position except the Spindle which is rotating at 60rpm.
initializeReferences(struct('Rz_type', 'rotating', 'Rz_period', 1));
And we initialize the disturbances to be equal to zero.
opts = struct(...
'Dwx', false, ... % Ground Motion - X direction
'Dwy', false, ... % Ground Motion - Y direction
'Dwz', false, ... % Ground Motion - Z direction
'Fty_x', false, ... % Translation Stage - X direction
'Fty_z', false, ... % Translation Stage - Z direction
'Frz_z', false ... % Spindle - Z direction
);
initDisturbances(opts);
We simulate the model.
sim('sim_nano_station_tomo');
And we save the obtained data.
MTr_alig_no_dist = MTr;
save('experiment_tomography/mat/experiment.mat', 'MTr_alig_no_dist', '-append');
Analysis
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
<<plt-matlab>>
<<plt-matlab>>
With Perturbations
Simulation Setup
We now activate the disturbances.
opts = struct(...
'Dwx', true, ... % Ground Motion - X direction
'Dwy', true, ... % Ground Motion - Y direction
'Dwz', true, ... % Ground Motion - Z direction
'Fty_x', true, ... % Translation Stage - X direction
'Fty_z', true, ... % Translation Stage - Z direction
'Frz_z', true ... % Spindle - Z direction
);
initDisturbances(opts);
We simulate the model.
sim('sim_nano_station_tomo');
And we save the obtained data.
MTr_alig_dist = MTr;
save('experiment_tomography/mat/experiment.mat', 'MTr_alig_dist', '-append');
Analysis
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
<<plt-matlab>>
<<plt-matlab>>
Tomography
Simulation Setup
We first set the wanted translation of the Micro Hexapod.
P_micro_hexapod = [0.01; 0; 0]; % [m]
We initialize the reference path.
initializeReferences(struct('Dh_pos', [P_micro_hexapod; 0; 0; 0], 'Rz_type', 'rotating', 'Rz_period', 1));
We initialize the stages.
initializeMicroHexapod(struct('AP', P_micro_hexapod));
And we initialize the disturbances to zero.
opts = struct(...
'Dwx', false, ... % Ground Motion - X direction
'Dwy', false, ... % Ground Motion - Y direction
'Dwz', false, ... % Ground Motion - Z direction
'Fty_x', false, ... % Translation Stage - X direction
'Fty_z', false, ... % Translation Stage - Z direction
'Frz_z', false ... % Spindle - Z direction
);
initDisturbances(opts);
We simulate the model.
sim('sim_nano_station_tomo');
And we save the obtained data.
MTr_not_alig = MTr;
save('experiment_tomography/mat/experiment.mat', 'MTr_not_alig', '-append');
Analysis
Edx = squeeze(MTr(1, 4, :));
Edy = squeeze(MTr(2, 4, :));
Edz = squeeze(MTr(3, 4, :));
% The angles obtained are u-v-w Euler angles (rotations in the moving frame)
Ery = atan2( squeeze(MTr(1, 3, :)), squeeze(sqrt(MTr(1, 1, :).^2 + MTr(1, 2, :).^2)));
Erx = atan2(-squeeze(MTr(2, 3, :))./cos(Ery), squeeze(MTr(3, 3, :))./cos(Ery));
Erz = atan2(-squeeze(MTr(1, 2, :))./cos(Ery), squeeze(MTr(1, 1, :))./cos(Ery));
<<plt-matlab>>
<<plt-matlab>>