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));
save('./mat/controllers.mat', 'K', 'K_iff', '-append');
initializeInputs();
%% Light Sample
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]);