nass-simscape/identification/id_micro_station.m

32 lines
884 B
Matlab

%% Script Description
% Make the same identification as Marc did
% Should comment out the nano-hexapod and sample before
% runing this script.
%%
clear; close all; clc;
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'sim_micro_station';
%% 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/Dg_inertial'],1,'output');
% Run the linearization
G_ms = linearize(mdl, io, 0);
% Input/Output names
G_ms.InputName = {'Fmx', 'Fmy', 'Fmz', 'Fgx', 'Fgy', 'Fgz'};
G_ms.OutputName = {'Dmx', 'Dmy', 'Dmz', 'Dgx', 'Dgy', 'Dgz'};
%% Save the obtained transfer functions
save('./mat/id_micro_station.mat', 'G_ms');