Add metrology element (change of base, computation of error)

Lot's of new things:
- try to use less .mat files
- computation of setpoint and error in the cartesian frame fixed to the granite
- change of base to have the errors w.r.t. the NASS base
- add script to plot setpoint, position and error
This commit is contained in:
Thomas Dehaeze
2018-10-24 15:08:23 +02:00
parent baedb9b571
commit 7575aee987
36 changed files with 447 additions and 135 deletions

View File

@@ -28,7 +28,7 @@ function [inputs] = initializeInputs(opts_param)
%% Ground motion
if islogical(opts.Dw) && opts.Dw == true
load('./mat/weight_Wxg.mat', 'Wxg');
load('./mat/perturbations.mat', 'Wxg');
Dw = 1/sqrt(2)*100*random('norm', 0, 1, length(time_vector), 3);
Dw(:, 1) = lsim(Wxg, Dw(:, 1), time_vector);
Dw(:, 2) = lsim(Wxg, Dw(:, 2), time_vector);
@@ -64,17 +64,17 @@ function [inputs] = initializeInputs(opts_param)
inputs.ry = timeseries(ry, time_vector);
%% Spindle [rad]
if islogical(opts.Rz) && opts.Rz == true
Rz = 2*pi*0.5*time_vector;
elseif islogical(opts.Rz) && opts.Rz == false
Rz = zeros(length(time_vector), 1);
elseif isnumeric(opts.Rz) && length(opts.Rz) == 1
Rz = 2*pi*(opts.Rz/60)*time_vector;
if islogical(opts.rz) && opts.rz == true
rz = 2*pi*0.5*time_vector;
elseif islogical(opts.rz) && opts.rz == false
rz = zeros(length(time_vector), 1);
elseif isnumeric(opts.rz) && length(opts.rz) == 1
rz = 2*pi*(opts.rz/60)*time_vector;
else
Rz = opts.Rz;
rz = opts.rz;
end
inputs.Rz = timeseries(Rz, time_vector);
inputs.rz = timeseries(rz, time_vector);
%% Micro Hexapod
if islogical(opts.u_hexa) && opts.setpoint == true
@@ -85,19 +85,19 @@ function [inputs] = initializeInputs(opts_param)
u_hexa = opts.u_hexa;
end
inputs.micro_hexapod = timeseries(u_hexa, time_vector);
inputs.u_hexa = timeseries(u_hexa, time_vector);
%% Center of gravity compensation
if islogical(opts.mass) && opts.setpoint == true
Rm = zeros(length(time_vector), 2);
axisc = zeros(length(time_vector), 2);
elseif islogical(opts.mass) && opts.setpoint == false
Rm = zeros(length(time_vector), 2);
Rm(:, 2) = pi*ones(length(time_vector), 1);
axisc = zeros(length(time_vector), 2);
axisc(:, 2) = pi*ones(length(time_vector), 1);
else
Rm = opts.mass;
axisc = opts.mass;
end
inputs.Rm = timeseries(Rm, time_vector);
inputs.axisc = timeseries(axisc, time_vector);
%% Nano Hexapod
if islogical(opts.n_hexa) && opts.setpoint == true
@@ -108,7 +108,7 @@ function [inputs] = initializeInputs(opts_param)
n_hexa = opts.n_hexa;
end
inputs.nano_hexapod = timeseries(n_hexa, time_vector);
inputs.n_hexa = timeseries(n_hexa, time_vector);
%% Set point [m, rad]
if islogical(opts.setpoint) && opts.setpoint == true

View File

@@ -12,9 +12,9 @@ function [] = initializeMicroHexapod(opts_param)
%% Stewart Object
micro_hexapod = struct();
micro_hexapod.h = 350; % Total height of the platform [mm]
micro_hexapod.jacobian = 265; % Point where the Jacobian is computed => Center of rotation [mm]
micro_hexapod.jacobian = 265; % Distance from the top platform to the Jacobian point [mm]
%% Bottom Plate
%% Bottom Plate - Mechanical Design
BP = struct();
BP.rad.int = 110; % Internal Radius [mm]
@@ -26,7 +26,7 @@ function [] = initializeMicroHexapod(opts_param)
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
%% Top Plate - Mechanical Design
TP = struct();
TP.rad.int = 82; % Internal Radius [mm]
@@ -38,7 +38,7 @@ function [] = initializeMicroHexapod(opts_param)
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];
%% Leg
%% Struts
Leg = struct();
Leg.stroke = 10e-3; % Maximum Stroke of each leg [m]

View File

@@ -1,10 +1,24 @@
function [ry] = initializeRy()
function [ry] = initializeRy(opts_param)
%% Default values for opts
opts = struct('rigid', false);
%% Populate opts with input parameters
if exist('opts_param','var')
for opt = fieldnames(opts_param)'
opts.(opt{1}) = opts_param.(opt{1});
end
end
%%
ry = struct();
ry.m = 200; % [kg]
ry.k.tilt = 1e4; % Rotation stiffness around y [N*m/deg]
if opts.rigid
ry.k.tilt = 1e10; % Rotation stiffness around y [N*m/deg]
else
ry.k.tilt = 1e4; % Rotation stiffness around y [N*m/deg]
end
ry.k.h = 357e6/4; % Stiffness in the direction of the guidance [N/m]
ry.k.rad = 555e6/4; % Stiffness in the top direction [N/m]

View File

@@ -1,18 +1,36 @@
function [rz] = initializeRz()
function [rz] = initializeRz(opts_param)
%% Default values for opts
opts = struct('rigid', false);
%% Populate opts with input parameters
if exist('opts_param','var')
for opt = fieldnames(opts_param)'
opts.(opt{1}) = opts_param.(opt{1});
end
end
%%
rz = struct();
% Estimated mass of the mooving part
rz.m = 250; % [kg]
% Estimated stiffnesses
rz.k.ax = 2e9; % Axial Stiffness [N/m]
rz.k.rad = 7e8; % Radial Stiffness [N/m]
rz.k.rot = 1e2; % Rotational Stiffness [N*m/deg]
rz.k.tilt = 1e2; % TODO [N*m/deg]
rz.k.rot = 100e6*2*pi/360; % Rotational Stiffness [N*m/deg]
rz.c.ax = 10*(1/5)*sqrt(rz.k.ax/rz.m);
rz.c.rad = 10*(1/5)*sqrt(rz.k.rad/rz.m);
rz.c.tilt = 100*(1/1)*sqrt(rz.k.tilt/rz.m);
rz.c.rot = 100*(1/1)*sqrt(rz.k.rot/rz.m);
if opts.rigid
rz.k.tilt = 1e10; % Vertical Rotational Stiffness [N*m/deg]
else
rz.k.tilt = 1e2; % TODO what value should I put? [N*m/deg]
end
% TODO
rz.c.ax = 2*sqrt(rz.k.ax/rz.m);
rz.c.rad = 2*sqrt(rz.k.rad/rz.m);
rz.c.tilt = 100*sqrt(rz.k.tilt/rz.m);
rz.c.rot = 100*sqrt(rz.k.rot/rz.m);
%% Save
save('./mat/stages.mat', 'rz', '-append');

View File

@@ -1,9 +1,9 @@
function [] = initializeSample(opts_param)
%% Default values for opts
sample = struct('radius', 100,...
'height', 300,...
'mass', 50,...
'offset', 0,...
sample = struct('radius', 100, ...
'height', 300, ...
'mass', 50, ...
'offset', 0, ...
'color', [0.45, 0.45, 0.45] ...
);

View File

@@ -1,10 +1,24 @@
function [ty] = initializeTy()
function [ty] = initializeTy(opts_param)
%% Default values for opts
opts = struct('rigid', false);
%% Populate opts with input parameters
if exist('opts_param','var')
for opt = fieldnames(opts_param)'
opts.(opt{1}) = opts_param.(opt{1});
end
end
%%
ty = struct();
ty.m = 250; % [kg]
ty.k.ax = 1e7/4; % Axial Stiffness for each of the 4 guidance (y) [N/m]
if opts.rigid
ty.k.ax = 1e10; % Axial Stiffness for each of the 4 guidance (y) [N/m]
else
ty.k.ax = 1e7/4; % Axial Stiffness for each of the 4 guidance (y) [N/m]
end
ty.k.rad = 9e9/4; % Radial Stiffness for each of the 4 guidance (x-z) [N/m]
ty.c.ax = 100*(1/5)*sqrt(ty.k.ax/ty.m);