Change subaxis to subplot

This commit is contained in:
Thomas Dehaeze 2019-10-14 16:45:24 +02:00
parent 075bf199da
commit cdbd62b3ee
9 changed files with 45 additions and 45 deletions

View File

@ -11,7 +11,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% New Plant damped %% New Plant damped
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; 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_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'); plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light PZ');
@ -24,7 +24,7 @@ set(gca, 'XTickLabel',[]);
legend('Location', 'southwest'); legend('Location', 'southwest');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; 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_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-');

View File

@ -11,7 +11,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% Plot the Loop gain for Translations - Light VC %% Plot the Loop gain for Translations - Light VC
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(1, 1)*G_iff_light_vc.G_cart(1, 1), freqs, 'Hz'))), 'DisplayName', 'x'); plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(1, 1)*G_iff_light_vc.G_cart(1, 1), freqs, 'Hz'))), 'DisplayName', 'x');
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(2, 2)*G_iff_light_vc.G_cart(2, 2), freqs, 'Hz'))), 'DisplayName', 'y'); plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(2, 2)*G_iff_light_vc.G_cart(2, 2), freqs, 'Hz'))), 'DisplayName', 'y');
@ -21,7 +21,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]'); ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(1, 1)*G_iff_light_vc.G_cart(1, 1), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(1, 1)*G_iff_light_vc.G_cart(1, 1), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(2, 2)*G_iff_light_vc.G_cart(2, 2), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(2, 2)*G_iff_light_vc.G_cart(2, 2), freqs, 'Hz'))));
@ -39,7 +39,7 @@ if save_fig; exportFig('loop_gain_fb_iff_light_vc_trans', 'normal-normal', struc
%% Plot the Loop gain for Rotations - Light VC %% Plot the Loop gain for Rotations - Light VC
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(4, 4)*G_iff_light_vc.G_cart(4, 4), freqs, 'Hz'))), 'DisplayName', 'Rx'); plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(4, 4)*G_iff_light_vc.G_cart(4, 4), freqs, 'Hz'))), 'DisplayName', 'Rx');
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(5, 5)*G_iff_light_vc.G_cart(5, 5), freqs, 'Hz'))), 'DisplayName', 'Ry'); plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(5, 5)*G_iff_light_vc.G_cart(5, 5), freqs, 'Hz'))), 'DisplayName', 'Ry');
@ -48,7 +48,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]'); ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(4, 4)*G_iff_light_vc.G_cart(4, 4), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(4, 4)*G_iff_light_vc.G_cart(4, 4), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(5, 5)*G_iff_light_vc.G_cart(5, 5), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(5, 5)*G_iff_light_vc.G_cart(5, 5), freqs, 'Hz'))));
@ -65,7 +65,7 @@ if save_fig; exportFig('loop_gain_fb_iff_light_vc_rot', 'normal-normal', struct(
%% Plot the Loop gain for Translations - Light PZ %% Plot the Loop gain for Translations - Light PZ
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(1, 1)*G_iff_light_pz.G_cart(1, 1), freqs, 'Hz'))), 'DisplayName', 'x'); plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(1, 1)*G_iff_light_pz.G_cart(1, 1), freqs, 'Hz'))), 'DisplayName', 'x');
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(2, 2)*G_iff_light_pz.G_cart(2, 2), freqs, 'Hz'))), 'DisplayName', 'y'); plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(2, 2)*G_iff_light_pz.G_cart(2, 2), freqs, 'Hz'))), 'DisplayName', 'y');
@ -75,7 +75,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]'); ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(1, 1)*G_iff_light_pz.G_cart(1, 1), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(1, 1)*G_iff_light_pz.G_cart(1, 1), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(2, 2)*G_iff_light_pz.G_cart(2, 2), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(2, 2)*G_iff_light_pz.G_cart(2, 2), freqs, 'Hz'))));
@ -93,7 +93,7 @@ if save_fig; exportFig('loop_gain_fb_iff_light_pz_trans', 'normal-normal', struc
%% Plot the Loop gain for Rotations - Light PZ %% Plot the Loop gain for Rotations - Light PZ
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(4, 4)*G_iff_light_pz.G_cart(4, 4), freqs, 'Hz'))), 'DisplayName', 'Rx'); plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(4, 4)*G_iff_light_pz.G_cart(4, 4), freqs, 'Hz'))), 'DisplayName', 'Rx');
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(5, 5)*G_iff_light_pz.G_cart(5, 5), freqs, 'Hz'))), 'DisplayName', 'Ry'); plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(5, 5)*G_iff_light_pz.G_cart(5, 5), freqs, 'Hz'))), 'DisplayName', 'Ry');
@ -102,7 +102,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]'); ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(4, 4)*G_iff_light_pz.G_cart(4, 4), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(4, 4)*G_iff_light_pz.G_cart(4, 4), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(5, 5)*G_iff_light_pz.G_cart(5, 5), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(5, 5)*G_iff_light_pz.G_cart(5, 5), freqs, 'Hz'))));

View File

@ -10,7 +10,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% Plant %% Plant
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))));
@ -23,7 +23,7 @@ ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), 'DisplayName', 'VC - Light'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), 'DisplayName', 'VC - Light');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light');
@ -44,7 +44,7 @@ if save_fig; exportFig('comp_models_plant_x_x', 'normal-normal', struct('path',
%% %%
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dz', 'Fnz'), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dz', 'Fnz'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dz', 'Fnz'), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dz', 'Fnz'), freqs, 'Hz'))));
@ -57,7 +57,7 @@ ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dz', 'Fnz'), freqs, 'Hz'))), 'DisplayName', 'VC - Light'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dz', 'Fnz'), freqs, 'Hz'))), 'DisplayName', 'VC - Light');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dz', 'Fnz'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dz', 'Fnz'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light');
@ -80,7 +80,7 @@ figure;
for i_input = 1:3 for i_input = 1:3
for i_output = 1:3 for i_output = 1:3
subaxis(3,3,3*(i_input-1)+i_output); subplot(3,3,3*(i_input-1)+i_output);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart(i_output, i_input), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart(i_output, i_input), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart(i_output, i_input), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart(i_output, i_input), freqs, 'Hz'))));

View File

@ -10,7 +10,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% %%
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_iff('Fm1', 'F1'), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_vc.G_iff('Fm1', 'F1'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_iff('Fm1', 'F1'), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_light_pz.G_iff('Fm1', 'F1'), freqs, 'Hz'))));
@ -23,7 +23,7 @@ ylabel('Amplitude [m/N]');
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_iff('Fm1', 'F1'), freqs, 'Hz'))), 'DisplayName', 'VC - Light'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_iff('Fm1', 'F1'), freqs, 'Hz'))), 'DisplayName', 'VC - Light');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_iff('Fm1', 'F1'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_iff('Fm1', 'F1'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light');

View File

@ -23,7 +23,7 @@ dir = 'y';
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fg' dir]), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))), '--'); plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))), '--');
@ -33,7 +33,7 @@ set(gca, 'XTickLabel',[]);
legend({'Flexible', 'Ty - Rigid'}); legend({'Flexible', 'Ty - Rigid'});
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fg' dir]), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))), '--'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))), '--');
@ -49,7 +49,7 @@ dir = 'y';
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dm' dir], ['Fm' dir]), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '--'); plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '--');
@ -59,7 +59,7 @@ set(gca, 'XTickLabel',[]);
legend({'Flexible', 'Ty - Rigid'}); legend({'Flexible', 'Ty - Rigid'});
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dm' dir], ['Fm' dir]), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '--'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '--');
@ -75,7 +75,7 @@ dir = 'z';
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fm' dir]), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))), '--'); plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))), '--');
@ -86,7 +86,7 @@ set(gca, 'XTickLabel',[]);
legend({'Flexible', 'Ty - Rigid'}); legend({'Flexible', 'Ty - Rigid'});
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fm' dir]), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))), '--'); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))), '--');

View File

@ -22,7 +22,7 @@ meas_sys = getDynamicTFs(m_object, 'marble', 'hexa', {{'tx', 'tx'},{'ty', 'ty'},
for dir = 'xyz' for dir = 'xyz'
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_ms(['Dg' dir], ['Fg' dir]), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_ms(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(meas_sys(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '.'); plot(freqs, abs(squeeze(freqresp(meas_sys(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '.');
@ -32,7 +32,7 @@ for dir = 'xyz'
legend({'Model', 'Meas.'}); legend({'Model', 'Meas.'});
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dg' dir], ['Fg' dir]), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '.'); plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '.');
@ -50,7 +50,7 @@ end
for dir = 'xyz' for dir = 'xyz'
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_ms(['Dm' dir], ['Fm' dir]), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_ms(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(meas_sys(['Dh' dir], ['Fh' dir]), freqs, 'Hz'))), '.'); plot(freqs, abs(squeeze(freqresp(meas_sys(['Dh' dir], ['Fh' dir]), freqs, 'Hz'))), '.');
@ -60,7 +60,7 @@ for dir = 'xyz'
legend({'Model', 'Meas.'}); legend({'Model', 'Meas.'});
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dm' dir], ['Fm' dir]), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dh' dir], ['Fh' dir]), freqs, 'Hz'))), '.'); plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dh' dir], ['Fh' dir]), freqs, 'Hz'))), '.');
@ -79,7 +79,7 @@ end
for dir = 'xyz' for dir = 'xyz'
figure; figure;
% Amplitude % Amplitude
ax1 = subaxis(2,1,1); ax1 = subplot(2,1,1);
hold on; hold on;
plot(freqs, abs(squeeze(freqresp(G_ms(['Dm' dir], ['Fg' dir]), freqs, 'Hz')))); plot(freqs, abs(squeeze(freqresp(G_ms(['Dm' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(meas_sys(['Dh' dir], ['Fm' dir]), freqs, 'Hz'))), '.'); plot(freqs, abs(squeeze(freqresp(meas_sys(['Dh' dir], ['Fm' dir]), freqs, 'Hz'))), '.');
@ -89,7 +89,7 @@ for dir = 'xyz'
legend({'Model', 'Meas.'}); legend({'Model', 'Meas.'});
hold off; hold off;
% Phase % Phase
ax2 = subaxis(2,1,2); ax2 = subplot(2,1,2);
hold on; hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dm' dir], ['Fg' dir]), freqs, 'Hz')))); plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dm' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dh' dir], ['Fm' dir]), freqs, 'Hz'))), '.'); plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dh' dir], ['Fm' dir]), freqs, 'Hz'))), '.');

View File

@ -2,7 +2,7 @@
figure; figure;
%% Tx %% Tx
subaxis(2, 3, 1); subplot(2, 3, 1);
hold on; hold on;
plot(error_nass.Time, error_nass.Data(:, 1), 'k-', 'DisplayName', '$\epsilon_x$'); plot(error_nass.Time, error_nass.Data(:, 1), 'k-', 'DisplayName', '$\epsilon_x$');
legend(); legend();
@ -10,7 +10,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)'); xlabel('Time (s)'); ylabel('Position (m)');
%% Ty %% Ty
subaxis(2, 3, 2); subplot(2, 3, 2);
hold on; hold on;
plot(error_nass.Time, error_nass.Data(:, 2), 'k-', 'DisplayName', '$\epsilon_y$'); plot(error_nass.Time, error_nass.Data(:, 2), 'k-', 'DisplayName', '$\epsilon_y$');
legend(); legend();
@ -18,7 +18,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)'); xlabel('Time (s)'); ylabel('Position (m)');
%% Tz %% Tz
subaxis(2, 3, 3); subplot(2, 3, 3);
hold on; hold on;
plot(error_nass.Time, error_nass.Data(:, 3), 'k-', 'DisplayName', '$\epsilon_z$'); plot(error_nass.Time, error_nass.Data(:, 3), 'k-', 'DisplayName', '$\epsilon_z$');
legend(); legend();
@ -26,7 +26,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)'); xlabel('Time (s)'); ylabel('Position (m)');
%% Rx %% Rx
subaxis(2, 3, 4); subplot(2, 3, 4);
hold on; hold on;
plot(error_nass.Time, error_nass.Data(:, 4), 'k-', 'DisplayName', '$\epsilon_{\theta_x}$'); plot(error_nass.Time, error_nass.Data(:, 4), 'k-', 'DisplayName', '$\epsilon_{\theta_x}$');
legend(); legend();
@ -34,7 +34,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)'); xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Ry %% Ry
subaxis(2, 3, 5); subplot(2, 3, 5);
hold on; hold on;
plot(error_nass.Time, error_nass.Data(:, 5), 'k-', 'DisplayName', '$\epsilon_{\theta_y}$'); plot(error_nass.Time, error_nass.Data(:, 5), 'k-', 'DisplayName', '$\epsilon_{\theta_y}$');
legend(); legend();
@ -42,7 +42,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)'); xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Rz %% Rz
subaxis(2, 3, 6); subplot(2, 3, 6);
hold on; hold on;
plot(error_nass.Time, error_nass.Data(:, 6), 'k-', 'DisplayName', '$\epsilon_{\theta_z}$'); plot(error_nass.Time, error_nass.Data(:, 6), 'k-', 'DisplayName', '$\epsilon_{\theta_z}$');
legend(); legend();

View File

@ -2,7 +2,7 @@
figure; figure;
%% Tx %% Tx
subaxis(2, 3, 1); subplot(2, 3, 1);
hold on; hold on;
plot(pos.Time, pos.Data(:, 1), 'k-'); plot(pos.Time, pos.Data(:, 1), 'k-');
plot(setpoint.Time, setpoint.Data(:, 1), 'k--'); plot(setpoint.Time, setpoint.Data(:, 1), 'k--');
@ -11,7 +11,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)'); xlabel('Time (s)'); ylabel('Position (m)');
%% Ty %% Ty
subaxis(2, 3, 2); subplot(2, 3, 2);
hold on; hold on;
plot(pos.Time, pos.Data(:, 2), 'k-'); plot(pos.Time, pos.Data(:, 2), 'k-');
plot(setpoint.Time, setpoint.Data(:, 2), 'k--'); plot(setpoint.Time, setpoint.Data(:, 2), 'k--');
@ -20,7 +20,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)'); xlabel('Time (s)'); ylabel('Position (m)');
%% Tz %% Tz
subaxis(2, 3, 3); subplot(2, 3, 3);
hold on; hold on;
plot(pos.Time, pos.Data(:, 3), 'k-'); plot(pos.Time, pos.Data(:, 3), 'k-');
plot(setpoint.Time, setpoint.Data(:, 3), 'k--'); plot(setpoint.Time, setpoint.Data(:, 3), 'k--');
@ -29,7 +29,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)'); xlabel('Time (s)'); ylabel('Position (m)');
%% Rx %% Rx
subaxis(2, 3, 4); subplot(2, 3, 4);
hold on; hold on;
plot(pos.Time, pos.Data(:, 4), 'k-'); plot(pos.Time, pos.Data(:, 4), 'k-');
plot(setpoint.Time, setpoint.Data(:, 4), 'k--'); plot(setpoint.Time, setpoint.Data(:, 4), 'k--');
@ -38,7 +38,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)'); xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Ry %% Ry
subaxis(2, 3, 5); subplot(2, 3, 5);
hold on; hold on;
plot(pos.Time, pos.Data(:, 5), 'k-'); plot(pos.Time, pos.Data(:, 5), 'k-');
plot(setpoint.Time, setpoint.Data(:, 5), 'k--'); plot(setpoint.Time, setpoint.Data(:, 5), 'k--');
@ -47,7 +47,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)'); xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Rz %% Rz
subaxis(2, 3, 6); subplot(2, 3, 6);
hold on; hold on;
plot(pos.Time, pos.Data(:, 6), 'k-'); plot(pos.Time, pos.Data(:, 6), 'k-');
plot(setpoint.Time, setpoint.Data(:, 6), 'k--'); plot(setpoint.Time, setpoint.Data(:, 6), 'k--');

View File

@ -13,7 +13,7 @@
%% Load all the data used for the simulation %% Load all the data used for the simulation
load('./mat/sim_conf.mat'); load('sim_conf.mat');
%% Load Controller %% Load Controller
load('./mat/controllers.mat'); load('controllers.mat');