Add script to identify tf from force to displacement of the legs
This commit is contained in:
parent
fa3658509c
commit
ef6f4613b1
@ -6,6 +6,8 @@ K = tf(zeros(6));
|
||||
K_iff = tf(zeros(6));
|
||||
save('./mat/controllers.mat', 'K', 'K_iff', '-append');
|
||||
|
||||
initializeInputs();
|
||||
|
||||
%% Light Sample
|
||||
initializeSample(struct('mass', 1));
|
||||
|
||||
|
28
identification/id_plant_variation.m
Normal file
28
identification/id_plant_variation.m
Normal 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')
|
24
identification/id_plant_variation_plots.m
Normal file
24
identification/id_plant_variation_plots.m
Normal 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]);
|
Binary file not shown.
@ -4,16 +4,5 @@
|
||||
%% Load all the data used for the simulation
|
||||
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('./mat/controllers.mat');
|
||||
|
@ -50,6 +50,8 @@ function [inputs] = initializeInputs(opts_param)
|
||||
Ry = 3*(2*pi/360)*sin(2*pi*0.2*t);
|
||||
elseif islogical(opts.Ry) && opts.Ry == false
|
||||
Ry = zeros(length(t), 1);
|
||||
elseif isnumeric(opts.Ry) && length(opts.Ry) == 1
|
||||
Ry = opts.Ry*(2*pi/360)*ones(length(t), 1);
|
||||
else
|
||||
Ry = opts.Ry;
|
||||
end
|
||||
@ -60,7 +62,7 @@ function [inputs] = initializeInputs(opts_param)
|
||||
elseif islogical(opts.Rz) && opts.Rz == false
|
||||
Rz = zeros(length(t), 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
|
||||
Rz = opts.Rz;
|
||||
end
|
||||
|
Binary file not shown.
BIN
mat/inputs.mat
BIN
mat/inputs.mat
Binary file not shown.
Loading…
Reference in New Issue
Block a user