2018-10-07 22:07:21 +02:00
|
|
|
%%
|
|
|
|
clear; close all; clc;
|
|
|
|
|
|
|
|
%% Load IFF Controllers
|
|
|
|
load('./mat/K_iff_crit.mat', 'K_iff_light_vc', 'K_iff_light_pz', 'K_iff_heavy_vc', 'K_iff_heavy_pz');
|
|
|
|
|
|
|
|
%% Light Sample
|
|
|
|
initializeSample(struct('mass', 1));
|
|
|
|
|
|
|
|
initializeNanoHexapod(struct('actuator', 'lorentz'));
|
|
|
|
K_iff = K_iff_light_vc; %#ok
|
2018-10-24 15:08:23 +02:00
|
|
|
save('./mat/controllers.mat', 'K_iff');
|
2018-10-07 22:07:21 +02:00
|
|
|
G_iff_light_vc = identifyPlant();
|
|
|
|
|
|
|
|
initializeNanoHexapod(struct('actuator', 'piezo'));
|
|
|
|
K_iff = K_iff_light_pz; %#ok
|
2018-10-24 15:08:23 +02:00
|
|
|
save('./mat/controllers.mat', 'K_iff');
|
2018-10-07 22:07:21 +02:00
|
|
|
G_iff_light_pz = identifyPlant();
|
|
|
|
|
|
|
|
%% Heavy Sample
|
|
|
|
initializeSample(struct('mass', 50));
|
|
|
|
|
|
|
|
initializeNanoHexapod(struct('actuator', 'lorentz'));
|
|
|
|
K_iff = K_iff_heavy_vc; %#ok
|
2018-10-24 15:08:23 +02:00
|
|
|
save('./mat/controllers.mat', 'K_iff');
|
2018-10-07 22:07:21 +02:00
|
|
|
G_iff_heavy_vc = identifyPlant();
|
|
|
|
|
|
|
|
initializeNanoHexapod(struct('actuator', 'piezo'));
|
|
|
|
K_iff = K_iff_heavy_pz;
|
2018-10-24 15:08:23 +02:00
|
|
|
save('./mat/controllers.mat', 'K_iff', '-append');
|
2018-10-07 22:07:21 +02:00
|
|
|
G_iff_heavy_pz = identifyPlant();
|
|
|
|
|
|
|
|
%% Save the obtained transfer functions
|
|
|
|
save('./mat/G_iff.mat', 'G_iff_light_vc', 'G_iff_light_pz', 'G_iff_heavy_vc', 'G_iff_heavy_pz');
|