2020-02-17 18:21:20 +01:00
|
|
|
function [micro_hexapod] = initializeMicroHexapod(args)
|
2020-02-03 17:50:52 +01:00
|
|
|
|
|
|
|
arguments
|
2020-03-31 11:38:15 +02:00
|
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible', 'modal-analysis', 'init', 'compliance'})} = 'flexible'
|
2020-02-03 17:50:52 +01:00
|
|
|
% 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.ARB (3,3) double {mustBeNumeric} = eye(3)
|
2020-02-25 17:49:08 +01:00
|
|
|
% Force that stiffness of each joint should apply at t=0
|
2020-03-17 11:22:57 +01:00
|
|
|
args.Foffset logical {mustBeNumericOrLogical} = false
|
2020-02-03 17:50:52 +01:00
|
|
|
end
|
2018-06-16 22:57:54 +02:00
|
|
|
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart = initializeStewartPlatform();
|
|
|
|
|
|
|
|
stewart = initializeFramesPositions(stewart, ...
|
|
|
|
'H', args.H, ...
|
|
|
|
'MO_B', args.MO_B);
|
|
|
|
|
|
|
|
stewart = generateGeneralConfiguration(stewart, ...
|
|
|
|
'FH', args.FH, ...
|
|
|
|
'FR', args.FR, ...
|
|
|
|
'FTh', args.FTh, ...
|
|
|
|
'MH', args.MH, ...
|
|
|
|
'MR', args.MR, ...
|
|
|
|
'MTh', args.MTh);
|
|
|
|
|
|
|
|
stewart = computeJointsPose(stewart);
|
|
|
|
|
|
|
|
stewart = initializeStrutDynamics(stewart, ...
|
|
|
|
'K', args.Ki, ...
|
|
|
|
'C', args.Ci);
|
|
|
|
|
|
|
|
stewart = initializeJointDynamics(stewart, ...
|
|
|
|
'type_F', 'universal_p', ...
|
|
|
|
'type_M', 'spherical_p');
|
|
|
|
|
|
|
|
stewart = initializeCylindricalPlatforms(stewart, ...
|
|
|
|
'Fpm', args.Fpm, ...
|
|
|
|
'Fph', args.Fph, ...
|
|
|
|
'Fpr', args.Fpr, ...
|
|
|
|
'Mpm', args.Mpm, ...
|
|
|
|
'Mph', args.Mph, ...
|
|
|
|
'Mpr', args.Mpr);
|
|
|
|
|
|
|
|
stewart = initializeCylindricalStruts(stewart, ...
|
|
|
|
'Fsm', args.Fsm, ...
|
|
|
|
'Fsh', args.Fsh, ...
|
|
|
|
'Fsr', args.Fsr, ...
|
|
|
|
'Msm', args.Msm, ...
|
|
|
|
'Msh', args.Msh, ...
|
|
|
|
'Msr', args.Msr);
|
|
|
|
|
|
|
|
stewart = computeJacobian(stewart);
|
|
|
|
|
|
|
|
stewart = initializeStewartPose(stewart, ...
|
|
|
|
'AP', args.AP, ...
|
|
|
|
'ARB', args.ARB);
|
|
|
|
|
|
|
|
stewart = initializeInertialSensor(stewart, 'type', 'none');
|
2018-06-16 22:57:54 +02:00
|
|
|
|
2020-02-25 17:49:08 +01:00
|
|
|
if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init')
|
|
|
|
load('mat/Foffset.mat', 'Fhm');
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.actuators.dLeq = -Fhm'./args.Ki;
|
2020-02-25 17:49:08 +01:00
|
|
|
else
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.actuators.dLeq = zeros(6,1);
|
2020-02-25 17:49:08 +01:00
|
|
|
end
|
2018-06-16 22:57:54 +02:00
|
|
|
|
2020-02-18 16:46:35 +01:00
|
|
|
switch args.type
|
|
|
|
case 'none'
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.type = 0;
|
2020-02-18 16:46:35 +01:00
|
|
|
case 'rigid'
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.type = 1;
|
2020-02-18 16:46:35 +01:00
|
|
|
case 'flexible'
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.type = 2;
|
2020-02-18 17:30:27 +01:00
|
|
|
case 'modal-analysis'
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.type = 3;
|
2020-02-25 17:49:08 +01:00
|
|
|
case 'init'
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.type = 4;
|
2020-03-31 11:38:15 +02:00
|
|
|
case 'compliance'
|
2020-05-04 12:03:08 +02:00
|
|
|
stewart.type = 5;
|
2020-02-18 16:46:35 +01:00
|
|
|
end
|
|
|
|
|
2020-05-04 12:03:08 +02:00
|
|
|
micro_hexapod = stewart;
|
2020-02-03 17:50:52 +01:00
|
|
|
save('./mat/stages.mat', 'micro_hexapod', '-append');
|