Add script to identify tf from force to displacement of the legs

This commit is contained in:
Thomas Dehaeze 2018-10-29 13:37:36 +01:00
parent fa3658509c
commit ef6f4613b1
8 changed files with 57 additions and 12 deletions

View File

@ -6,6 +6,8 @@ K = tf(zeros(6));
K_iff = tf(zeros(6)); K_iff = tf(zeros(6));
save('./mat/controllers.mat', 'K', 'K_iff', '-append'); save('./mat/controllers.mat', 'K', 'K_iff', '-append');
initializeInputs();
%% Light Sample %% Light Sample
initializeSample(struct('mass', 1)); initializeSample(struct('mass', 1));

View File

@ -0,0 +1,28 @@
%%
clear; close all; clc;
%%
K = tf(zeros(6));
K_iff = tf(zeros(6));
save('./mat/controllers.mat', 'K', 'K_iff', '-append');
%% Light Sample
initializeSample(struct('mass', 50));
initializeNanoHexapod(struct('actuator', 'piezo'));
%% Vertical Configuration
initializeInputs();
G_vert_init = identifyPlant();
initializeInputs(struct('Rz', 90));
G_vert_turn = identifyPlant();
%% Tilted configuration
initializeInputs(struct('Ry', 3));
G_tilt_init = identifyPlant();
initializeInputs(struct('Ry', 3, 'Rz', 90));
G_tilt_turn = identifyPlant();
%% Save
save('./mat/id_plant_variation.mat', 'G_vert_init', 'G_vert_turn', 'G_tilt_init', 'G_tilt_turn')

View File

@ -0,0 +1,24 @@
%%
clear; close all; clc;
%% Load
load('./mat/id_plant_variation.mat', 'G_vert_init', 'G_vert_turn', 'G_tilt_init', 'G_tilt_turn')
%%
bodeFig({G_vert_init.G_dleg(1, 1), ...
G_vert_init.G_dleg(2, 2), ...
G_vert_init.G_dleg(3, 3), ...
G_vert_init.G_dleg(4, 4), ...
G_vert_init.G_dleg(5, 5), ...
G_vert_init.G_dleg(6, 6)}, struct('phase', true));
xlim([1, 500]);
%%
bodeFig({G_vert_init.G_dleg(1, 1), ...
G_vert_turn.G_dleg(1, 1),}, struct('phase', true));
xlim([1, 500]);
%%
bodeFig({G_vert_init.G_dleg(1, 1), ...
G_tilt_init.G_dleg(1, 1),}, struct('phase', true));
xlim([1, 500]);

View File

@ -4,16 +4,5 @@
%% Load all the data used for the simulation %% Load all the data used for the simulation
load('./mat/sim_conf.mat'); load('./mat/sim_conf.mat');
%% Load SolidWorks Data
% load('./mat/solids.mat');
%% Load data of each stage
% TODO - This is now loaded by mask of each stage
% load('./mat/stages.mat');
%% Load Signals Applied to the system
% TODO - This is now loaded by the input referenced system
% load('./mat/inputs.mat');
%% Load Controller %% Load Controller
load('./mat/controllers.mat'); load('./mat/controllers.mat');

View File

@ -50,6 +50,8 @@ function [inputs] = initializeInputs(opts_param)
Ry = 3*(2*pi/360)*sin(2*pi*0.2*t); Ry = 3*(2*pi/360)*sin(2*pi*0.2*t);
elseif islogical(opts.Ry) && opts.Ry == false elseif islogical(opts.Ry) && opts.Ry == false
Ry = zeros(length(t), 1); Ry = zeros(length(t), 1);
elseif isnumeric(opts.Ry) && length(opts.Ry) == 1
Ry = opts.Ry*(2*pi/360)*ones(length(t), 1);
else else
Ry = opts.Ry; Ry = opts.Ry;
end end
@ -60,7 +62,7 @@ function [inputs] = initializeInputs(opts_param)
elseif islogical(opts.Rz) && opts.Rz == false elseif islogical(opts.Rz) && opts.Rz == false
Rz = zeros(length(t), 1); Rz = zeros(length(t), 1);
elseif isnumeric(opts.Rz) && length(opts.Rz) == 1 elseif isnumeric(opts.Rz) && length(opts.Rz) == 1
Rz = 2*pi*(opts.Rz/60)*t; Rz = opts.Rz*(2*pi/360)*ones(length(t), 1);
else else
Rz = opts.Rz; Rz = opts.Rz;
end end

Binary file not shown.

Binary file not shown.