2018-06-07 18:27:02 +02:00
|
|
|
%% Script Description
|
|
|
|
%
|
|
|
|
%%
|
2018-06-13 09:37:20 +02:00
|
|
|
clear; close all; clc;
|
2018-06-07 18:27:02 +02:00
|
|
|
|
|
|
|
%% Options for preprocessing the identified transfer functions
|
|
|
|
f_low = 10;
|
2018-06-13 09:37:20 +02:00
|
|
|
f_high = 10000;
|
2018-06-07 18:27:02 +02:00
|
|
|
|
|
|
|
%% Options for Linearized
|
|
|
|
options = linearizeOptions;
|
|
|
|
options.SampleTime = 0;
|
|
|
|
|
|
|
|
%% Name of the Simulink File
|
|
|
|
mdl = 'Assemblage';
|
|
|
|
|
2018-06-13 09:37:20 +02:00
|
|
|
%% NASS
|
2018-06-07 18:27:02 +02:00
|
|
|
% Input/Output definition
|
2018-06-13 09:37:20 +02:00
|
|
|
io(1) = linio([mdl, '/Micro-Station/Fn'],1,'input');
|
|
|
|
io(2) = linio([mdl, '/Micro-Station/Nano_Hexapod'],1,'output');
|
2018-06-07 18:27:02 +02:00
|
|
|
|
|
|
|
% Run the linearization
|
|
|
|
G_f_to_d = linearize(mdl,io, 0);
|
|
|
|
|
2018-06-13 09:37:20 +02:00
|
|
|
G_f_to_d = preprocessIdTf(G_f_to_d, 10, 10000);
|
|
|
|
|
2018-06-07 18:27:02 +02:00
|
|
|
% Input/Output names
|
2018-06-13 09:37:20 +02:00
|
|
|
G_f_to_d.InputName = {'Fx', 'Fy', 'Fz', 'Mx', 'My', 'Mz'};
|
|
|
|
G_f_to_d.OutputName = {'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz'};
|
2018-06-07 18:27:02 +02:00
|
|
|
|
|
|
|
% Bode Plot of the linearized function
|
2018-06-13 09:37:20 +02:00
|
|
|
bodeFig({G_f_to_d(1, 1), G_f_to_d(2, 2), G_f_to_d(3, 3)}, struct('phase', true))
|
|
|
|
legend({'$F_{n_x} \rightarrow D_{x}$', '$F_{n_y} \rightarrow D_{y}$', '$F_{n_z} \rightarrow D_{z}$'})
|
2018-06-07 18:27:02 +02:00
|
|
|
|
|
|
|
%%
|
2018-06-13 09:37:20 +02:00
|
|
|
save('./mat/G_f_to_d.mat', 'G_f_to_d');
|