Huge Update
- Modify the joints for Ty, Ry, Rz to have only one bushing joint. - Compensation of gravity
This commit is contained in:
@@ -129,7 +129,7 @@ These functions are defined below.
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.log char {mustBeMember(args.log,{'none', 'all'})} = 'none'
|
||||
args.log char {mustBeMember(args.log,{'none', 'all', 'forces'})} = 'none'
|
||||
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
|
||||
end
|
||||
#+end_src
|
||||
@@ -152,6 +152,8 @@ These functions are defined below.
|
||||
conf_log.type = 0;
|
||||
case 'all'
|
||||
conf_log.type = 1;
|
||||
case 'forces'
|
||||
conf_log.type = 2;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -298,7 +300,8 @@ The output =sample_pos= corresponds to the impact point of the X-ray.
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'modal-analysis'})} = 'flexible'
|
||||
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'modal-analysis', 'init'})} = 'flexible'
|
||||
args.Foffset logical {mustBeNumericOrLogical} = true
|
||||
args.density (1,1) double {mustBeNumeric, mustBeNonnegative} = 2800 % Density [kg/m3]
|
||||
args.x0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the X direction [m]
|
||||
args.y0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the Y direction [m]
|
||||
@@ -330,45 +333,51 @@ First, we initialize the =granite= structure.
|
||||
granite.type = 2;
|
||||
case 'modal-analysis'
|
||||
granite.type = 3;
|
||||
case 'init'
|
||||
granite.type = 4;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
Properties of the Material and link to the geometry of the granite.
|
||||
#+begin_src matlab
|
||||
granite.density = args.density; % [kg/m3]
|
||||
granite.STEP = './STEPS/granite/granite.STEP';
|
||||
#+end_src
|
||||
|
||||
Stiffness of the connection with Ground.
|
||||
#+begin_src matlab
|
||||
granite.k.x = 4e9; % [N/m]
|
||||
granite.k.y = 3e8; % [N/m]
|
||||
granite.k.z = 8e8; % [N/m]
|
||||
#+end_src
|
||||
|
||||
Damping of the connection with Ground.
|
||||
#+begin_src matlab
|
||||
granite.c.x = 4.0e5; % [N/(m/s)]
|
||||
granite.c.y = 1.1e5; % [N/(m/s)]
|
||||
granite.c.z = 9.0e5; % [N/(m/s)]
|
||||
#+end_src
|
||||
|
||||
Equilibrium position of the Cartesian joint.
|
||||
#+begin_src matlab
|
||||
granite.x0 = args.x0;
|
||||
granite.y0 = args.y0;
|
||||
granite.z0 = args.z0;
|
||||
#+end_src
|
||||
|
||||
Z-offset for the initial position of the sample with respect to the granite top surface.
|
||||
#+begin_src matlab
|
||||
granite.sample_pos = 0.8; % [m]
|
||||
#+end_src
|
||||
|
||||
** Stiffness and Damping properties
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
granite.K = [4e9; 3e8; 8e8]; % [N/m]
|
||||
granite.C = [4.0e5; 1.1e5; 9.0e5]; % [N/(m/s)]
|
||||
#+end_src
|
||||
|
||||
** Equilibrium position of the each joint.
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
||||
load('mat/Foffset.mat', 'Fgm');
|
||||
granite.Deq = -Fgm'./granite.K;
|
||||
else
|
||||
granite.Deq = zeros(6,1);
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Save the Structure
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
@@ -423,15 +432,8 @@ The Simscape model of the Translation stage consist of:
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis'})} = 'flexible'
|
||||
args.x11 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z11 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x21 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z21 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x12 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z12 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x22 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z22 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
||||
args.Foffset logical {mustBeNumericOrLogical} = true
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -444,7 +446,6 @@ First, we initialize the =ty= structure.
|
||||
ty = struct();
|
||||
#+end_src
|
||||
|
||||
|
||||
** Add Translation Stage Type
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
@@ -459,11 +460,12 @@ First, we initialize the =ty= structure.
|
||||
ty.type = 2;
|
||||
case 'modal-analysis'
|
||||
ty.type = 3;
|
||||
case 'init'
|
||||
ty.type = 4;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
@@ -506,28 +508,28 @@ Define the density of the materials as well as the geometry (STEP files).
|
||||
ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP';
|
||||
#+end_src
|
||||
|
||||
Stiffness of the stage.
|
||||
** Stiffness and Damping properties
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
ty.k.ax = 5e8; % Axial Stiffness for each of the 4 guidance (y) [N/m]
|
||||
ty.k.rad = 5e7; % Radial Stiffness for each of the 4 guidance (x-z) [N/m]
|
||||
ty.K = [2e8; 1e8; 2e8; 6e7; 9e7; 6e7]; % [N/m, N*m/rad]
|
||||
ty.C = [8e4; 5e4; 8e4; 2e4; 3e4; 2e4]; % [N/(m/s), N*m/(rad/s)]
|
||||
#+end_src
|
||||
|
||||
Damping of the stage.
|
||||
#+begin_src matlab
|
||||
ty.c.ax = 70710; % [N/(m/s)]
|
||||
ty.c.rad = 22360; % [N/(m/s)]
|
||||
#+end_src
|
||||
** Equilibrium position of the each joint.
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
Equilibrium position of the joints.
|
||||
#+begin_src matlab
|
||||
ty.x0_11 = args.x11;
|
||||
ty.z0_11 = args.z11;
|
||||
ty.x0_12 = args.x12;
|
||||
ty.z0_12 = args.z12;
|
||||
ty.x0_21 = args.x21;
|
||||
ty.z0_21 = args.z21;
|
||||
ty.x0_22 = args.x22;
|
||||
ty.z0_22 = args.z22;
|
||||
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
||||
load('mat/Foffset.mat', 'Ftym');
|
||||
ty.Deq = -Ftym'./ty.K;
|
||||
else
|
||||
ty.Deq = zeros(6,1);
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Save the Structure
|
||||
@@ -584,19 +586,9 @@ The Simscape model of the Tilt stage is composed of:
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis'})} = 'flexible'
|
||||
args.x11 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.y11 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z11 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x12 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.y12 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z12 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x21 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.y21 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z21 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x22 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.y22 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z22 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
||||
args.Foffset logical {mustBeNumericOrLogical} = true
|
||||
args.Ry_init (1,1) double {mustBeNumeric} = 0
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -624,12 +616,12 @@ First, we initialize the =ry= structure.
|
||||
ry.type = 2;
|
||||
case 'modal-analysis'
|
||||
ry.type = 3;
|
||||
case 'init'
|
||||
ry.type = 4;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
@@ -652,48 +644,44 @@ Properties of the Material and link to the geometry of the Tilt stage.
|
||||
ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP';
|
||||
#+end_src
|
||||
|
||||
Stiffness of the stage.
|
||||
#+begin_src matlab
|
||||
ry.k.tilt = 1e4; % Rotation stiffness around y [N*m/deg]
|
||||
ry.k.h = 1e8; % Stiffness in the direction of the guidance [N/m]
|
||||
ry.k.rad = 1e8; % Stiffness in the top direction [N/m]
|
||||
ry.k.rrad = 1e8; % Stiffness in the side direction [N/m]
|
||||
#+end_src
|
||||
|
||||
Damping of the stage.
|
||||
#+begin_src matlab
|
||||
ry.c.tilt = 2.8e2;
|
||||
ry.c.h = 2.8e4;
|
||||
ry.c.rad = 2.8e4;
|
||||
ry.c.rrad = 2.8e4;
|
||||
#+end_src
|
||||
|
||||
Equilibrium position of the joints.
|
||||
#+begin_src matlab
|
||||
ry.x0_11 = args.x11;
|
||||
ry.y0_11 = args.y11;
|
||||
ry.z0_11 = args.z11;
|
||||
ry.x0_12 = args.x12;
|
||||
ry.y0_12 = args.y12;
|
||||
ry.z0_12 = args.z12;
|
||||
ry.x0_21 = args.x21;
|
||||
ry.y0_21 = args.y21;
|
||||
ry.z0_21 = args.z21;
|
||||
ry.x0_22 = args.x22;
|
||||
ry.y0_22 = args.y22;
|
||||
ry.z0_22 = args.z22;
|
||||
#+end_src
|
||||
|
||||
Z-Offset so that the center of rotation matches the sample center;
|
||||
#+begin_src matlab
|
||||
ry.z_offset = 0.58178; % [m]
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
ry.Ry_init = args.Ry_init; % [rad]
|
||||
#+end_src
|
||||
|
||||
** Stiffness and Damping properties
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
ry.K = [3.8e8; 4e8; 3.8e8; 1.2e8; 6e4; 1.2e8];
|
||||
ry.C = [1e5; 1e5; 1e5; 3e4; 1e3; 3e4];
|
||||
#+end_src
|
||||
|
||||
** Equilibrium position of the each joint.
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
||||
load('mat/Foffset.mat', 'Fym');
|
||||
ry.Deq = -Fym'./ry.K;
|
||||
else
|
||||
ry.Deq = zeros(6,1);
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Save the Structure
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
The =ty= structure is saved.
|
||||
The =ry= structure is saved.
|
||||
#+begin_src matlab
|
||||
save('./mat/stages.mat', 'ry', '-append');
|
||||
#+end_src
|
||||
@@ -739,12 +727,8 @@ The Simscape model of the Spindle is composed of:
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis'})} = 'flexible'
|
||||
args.x0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||
args.y0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||
args.z0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [m]
|
||||
args.rx0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [rad]
|
||||
args.ry0 (1,1) double {mustBeNumeric} = 0 % Equilibrium position of the Joint [rad]
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
||||
args.Foffset logical {mustBeNumericOrLogical} = true
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -757,7 +741,6 @@ First, we initialize the =rz= structure.
|
||||
rz = struct();
|
||||
#+end_src
|
||||
|
||||
|
||||
** Add Spindle Type
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
@@ -772,13 +755,16 @@ First, we initialize the =rz= structure.
|
||||
rz.type = 2;
|
||||
case 'modal-analysis'
|
||||
rz.type = 3;
|
||||
case 'init'
|
||||
rz.type = 4;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
Properties of the Material and link to the geometry of the spindle.
|
||||
#+begin_src matlab
|
||||
% Spindle - Slip Ring
|
||||
@@ -794,29 +780,28 @@ Properties of the Material and link to the geometry of the spindle.
|
||||
rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP';
|
||||
#+end_src
|
||||
|
||||
Stiffness of the stage.
|
||||
** Stiffness and Damping properties
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
rz.k.rot = 1e6; % TODO - Rotational Stiffness (Rz) [N*m/deg]
|
||||
rz.k.tilt = 1e6; % Rotational Stiffness (Rx, Ry) [N*m/deg]
|
||||
rz.k.ax = 2e9; % Axial Stiffness (Z) [N/m]
|
||||
rz.k.rad = 7e8; % Radial Stiffness (X, Y) [N/m]
|
||||
rz.K = [7e8; 7e8; 2e9; 1e7; 1e7; 1e7];
|
||||
rz.C = [4e4; 4e4; 7e4; 1e4; 1e4; 1e4];
|
||||
#+end_src
|
||||
|
||||
Damping of the stage.
|
||||
#+begin_src matlab
|
||||
rz.c.rot = 1.6e3;
|
||||
rz.c.tilt = 1.6e3;
|
||||
rz.c.ax = 7.1e4;
|
||||
rz.c.rad = 4.2e4;
|
||||
#+end_src
|
||||
** Equilibrium position of the each joint.
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
Equilibrium position of the joints.
|
||||
#+begin_src matlab
|
||||
rz.x0 = args.x0;
|
||||
rz.y0 = args.y0;
|
||||
rz.z0 = args.z0;
|
||||
rz.rx0 = args.rx0;
|
||||
rz.ry0 = args.ry0;
|
||||
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
||||
load('mat/Foffset.mat', 'Fzm');
|
||||
rz.Deq = -Fzm'./rz.K;
|
||||
else
|
||||
rz.Deq = zeros(6,1);
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Save the Structure
|
||||
@@ -864,7 +849,7 @@ The =rz= structure is saved.
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis'})} = 'flexible'
|
||||
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init'})} = 'flexible'
|
||||
% initializeFramesPositions
|
||||
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e-3
|
||||
args.MO_B (1,1) double {mustBeNumeric} = 270e-3
|
||||
@@ -895,8 +880,8 @@ The =rz= structure is saved.
|
||||
% inverseKinematics
|
||||
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
|
||||
args.ARB (3,3) double {mustBeNumeric} = eye(3)
|
||||
% Equilibrium position of each leg
|
||||
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
|
||||
% Force that stiffness of each joint should apply at t=0
|
||||
args.Foffset logical {mustBeNumericOrLogical} = true
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -919,10 +904,14 @@ The =rz= structure is saved.
|
||||
|
||||
Equilibrium position of the each joint.
|
||||
#+begin_src matlab
|
||||
micro_hexapod.dLeq = args.dLeq;
|
||||
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
||||
load('mat/Foffset.mat', 'Fhm');
|
||||
micro_hexapod.dLeq = -Fhm'./args.Ki;
|
||||
else
|
||||
micro_hexapod.dLeq = zeros(6,1);
|
||||
end
|
||||
#+end_src
|
||||
|
||||
|
||||
** Add Type
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
@@ -937,6 +926,8 @@ Equilibrium position of the each joint.
|
||||
micro_hexapod.type = 2;
|
||||
case 'modal-analysis'
|
||||
micro_hexapod.type = 3;
|
||||
case 'init'
|
||||
micro_hexapod.type = 4;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -1017,10 +1008,11 @@ First, we initialize the =axisc= structure.
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
Properties of the Material and link to the geometry files.
|
||||
#+begin_src matlab
|
||||
% Structure
|
||||
@@ -1116,29 +1108,30 @@ First, we initialize the =mirror= structure.
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
We define the geometrical values.
|
||||
#+begin_src matlab
|
||||
mirror.h = 50; % Height of the mirror [mm]
|
||||
mirror.h = 0.05; % Height of the mirror [m]
|
||||
|
||||
mirror.thickness = 25; % Thickness of the plate supporting the sample [mm]
|
||||
mirror.thickness = 0.025; % Thickness of the plate supporting the sample [m]
|
||||
|
||||
mirror.hole_rad = 120; % radius of the hole in the mirror [mm]
|
||||
mirror.hole_rad = 0.120; % radius of the hole in the mirror [m]
|
||||
|
||||
mirror.support_rad = 100; % radius of the support plate [mm]
|
||||
mirror.support_rad = 0.1; % radius of the support plate [m]
|
||||
|
||||
% point of interest offset in z (above the top surfave) [mm]
|
||||
% point of interest offset in z (above the top surfave) [m]
|
||||
switch args.type
|
||||
case 'none'
|
||||
mirror.jacobian = 200;
|
||||
mirror.jacobian = 0.20;
|
||||
case 'rigid'
|
||||
mirror.jacobian = 200 - mirror.h;
|
||||
mirror.jacobian = 0.20 - mirror.h;
|
||||
end
|
||||
|
||||
mirror.rad = 180; % radius of the mirror (at the bottom surface) [mm]
|
||||
mirror.rad = 0.180; % radius of the mirror (at the bottom surface) [m]
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab
|
||||
@@ -1352,15 +1345,13 @@ The Simscape model of the sample environment is composed of:
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none'})} = 'flexible'
|
||||
args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m]
|
||||
args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m]
|
||||
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
|
||||
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz]
|
||||
args.offset (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.x0 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.y0 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.z0 (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.type char {mustBeMember(args.type,{'rigid', 'flexible', 'none', 'init'})} = 'flexible'
|
||||
args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m]
|
||||
args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m]
|
||||
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
|
||||
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz]
|
||||
args.offset (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.Foffset logical {mustBeNumericOrLogical} = true
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -1385,40 +1376,46 @@ First, we initialize the =sample= structure.
|
||||
sample.type = 1;
|
||||
case 'flexible'
|
||||
sample.type = 2;
|
||||
case 'init'
|
||||
sample.type = 3;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Function content
|
||||
** Material and Geometry
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
We define the geometrical parameters of the sample as well as its mass and position.
|
||||
#+begin_src matlab
|
||||
sample.radius = args.radius; % [m]
|
||||
sample.height = args.height; % [m]
|
||||
sample.mass = args.mass; % [kg]
|
||||
sample.mass = args.mass; % [kg]
|
||||
sample.offset = args.offset; % [m]
|
||||
#+end_src
|
||||
|
||||
Stiffness of the sample fixation.
|
||||
** Stiffness and Damping properties
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
#+begin_src matlab
|
||||
sample.k.x = sample.mass * (2*pi * args.freq)^2; % [N/m]
|
||||
sample.k.y = sample.mass * (2*pi * args.freq)^2; % [N/m]
|
||||
sample.k.z = sample.mass * (2*pi * args.freq)^2; % [N/m]
|
||||
sample.K = ones(3,1) * sample.mass * (2*pi * args.freq)^2; % [N/m]
|
||||
sample.C = 0.1 * sqrt(sample.K*sample.mass); % [N/(m/s)]
|
||||
#+end_src
|
||||
|
||||
Damping of the sample fixation.
|
||||
#+begin_src matlab
|
||||
sample.c.x = 0.1*sqrt(sample.k.x*sample.mass); % [N/(m/s)]
|
||||
sample.c.y = 0.1*sqrt(sample.k.y*sample.mass); % [N/(m/s)]
|
||||
sample.c.z = 0.1*sqrt(sample.k.z*sample.mass); % [N/(m/s)]
|
||||
#+end_src
|
||||
** Equilibrium position of the each joint.
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
|
||||
Equilibrium position of the Cartesian joint corresponding to the sample fixation.
|
||||
#+begin_src matlab
|
||||
sample.x0 = args.x0; % [m]
|
||||
sample.y0 = args.y0; % [m]
|
||||
sample.z0 = args.z0; % [m]
|
||||
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
||||
load('mat/Foffset.mat', 'Fsm');
|
||||
sample.Deq = -Fsm'./sample.K;
|
||||
else
|
||||
sample.Deq = zeros(3,1);
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Save the Structure
|
||||
@@ -1746,11 +1743,33 @@ The =controller= structure is saved.
|
||||
switch args.Dn_type
|
||||
case 'constant'
|
||||
Dn = [args.Dn_pos, args.Dn_pos];
|
||||
|
||||
load('mat/stages.mat', 'nano_hexapod');
|
||||
|
||||
AP = [args.Dn_pos(1) ; args.Dn_pos(2) ; args.Dn_pos(3)];
|
||||
|
||||
tx = args.Dn_pos(4);
|
||||
ty = args.Dn_pos(5);
|
||||
tz = args.Dn_pos(6);
|
||||
|
||||
ARB = [cos(tz) -sin(tz) 0;
|
||||
sin(tz) cos(tz) 0;
|
||||
0 0 1]*...
|
||||
[ cos(ty) 0 sin(ty);
|
||||
0 1 0;
|
||||
-sin(ty) 0 cos(ty)]*...
|
||||
[1 0 0;
|
||||
0 cos(tx) -sin(tx);
|
||||
0 sin(tx) cos(tx)];
|
||||
|
||||
[~, Dnl] = inverseKinematics(nano_hexapod, 'AP', AP, 'ARB', ARB);
|
||||
Dnl = [Dnl, Dnl];
|
||||
otherwise
|
||||
warning('Dn_type is not set correctly');
|
||||
end
|
||||
|
||||
Dn = struct('time', t, 'signals', struct('values', Dn));
|
||||
Dnl = struct('time', t, 'signals', struct('values', Dnl));
|
||||
#+end_src
|
||||
|
||||
** Save
|
||||
@@ -1759,7 +1778,7 @@ The =controller= structure is saved.
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
%% Save
|
||||
save('mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Ts');
|
||||
save('mat/nass_references.mat', 'Dy', 'Ry', 'Rz', 'Dh', 'Dhl', 'Rm', 'Dn', 'Dnl', 'Ts');
|
||||
end
|
||||
#+end_src
|
||||
|
||||
@@ -1985,6 +2004,81 @@ We define some parameters that will be used in the algorithm.
|
||||
save('mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't');
|
||||
#+end_src
|
||||
|
||||
* Initialize Position Errors
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/initializePosError.m
|
||||
:header-args:matlab+: :comments none :mkdirp yes
|
||||
:header-args:matlab+: :eval no :results none
|
||||
:END:
|
||||
<<sec:initializePosError>>
|
||||
|
||||
** Function Declaration and Documentation
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
function [] = initializePosError(args)
|
||||
% initializePosError - Initialize the position errors
|
||||
%
|
||||
% Syntax: [] = initializePosError(args)
|
||||
%
|
||||
% Inputs:
|
||||
% - args -
|
||||
|
||||
#+end_src
|
||||
|
||||
** Optional Parameters
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.error logical {mustBeNumericOrLogical} = false
|
||||
args.Dy (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.Ry (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
args.Rz (1,1) double {mustBeNumeric} = 0 % [m]
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Structure initialization
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
First, we initialize the =pos_error= structure.
|
||||
#+begin_src matlab
|
||||
pos_error = struct();
|
||||
#+end_src
|
||||
|
||||
** Type
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
if args.error
|
||||
pos_error.type = 1;
|
||||
else
|
||||
pos_error.type = 0;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Position Errors
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
pos_error.Dy = args.Dy;
|
||||
pos_error.Ry = args.Ry;
|
||||
pos_error.Rz = args.Rz;
|
||||
#+end_src
|
||||
|
||||
** Save
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
save('mat/pos_error.mat', 'pos_error');
|
||||
#+end_src
|
||||
|
||||
* Z-Axis Geophone
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/initializeZAxisGeophone.m
|
||||
|
Binary file not shown.
BIN
simscape_subsystems/micro_hexapod_leg_rigid.slx
Normal file
BIN
simscape_subsystems/micro_hexapod_leg_rigid.slx
Normal file
Binary file not shown.
BIN
simscape_subsystems/nano_hexapod_leg_rigid.slx
Normal file
BIN
simscape_subsystems/nano_hexapod_leg_rigid.slx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user