Update all the initialization function

Generally, remove the unused parameters,
Remove the colors and other no important parameters.
This commit is contained in:
Thomas Dehaeze 2020-02-03 17:50:52 +01:00
parent d9a15470ab
commit 3318694d53
11 changed files with 381 additions and 549 deletions

View File

@ -1,31 +1,21 @@
function [axisc] = initializeAxisc() function [axisc] = initializeAxisc()
%%
axisc = struct(); axisc = struct();
%% Axis Compensator - Static Properties
% Structure % Structure
axisc.structure.density = 3400; % [kg/m3] axisc.structure.density = 3400; % [kg/m3]
axisc.structure.color = [0.792 0.820 0.933];
axisc.structure.STEP = './STEPS/axisc/axisc_structure.STEP'; axisc.structure.STEP = './STEPS/axisc/axisc_structure.STEP';
% Wheel % Wheel
axisc.wheel.density = 2700; % [kg/m3] axisc.wheel.density = 2700; % [kg/m3]
axisc.wheel.color = [0.753 0.753 0.753];
axisc.wheel.STEP = './STEPS/axisc/axisc_wheel.STEP'; axisc.wheel.STEP = './STEPS/axisc/axisc_wheel.STEP';
% Mass % Mass
axisc.mass.density = 7800; % [kg/m3] axisc.mass.density = 7800; % [kg/m3]
axisc.mass.color = [0.792 0.820 0.933];
axisc.mass.STEP = './STEPS/axisc/axisc_mass.STEP'; axisc.mass.STEP = './STEPS/axisc/axisc_mass.STEP';
% Gear % Gear
axisc.gear.density = 7800; % [kg/m3] axisc.gear.density = 7800; % [kg/m3]
axisc.gear.color = [0.792 0.820 0.933];
axisc.gear.STEP = './STEPS/axisc/axisc_gear.STEP'; axisc.gear.STEP = './STEPS/axisc/axisc_gear.STEP';
axisc.m = 40; % TODO [kg]
%% Axis Compensator - Dynamical Properties
% axisc.k.ax = 1; % TODO [N*m/deg)]
% axisc.c.ax = (1/1)*sqrt(axisc.k.ax/axisc.m);
%% Save
save('./mat/stages.mat', 'axisc', '-append'); save('./mat/stages.mat', 'axisc', '-append');
end

View File

@ -1,47 +1,29 @@
function [granite] = initializeGranite(args) function [granite] = initializeGranite(args)
arguments arguments
args.rigid logical {mustBeNumericOrLogical} = false 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]
args.z0 (1,1) double {mustBeNumeric} = 0 % Rest position of the Joint in the Z direction [m]
end end
%%
granite = struct(); granite = struct();
%% Static Properties granite.density = args.density; % [kg/m3]
granite.density = 2800; % [kg/m3]
granite.volume = 0.749; % [m3] TODO - should
granite.mass = granite.density*granite.volume; % [kg]
granite.color = [1 1 1];
granite.STEP = './STEPS/granite/granite.STEP'; granite.STEP = './STEPS/granite/granite.STEP';
granite.mass_top = 4000; % [kg] TODO
%% Dynamical Properties
if args.rigid
granite.k.x = 1e12; % [N/m]
granite.k.y = 1e12; % [N/m]
granite.k.z = 1e12; % [N/m]
granite.k.rx = 1e10; % [N*m/deg]
granite.k.ry = 1e10; % [N*m/deg]
granite.k.rz = 1e10; % [N*m/deg]
else
granite.k.x = 4e9; % [N/m] granite.k.x = 4e9; % [N/m]
granite.k.y = 3e8; % [N/m] granite.k.y = 3e8; % [N/m]
granite.k.z = 8e8; % [N/m] granite.k.z = 8e8; % [N/m]
granite.k.rx = 1e4; % [N*m/deg]
granite.k.ry = 1e4; % [N*m/deg]
granite.k.rz = 1e6; % [N*m/deg]
end
granite.c.x = 0.1*sqrt(granite.mass_top*granite.k.x); % [N/(m/s)] granite.c.x = 4.0e5; % [N/(m/s)]
granite.c.y = 0.1*sqrt(granite.mass_top*granite.k.y); % [N/(m/s)] granite.c.y = 1.1e5; % [N/(m/s)]
granite.c.z = 0.5*sqrt(granite.mass_top*granite.k.z); % [N/(m/s)] granite.c.z = 9.0e5; % [N/(m/s)]
granite.c.rx = 0.1*sqrt(granite.mass_top*granite.k.rx); % [N*m/(deg/s)]
granite.c.ry = 0.1*sqrt(granite.mass_top*granite.k.ry); % [N*m/(deg/s)]
granite.c.rz = 0.1*sqrt(granite.mass_top*granite.k.rz); % [N*m/(deg/s)]
%% Positioning parameters granite.x0 = args.x0;
granite.sample_pos = 0.8; % Z-offset for the initial position of the sample [m] granite.y0 = args.y0;
granite.z0 = args.z0;
granite.sample_pos = 0.8; % [m]
%% Save
save('./mat/stages.mat', 'granite', '-append'); save('./mat/stages.mat', 'granite', '-append');
end

View File

@ -1,11 +1,8 @@
function [ground] = initializeGround() function [ground] = initializeGround()
%%
ground = struct(); ground = struct();
ground.shape = [2, 2, 0.5]; % [m] ground.shape = [2, 2, 0.5]; % [m]
ground.density = 2800; % [kg/m3] ground.density = 2800; % [kg/m3]
ground.color = [0.5, 0.5, 0.5];
%% Save
save('./mat/stages.mat', 'ground', '-append'); save('./mat/stages.mat', 'ground', '-append');
end

View File

@ -1,196 +1,51 @@
function [micro_hexapod] = initializeMicroHexapod(args) function [micro_hexapod] = initializeMicroHexapodNew(args)
arguments arguments
args.rigid logical {mustBeNumericOrLogical} = false % initializeFramesPositions
args.H (1,1) double {mustBeNumeric, mustBePositive} = 350e-3
args.MO_B (1,1) double {mustBeNumeric} = 270e-3
% generateGeneralConfiguration
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 175.5e-3
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180)
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 45e-3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 118e-3
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180)
% initializeStrutDynamics
args.Ki (6,1) double {mustBeNumeric, mustBeNonnegative} = 2e7*ones(6,1)
args.Ci (6,1) double {mustBeNumeric, mustBeNonnegative} = 1.4e3*ones(6,1)
% initializeCylindricalPlatforms
args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 10
args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 26e-3
args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 207.5e-3
args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 10
args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 26e-3
args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 150e-3
% initializeCylindricalStruts
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 1
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 25e-3
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 1
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 25e-3
% inverseKinematics
args.AP (3,1) double {mustBeNumeric} = zeros(3,1) args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3) args.ARB (3,3) double {mustBeNumeric} = eye(3)
% Equilibrium position of each leg
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
end end
%% Stewart Object micro_hexapod = initializeFramesPositions('H', args.H, 'MO_B', args.MO_B);
micro_hexapod = struct(); micro_hexapod = generateGeneralConfiguration(micro_hexapod, 'FH', args.FH, 'FR', args.FR, 'FTh', args.FTh, 'MH', args.MH, 'MR', args.MR, 'MTh', args.MTh);
micro_hexapod.h = 350; % Total height of the platform [mm] micro_hexapod = computeJointsPose(micro_hexapod);
micro_hexapod.jacobian = 270; % Distance from the top of the mobile platform to the Jacobian point [mm] micro_hexapod = initializeStrutDynamics(micro_hexapod, 'Ki', args.Ki, 'Ci', args.Ci);
micro_hexapod = initializeCylindricalPlatforms(micro_hexapod, 'Fpm', args.Fpm, 'Fph', args.Fph, 'Fpr', args.Fpr, 'Mpm', args.Mpm, 'Mph', args.Mph, 'Mpr', args.Mpr);
micro_hexapod = initializeCylindricalStruts(micro_hexapod, 'Fsm', args.Fsm, 'Fsh', args.Fsh, 'Fsr', args.Fsr, 'Msm', args.Msm, 'Msh', args.Msh, 'Msr', args.Msr);
micro_hexapod = computeJacobian(micro_hexapod);
[Li, dLi] = inverseKinematics(micro_hexapod, 'AP', args.AP, 'ARB', args.ARB);
micro_hexapod.Li = Li;
micro_hexapod.dLi = dLi;
%% Bottom Plate - Mechanical Design micro_hexapod.dLeq = args.dLeq;
BP = struct();
BP.rad.int = 110; % Internal Radius [mm]
BP.rad.ext = 207.5; % External Radius [mm]
BP.thickness = 26; % Thickness [mm]
BP.leg.rad = 175.5; % Radius where the legs articulations are positionned [mm]
BP.leg.ang = 9.5; % Angle Offset [deg]
BP.density = 8000; % Density of the material [kg/m^3]
BP.color = [0.6 0.6 0.6]; % Color [rgb]
BP.shape = [BP.rad.int BP.thickness; BP.rad.int 0; BP.rad.ext 0; BP.rad.ext BP.thickness];
%% Top Plate - Mechanical Design
TP = struct();
TP.rad.int = 82; % Internal Radius [mm]
TP.rad.ext = 150; % Internal Radius [mm]
TP.thickness = 26; % Thickness [mm]
TP.leg.rad = 118; % Radius where the legs articulations are positionned [mm]
TP.leg.ang = 12.1; % Angle Offset [deg]
TP.density = 8000; % Density of the material [kg/m^3]
TP.color = [0.6 0.6 0.6]; % Color [rgb]
TP.shape = [TP.rad.int TP.thickness; TP.rad.int 0; TP.rad.ext 0; TP.rad.ext TP.thickness];
%% Struts
Leg = struct();
Leg.stroke = 10e-3; % Maximum Stroke of each leg [m]
if args.rigid
Leg.k.ax = 1e12; % Stiffness of each leg [N/m]
else
Leg.k.ax = 2e7; % Stiffness of each leg [N/m]
end
Leg.ksi.ax = 0.1; % Modal damping ksi = 1/2*c/sqrt(km) []
Leg.rad.bottom = 25; % Radius of the cylinder of the bottom part [mm]
Leg.rad.top = 17; % Radius of the cylinder of the top part [mm]
Leg.density = 8000; % Density of the material [kg/m^3]
Leg.color.bottom = [0.5 0.5 0.5]; % Color [rgb]
Leg.color.top = [0.5 0.5 0.5]; % Color [rgb]
Leg.sphere.bottom = Leg.rad.bottom; % Size of the sphere at the end of the leg [mm]
Leg.sphere.top = Leg.rad.top; % Size of the sphere at the end of the leg [mm]
Leg.m = TP.density*((pi*(TP.rad.ext/1000)^2)*(TP.thickness/1000)-(pi*(TP.rad.int/1000^2))*(TP.thickness/1000))/6; % TODO [kg]
Leg = updateDamping(Leg);
%% Sphere
SP = struct();
SP.height.bottom = 27; % [mm]
SP.height.top = 27; % [mm]
SP.density.bottom = 8000; % [kg/m^3]
SP.density.top = 8000; % [kg/m^3]
SP.color.bottom = [0.6 0.6 0.6]; % [rgb]
SP.color.top = [0.6 0.6 0.6]; % [rgb]
SP.k.ax = 0; % [N*m/deg]
SP.ksi.ax = 10;
SP.thickness.bottom = SP.height.bottom-Leg.sphere.bottom; % [mm]
SP.thickness.top = SP.height.top-Leg.sphere.top; % [mm]
SP.rad.bottom = Leg.sphere.bottom; % [mm]
SP.rad.top = Leg.sphere.top; % [mm]
SP.m = SP.density.bottom*2*pi*((SP.rad.bottom*1e-3)^2)*(SP.height.bottom*1e-3); % TODO [kg]
SP = updateDamping(SP);
%%
Leg.support.bottom = [0 SP.thickness.bottom; 0 0; SP.rad.bottom 0; SP.rad.bottom SP.height.bottom];
Leg.support.top = [0 SP.thickness.top; 0 0; SP.rad.top 0; SP.rad.top SP.height.top];
%%
micro_hexapod.BP = BP;
micro_hexapod.TP = TP;
micro_hexapod.Leg = Leg;
micro_hexapod.SP = SP;
%%
micro_hexapod = initializeParameters(micro_hexapod);
%% Setup equilibrium position of each leg
micro_hexapod.L0 = inverseKinematicsHexapod(micro_hexapod, args.AP, args.ARB);
%% Save
save('./mat/stages.mat', 'micro_hexapod', '-append'); save('./mat/stages.mat', 'micro_hexapod', '-append');
%%
function [element] = updateDamping(element)
field = fieldnames(element.k);
for i = 1:length(field)
element.c.(field{i}) = 2*element.ksi.(field{i})*sqrt(element.k.(field{i})*element.m);
end
end
%%
function [stewart] = initializeParameters(stewart)
%% Connection points on base and top plate w.r.t. World frame at the center of the base plate
stewart.pos_base = zeros(6, 3);
stewart.pos_top = zeros(6, 3);
alpha_b = stewart.BP.leg.ang*pi/180; % angle de décalage par rapport à 120 deg (pour positionner les supports bases)
alpha_t = stewart.TP.leg.ang*pi/180; % +- offset angle from 120 degree spacing on top
height = (stewart.h-stewart.BP.thickness-stewart.TP.thickness-stewart.Leg.sphere.bottom-stewart.Leg.sphere.top-stewart.SP.thickness.bottom-stewart.SP.thickness.top)*0.001; % TODO
radius_b = stewart.BP.leg.rad*0.001; % rayon emplacement support base
radius_t = stewart.TP.leg.rad*0.001; % top radius in meters
for i = 1:3
% base points
angle_m_b = (2*pi/3)* (i-1) - alpha_b;
angle_p_b = (2*pi/3)* (i-1) + alpha_b;
stewart.pos_base(2*i-1,:) = [radius_b*cos(angle_m_b), radius_b*sin(angle_m_b), 0.0];
stewart.pos_base(2*i,:) = [radius_b*cos(angle_p_b), radius_b*sin(angle_p_b), 0.0];
% top points
% Top points are 60 degrees offset
angle_m_t = (2*pi/3)* (i-1) - alpha_t + 2*pi/6;
angle_p_t = (2*pi/3)* (i-1) + alpha_t + 2*pi/6;
stewart.pos_top(2*i-1,:) = [radius_t*cos(angle_m_t), radius_t*sin(angle_m_t), height];
stewart.pos_top(2*i,:) = [radius_t*cos(angle_p_t), radius_t*sin(angle_p_t), height];
end
% permute pos_top points so that legs are end points of base and top points
stewart.pos_top = [stewart.pos_top(6,:); stewart.pos_top(1:5,:)]; %6th point on top connects to 1st on bottom
stewart.pos_top_tranform = stewart.pos_top - height*[zeros(6, 2),ones(6, 1)];
%% leg vectors
legs = stewart.pos_top - stewart.pos_base;
leg_length = zeros(6, 1);
leg_vectors = zeros(6, 3);
for i = 1:6
leg_length(i) = norm(legs(i,:));
leg_vectors(i,:) = legs(i,:) / leg_length(i);
end
stewart.Leg.lenght = 1000*leg_length(1)/1.5;
stewart.Leg.shape.bot = [0 0; ...
stewart.Leg.rad.bottom 0; ...
stewart.Leg.rad.bottom stewart.Leg.lenght; ...
stewart.Leg.rad.top stewart.Leg.lenght; ...
stewart.Leg.rad.top 0.2*stewart.Leg.lenght; ...
0 0.2*stewart.Leg.lenght];
%% Calculate revolute and cylindrical axes
rev1 = zeros(6, 3);
rev2 = zeros(6, 3);
cyl1 = zeros(6, 3);
for i = 1:6
rev1(i,:) = cross(leg_vectors(i,:), [0 0 1]);
rev1(i,:) = rev1(i,:) / norm(rev1(i,:));
rev2(i,:) = - cross(rev1(i,:), leg_vectors(i,:));
rev2(i,:) = rev2(i,:) / norm(rev2(i,:));
cyl1(i,:) = leg_vectors(i,:);
end
%% Coordinate systems
stewart.lower_leg = struct('rotation', eye(3));
stewart.upper_leg = struct('rotation', eye(3));
for i = 1:6
stewart.lower_leg(i).rotation = [rev1(i,:)', rev2(i,:)', cyl1(i,:)'];
stewart.upper_leg(i).rotation = [rev1(i,:)', rev2(i,:)', cyl1(i,:)'];
end
%% Position Matrix
stewart.M_pos_base = stewart.pos_base + (height+(stewart.TP.thickness+stewart.Leg.sphere.top+stewart.SP.thickness.top+stewart.jacobian)*1e-3)*[zeros(6, 2),ones(6, 1)];
%% Compute Jacobian Matrix
aa = stewart.pos_top_tranform + (stewart.jacobian - stewart.TP.thickness - stewart.SP.height.top)*1e-3*[zeros(6, 2),ones(6, 1)];
stewart.J = getJacobianMatrix(leg_vectors', aa');
end
%%
function J = getJacobianMatrix(RM, M_pos_base)
% RM: [3x6] unit vector of each leg in the fixed frame
% M_pos_base: [3x6] vector of the leg connection at the top platform location in the fixed frame
J = zeros(6);
J(:, 1:3) = RM';
J(:, 4:6) = cross(M_pos_base, RM)';
end
end

View File

@ -1,24 +1,23 @@
function [] = initializeMirror(args) function [] = initializeMirror(args)
arguments arguments
args.shape char {mustBeMember(args.shape,{'spherical', 'conical'})} = 'spherical' args.shape char {mustBeMember(args.shape,{'spherical', 'conical'})} = 'spherical'
args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 % [deg]
end end
%%
mirror = struct(); mirror = struct();
mirror.h = 50; % height of the mirror [mm]
mirror.h = 50; % Height of the mirror [mm]
mirror.thickness = 25; % Thickness of the plate supporting the sample [mm] mirror.thickness = 25; % Thickness of the plate supporting the sample [mm]
mirror.hole_rad = 120; % radius of the hole in the mirror [mm] mirror.hole_rad = 120; % radius of the hole in the mirror [mm]
mirror.support_rad = 100; % radius of the support plate [mm] mirror.support_rad = 100; % radius of the support plate [mm]
mirror.jacobian = 150; % point of interest offset in z (above the top surfave) [mm] mirror.jacobian = 150; % point of interest offset in z (above the top surfave) [mm]
mirror.rad = 180; % radius of the mirror (at the bottom surface) [mm] mirror.rad = 180; % radius of the mirror (at the bottom surface) [mm]
mirror.density = 2400; % Density of the mirror [kg/m3] mirror.density = 2400; % Density of the material [kg/m3]
mirror.color = [0.4 1.0 1.0]; % Color of the mirror
mirror.cone_length = mirror.rad*tand(args.angle)+mirror.h+mirror.jacobian; % Distance from Apex point of the cone to jacobian point mirror.cone_length = mirror.rad*tand(args.angle)+mirror.h+mirror.jacobian; % Distance from Apex point of the cone to jacobian point
%% Shape
mirror.shape = [... mirror.shape = [...
0 mirror.h-mirror.thickness 0 mirror.h-mirror.thickness
mirror.hole_rad mirror.h-mirror.thickness; ... mirror.hole_rad mirror.h-mirror.thickness; ...
@ -40,6 +39,4 @@ function [] = initializeMirror(args)
mirror.shape = [mirror.shape; 0 mirror.h]; mirror.shape = [mirror.shape; 0 mirror.h];
%% Save
save('./mat/stages.mat', 'mirror', '-append'); save('./mat/stages.mat', 'mirror', '-append');
end

View File

@ -1,15 +1,16 @@
function [nano_hexapod] = initializeNanoHexapod(args) function [nano_hexapod] = initializeNanoHexapod(args)
arguments arguments
% initializeFramesPositions % initializeFramesPositions
args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3 args.H (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
args.MO_B (1,1) double {mustBeNumeric} = 175e-3 args.MO_B (1,1) double {mustBeNumeric} = 175e-3
% generateGeneralConfiguration % generateGeneralConfiguration
args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3 args.FH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
args.FR (1,1) double {mustBeNumeric, mustBePositive} = 100e-3; args.FR (1,1) double {mustBeNumeric, mustBePositive} = 100e-3
args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180); args.FTh (6,1) double {mustBeNumeric} = [-10, 10, 120-10, 120+10, 240-10, 240+10]*(pi/180)
args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3 args.MH (1,1) double {mustBeNumeric, mustBePositive} = 15e-3
args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e-3; args.MR (1,1) double {mustBeNumeric, mustBePositive} = 90e-3
args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180); args.MTh (6,1) double {mustBeNumeric} = [-60+10, 60-10, 60+10, 180-10, 180+10, -60-10]*(pi/180)
% initializeStrutDynamics % initializeStrutDynamics
args.actuator char {mustBeMember(args.actuator,{'piezo', 'lorentz'})} = 'piezo' args.actuator char {mustBeMember(args.actuator,{'piezo', 'lorentz'})} = 'piezo'
% initializeCylindricalPlatforms % initializeCylindricalPlatforms
@ -29,34 +30,27 @@ function [nano_hexapod] = initializeNanoHexapod(args)
% inverseKinematics % inverseKinematics
args.AP (3,1) double {mustBeNumeric} = zeros(3,1) args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3) args.ARB (3,3) double {mustBeNumeric} = eye(3)
% Equilibrium position of each leg
args.dLeq (6,1) double {mustBeNumeric} = zeros(6,1)
end end
stewart = initializeFramesPositions('H', args.H, 'MO_B', args.MO_B); nano_hexapod = initializeFramesPositions('H', args.H, 'MO_B', args.MO_B);
nano_hexapod = generateGeneralConfiguration(nano_hexapod, 'FH', args.FH, 'FR', args.FR, 'FTh', args.FTh, 'MH', args.MH, 'MR', args.MR, 'MTh', args.MTh);
stewart = generateGeneralConfiguration(stewart, 'FH', args.FH, 'FR', args.FR, 'FTh', args.FTh, 'MH', args.MH, 'MR', args.MR, 'MTh', args.MTh); nano_hexapod = computeJointsPose(nano_hexapod);
stewart = computeJointsPose(stewart);
if strcmp(args.actuator, 'piezo') if strcmp(args.actuator, 'piezo')
stewart = initializeStrutDynamics(stewart, 'Ki', 1e7*ones(6,1), ... nano_hexapod = initializeStrutDynamics(nano_hexapod, 'Ki', 1e7*ones(6,1), 'Ci', 1e2*ones(6,1));
'Ci', 1e2*ones(6,1));
elseif strcmp(args.actuator, 'lorentz') elseif strcmp(args.actuator, 'lorentz')
stewart = initializeStrutDynamics(stewart, 'Ki', 1e4*ones(6,1), ... nano_hexapod = initializeStrutDynamics(nano_hexapod, 'Ki', 1e4*ones(6,1), 'Ci', 1e2*ones(6,1));
'Ci', 1e2*ones(6,1));
else else
error('args.actuator should be piezo or lorentz'); error('args.actuator should be piezo or lorentz');
end end
nano_hexapod = initializeCylindricalPlatforms(nano_hexapod, 'Fpm', args.Fpm, 'Fph', args.Fph, 'Fpr', args.Fpr, 'Mpm', args.Mpm, 'Mph', args.Mph, 'Mpr', args.Mpr);
nano_hexapod = initializeCylindricalStruts(nano_hexapod, 'Fsm', args.Fsm, 'Fsh', args.Fsh, 'Fsr', args.Fsr, 'Msm', args.Msm, 'Msh', args.Msh, 'Msr', args.Msr);
nano_hexapod = computeJacobian(nano_hexapod);
[Li, dLi] = inverseKinematics(nano_hexapod, 'AP', args.AP, 'ARB', args.ARB);
nano_hexapod.Li = Li;
nano_hexapod.dLi = dLi;
stewart = initializeCylindricalPlatforms(stewart, 'Fpm', args.Fpm, 'Fph', args.Fph, 'Fpr', args.Fpr, 'Mpm', args.Mpm, 'Mph', args.Mph, 'Mpr', args.Mpr); nano_hexapod.dLeq = args.dLeq;
stewart = initializeCylindricalStruts(stewart, 'Fsm', args.Fsm, 'Fsh', args.Fsh, 'Fsr', args.Fsr, 'Msm', args.Msm, 'Msh', args.Msh, 'Msr', args.Msr);
stewart = computeJacobian(stewart);
[Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB);
nano_hexapod = stewart;
%% Save
save('./mat/stages.mat', 'nano_hexapod', '-append'); save('./mat/stages.mat', 'nano_hexapod', '-append');
end

View File

@ -161,7 +161,7 @@ switch args.Dh_type
0 cos(tx) -sin(tx); 0 cos(tx) -sin(tx);
0 sin(tx) cos(tx)]; 0 sin(tx) cos(tx)];
[Dhl] = inverseKinematicsHexapod(micro_hexapod, AP, ARB); [~, Dhl] = inverseKinematics(micro_hexapod, 'AP', AP, 'ARB', ARB);
Dhl = [Dhl, Dhl]; Dhl = [Dhl, Dhl];
otherwise otherwise
warning('Dh_type is not set correctly'); warning('Dh_type is not set correctly');

View File

@ -1,52 +1,61 @@
function [ry] = initializeRy(args) function [ry] = initializeRy(args)
arguments arguments
args.rigid logical {mustBeNumericOrLogical} = false 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]
end end
%%
ry = struct(); ry = struct();
%% Tilt Stage - Static Properties
% Ry - Guide for the tilt stage % Ry - Guide for the tilt stage
ry.guide.density = 7800; % [kg/m3] ry.guide.density = 7800; % [kg/m3]
ry.guide.color = [0.792 0.820 0.933];
ry.guide.STEP = './STEPS/ry/Tilt_Guide.STEP'; ry.guide.STEP = './STEPS/ry/Tilt_Guide.STEP';
% Ry - Rotor of the motor % Ry - Rotor of the motor
ry.rotor.density = 2400; % [kg/m3] ry.rotor.density = 2400; % [kg/m3]
ry.rotor.color = [0.792 0.820 0.933];
ry.rotor.STEP = './STEPS/ry/Tilt_Motor_Axis.STEP'; ry.rotor.STEP = './STEPS/ry/Tilt_Motor_Axis.STEP';
% Ry - Motor % Ry - Motor
ry.motor.density = 3200; % [kg/m3] ry.motor.density = 3200; % [kg/m3]
ry.motor.color = [0.792 0.820 0.933];
ry.motor.STEP = './STEPS/ry/Tilt_Motor.STEP'; ry.motor.STEP = './STEPS/ry/Tilt_Motor.STEP';
% Ry - Plateau Tilt % Ry - Plateau Tilt
ry.stage.density = 7800; % [kg/m3] ry.stage.density = 7800; % [kg/m3]
ry.stage.color = [0.792 0.820 0.933];
ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP'; ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP';
ry.m = 800; % TODO [kg]
%% Tilt Stage - Dynamical Properties
if args.rigid
ry.k.tilt = 1e10; % Rotation stiffness around y [N*m/deg]
ry.k.h = 1e12; % Stiffness in the direction of the guidance [N/m]
ry.k.rad = 1e12; % Stiffness in the top direction [N/m]
ry.k.rrad = 1e12; % Stiffness in the side direction [N/m]
else
ry.k.tilt = 1e4; % Rotation stiffness around y [N*m/deg] 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.h = 1e8; % Stiffness in the direction of the guidance [N/m]
ry.k.rad = 1e8; % Stiffness in the top direction [N/m] ry.k.rad = 1e8; % Stiffness in the top direction [N/m]
ry.k.rrad = 1e8; % Stiffness in the side direction [N/m] ry.k.rrad = 1e8; % Stiffness in the side direction [N/m]
end
ry.c.h = 0.1*sqrt(ry.k.h*ry.m); ry.c.tilt = 2.8e2;
ry.c.rad = 0.1*sqrt(ry.k.rad*ry.m); ry.c.h = 2.8e4;
ry.c.rrad = 0.1*sqrt(ry.k.rrad*ry.m); ry.c.rad = 2.8e4;
ry.c.tilt = 0.1*sqrt(ry.k.tilt*ry.m); ry.c.rrad = 2.8e4;
%% Positioning parameters ry.x0_11 = args.x11;
ry.z_offset = 0.58178; % Z-Offset so that the center of rotation matches the sample center [m] 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;
ry.z_offset = 0.58178; % [m]
%% Save
save('./mat/stages.mat', 'ry', '-append'); save('./mat/stages.mat', 'ry', '-append');
end

View File

@ -1,48 +1,42 @@
function [rz] = initializeRz(args) function [rz] = initializeRz(args)
arguments arguments
args.rigid logical {mustBeNumericOrLogical} = false args.rigid logical {mustBeNumericOrLogical} = false
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.rx0 (1,1) double {mustBeNumeric} = 0 % [rad]
args.ry0 (1,1) double {mustBeNumeric} = 0 % [rad]
end end
%%
rz = struct(); rz = struct();
%% Spindle - Static Properties
% Spindle - Slip Ring % Spindle - Slip Ring
rz.slipring.density = 7800; % [kg/m3] rz.slipring.density = 7800; % [kg/m3]
rz.slipring.color = [0.792 0.820 0.933];
rz.slipring.STEP = './STEPS/rz/Spindle_Slip_Ring.STEP'; rz.slipring.STEP = './STEPS/rz/Spindle_Slip_Ring.STEP';
% Spindle - Rotor % Spindle - Rotor
rz.rotor.density = 7800; % [kg/m3] rz.rotor.density = 7800; % [kg/m3]
rz.rotor.color = [0.792 0.820 0.933];
rz.rotor.STEP = './STEPS/rz/Spindle_Rotor.STEP'; rz.rotor.STEP = './STEPS/rz/Spindle_Rotor.STEP';
% Spindle - Stator % Spindle - Stator
rz.stator.density = 7800; % [kg/m3] rz.stator.density = 7800; % [kg/m3]
rz.stator.color = [0.792 0.820 0.933];
rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP'; rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP';
% Estimated mass of the mooving part
rz.m = 250; % [kg]
%% Spindle - Dynamical Properties
if args.rigid
rz.k.rot = 1e10; % Rotational Stiffness (Rz) [N*m/deg]
rz.k.tilt = 1e10; % Rotational Stiffness (Rx, Ry) [N*m/deg]
rz.k.ax = 1e12; % Axial Stiffness (Z) [N/m]
rz.k.rad = 1e12; % Radial Stiffness (X, Y) [N/m]
else
rz.k.rot = 1e6; % TODO - Rotational Stiffness (Rz) [N*m/deg] rz.k.rot = 1e6; % TODO - Rotational Stiffness (Rz) [N*m/deg]
rz.k.tilt = 1e6; % Rotational Stiffness (Rx, Ry) [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.ax = 2e9; % Axial Stiffness (Z) [N/m]
rz.k.rad = 7e8; % Radial Stiffness (X, Y) [N/m] rz.k.rad = 7e8; % Radial Stiffness (X, Y) [N/m]
end
% Damping rz.c.rot = 1.6e3;
rz.c.ax = 0.1*sqrt(rz.k.ax*rz.m); rz.c.tilt = 1.6e3;
rz.c.rad = 0.1*sqrt(rz.k.rad*rz.m); rz.c.ax = 7.1e4;
rz.c.tilt = 0.1*sqrt(rz.k.tilt*rz.m); rz.c.rad = 4.2e4;
rz.c.rot = 0.1*sqrt(rz.k.rot*rz.m);
rz.x0 = args.x0;
rz.y0 = args.y0;
rz.z0 = args.z0;
rz.rx0 = args.rx0;
rz.ry0 = args.ry0;
%% Save
save('./mat/stages.mat', 'rz', '-append'); save('./mat/stages.mat', 'rz', '-append');
end

View File

@ -1,23 +1,33 @@
function [sample] = initializeSample(sample) function [sample] = initializeSample(args)
arguments arguments
sample.radius (1,1) double {mustBeNumeric, mustBePositive} = 100 % [mm] args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m]
sample.height (1,1) double {mustBeNumeric, mustBePositive} = 300 % [mm] args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m]
sample.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg] args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
sample.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz] args.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz]
sample.offset (1,1) double {mustBeNumeric} = 0 % [mm] args.offset (1,1) double {mustBeNumeric} = 0 % [m]
sample.color (1,3) double {mustBeNumeric} = [0.45, 0.45, 0.45] args.x0 (1,1) double {mustBeNumeric} = 0 % [m]
args.y0 (1,1) double {mustBeNumeric} = 0 % [m]
args.z0 (1,1) double {mustBeNumeric} = 0 % [m]
end end
%% sample = struct();
sample.k.x = sample.mass * (2*pi * sample.freq)^2;
sample.c.x = 0.1*sqrt(sample.k.x*sample.mass);
sample.k.y = sample.mass * (2*pi * sample.freq)^2; sample.radius = args.radius; % [m]
sample.c.y = 0.1*sqrt(sample.k.y*sample.mass); sample.height = args.height; % [m]
sample.mass = args.mass; % [kg]
sample.offset = args.offset; % [m]
sample.k.z = sample.mass * (2*pi * sample.freq)^2; sample.k.x = sample.mass * (2*pi * args.freq)^2; % [N/m]
sample.c.z = 0.1*sqrt(sample.k.z*sample.mass); 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.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)]
sample.x0 = args.x0; % [m]
sample.y0 = args.y0; % [m]
sample.z0 = args.z0; % [m]
%% Save
save('./mat/stages.mat', 'sample', '-append'); save('./mat/stages.mat', 'sample', '-append');
end

View File

@ -1,63 +1,67 @@
function [ty] = initializeTy(args) function [ty] = initializeTy(args)
arguments arguments
args.rigid logical {mustBeNumericOrLogical} = false 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]
end end
%%
ty = struct(); ty = struct();
%% Y-Translation - Static Properties
% Ty Granite frame % Ty Granite frame
ty.granite_frame.density = 7800; % [kg/m3] ty.granite_frame.density = 7800; % [kg/m3] => 43kg
ty.granite_frame.color = [0.753 1 0.753];
ty.granite_frame.STEP = './STEPS/Ty/Ty_Granite_Frame.STEP'; ty.granite_frame.STEP = './STEPS/Ty/Ty_Granite_Frame.STEP';
% Guide Translation Ty % Guide Translation Ty
ty.guide.density = 7800; % [kg/m3] ty.guide.density = 7800; % [kg/m3] => 76kg
ty.guide.color = [0.792 0.820 0.933];
ty.guide.STEP = './STEPS/ty/Ty_Guide.STEP'; ty.guide.STEP = './STEPS/ty/Ty_Guide.STEP';
% Ty - Guide_Translation12 % Ty - Guide_Translation12
ty.guide12.density = 7800; % [kg/m3] ty.guide12.density = 7800; % [kg/m3]
ty.guide12.color = [0.792 0.820 0.933];
ty.guide12.STEP = './STEPS/Ty/Ty_Guide_12.STEP'; ty.guide12.STEP = './STEPS/Ty/Ty_Guide_12.STEP';
% Ty - Guide_Translation11 % Ty - Guide_Translation11
ty.guide11.density = 7800; % [kg/m3] ty.guide11.density = 7800; % [kg/m3]
ty.guide11.color = [0.792 0.820 0.933];
ty.guide11.STEP = './STEPS/ty/Ty_Guide_11.STEP'; ty.guide11.STEP = './STEPS/ty/Ty_Guide_11.STEP';
% Ty - Guide_Translation22 % Ty - Guide_Translation22
ty.guide22.density = 7800; % [kg/m3] ty.guide22.density = 7800; % [kg/m3]
ty.guide22.color = [0.792 0.820 0.933];
ty.guide22.STEP = './STEPS/ty/Ty_Guide_22.STEP'; ty.guide22.STEP = './STEPS/ty/Ty_Guide_22.STEP';
% Ty - Guide_Translation21 % Ty - Guide_Translation21
ty.guide21.density = 7800; % [kg/m3] ty.guide21.density = 7800; % [kg/m3]
ty.guide21.color = [0.792 0.820 0.933];
ty.guide21.STEP = './STEPS/Ty/Ty_Guide_21.STEP'; ty.guide21.STEP = './STEPS/Ty/Ty_Guide_21.STEP';
% Ty - Plateau translation % Ty - Plateau translation
ty.frame.density = 7800; % [kg/m3] ty.frame.density = 7800; % [kg/m3]
ty.frame.color = [0.792 0.820 0.933];
ty.frame.STEP = './STEPS/ty/Ty_Stage.STEP'; ty.frame.STEP = './STEPS/ty/Ty_Stage.STEP';
% Ty Stator Part % Ty Stator Part
ty.stator.density = 5400; % [kg/m3] ty.stator.density = 5400; % [kg/m3]
ty.stator.color = [0.792 0.820 0.933];
ty.stator.STEP = './STEPS/ty/Ty_Motor_Stator.STEP'; ty.stator.STEP = './STEPS/ty/Ty_Motor_Stator.STEP';
% Ty Rotor Part % Ty Rotor Part
ty.rotor.density = 5400; % [kg/m3] ty.rotor.density = 5400; % [kg/m3]
ty.rotor.color = [0.792 0.820 0.933];
ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP'; ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP';
ty.m = 1000; % TODO [kg]
%% Y-Translation - Dynamicals Properties
if args.rigid
ty.k.ax = 1e12; % Axial Stiffness for each of the 4 guidance (y) [N/m]
ty.k.rad = 1e12; % Radial Stiffness for each of the 4 guidance (x-z) [N/m]
else
ty.k.ax = 5e8; % Axial Stiffness for each of the 4 guidance (y) [N/m] 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.rad = 5e7; % Radial Stiffness for each of the 4 guidance (x-z) [N/m]
end
ty.c.ax = 0.1*sqrt(ty.k.ax*ty.m); ty.c.ax = 70710; % [N/(m/s)]
ty.c.rad = 0.1*sqrt(ty.k.rad*ty.m); ty.c.rad = 22360; % [N/(m/s)]
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;
%% Save
save('./mat/stages.mat', 'ty', '-append'); save('./mat/stages.mat', 'ty', '-append');
end