nass-simscape/active_damping/iff_identification.m
Thomas Dehaeze 7575aee987 Add metrology element (change of base, computation of error)
Lot's of new things:
- try to use less .mat files
- computation of setpoint and error in the cartesian frame fixed to the granite
- change of base to have the errors w.r.t. the NASS base
- add script to plot setpoint, position and error
2018-10-24 15:08:23 +02:00

35 lines
1.0 KiB
Matlab

%%
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
save('./mat/controllers.mat', 'K_iff');
G_iff_light_vc = identifyPlant();
initializeNanoHexapod(struct('actuator', 'piezo'));
K_iff = K_iff_light_pz; %#ok
save('./mat/controllers.mat', 'K_iff');
G_iff_light_pz = identifyPlant();
%% Heavy Sample
initializeSample(struct('mass', 50));
initializeNanoHexapod(struct('actuator', 'lorentz'));
K_iff = K_iff_heavy_vc; %#ok
save('./mat/controllers.mat', 'K_iff');
G_iff_heavy_vc = identifyPlant();
initializeNanoHexapod(struct('actuator', 'piezo'));
K_iff = K_iff_heavy_pz;
save('./mat/controllers.mat', 'K_iff', '-append');
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');