Add function to describe the state of the nass

This commit is contained in:
Thomas Dehaeze 2020-04-15 10:56:18 +02:00
parent 163b80d8a2
commit 4973abb742
9 changed files with 493 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -24,6 +24,281 @@
#+PROPERTY: header-args:latex+ :output-dir figs #+PROPERTY: header-args:latex+ :output-dir figs
:END: :END:
* describeNassSetup
:PROPERTIES:
:header-args:matlab+: :tangle ..//src/describeNassSetup.m
:header-args:matlab+: :comments none :mkdirp yes :eval no
:END:
<<sec:describeNassSetup>>
** Function description
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
function [] = describeNassSetup()
% describeNassSetup -
%
% Syntax: [] = describeNassSetup()
%
% Inputs:
% - -
%
% Outputs:
% - -
#+end_src
** Simscape Configuration
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/conf_simscape.mat', 'conf_simscape');
#+end_src
#+begin_src matlab
fprintf('Simscape Configuration:\n');
if conf_simscape.type == 1
fprintf('- Gravity is included\n');
else
fprintf('- Gravity is not included\n');
end
fprintf('\n');
#+end_src
** Disturbances
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/nass_disturbances.mat', 'args');
#+end_src
#+begin_src matlab
fprintf('Disturbances:\n');
if ~args.enable
fprintf('- No disturbance is included\n');
else
if args.Dwx && args.Dwy && args.Dwz
fprintf('- Ground motion\n');
end
if args.Fty_x && args.Fty_z
fprintf('- Vibrations of the Translation Stage\n');
end
if args.Frz_z
fprintf('- Vibrations of the Spindle\n');
end
end
fprintf('\n');
#+end_src
** References
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/nass_references.mat', 'args');
#+end_src
#+begin_src matlab
fprintf('Reference Tracking:\n');
fprintf('- Translation Stage:\n');
switch args.Dy_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Dy = %.0f [mm]\n', args.Dy_amplitude*1e3);
case 'triangular'
fprintf(' - Triangular Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Dy_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Dy_period);
case 'sinusoidal'
fprintf(' - Sinusoidal Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Dy_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Dy_period);
end
fprintf('- Tilt Stage:\n');
switch args.Ry_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Ry = %.0f [mm]\n', args.Ry_amplitude*1e3);
case 'triangular'
fprintf(' - Triangular Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Ry_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Ry_period);
case 'sinusoidal'
fprintf(' - Sinusoidal Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Ry_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Ry_period);
end
fprintf('- Spindle:\n');
switch args.Rz_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Rz = %.0f [deg]\n', 180/pi*args.Rz_amplitude);
case { 'rotating', 'rotating-not-filtered' }
fprintf(' - Rotating\n');
fprintf(' - Speed = %.0f [rpm]\n', 60/Rz_period);
end
fprintf('- Micro Hexapod:\n');
switch args.Dh_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Dh = %.0f, %.0f, %.0f [mm]\n', args.Dh_pos(1), args.Dh_pos(2), args.Dh_pos(3));
fprintf(' - Rh = %.0f, %.0f, %.0f [deg]\n', args.Dh_pos(4), args.Dh_pos(5), args.Dh_pos(6));
end
fprintf('\n');
#+end_src
** Controller
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/controller.mat', 'controller');
#+end_src
#+begin_src matlab
fprintf('Controller:\n');
fprintf('- %s\n', controller.name);
fprintf('\n');
#+end_src
** Micro-Station
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/stages.mat', 'ground', 'granite', 'ty', 'ry', 'rz', 'micro_hexapod', 'axisc');
#+end_src
#+begin_src matlab
fprintf('Micro Station:\n');
if granite.type == 1 && ...
ty.type == 1 && ...
ry.type == 1 && ...
rz.type == 1 && ...
micro_hexapod.type == 1;
fprintf('- All stages are rigid\n');
elseif granite.type == 2 && ...
ty.type == 2 && ...
ry.type == 2 && ...
rz.type == 2 && ...
micro_hexapod.type == 2;
fprintf('- All stages are flexible\n');
else
if granite.type == 1 || granite.type == 4
fprintf('- Granite is rigid\n');
else
fprintf('- Granite is flexible\n');
end
if ty.type == 1 || ty.type == 4
fprintf('- Translation Stage is rigid\n');
else
fprintf('- Translation Stage is flexible\n');
end
if ry.type == 1 || ry.type == 4
fprintf('- Tilt Stage is rigid\n');
else
fprintf('- Tilt Stage is flexible\n');
end
if rz.type == 1 || rz.type == 4
fprintf('- Spindle is rigid\n');
else
fprintf('- Spindle is flexible\n');
end
if micro_hexapod.type == 1 || micro_hexapod.type == 4
fprintf('- Micro Hexapod is rigid\n');
else
fprintf('- Micro Hexapod is flexible\n');
end
end
fprintf('\n');
#+end_src
** Metrology
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/stages.mat', 'mirror');
#+end_src
#+begin_src matlab
fprintf('Reference Mirror:\n');
if mirror.type == 2;
fprintf('- flexible fixation\n');
fprintf('- w = %.0f [Hz]\n', mirror.freq(1));
else
fprintf('- rigidly attached to the nano-hexapod\n');
end
fprintf('- m = %.0f [kg]\n', mirror.mass);
fprintf('\n');
#+end_src
** Nano Hexapod
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/stages.mat', 'nano_hexapod');
#+end_src
#+begin_src matlab
fprintf('Nano Hexapod:\n');
if nano_hexapod.type == 0;
fprintf('- no included\n');
elseif nano_hexapod.type == 1 || nano_hexapod.type == 3;
fprintf('- rigid\n');
elseif nano_hexapod.type == 2;
fprintf('- flexible\n');
fprintf('- Ki = %.0g [N/m]\n', nano_hexapod.Ki(1));
end
fprintf('\n');
#+end_src
** Sample
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_src matlab
load('./mat/stages.mat', 'sample');
#+end_src
#+begin_src matlab
fprintf('Sample:\n');
if sample.type == 0;
fprintf('- no included\n');
elseif sample.type == 1 || sample.type == 3;
fprintf('- rigid\n');
fprintf('- mass = %.0f [kg]\n', sample.mass);
fprintf('- moment of inertia = %.2f, %.2f, %.2f [kg m2]\n', sample.inertia(1), sample.inertia(2), sample.inertia(3));
elseif sample.type == 2;
fprintf('- flexible\n');
fprintf('- mass = %.0f [kg]\n', sample.mass);
fprintf('- moment of inertia = %.2f, %.2f, %.2f [kg m2]\n', sample.inertia(1), sample.inertia(2), sample.inertia(3));
% fprintf('- Kt = %.0g, %.0g, %.0g [N/m]\n', sample.K(1), sample.K(2), sample.K(3));
% fprintf('- Kr = %.0g, %.0g, %.0g [Nm/rad]\n', sample.K(4), sample.K(5), sample.K(6));
fprintf('- wt(x,y,z) = %.0f, %.0f, %.0f [Hz]\n', 1/2/pi*sqrt(sample.K(1)/sample.mass), 1/2/pi*sqrt(sample.K(1)/sample.mass), 1/2/pi*sqrt(sample.K(1)/sample.mass));
fprintf('- wr(x,y,z) = %.0f, %.0f, %.0f [Hz]\n', 1/2/pi*sqrt(sample.K(4)/sample.inertia(1)), 1/2/pi*sqrt(sample.K(5)/sample.inertia(2)), 1/2/pi*sqrt(sample.K(6)/sample.inertia(3)));
end
fprintf('\n');
#+end_src
* computeReferencePose * computeReferencePose
:PROPERTIES: :PROPERTIES:
:header-args:matlab+: :tangle ../src/computeReferencePose.m :header-args:matlab+: :tangle ../src/computeReferencePose.m

View File

@ -1544,22 +1544,31 @@ First, we initialize the =controller= structure.
switch args.type switch args.type
case 'open-loop' case 'open-loop'
controller.type = 1; controller.type = 1;
controller.name = 'Open-Loop';
case 'dvf' case 'dvf'
controller.type = 2; controller.type = 2;
controller.name = 'Decentralized Direct Velocity Feedback';
case 'iff' case 'iff'
controller.type = 3; controller.type = 3;
controller.name = 'Decentralized Integral Force Feedback';
case 'hac-dvf' case 'hac-dvf'
controller.type = 4; controller.type = 4;
controller.name = 'HAC-DVF';
case 'ref-track-L' case 'ref-track-L'
controller.type = 5; controller.type = 5;
controller.name = 'Reference Tracking in the frame of the legs';
case 'ref-track-iff-L' case 'ref-track-iff-L'
controller.type = 6; controller.type = 6;
controller.name = 'Reference Tracking in the frame of the legs + IFF';
case 'cascade-hac-lac' case 'cascade-hac-lac'
controller.type = 7; controller.type = 7;
controller.name = 'Cascade Control + HAC-LAC';
case 'hac-iff' case 'hac-iff'
controller.type = 8; controller.type = 8;
controller.name = 'HAC-IFF';
case 'stabilizing' case 'stabilizing'
controller.type = 9; controller.type = 9;
controller.name = 'Stabilizing Controller';
end end
#+end_src #+end_src
@ -1867,7 +1876,7 @@ The =controller= structure is saved.
:END: :END:
#+begin_src matlab #+begin_src matlab
%% Save %% Save
save('./mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'Ts'); save('./mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'args', 'Ts');
end end
#+end_src #+end_src
@ -2090,7 +2099,7 @@ We define some parameters that will be used in the algorithm.
:UNNUMBERED: t :UNNUMBERED: t
:END: :END:
#+begin_src matlab #+begin_src matlab
save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't'); save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't', 'args');
#+end_src #+end_src
* Initialize Position Errors * Initialize Position Errors

196
src/describeNassSetup.m Normal file
View File

@ -0,0 +1,196 @@
function [] = describeNassSetup()
% describeNassSetup -
%
% Syntax: [] = describeNassSetup()
%
% Inputs:
% - -
%
% Outputs:
% - -
load('./mat/conf_simscape.mat', 'conf_simscape');
fprintf('Simscape Configuration:\n');
if conf_simscape.type == 1
fprintf('- Gravity is included\n');
else
fprintf('- Gravity is not included\n');
end
fprintf('\n');
load('./mat/nass_disturbances.mat', 'args');
fprintf('Disturbances:\n');
if ~args.enable
fprintf('- No disturbance is included\n');
else
if args.Dwx && args.Dwy && args.Dwz
fprintf('- Ground motion\n');
end
if args.Fty_x && args.Fty_z
fprintf('- Vibrations of the Translation Stage\n');
end
if args.Frz_z
fprintf('- Vibrations of the Spindle\n');
end
end
fprintf('\n');
load('./mat/nass_references.mat', 'args');
fprintf('Reference Tracking:\n');
fprintf('- Translation Stage:\n');
switch args.Dy_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Dy = %.0f [mm]\n', args.Dy_amplitude*1e3);
case 'triangular'
fprintf(' - Triangular Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Dy_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Dy_period);
case 'sinusoidal'
fprintf(' - Sinusoidal Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Dy_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Dy_period);
end
fprintf('- Tilt Stage:\n');
switch args.Ry_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Ry = %.0f [mm]\n', args.Ry_amplitude*1e3);
case 'triangular'
fprintf(' - Triangular Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Ry_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Ry_period);
case 'sinusoidal'
fprintf(' - Sinusoidal Path\n');
fprintf(' - Amplitude = %.0f [mm]\n', args.Ry_amplitude*1e3);
fprintf(' - Period = %.0f [s]\n', args.Ry_period);
end
fprintf('- Spindle:\n');
switch args.Rz_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Rz = %.0f [deg]\n', 180/pi*args.Rz_amplitude);
case { 'rotating', 'rotating-not-filtered' }
fprintf(' - Rotating\n');
fprintf(' - Speed = %.0f [rpm]\n', 60/Rz_period);
end
fprintf('- Micro Hexapod:\n');
switch args.Dh_type
case 'constant'
fprintf(' - Constant Position\n');
fprintf(' - Dh = %.0f, %.0f, %.0f [mm]\n', args.Dh_pos(1), args.Dh_pos(2), args.Dh_pos(3));
fprintf(' - Rh = %.0f, %.0f, %.0f [deg]\n', args.Dh_pos(4), args.Dh_pos(5), args.Dh_pos(6));
end
fprintf('\n');
load('./mat/controller.mat', 'controller');
fprintf('Controller:\n');
fprintf('- %s\n', controller.name);
fprintf('\n');
load('./mat/stages.mat', 'ground', 'granite', 'ty', 'ry', 'rz', 'micro_hexapod', 'axisc');
fprintf('Micro Station:\n');
if granite.type == 1 && ...
ty.type == 1 && ...
ry.type == 1 && ...
rz.type == 1 && ...
micro_hexapod.type == 1;
fprintf('- All stages are rigid\n');
elseif granite.type == 2 && ...
ty.type == 2 && ...
ry.type == 2 && ...
rz.type == 2 && ...
micro_hexapod.type == 2;
fprintf('- All stages are flexible\n');
else
if granite.type == 1 || granite.type == 4
fprintf('- Granite is rigid\n');
else
fprintf('- Granite is flexible\n');
end
if ty.type == 1 || ty.type == 4
fprintf('- Translation Stage is rigid\n');
else
fprintf('- Translation Stage is flexible\n');
end
if ry.type == 1 || ry.type == 4
fprintf('- Tilt Stage is rigid\n');
else
fprintf('- Tilt Stage is flexible\n');
end
if rz.type == 1 || rz.type == 4
fprintf('- Spindle is rigid\n');
else
fprintf('- Spindle is flexible\n');
end
if micro_hexapod.type == 1 || micro_hexapod.type == 4
fprintf('- Micro Hexapod is rigid\n');
else
fprintf('- Micro Hexapod is flexible\n');
end
end
fprintf('\n');
load('./mat/stages.mat', 'mirror');
fprintf('Reference Mirror:\n');
if mirror.type == 2;
fprintf('- flexible fixation\n');
fprintf('- w = %.0f [Hz]\n', mirror.freq(1));
else
fprintf('- rigidly attached to the nano-hexapod\n');
end
fprintf('- m = %.0f [kg]\n', mirror.mass);
fprintf('\n');
load('./mat/stages.mat', 'nano_hexapod');
fprintf('Nano Hexapod:\n');
if nano_hexapod.type == 0;
fprintf('- no included\n');
elseif nano_hexapod.type == 1 || nano_hexapod.type == 3;
fprintf('- rigid\n');
elseif nano_hexapod.type == 2;
fprintf('- flexible\n');
fprintf('- Ki = %.0g [N/m]\n', nano_hexapod.Ki(1));
end
fprintf('\n');
load('./mat/stages.mat', 'sample');
fprintf('Sample:\n');
if sample.type == 0;
fprintf('- no included\n');
elseif sample.type == 1 || sample.type == 3;
fprintf('- rigid\n');
fprintf('- mass = %.0f [kg]\n', sample.mass);
fprintf('- moment of inertia = %.2f, %.2f, %.2f [kg m2]\n', sample.inertia(1), sample.inertia(2), sample.inertia(3));
elseif sample.type == 2;
fprintf('- flexible\n');
fprintf('- mass = %.0f [kg]\n', sample.mass);
fprintf('- moment of inertia = %.2f, %.2f, %.2f [kg m2]\n', sample.inertia(1), sample.inertia(2), sample.inertia(3));
% fprintf('- Kt = %.0g, %.0g, %.0g [N/m]\n', sample.K(1), sample.K(2), sample.K(3));
% fprintf('- Kr = %.0g, %.0g, %.0g [Nm/rad]\n', sample.K(4), sample.K(5), sample.K(6));
fprintf('- wt(x,y,z) = %.0f, %.0f, %.0f [Hz]\n', 1/2/pi*sqrt(sample.K(1)/sample.mass), 1/2/pi*sqrt(sample.K(1)/sample.mass), 1/2/pi*sqrt(sample.K(1)/sample.mass));
fprintf('- wr(x,y,z) = %.0f, %.0f, %.0f [Hz]\n', 1/2/pi*sqrt(sample.K(4)/sample.inertia(1)), 1/2/pi*sqrt(sample.K(5)/sample.inertia(2)), 1/2/pi*sqrt(sample.K(6)/sample.inertia(3)));
end
fprintf('\n');

View File

@ -9,22 +9,31 @@ controller = struct();
switch args.type switch args.type
case 'open-loop' case 'open-loop'
controller.type = 1; controller.type = 1;
controller.name = 'Open-Loop';
case 'dvf' case 'dvf'
controller.type = 2; controller.type = 2;
controller.name = 'Decentralized Direct Velocity Feedback';
case 'iff' case 'iff'
controller.type = 3; controller.type = 3;
controller.name = 'Decentralized Integral Force Feedback';
case 'hac-dvf' case 'hac-dvf'
controller.type = 4; controller.type = 4;
controller.name = 'HAC-DVF';
case 'ref-track-L' case 'ref-track-L'
controller.type = 5; controller.type = 5;
controller.name = 'Reference Tracking in the frame of the legs';
case 'ref-track-iff-L' case 'ref-track-iff-L'
controller.type = 6; controller.type = 6;
controller.name = 'Reference Tracking in the frame of the legs + IFF';
case 'cascade-hac-lac' case 'cascade-hac-lac'
controller.type = 7; controller.type = 7;
controller.name = 'Cascade Control + HAC-LAC';
case 'hac-iff' case 'hac-iff'
controller.type = 8; controller.type = 8;
controller.name = 'HAC-IFF';
case 'stabilizing' case 'stabilizing'
controller.type = 9; controller.type = 9;
controller.name = 'Stabilizing Controller';
end end
save('./mat/controller.mat', 'controller'); save('./mat/controller.mat', 'controller');

View File

@ -132,4 +132,4 @@ Fty_x = Fty_x - Fty_x(1);
Fty_z = Fty_z - Fty_z(1); Fty_z = Fty_z - Fty_z(1);
Frz_z = Frz_z - Frz_z(1); Frz_z = Frz_z - Frz_z(1);
save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't'); save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't', 'args');

View File

@ -226,5 +226,5 @@ Dn = struct('time', t, 'signals', struct('values', Dn));
Dnl = struct('time', t, 'signals', struct('values', Dnl)); Dnl = struct('time', t, 'signals', struct('values', Dnl));
%% Save %% Save
save('./mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'Ts'); save('./mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'args', 'Ts');
end end