[WIP] Change inputs.mat elements

Create new identification simulink
This commit is contained in:
Thomas Dehaeze
2018-10-12 18:17:03 +02:00
parent 782129a31d
commit 14259c7e67
26 changed files with 60 additions and 68 deletions

View File

@@ -1,4 +1,4 @@
function [] = initializeAxisc()
function [axisc] = initializeAxisc()
%%
axisc = struct();

View File

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

View File

@@ -1,13 +1,13 @@
function [inputs] = initializeInputs(opts_param)
%% Default values for opts
opts = struct('setpoint', false, ...
'ground_motion', false, ...
'ty', false, ...
'ry', false, ...
'rz', false, ... % If numerical value, rpm speed of the spindle
'u_hexa', false, ...
'mass', false, ...
'n_hexa', false ...
opts = struct('setpoint', false, ...
'Dw', false, ...
'ty', false, ...
'ry', false, ...
'Rz', false, ...
'u_hexa', false, ...
'mass', false, ...
'n_hexa', false ...
);
%% Populate opts with input parameters
@@ -27,19 +27,19 @@ function [inputs] = initializeInputs(opts_param)
inputs = struct();
%% Ground motion
if islogical(opts.ground_motion) && opts.ground_motion == true
if islogical(opts.Dw) && opts.Dw == true
load('./mat/weight_Wxg.mat', 'Wxg');
ground_motion = 1/sqrt(2)*100*random('norm', 0, 1, length(time_vector), 3);
ground_motion(:, 1) = lsim(Wxg, ground_motion(:, 1), time_vector);
ground_motion(:, 2) = lsim(Wxg, ground_motion(:, 2), time_vector);
ground_motion(:, 3) = lsim(Wxg, ground_motion(:, 3), time_vector);
elseif islogical(opts.ground_motion) && opts.ground_motion == false
ground_motion = zeros(length(time_vector), 3);
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);
Dw(:, 3) = lsim(Wxg, Dw(:, 3), time_vector);
elseif islogical(opts.Dw) && opts.Dw == false
Dw = zeros(length(time_vector), 3);
else
ground_motion = opts.ground_motion;
Dw = opts.Dw;
end
inputs.ground_motion = timeseries(ground_motion, time_vector);
inputs.Dw = timeseries(Dw, time_vector);
%% Translation stage [m]
if islogical(opts.ty) && opts.ty == true
@@ -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
@@ -89,15 +89,15 @@ function [inputs] = initializeInputs(opts_param)
%% Center of gravity compensation
if islogical(opts.mass) && opts.setpoint == true
axisc = zeros(length(time_vector), 2);
Rm = zeros(length(time_vector), 2);
elseif islogical(opts.mass) && opts.setpoint == false
axisc = zeros(length(time_vector), 2);
axisc(:, 2) = pi*ones(length(time_vector), 1);
Rm = zeros(length(time_vector), 2);
Rm(:, 2) = pi*ones(length(time_vector), 1);
else
axisc = opts.mass;
Rm = opts.mass;
end
inputs.axisc = timeseries(axisc, time_vector);
inputs.Rm = timeseries(Rm, time_vector);
%% Nano Hexapod
if islogical(opts.n_hexa) && opts.setpoint == true

View File

@@ -1,13 +1,14 @@
function [] = initializeRy()
function [ry] = initializeRy()
%%
ry = struct();
ry.m = 200; % [kg]
ry.k.tilt = 1e4; % Rotation stiffness around y [N*m/deg]
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]
ry.k.rrad = 238e6/4; % Stiffness in the side direction [N/m]
ry.k.tilt = 1e4 ; % Rotation stiffness around y [N*m/deg]
ry.c.h = 10*(1/5)*sqrt(ry.k.h/ry.m);
ry.c.rad = 10*(1/5)*sqrt(ry.k.rad/ry.m);

View File

@@ -1,4 +1,4 @@
function [] = initializeRz()
function [rz] = initializeRz()
%%
rz = struct();
@@ -6,8 +6,8 @@ function [] = initializeRz()
rz.k.ax = 2e9; % Axial Stiffness [N/m]
rz.k.rad = 7e8; % Radial Stiffness [N/m]
rz.k.tilt = 1e2; % TODO [N*m/deg]
rz.k.rot = 1e2; % Rotational Stiffness [N*m/deg]
rz.k.tilt = 1e2; % TODO [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);

View File

@@ -4,8 +4,8 @@ function [ty] = initializeTy()
ty.m = 250; % [kg]
ty.k.ax = 1e7/4; % Axial Stiffness for each of the 4 guidance (y) [N/m]
ty.k.rad = 9e9/4; % Radial Stiffness for each of the 4 guidance (x-z) [N/m]
ty.k.ax = 1e7/4; % Axial Stiffness for each of the 4 guidance (y) [N/m]
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);
ty.c.rad = 100*(1/5)*sqrt(ty.k.rad/ty.m);