2018-10-24 15:08:23 +02:00
|
|
|
%% Script Description
|
|
|
|
% Determine if we take into account the flexibilities,
|
|
|
|
% does that changes a lot
|
|
|
|
|
|
|
|
%%
|
|
|
|
clear; close all; clc;
|
|
|
|
|
|
|
|
%% Initialize all the stage by default
|
|
|
|
run init_data.m
|
|
|
|
|
|
|
|
%% Options for Linearized
|
|
|
|
options = linearizeOptions;
|
|
|
|
options.SampleTime = 0;
|
|
|
|
|
|
|
|
%% Name of the Simulink File
|
2018-10-29 12:57:13 +01:00
|
|
|
mdl = 'sim_micro_station_id';
|
2018-10-24 15:08:23 +02:00
|
|
|
|
|
|
|
%% Micro-Hexapod
|
|
|
|
% Input/Output definition
|
|
|
|
io(1) = linio([mdl, '/Micro-Station/Fm_ext'],1,'openinput');
|
|
|
|
io(2) = linio([mdl, '/Micro-Station/Fg_ext'],1,'openinput');
|
|
|
|
io(3) = linio([mdl, '/Micro-Station/Dm_inertial'],1,'output');
|
|
|
|
io(4) = linio([mdl, '/Micro-Station/Ty_inertial'],1,'output');
|
|
|
|
io(5) = linio([mdl, '/Micro-Station/Ry_inertial'],1,'output');
|
|
|
|
io(6) = linio([mdl, '/Micro-Station/Dg_inertial'],1,'output');
|
|
|
|
|
|
|
|
|
|
|
|
%% Run the linearization
|
|
|
|
initializeTy();
|
|
|
|
|
|
|
|
G_ms_flexible = linearize(mdl, io, 0);
|
|
|
|
|
|
|
|
% Input/Output names
|
|
|
|
G_ms_flexible.InputName = {'Fmx', 'Fmy', 'Fmz',...
|
2018-10-25 11:00:30 +02:00
|
|
|
'Fgx', 'Fgy', 'Fgz'};
|
2018-10-24 15:08:23 +02:00
|
|
|
G_ms_flexible.OutputName = {'Dmx', 'Dmy', 'Dmz', ...
|
2018-10-25 11:00:30 +02:00
|
|
|
'Tyx', 'Tyy', 'Tyz', ...
|
|
|
|
'Ryx', 'Ryy', 'Ryz', ...
|
|
|
|
'Dgx', 'Dgy', 'Dgz'};
|
2018-10-24 15:08:23 +02:00
|
|
|
|
|
|
|
%% Run the linearization
|
|
|
|
initializeTy(struct('rigid', true));
|
|
|
|
|
|
|
|
G_ms_ty_rigid = linearize(mdl, io, 0);
|
|
|
|
|
|
|
|
% Input/Output names
|
|
|
|
G_ms_ty_rigid.InputName = {'Fmx', 'Fmy', 'Fmz',...
|
|
|
|
'Fgx', 'Fgy', 'Fgz'};
|
|
|
|
G_ms_ty_rigid.OutputName = {'Dmx', 'Dmy', 'Dmz', ...
|
|
|
|
'Tyx', 'Tyy', 'Tyz', ...
|
|
|
|
'Ryx', 'Ryy', 'Ryz', ...
|
|
|
|
'Dgx', 'Dgy', 'Dgz'};
|
|
|
|
|
|
|
|
%% Save the obtained transfer functions
|
|
|
|
save('./mat/id_micro_station_flexibility.mat', 'G_ms_flexible', 'G_ms_ty_rigid');
|