Add ground element, ground motion, and force on the granite.

This commit is contained in:
Thomas Dehaeze 2018-06-06 19:16:04 +02:00
parent ef1a2ff692
commit d59349f5d4
3 changed files with 82 additions and 0 deletions

Binary file not shown.

5
Data.m
View File

@ -9,6 +9,11 @@ Tsim = 1; % Simulation time [s]
%% Gravity
g = 0 ; % Gravity along the z axis [m/s^2]
%% Ground
ground = struct();
ground.shape = [2, 2, 0.5]; % m
%% Granite
granite = struct();

View File

@ -0,0 +1,77 @@
%% Script Description
% Run an identification of each stage from input to output
% Save all computed transfer functions into one .mat file
%%
clear;
close all;
clc
%% Define options for bode plots
bode_opts = bodeoptions;
bode_opts.Title.FontSize = 12;
bode_opts.XLabel.FontSize = 12;
bode_opts.YLabel.FontSize = 12;
bode_opts.FreqUnits = 'Hz';
bode_opts.MagUnits = 'abs';
bode_opts.MagScale = 'log';
bode_opts.PhaseWrapping = 'on';
bode_opts.PhaseVisible = 'on';
%% Options for preprocessing the identified transfer functions
f_low = 10;
f_high = 1000;
%% Options for Linearized
options = linearizeOptions;
options.SampleTime = 0;
%% Name of the Simulink File
mdl = 'Assemblage';
%% Micro-Hexapod
% Input/Output definition
io(1) = linio([mdl, '/Fhexa_cart'],1,'input');
io(2) = linio([mdl, '/Micro_Hexapod'],1,'output');
% Run the linearization
G_micro_hexapod_raw = linearize(mdl,io, 0);
% Post-process the linearized function
G_micro_hexapod = preprocessIdTf(G_micro_hexapod_raw, f_low, f_high);
% Input/Output names
G_micro_hexapod.InputName = {'Fy'};
G_micro_hexapod.OutputName = {'Dy'};
% Bode Plot of the linearized function
figure;
bode(G_micro_hexapod(1, 1), bode_opts)
%% Granite
% Input/Output definition
io(1) = linio([mdl, '/Granite_F'],1,'input');
io(2) = linio([mdl, '/Granite'],1,'output');
% Run the linearization
G_micro_hexapod_raw = linearize(mdl,io, 0);
% Post-process the linearized function
G_micro_hexapod = preprocessIdTf(G_micro_hexapod_raw, f_low, f_high);
% Input/Output names
G_micro_hexapod.InputName = {'Fy'};
G_micro_hexapod.OutputName = {'Dy'};
% Bode Plot of the linearized function
figure;
bode(G_micro_hexapod(1, 1), bode_opts)
%% Functions
function G = preprocessIdTf(G0, f_low, f_high)
[~,G1] = freqsep(G0, 2*pi*f_low);
[G2,~] = freqsep(G1, 2*pi*f_high);
G = minreal(G2);
end