Generation of disturbances is now reproducible

This commit is contained in:
Thomas Dehaeze 2020-02-05 13:36:41 +01:00
parent 62f971c2aa
commit ed4ac36c01
5 changed files with 52 additions and 4 deletions

View File

@ -3675,11 +3675,15 @@ The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
initializeSample('mass', args.sample_mass); initializeSample('mass', args.sample_mass);
#+end_src #+end_src
We set the references to zero. We set the references that corresponds to a tomography experiment.
#+begin_src matlab #+begin_src matlab
initializeReferences('Rz_type', 'rotating', 'Rz_period', args.Rz_period); initializeReferences('Rz_type', 'rotating', 'Rz_period', args.Rz_period);
#+end_src #+end_src
#+begin_src matlab
initializeDisturbances();
#+end_src
And all the controllers are set to 0. And all the controllers are set to 0.
#+begin_src matlab #+begin_src matlab
K = tf(zeros(6)); K = tf(zeros(6));

View File

@ -0,0 +1,30 @@
function [] = prepareLinearizeIdentification(args)
arguments
args.nass_actuator char {mustBeMember(args.nass_actuator,{'piezo', 'lorentz'})} = 'piezo'
args.sample_mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
end
initializeGround();
initializeGranite();
initializeTy();
initializeRy();
initializeRz();
initializeMicroHexapod();
initializeAxisc();
initializeMirror();
initializeNanoHexapod('actuator', args.nass_actuator);
initializeSample('mass', args.sample_mass);
initializeReferences();
initializeDisturbances('enable', false);
K = tf(zeros(6));
save('./mat/controllers.mat', 'K', '-append');
K_ine = tf(zeros(6));
save('./mat/controllers.mat', 'K_ine', '-append');
K_iff = tf(zeros(6));
save('./mat/controllers.mat', 'K_iff', '-append');
K_dvf = tf(zeros(6));
save('./mat/controllers.mat', 'K_dvf', '-append');

View File

@ -2,8 +2,8 @@ function [] = prepareTomographyExperiment(args)
arguments arguments
args.nass_actuator char {mustBeMember(args.nass_actuator,{'piezo', 'lorentz'})} = 'piezo' args.nass_actuator char {mustBeMember(args.nass_actuator,{'piezo', 'lorentz'})} = 'piezo'
args.sample_mass (1,1) double {mustBeNumeric, mustBePositive} = 50 args.sample_mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
args.Ry_period (1,1) double {mustBeNumeric, mustBePositive} = 1 args.Rz_period (1,1) double {mustBeNumeric, mustBePositive} = 1 % [s]
end end
initializeGround(); initializeGround();
@ -18,7 +18,9 @@ initializeMirror();
initializeNanoHexapod('actuator', args.nass_actuator); initializeNanoHexapod('actuator', args.nass_actuator);
initializeSample('mass', args.sample_mass); initializeSample('mass', args.sample_mass);
initializeReferences('Rz_type', 'rotating', 'Rz_period', args.Ry_period); initializeReferences('Rz_type', 'rotating', 'Rz_period', args.Rz_period);
initializeDisturbances();
K = tf(zeros(6)); K = tf(zeros(6));
save('./mat/controllers.mat', 'K', '-append'); save('./mat/controllers.mat', 'K', '-append');

View File

@ -1401,6 +1401,7 @@ We define some parameters that will be used in the algorithm.
#+begin_src matlab #+begin_src matlab
if args.Dwx && args.enable if args.Dwx && args.enable
rng(111);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -1412,6 +1413,7 @@ We define some parameters that will be used in the algorithm.
#+begin_src matlab #+begin_src matlab
if args.Dwy && args.enable if args.Dwy && args.enable
rng(112);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -1423,6 +1425,7 @@ We define some parameters that will be used in the algorithm.
#+begin_src matlab #+begin_src matlab
if args.Dwy && args.enable if args.Dwy && args.enable
rng(113);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -1443,6 +1446,7 @@ We define some parameters that will be used in the algorithm.
for i = 1:N/2 for i = 1:N/2
C(i) = sqrt(phi(i)*df); C(i) = sqrt(phi(i)*df);
end end
rng(121);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -1464,6 +1468,7 @@ We define some parameters that will be used in the algorithm.
for i = 1:N/2 for i = 1:N/2
C(i) = sqrt(phi(i)*df); C(i) = sqrt(phi(i)*df);
end end
rng(122);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -1485,6 +1490,7 @@ We define some parameters that will be used in the algorithm.
for i = 1:N/2 for i = 1:N/2
C(i) = sqrt(phi(i)*df); C(i) = sqrt(phi(i)*df);
end end
rng(131);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;

View File

@ -45,6 +45,7 @@ for i = 1:N/2
end end
if args.Dwx && args.enable if args.Dwx && args.enable
rng(111);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -54,6 +55,7 @@ else
end end
if args.Dwy && args.enable if args.Dwy && args.enable
rng(112);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -63,6 +65,7 @@ else
end end
if args.Dwy && args.enable if args.Dwy && args.enable
rng(113);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -77,6 +80,7 @@ if args.Fty_x && args.enable
for i = 1:N/2 for i = 1:N/2
C(i) = sqrt(phi(i)*df); C(i) = sqrt(phi(i)*df);
end end
rng(121);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -92,6 +96,7 @@ if args.Fty_z && args.enable
for i = 1:N/2 for i = 1:N/2
C(i) = sqrt(phi(i)*df); C(i) = sqrt(phi(i)*df);
end end
rng(122);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;
@ -107,6 +112,7 @@ if args.Frz_z && args.enable
for i = 1:N/2 for i = 1:N/2
C(i) = sqrt(phi(i)*df); C(i) = sqrt(phi(i)*df);
end end
rng(131);
theta = 2*pi*rand(N/2,1); % Generate random phase [rad] theta = 2*pi*rand(N/2,1); % Generate random phase [rad]
Cx = [0 ; C.*complex(cos(theta),sin(theta))]; Cx = [0 ; C.*complex(cos(theta),sin(theta))];
Cx = [Cx; flipud(conj(Cx(2:end)))];; Cx = [Cx; flipud(conj(Cx(2:end)))];;