Add sample initialization

This commit is contained in:
Thomas Dehaeze 2025-02-12 14:10:49 +01:00
parent 85635d4087
commit 0bc6857290
3 changed files with 26 additions and 19 deletions

Binary file not shown.

View File

@ -1,22 +1,24 @@
function [sample] = initializeSample(args)
arguments
args.type char {mustBeMember(args.type,{'none', 'cylindrical'})} = 'none'
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e-3 % Height [m]
args.R (1,1) double {mustBeNumeric, mustBePositive} = 350e-3 % Radius [m]
args.R (1,1) double {mustBeNumeric, mustBePositive} = 110e-3 % Radius [m]
args.m (1,1) double {mustBeNumeric, mustBePositive} = 1 % Mass [kg]
end
sample = struct();
switch args.type
case '0'
case 'none'
sample.type = 0;
case '1'
sample.m = 0;
case 'cylindrical'
sample.type = 1;
case '2'
sample.type = 2;
case '3'
sample.type = 3;
sample.H = args.H;
sample.R = args.R;
sample.m = args.m;
end
if exist('./mat', 'dir')

View File

@ -210,15 +210,18 @@ Goal: validation of the concept
- Take into account disturbances, sensor noise, etc...
- Tomography + lateral scans (same as what was done in open loop [[file:~/Cloud/work-projects/ID31-NASS/phd-thesis-chapters/A4-simscape-micro-station/simscape-micro-station.org::*Simulation of Scientific Experiments][here]])
** TODO [#A] Merge the micro-station model with the nano-hexapod model
SCHEDULED: <2025-02-12 Wed>
** DONE [#A] Merge the micro-station model with the nano-hexapod model
CLOSED: [2025-02-12 Wed 12:10] SCHEDULED: <2025-02-12 Wed>
- [X] *Start from the Simscape model of the ID31 tests*
=/home/thomas/Cloud/work-projects/ID31-NASS/phd-thesis-chapters/C5-test-bench-id31/matlab/nass_model_id31.slx=
- [X] Remove LION metrology to have perfect measurement
- [ ] Remove nano-hexapod model and add simplified model
- [X] Remove nano-hexapod model and add simplified model
- [ ] Add "cylindrical" payloads (configurable in mass)
** TODO [#B] Add payload configurable subsystem
SCHEDULED: <2025-02-12 Wed>
** TODO [#B] Discuss the necessity of estimated Rz?
One big advantage of doing the control in the cartesian plane, is that we don't need the estimation of nano-hexapod Rz, therefore we don't need the encoders anymore!
@ -364,7 +367,7 @@ initializeRy();
initializeRz();
initializeMicroHexapod();
initializeSimplifiedNanoHexapod();
% initializeSample('type', '0');
initializeSample('type', 'cylindrical');
initializeSimscapeConfiguration('gravity', false);
initializeDisturbances('enable', false);
@ -1943,28 +1946,30 @@ function [nano_hexapod] = initializeSimplifiedNanoHexapod(args)
end
#+end_src
*** TODO [#A] =initializeSample=: Sample
*** =initializeSample=: Sample
#+begin_src matlab :tangle matlab/src/initializeSample.m :comments none :mkdirp yes :eval no
function [sample] = initializeSample(args)
arguments
args.type char {mustBeMember(args.type,{'none', 'cylindrical'})} = 'none'
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e-3 % Height [m]
args.R (1,1) double {mustBeNumeric, mustBePositive} = 350e-3 % Radius [m]
args.R (1,1) double {mustBeNumeric, mustBePositive} = 110e-3 % Radius [m]
args.m (1,1) double {mustBeNumeric, mustBePositive} = 1 % Mass [kg]
end
sample = struct();
switch args.type
case '0'
case 'none'
sample.type = 0;
case '1'
sample.m = 0;
case 'cylindrical'
sample.type = 1;
case '2'
sample.type = 2;
case '3'
sample.type = 3;
sample.H = args.H;
sample.R = args.R;
sample.m = args.m;
end
if exist('./mat', 'dir')