nass-simscape/identification/id_micro_station.m

59 lines
1.6 KiB
Mathematica
Raw Normal View History

%% Script Description
2018-06-16 22:57:54 +02:00
% Make the same identification as Marc did
% Should comment out the nano-hexapod and sample before
% runing this script.
%%
2018-06-16 22:57:54 +02:00
clear; close all; clc;
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
2018-06-16 22:57:54 +02:00
mdl = 'Micro_Station_Identification';
%% Micro-Hexapod
% Input/Output definition
2018-06-16 22:57:54 +02:00
io(1) = linio([mdl, '/Micro-Station/Fm'],1,'input');
io(2) = linio([mdl, '/Micro-Station/Micro_Hexapod_Inertial_Sensor'],1,'output');
% Run the linearization
2018-06-16 22:57:54 +02:00
G_h_h_raw = linearize(mdl,io, 0);
G_h_h_raw = G_h_h_raw(1:3, 1:3);
G_h_h = preprocessIdTf(G_h_h_raw, 10, 10000);
% Input/Output names
G_h_h.InputName = {'Fux', 'Fuy', 'Fuz'};
G_h_h.OutputName = {'Dux', 'Duy', 'Duz'};
%% Granite
% Input/Output definition
2018-06-16 22:57:54 +02:00
io(1) = linio([mdl, '/Micro-Station/F_granite'],1,'input');
io(2) = linio([mdl, '/Micro-Station/Granite_Inertial_Sensor'],1,'output');
% Run the linearization
2018-06-16 22:57:54 +02:00
G_g_g_raw = linearize(mdl,io, 0);
G_g_g = preprocessIdTf(G_g_g_raw, 10, 10000);
% Input/Output names
G_g_g.InputName = {'Fgx', 'Fgy', 'Fgz'};
G_g_g.OutputName = {'Dgx', 'Dgy', 'Dgz'};
%% Micro Hexapod to Granite
% Input/Output definition
2018-06-16 22:57:54 +02:00
io(1) = linio([mdl, '/Micro-Station/Fm'],1,'input');
io(2) = linio([mdl, '/Micro-Station/Granite_Inertial_Sensor'],1,'output');
% Run the linearization
2018-06-16 22:57:54 +02:00
G_h_g_raw = linearize(mdl,io, 0);
G_h_g_raw = G_h_g_raw(1:3, 1:3);
G_h_g = preprocessIdTf(G_h_g_raw, 10, 10000);
% Input/Output names
G_h_g.InputName = {'Fhx', 'Fhy', 'Fhz'};
G_h_g.OutputName = {'Dgx', 'Dgy', 'Dgz'};
%% Save the obtained transfer functions
save('./mat/id_micro_station.mat', 'G_h_h', 'G_g_g', 'G_h_g');