Remove unused matlab files about active damping

This commit is contained in:
Thomas Dehaeze 2019-12-11 14:47:59 +01:00
parent 7ca627ff91
commit ae148d1248
7 changed files with 0 additions and 230 deletions

View File

@ -1,28 +0,0 @@
%%
clear; close all; clc;
%% IFF: Integral Force Feedback Control
% Generate the IFF Control Laws
run iff_control.m
% Identification of the TF of damped system
run iff_identification.m
% Compare undamped and damped system
run iff_comp_tf.m
% Generate Control Laws with the damped system
run iff_fb_control.m
% Plot Loop Gains for the new control laws
run iff_fb_control_plots.m
% Simulation of the damped system
run iff_simulation.m
% Plot results of the simulations
run iff_results.m
%% DVF: Direct Velocity Feedback
% Generate the DVF Control Laws
run dvf_control.m

View File

@ -1,22 +0,0 @@
%%
clear; close all; clc;
%% Load the identified transfer functions
load('./mat/G.mat', 'G_light_vc', 'G_light_pz', 'G_heavy_vc', 'G_heavy_pz');
%% Load Configuration file
load('./mat/config.mat', 'save_fig', 'freqs');
%%
s = tf('s');
%%
% sisotool(-G_heavy_pz.G_dvf('Vnx', 'Fnx'))
K_dvf_light_vc = tf(eye(6));
K_dvf_light_pz = tf(eye(6));
K_dvf_heavy_vc = tf(eye(6));
K_dvf_heavy_pz = tf(eye(6));
%%
save('./mat/K_dvf_crit.mat', 'K_dvf_light_vc', 'K_dvf_light_pz', 'K_dvf_heavy_vc', 'K_dvf_heavy_pz');

View File

@ -1,74 +0,0 @@
%%
clear; close all; clc;
%% Load System and Damped System
load('./mat/G.mat', 'G_light_vc', 'G_light_pz', 'G_heavy_vc', 'G_heavy_pz');
load('./mat/G_iff.mat', 'G_iff_light_vc', 'G_iff_light_pz', 'G_iff_heavy_vc', 'G_iff_heavy_pz');
%% Load Configuration file
load('./mat/config.mat', 'save_fig', 'freqs');
%% New Plant damped
figure;
% Amplitude
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light VC');
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light PZ');
set(gca,'ColorOrderIndex',1);
plot(freqs, abs(squeeze(freqresp(G_iff_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '--', 'DisplayName', 'Damped');
plot(freqs, abs(squeeze(freqresp(G_iff_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '--', 'DisplayName', 'Damped');
set(gca,'xscale','log'); set(gca,'yscale','log');
ylabel('Amplitude [m/N]');
set(gca, 'XTickLabel',[]);
legend('Location', 'southwest');
hold off;
% Phase
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-');
set(gca,'ColorOrderIndex',1);
plot(freqs, 180/pi*angle(squeeze(freqresp(G_iff_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '--');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_iff_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '--');
set(gca,'xscale','log');
ylim([-180, 180]);
yticks([-180, -90, 0, 90, 180]);
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
hold off;
linkaxes([ax1,ax2],'x');
xlim([freqs(1) freqs(end)]);
if save_fig; exportFig('damping_comp_plant', 'normal-normal', struct('path', 'active_damping')); end
%% From xw to d
figure;
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_gm('Dx', 'Dgx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light VC');
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_gm('Dx', 'Dgx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light PZ');
set(gca,'ColorOrderIndex',1);
plot(freqs, abs(squeeze(freqresp(G_iff_light_vc.G_gm('Dx', 'Dgx'), freqs, 'Hz'))), '--', 'DisplayName', 'Damped');
plot(freqs, abs(squeeze(freqresp(G_iff_light_pz.G_gm('Dx', 'Dgx'), freqs, 'Hz'))), '--', 'DisplayName', 'Damped');
hold off;
xlim([freqs(1) freqs(end)]);
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/m]'); xlabel('Frequency [Hz]');
legend('Location', 'southwest');
if save_fig; exportFig('damping_comp_xw', 'normal-normal', struct('path', 'active_damping')); end
%% From fi to d
figure;
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_fs('Dx', 'Fsx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light VC');
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_fs('Dx', 'Fsx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light PZ');
set(gca,'ColorOrderIndex',1);
plot(freqs, abs(squeeze(freqresp(G_iff_light_vc.G_fs('Dx', 'Fsx'), freqs, 'Hz'))), '--', 'DisplayName', 'Damped');
plot(freqs, abs(squeeze(freqresp(G_iff_light_pz.G_fs('Dx', 'Fsx'), freqs, 'Hz'))), '--', 'DisplayName', 'Damped');
hold off;
xlim([freqs(1) freqs(end)]);
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
ylabel('Amplitude [m/N]'); xlabel('Frequency [Hz]');
legend('Location', 'southwest');
if save_fig; exportFig('damping_comp_fi', 'normal-normal', struct('path', 'active_damping')); end

View File

@ -1,22 +0,0 @@
%%
clear; close all; clc;
%% Load the identified transfer functions
load('./mat/G.mat', 'G_light_vc', 'G_light_pz', 'G_heavy_vc', 'G_heavy_pz');
%% Load Configuration file
load('./mat/config.mat', 'save_fig', 'freqs');
%%
s = tf('s');
%%
% sisotool(-G_heavy_pz.G_iff('Fm1', 'F1')/s)
K_iff_light_vc = 48/s*tf(eye(6));
K_iff_light_pz = 1500/s*tf(eye(6));
K_iff_heavy_vc = 20/s*tf(eye(6));
K_iff_heavy_pz = 535/s*tf(eye(6));
%%
save('./mat/K_iff_crit.mat', 'K_iff_light_vc', 'K_iff_light_pz', 'K_iff_heavy_vc', 'K_iff_heavy_pz');

View File

@ -1,34 +0,0 @@
%%
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');

View File

@ -1,39 +0,0 @@
%%
clear; close all; clc;
%% Load Configuration file
load('./mat/config.mat', 'save_fig', 'freqs');
%% Load Simulation Results
sim_light_vc_ol = load('./mat/sim_light_vc_ol_none.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_pz_ol = load('./mat/sim_light_pz_ol_none.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_vc_cl = load('./mat/sim_light_vc_cl_none.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_pz_cl = load('./mat/sim_light_pz_cl_none.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_vc_ol_iff = load('./mat/sim_light_vc_ol_iff.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_pz_ol_iff = load('./mat/sim_light_pz_ol_iff.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_vc_cl_iff = load('./mat/sim_light_vc_cl_iff.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
sim_light_pz_cl_iff = load('./mat/sim_light_pz_cl_iff.mat', 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
%%
figure;
hold on;
plot(sim_light_vc_ol.Dx, sim_light_vc_ol.Dy);
plot(sim_light_vc_cl.Dx, sim_light_vc_cl.Dy);
plot(sim_light_vc_ol_iff.Dx, sim_light_vc_ol_iff.Dy);
plot(sim_light_vc_cl_iff.Dx, sim_light_vc_cl_iff.Dy);
hold off;
%%
rms(sqrt(sim_light_vc_ol.Dx.^2+sim_light_vc_ol.Dy.^2))
rms(sqrt(sim_light_vc_cl.Dx.^2+sim_light_vc_cl.Dy.^2))
rms(sqrt(sim_light_vc_ol_iff.Dx.^2+sim_light_vc_ol_iff.Dy.^2))
rms(sqrt(sim_light_vc_cl_iff.Dx.^2+sim_light_vc_cl_iff.Dy.^2))
%%
rms(sqrt(sim_light_pz_ol.Dx.^2+sim_light_pz_ol.Dy.^2))
rms(sqrt(sim_light_pz_cl.Dx.^2+sim_light_pz_cl.Dy.^2))
rms(sqrt(sim_light_pz_ol_iff.Dx.^2+sim_light_pz_ol_iff.Dy.^2))
rms(sqrt(sim_light_pz_cl_iff.Dx.^2+sim_light_pz_cl_iff.Dy.^2))

View File

@ -1,11 +0,0 @@
%%
clear; close all; clc;
%% Initialize Simulation and Inputs
initializeExperiment('tomography', 'light');
%% Run Open Loop Simulations
runSimulation('vc', 'light', 'ol', 'iff');
runSimulation('pz', 'light', 'ol', 'iff');
% runSimulation('vc', 'heavy', 'ol', 'iff');
% runSimulation('pz', 'heavy', 'ol', 'iff');