Tangled matlab files
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 43 KiB  | 
							
								
								
									
										307
									
								
								matlab/detail_fem_1_flexible_body.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										307
									
								
								matlab/detail_fem_1_flexible_body.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,307 @@
 | 
			
		||||
%% Clear Workspace and Close figures
 | 
			
		||||
clear; close all; clc;
 | 
			
		||||
 | 
			
		||||
%% Intialize Laplace variable
 | 
			
		||||
s = zpk('s');
 | 
			
		||||
 | 
			
		||||
%% Path for functions, data and scripts
 | 
			
		||||
addpath('./src/'); % Path for scripts
 | 
			
		||||
addpath('./mat/'); % Path for data
 | 
			
		||||
addpath('./STEPS/'); % Path for Simscape Model
 | 
			
		||||
addpath('./subsystems/'); % Path for Subsystems Simulink files
 | 
			
		||||
 | 
			
		||||
%% Linearization options
 | 
			
		||||
opts = linearizeOptions;
 | 
			
		||||
opts.SampleTime = 0;
 | 
			
		||||
 | 
			
		||||
%% Open Simscape Model
 | 
			
		||||
mdl = 'detail_fem_super_element'; % Name of the Simulink File
 | 
			
		||||
open(mdl); % Open Simscape Model
 | 
			
		||||
 | 
			
		||||
%% Colors for the figures
 | 
			
		||||
colors = colororder;
 | 
			
		||||
freqs = logspace(1,3,500); % Frequency vector [Hz]
 | 
			
		||||
 | 
			
		||||
%% Estimate "Sensor Constant" - (THP5H)
 | 
			
		||||
d33 = 680e-12;        % Strain constant [m/V]
 | 
			
		||||
n   = 160;            % Number of layers per stack
 | 
			
		||||
eT  = 4500*8.854e-12; % Permittivity under constant stress [F/m]
 | 
			
		||||
sD  = 21e-12;         % Compliance under constant electric displacement [m2/N]
 | 
			
		||||
 | 
			
		||||
gs = d33/(eT*sD*n);   % Sensor Constant [V/m]
 | 
			
		||||
 | 
			
		||||
%% Estimate "Actuator Constant" - (THP5H)
 | 
			
		||||
d33 = 680e-12;   % Strain constant [m/V]
 | 
			
		||||
n   = 320;       % Number of layers
 | 
			
		||||
 | 
			
		||||
cE  = 1/sD;      % Youngs modulus [N/m^2]
 | 
			
		||||
A   = (10e-3)^2; % Area of the stacks [m^2]
 | 
			
		||||
L   = 40e-3;     % Length of the two stacks [m]
 | 
			
		||||
ka  = cE*A/L;    % Stiffness of the two stacks [N/m]
 | 
			
		||||
 | 
			
		||||
ga = d33*n*ka;   % Actuator Constant [N/V]
 | 
			
		||||
 | 
			
		||||
%% Load reduced order model
 | 
			
		||||
K = readmatrix('APA95ML_K.CSV'); % order: 48
 | 
			
		||||
M = readmatrix('APA95ML_M.CSV');
 | 
			
		||||
[int_xyz, int_i, n_xyz, n_i, nodes] = extractNodes('APA95ML_out_nodes_3D.txt');
 | 
			
		||||
 | 
			
		||||
%% Stiffness estimation
 | 
			
		||||
m = 0.0001; % block-free condition, no payload
 | 
			
		||||
k_support = 1e9;
 | 
			
		||||
c_support = 1e3;
 | 
			
		||||
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Fd'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/y'],  1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
 | 
			
		||||
G = linearize(mdl, io);
 | 
			
		||||
 | 
			
		||||
% The inverse of the DC gain of the transfer function
 | 
			
		||||
% from vertical force to vertical displacement is the axial stiffness of the APA
 | 
			
		||||
k_est = 1/dcgain(G); % [N/m]
 | 
			
		||||
 | 
			
		||||
%% Estimated compliance of the APA95ML
 | 
			
		||||
freqs = logspace(2, log10(5000), 1000);
 | 
			
		||||
 | 
			
		||||
% Get first resonance indice
 | 
			
		||||
i_max = find(abs(squeeze(freqresp(G, freqs(2:end), 'Hz'))) - abs(squeeze(freqresp(G, freqs(1:end-1), 'Hz'))) < 0, 1);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G, freqs, 'Hz'))), 'DisplayName', 'Compliance');
 | 
			
		||||
plot([freqs(1), freqs(end)], [1/k_est, 1/k_est], 'k--', 'DisplayName', sprintf('$1/k$ ($k = %.0f N/\\mu m$)', 1e-6*k_est))
 | 
			
		||||
xline(freqs(i_max), '--', 'linewidth', 1, 'color', [0,0,0], 'DisplayName', sprintf('$f_0 = %.0f$ Hz', freqs(i_max)))
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]');
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
xlim([100, 5000]);
 | 
			
		||||
 | 
			
		||||
%% Estimation of the amplification factor and Stroke
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Fa'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/y'],  1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/d'],  1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
 | 
			
		||||
G = linearize(mdl, io);
 | 
			
		||||
 | 
			
		||||
% Estimated amplification factor
 | 
			
		||||
ampl_factor = abs(dcgain(G(1,1))./dcgain(G(2,1)));
 | 
			
		||||
 | 
			
		||||
% Estimated stroke
 | 
			
		||||
apa_stroke = ampl_factor * 3 * 20e-6; % [m]
 | 
			
		||||
 | 
			
		||||
%% Experimental plant identification
 | 
			
		||||
% with PD200 amplifier (gain of 20) - 2 stacks as an actuator, 1 as a sensor
 | 
			
		||||
load('apa95ml_5kg_2a_1s.mat')
 | 
			
		||||
 | 
			
		||||
Va = 20*u; % Voltage amplifier gain: 20
 | 
			
		||||
 | 
			
		||||
% Spectral Analysis parameters
 | 
			
		||||
Ts = t(end)/(length(t)-1);
 | 
			
		||||
Nfft = floor(1/Ts);
 | 
			
		||||
win = hanning(Nfft);
 | 
			
		||||
Noverlap = floor(Nfft/2);
 | 
			
		||||
 | 
			
		||||
% Identification of the transfer function from Va to di
 | 
			
		||||
[G_y,  f]  = tfestimate(detrend(Va, 0), detrend(y, 0), win, Noverlap, Nfft, 1/Ts);
 | 
			
		||||
[G_Vs, ~]  = tfestimate(detrend(Va, 0), detrend(v, 0), win, Noverlap, Nfft, 1/Ts);
 | 
			
		||||
 | 
			
		||||
%% Plant Identification from Multi-Body model
 | 
			
		||||
% Load Reduced Order Matrices
 | 
			
		||||
K = readmatrix('APA95ML_K.CSV'); % order: 48
 | 
			
		||||
M = readmatrix('APA95ML_M.CSV');
 | 
			
		||||
[int_xyz, int_i, n_xyz, n_i, nodes] = extractNodes('APA95ML_out_nodes_3D.txt');
 | 
			
		||||
 | 
			
		||||
m = 5.5; % Mass of the suspended granite [kg]
 | 
			
		||||
k_support = 4e7;
 | 
			
		||||
c_support = 3e2;
 | 
			
		||||
 | 
			
		||||
% Compute transfer functions
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Va'], 1, 'openinput');  io_i = io_i + 1; % Voltage accros piezo stacks [V]
 | 
			
		||||
io(io_i) = linio([mdl, '/y'],  1, 'openoutput'); io_i = io_i + 1; % Vertical Displacement [m]
 | 
			
		||||
io(io_i) = linio([mdl, '/Vs'], 1, 'openoutput'); io_i = io_i + 1; % Sensor stack voltage [V]
 | 
			
		||||
 | 
			
		||||
Gm = linearize(mdl, io);
 | 
			
		||||
Gm.InputName  = {'Va'};
 | 
			
		||||
Gm.OutputName = {'y', 'Vs'};
 | 
			
		||||
 | 
			
		||||
%% Comparison of the identified transfer function from Va to di to the multi-body model
 | 
			
		||||
freqs = logspace(1, 3, 500);
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, abs(G_y), '-', 'color', [colors(2,:), 0.5], 'linewidth', 2.5, 'DisplayName', 'Measured FRF');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(Gm('y', 'Va'), freqs, 'Hz'))), '--', 'color', colors(2,:), 'DisplayName', 'Model')
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude $y/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
hold off;
 | 
			
		||||
ylim([1e-8, 1e-5]);
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, 180/pi*angle(G_y), '-', 'color' , [colors(2,:), 0.5], 'linewidth', 2.5);
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(Gm('y', 'Va'), freqs, 'Hz'))), '--', 'color', colors(2,:))
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
 | 
			
		||||
hold off;
 | 
			
		||||
yticks(-360:45:360);
 | 
			
		||||
ylim([-45, 180]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
xlim([10, 1e3]);
 | 
			
		||||
 | 
			
		||||
%% Comparison of the identified transfer function from Va to Vs to the multi-body model
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, abs(G_Vs), '-', 'color', [colors(1,:), 0.5], 'linewidth', 2.5, 'DisplayName', 'Measured FRF');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(Gm('Vs', 'Va'), freqs, 'Hz'))), '--', 'color', colors(1,:), 'DisplayName', 'Model')
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude $V_s/V_a$ [V/V]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
hold off;
 | 
			
		||||
ylim([1e-3, 1e1]);
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, 180/pi*angle(G_Vs), '-', 'color', [colors(1,:), 0.5], 'linewidth', 2.5);
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(Gm('Vs', 'Va'), freqs, 'Hz'))), '--', 'color', colors(1,:))
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
 | 
			
		||||
hold off;
 | 
			
		||||
yticks(-360:90:360); ylim([-180, 180]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
xlim([10, 1e3]);
 | 
			
		||||
 | 
			
		||||
%% Integral Force Feedback Controller
 | 
			
		||||
K_iff = (1/(s + 2*2*pi))*(s/(s + 0.5*2*pi));
 | 
			
		||||
K_iff.inputname = {'Vs'};
 | 
			
		||||
K_iff.outputname = {'u_iff'};
 | 
			
		||||
 | 
			
		||||
% New damped plant input
 | 
			
		||||
S1 = sumblk("u = u_iff + u_damp");
 | 
			
		||||
 | 
			
		||||
% Voltage amplifier with gain of 20
 | 
			
		||||
voltage_amplifier = tf(20);
 | 
			
		||||
voltage_amplifier.inputname = {'u'};
 | 
			
		||||
voltage_amplifier.outputname = {'Va'};
 | 
			
		||||
 | 
			
		||||
%% Load experimental data with IFF implemented with different gains
 | 
			
		||||
load('apa95ml_iff_test.mat', 'results');
 | 
			
		||||
 | 
			
		||||
% Tested gains
 | 
			
		||||
g_iff = [0, 10, 50, 100, 500, 1000];
 | 
			
		||||
 | 
			
		||||
% Spectral Analysis parameters
 | 
			
		||||
Ts = t(end)/(length(t)-1);
 | 
			
		||||
Nfft = floor(1/Ts);
 | 
			
		||||
win = hanning(Nfft);
 | 
			
		||||
Noverlap = floor(Nfft/2);
 | 
			
		||||
 | 
			
		||||
%% Computed the identified FRF of the damped plants
 | 
			
		||||
tf_iff = {zeros(1, length(g_iff))};
 | 
			
		||||
for i=1:length(g_iff)
 | 
			
		||||
    [tf_est, f] = tfestimate(results{i}.u, results{i}.y, win, Noverlap, Nfft, 1/Ts);
 | 
			
		||||
    tf_iff(i) = {tf_est};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
%% Estimate the damped plants from the multi-body model
 | 
			
		||||
Gm_iff = {zeros(1, length(g_iff))};
 | 
			
		||||
 | 
			
		||||
for i=1:length(g_iff)
 | 
			
		||||
    K_iff_g = -K_iff*g_iff(i); K_iff_g.inputname = {'Vs'}; K_iff_g.outputname = {'u_iff'};
 | 
			
		||||
    Gm_iff(i) = {connect(Gm, K_iff_g, S1, voltage_amplifier, {'u_damp'}, {'y'})};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
%% Identify second order plants from the experimental data
 | 
			
		||||
% This is mandatory to estimate the experimental "poles"
 | 
			
		||||
% an place them in the root-locus plot
 | 
			
		||||
G_id = {zeros(1,length(results))};
 | 
			
		||||
 | 
			
		||||
f_start = 70; % [Hz]
 | 
			
		||||
f_end = 500; % [Hz]
 | 
			
		||||
 | 
			
		||||
for i = 1:length(results)
 | 
			
		||||
    tf_id = tf_iff{i}(sum(f<f_start):length(f)-sum(f>f_end));
 | 
			
		||||
    f_id = f(sum(f<f_start):length(f)-sum(f>f_end));
 | 
			
		||||
 | 
			
		||||
    gfr = idfrd(tf_id, 2*pi*f_id, Ts);
 | 
			
		||||
    G_id(i) = {procest(gfr,'P2UDZ')};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
%% Comparison of the Root-Locus computed from the multi-body model and the identified closed-loop poles
 | 
			
		||||
gains = logspace(0, 5, 1000);
 | 
			
		||||
figure;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(real( pole(Gm('Vs', 'Va'))), imag( pole(Gm('Vs', 'Va'))), 'kx', 'HandleVisibility', 'off');
 | 
			
		||||
plot(real(tzero(Gm('Vs', 'Va'))), imag(tzero(Gm('Vs', 'Va'))), 'ko', 'HandleVisibility', 'off');
 | 
			
		||||
for i = 1:length(gains)
 | 
			
		||||
    cl_poles = pole(feedback(Gm('Vs', 'Va'), gains(i)*K_iff));
 | 
			
		||||
    plot(real(cl_poles(imag(cl_poles)>100)), imag(cl_poles(imag(cl_poles)>100)), 'k.', 'HandleVisibility', 'off');
 | 
			
		||||
end
 | 
			
		||||
for i = 1:length(g_iff)
 | 
			
		||||
    cl_poles = pole(Gm_iff{i});
 | 
			
		||||
    plot(real(cl_poles(imag(cl_poles)>100)), imag(cl_poles(imag(cl_poles)>100)), '.', 'MarkerSize', 20, 'color', colors(i,:), 'HandleVisibility', 'off');
 | 
			
		||||
    plot(real(pole(G_id{i})), imag(pole(G_id{i})), 'x', 'color', colors(i,:), 'DisplayName', sprintf('g = %0.f', g_iff(i)), 'DisplayName', sprintf('$g = %.0f$', g_iff(i)));
 | 
			
		||||
end
 | 
			
		||||
xlabel('Real Part');
 | 
			
		||||
ylabel('Imaginary Part');
 | 
			
		||||
axis equal;
 | 
			
		||||
ylim([-100, 2100]);
 | 
			
		||||
xlim([-2100,100]);
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
%% Experimental damped plant for several IFF gains and estimated damped plants from the model
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2, 1]);
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, abs(tf_iff{1}), '-', 'DisplayName', '$g = 0$', 'color', [0,0,0, 0.5], 'linewidth', 2.5)
 | 
			
		||||
plot(f, abs(squeeze(freqresp(Gm_iff{1}, f, 'Hz'))), 'k--', 'HandleVisibility', 'off')
 | 
			
		||||
for i = 2:length(results)
 | 
			
		||||
    plot(f, abs(tf_iff{i}), '-', 'DisplayName', sprintf('g = %0.f', g_iff(i)), 'color', [colors(i-1,:), 0.5], 'linewidth', 2.5)
 | 
			
		||||
end
 | 
			
		||||
for i = 2:length(results)
 | 
			
		||||
    plot(f, abs(squeeze(freqresp(Gm_iff{i}, f, 'Hz'))), '--', 'color', colors(i-1,:), 'HandleVisibility', 'off')
 | 
			
		||||
end
 | 
			
		||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
 | 
			
		||||
ylabel('Amplitude $y/V_a$ [m/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
hold off;
 | 
			
		||||
ylim([1e-6, 2e-4]);
 | 
			
		||||
leg = legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, 180/pi*angle(tf_iff{1}./squeeze(freqresp(exp(-s*2e-4), f, 'Hz'))), '-', 'color', [0,0,0, 0.5], 'linewidth', 2.5)
 | 
			
		||||
plot(f, 180/pi*angle(squeeze(freqresp(Gm_iff{1}, f, 'Hz'))), 'k--')
 | 
			
		||||
for i = 2:length(results)
 | 
			
		||||
    plot(f, 180/pi*angle(tf_iff{i}./squeeze(freqresp(exp(-s*2e-4), f, 'Hz'))), '-', 'color', [colors(i-1,:), 0.5], 'linewidth', 2.5)
 | 
			
		||||
    plot(f, 180/pi*angle(squeeze(freqresp(Gm_iff{i}, f, 'Hz'))), '--', 'color', colors(i-1,:))
 | 
			
		||||
end
 | 
			
		||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
hold off;
 | 
			
		||||
yticks(-360:45:360);
 | 
			
		||||
ylim([-10, 190]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2], 'x');
 | 
			
		||||
xlim([150, 500]);
 | 
			
		||||
							
								
								
									
										318
									
								
								matlab/detail_fem_2_actuators.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										318
									
								
								matlab/detail_fem_2_actuators.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,318 @@
 | 
			
		||||
%% Clear Workspace and Close figures
 | 
			
		||||
clear; close all; clc;
 | 
			
		||||
 | 
			
		||||
%% Intialize Laplace variable
 | 
			
		||||
s = zpk('s');
 | 
			
		||||
 | 
			
		||||
%% Path for functions, data and scripts
 | 
			
		||||
addpath('./src/'); % Path for scripts
 | 
			
		||||
addpath('./mat/'); % Path for data
 | 
			
		||||
addpath('./STEPS/'); % Path for Simscape Model
 | 
			
		||||
addpath('./subsystems/'); % Path for Subsystems Simulink files
 | 
			
		||||
 | 
			
		||||
%% Linearization options
 | 
			
		||||
opts = linearizeOptions;
 | 
			
		||||
opts.SampleTime = 0;
 | 
			
		||||
 | 
			
		||||
%% Open Simscape Model
 | 
			
		||||
mdl = 'detail_fem_APA300ML'; % Name of the Simulink File
 | 
			
		||||
open(mdl); % Open Simscape Model
 | 
			
		||||
 | 
			
		||||
% Piezoelectric parameters
 | 
			
		||||
ga = -25.9; % [N/V]
 | 
			
		||||
gs = -5.08e6; % [V/m]
 | 
			
		||||
 | 
			
		||||
%% Colors for the figures
 | 
			
		||||
colors = colororder;
 | 
			
		||||
freqs = logspace(1,3,500); % Frequency vector [Hz]
 | 
			
		||||
 | 
			
		||||
%% Identify dynamics with "Reduced Order Flexible Body"
 | 
			
		||||
K = readmatrix('APA300ML_mat_K.CSV');
 | 
			
		||||
M = readmatrix('APA300ML_mat_M.CSV');
 | 
			
		||||
[int_xyz, int_i, n_xyz, n_i, nodes] = extractNodes('APA300ML_out_nodes_3D.txt');
 | 
			
		||||
 | 
			
		||||
m = 5; % [kg]
 | 
			
		||||
ga = 25.9; % [N/V]
 | 
			
		||||
gs = 5.08e6; % [V/m]
 | 
			
		||||
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Va'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Fd'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/z'], 1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Vs'], 1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
 | 
			
		||||
G_fem = linearize(mdl, io);
 | 
			
		||||
G_fem_z = G_fem('z','Va');
 | 
			
		||||
G_fem_Vs = G_fem('Vs', 'Va');
 | 
			
		||||
G_fem_comp = G_fem('z', 'Fd');
 | 
			
		||||
 | 
			
		||||
%% Determine c1 and k1 from the zero
 | 
			
		||||
G_zeros = zero(minreal(G_fem_Vs));
 | 
			
		||||
G_zeros = G_zeros(imag(G_zeros)>0);
 | 
			
		||||
[~, i_sort] = sort(imag(G_zeros));
 | 
			
		||||
G_zeros = G_zeros(i_sort);
 | 
			
		||||
G_zero = G_zeros(1);
 | 
			
		||||
 | 
			
		||||
% Solving 2nd order equations
 | 
			
		||||
c1 = -2*m*real(G_zero);
 | 
			
		||||
k1 = m*(imag(G_zero)^2 + real(G_zero)^2);
 | 
			
		||||
 | 
			
		||||
%% Determine ka, ke, ca, ce from the first pole
 | 
			
		||||
G_poles = pole(minreal(G_fem_z));
 | 
			
		||||
G_poles = G_poles(imag(G_poles)>0);
 | 
			
		||||
[~, i_sort] = sort(imag(G_poles));
 | 
			
		||||
G_poles = G_poles(i_sort);
 | 
			
		||||
G_pole = G_poles(1);
 | 
			
		||||
 | 
			
		||||
% Solving 2nd order equations
 | 
			
		||||
ce = 3*(-2*m*real(G_pole(1)) - c1);
 | 
			
		||||
ca = 1/2*ce;
 | 
			
		||||
 | 
			
		||||
ke = 3*(m*(imag(G_pole)^2 + real(G_pole)^2) - k1);
 | 
			
		||||
ka = 1/2*ke;
 | 
			
		||||
 | 
			
		||||
%% Matching sensor/actuator constants
 | 
			
		||||
% ga = dcgain(G_fem_z) / (1/(ka + k1*ke/(k1 + ke)));
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/Fa'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/z'], 1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
ga = dcgain(G_fem_z)/dcgain(linearize([mdl, '_2dof'], io));
 | 
			
		||||
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/Va'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/dL'], 1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
gs = dcgain(G_fem_Vs)/dcgain(linearize([mdl, '_2dof'], io));
 | 
			
		||||
 | 
			
		||||
%% Identify dynamics with tuned 2DoF model
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/Va'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/Fd'], 1, 'openinput');  io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/z'], 1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
io(io_i) = linio([mdl, '_2dof', '/Vs'], 1, 'openoutput'); io_i = io_i + 1;
 | 
			
		||||
 | 
			
		||||
G_2dof = linearize([mdl, '_2dof'], io);
 | 
			
		||||
G_2dof_z = G_2dof('z','Va');
 | 
			
		||||
G_2dof_Vs = G_2dof('Vs', 'Va');
 | 
			
		||||
G_2dof_comp = G_2dof('z', 'Fd');
 | 
			
		||||
 | 
			
		||||
%% Comparison of the transfer functions from Va to vertical motion - FEM vs 2DoF
 | 
			
		||||
freqs = logspace(1, 3, 500);
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_fem_z, freqs, 'Hz'))), '-', 'color', [colors(2,:), 0.5], 'linewidth', 2.5, 'DisplayName', 'FEM')
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_2dof_z, freqs, 'Hz'))), '--', 'color', colors(2,:), 'DisplayName', '2DoF Model')
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude $y/V_a$ [m/V]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
hold off;
 | 
			
		||||
ylim([1e-8, 2e-4]);
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_fem_z, freqs, 'Hz')))), '-', 'color', [colors(2,:), 0.5], 'linewidth', 2.5);
 | 
			
		||||
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_2dof_z, freqs, 'Hz')))), '--', 'color', colors(2,:))
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
 | 
			
		||||
hold off;
 | 
			
		||||
yticks(-360:45:360); ylim([-20, 200]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
xlim([10, 1e3]);
 | 
			
		||||
 | 
			
		||||
%% Comparison of the transfer functions from Va to Vs - FEM vs 2DoF
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_fem_Vs, freqs, 'Hz'))), '-', 'color', [colors(1,:), 0.5], 'linewidth', 2.5, 'DisplayName', 'FEM');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_2dof_Vs, freqs, 'Hz'))), '--', 'color', colors(1,:), 'DisplayName', '2DoF Model')
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude $V_s/V_a$ [V/V]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
hold off;
 | 
			
		||||
ylim([6e-4, 3e1]);
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_fem_Vs, freqs, 'Hz')))), '-', 'color', [colors(1,:), 0.5], 'linewidth', 2.5);
 | 
			
		||||
plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_2dof_Vs, freqs, 'Hz')))), '--', 'color', colors(1,:))
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
xlabel('Frequency [Hz]'); ylabel('Phase [deg]');
 | 
			
		||||
hold off;
 | 
			
		||||
yticks(-360:45:360); ylim([-20, 200]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
xlim([10, 1e3]);
 | 
			
		||||
 | 
			
		||||
%% Effect of electrical boundaries on the
 | 
			
		||||
oc = load('detail_fem_apa95ml_open_circuit.mat',  't', 'encoder', 'u');
 | 
			
		||||
sc = load('detail_fem_apa95ml_short_circuit.mat', 't', 'encoder', 'u');
 | 
			
		||||
 | 
			
		||||
% Spectral Analysis parameters
 | 
			
		||||
Ts = sc.t(end)/(length(sc.t)-1);
 | 
			
		||||
Nfft = floor(2/Ts);
 | 
			
		||||
win = hanning(Nfft);
 | 
			
		||||
Noverlap = floor(Nfft/2);
 | 
			
		||||
 | 
			
		||||
% Identification of the transfer function from Va to di
 | 
			
		||||
[G_oc,  f]  = tfestimate(detrend(oc.u, 0), detrend(oc.encoder, 0), win, Noverlap, Nfft, 1/Ts);
 | 
			
		||||
[G_sc,  f]  = tfestimate(detrend(sc.u, 0), detrend(sc.encoder, 0), win, Noverlap, Nfft, 1/Ts);
 | 
			
		||||
 | 
			
		||||
% Find resonance frequencies
 | 
			
		||||
[~, i_oc] = max(abs(G_oc(f<300)));
 | 
			
		||||
[~, i_sc] = max(abs(G_sc(f<300)));
 | 
			
		||||
 | 
			
		||||
%% Effect of the electrical bondaries of the force sensor stack on the APA95ML resonance frequency
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, abs(G_oc), '-', 'DisplayName', sprintf('Open-Circuit - $f_0 = %.1f Hz$', f(i_oc)))
 | 
			
		||||
plot(f, abs(G_sc), '-', 'DisplayName', sprintf('Short-Circuit - $f_0 = %.1f Hz$', f(i_sc)))
 | 
			
		||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'log');
 | 
			
		||||
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
hold off;
 | 
			
		||||
ylim([1e-6, 1e-4]);
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(f, 180/pi*angle(G_oc), '-')
 | 
			
		||||
plot(f, 180/pi*angle(G_sc), '-')
 | 
			
		||||
set(gca, 'Xscale', 'log'); set(gca, 'Yscale', 'lin');
 | 
			
		||||
ylabel('Phase'); xlabel('Frequency [Hz]');
 | 
			
		||||
hold off;
 | 
			
		||||
yticks(-360:45:360);
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
axis padded 'auto x'
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2], 'x');
 | 
			
		||||
xlim([100, 300]);
 | 
			
		||||
 | 
			
		||||
%% Compare Dynamics between "Reduced Order" flexible joints and "2-dof and 3-dof" joints
 | 
			
		||||
% Let's initialize all the stages with default parameters.
 | 
			
		||||
initializeGround('type', 'rigid');
 | 
			
		||||
initializeGranite('type', 'rigid');
 | 
			
		||||
initializeTy('type', 'rigid');
 | 
			
		||||
initializeRy('type', 'rigid');
 | 
			
		||||
initializeRz('type', 'rigid');
 | 
			
		||||
initializeMicroHexapod('type', 'rigid');
 | 
			
		||||
initializeSample('m', 50);
 | 
			
		||||
 | 
			
		||||
initializeSimscapeConfiguration();
 | 
			
		||||
initializeDisturbances('enable', false);
 | 
			
		||||
initializeLoggingConfiguration('log', 'none');
 | 
			
		||||
initializeController('type', 'open-loop');
 | 
			
		||||
initializeReferences();
 | 
			
		||||
 | 
			
		||||
mdl = 'detail_fem_nass';
 | 
			
		||||
 | 
			
		||||
% Input/Output definition
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Controller'],     1, 'openinput');              io_i = io_i + 1; % Actuator Inputs
 | 
			
		||||
io(io_i) = linio([mdl, '/Tracking Error'], 1, 'openoutput', [], 'EdL');  io_i = io_i + 1; % Errors in the frame of the struts
 | 
			
		||||
io(io_i) = linio([mdl, '/NASS'],       3, 'openoutput', [], 'fn');  io_i = io_i + 1; % Force Sensors
 | 
			
		||||
 | 
			
		||||
% Flexible actuators
 | 
			
		||||
initializeSimplifiedNanoHexapod('actuator_type', 'flexible', ...
 | 
			
		||||
            'flex_type_F', '2dof', ...
 | 
			
		||||
            'flex_type_M', '3dof');
 | 
			
		||||
 | 
			
		||||
G_flex = linearize(mdl, io);
 | 
			
		||||
G_flex.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
G_flex.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
 | 
			
		||||
% Actuators modeled as 2DoF system
 | 
			
		||||
initializeSimplifiedNanoHexapod('actuator_type', 'apa300ml', ...
 | 
			
		||||
            'flex_type_F', '2dof', ...
 | 
			
		||||
            'flex_type_M', '3dof');
 | 
			
		||||
 | 
			
		||||
G_ideal = linearize(mdl, io);
 | 
			
		||||
G_ideal.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
G_ideal.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
 | 
			
		||||
%% Comparison of the dynamics for actuators modeled using "reduced order flexible body" and using 2DoF system - HAC plant
 | 
			
		||||
freqs = logspace(1, 4, 1000);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for j = 1:5
 | 
			
		||||
    for k = j+1:6
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_flex("l"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(1,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_ideal("l"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(2,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_flex("l1","f1"), freqs, 'Hz'))), 'color', colors(1,:), 'DisplayName', 'FEM');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_ideal("l1","f1"), freqs, 'Hz'))), 'color', colors(2,:), 'DisplayName', '2-DoF');
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'northeast', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-10, 1e-4]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_flex("l1","f1"), freqs, 'Hz'))));
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ideal("l1","f1"), freqs, 'Hz'))));
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
 | 
			
		||||
%% Comparison of the dynamics for actuators modeled using "reduced order flexible body" and using 2DoF system - IFF plant
 | 
			
		||||
freqs = logspace(0, 3, 1000);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for j = 1:5
 | 
			
		||||
    for k = j+1:6
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_flex("fm"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(1,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_ideal("fm"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(2,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_flex("fm1","f1"), freqs, 'Hz'))), 'color', colors(1,:), 'DisplayName', 'FEM');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_ideal("fm1","f1"), freqs, 'Hz'))), 'color', colors(2,:), 'DisplayName', '2-DoF');
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-5, 1e1]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_flex("fm1","f1"), freqs, 'Hz'))));
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ideal("fm1","f1"), freqs, 'Hz'))));
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
							
								
								
									
										623
									
								
								matlab/detail_fem_3_flexible_joints.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										623
									
								
								matlab/detail_fem_3_flexible_joints.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,623 @@
 | 
			
		||||
%% Clear Workspace and Close figures
 | 
			
		||||
clear; close all; clc;
 | 
			
		||||
 | 
			
		||||
%% Intialize Laplace variable
 | 
			
		||||
s = zpk('s');
 | 
			
		||||
 | 
			
		||||
%% Path for functions, data and scripts
 | 
			
		||||
addpath('./src/'); % Path for scripts
 | 
			
		||||
addpath('./mat/'); % Path for data
 | 
			
		||||
addpath('./STEPS/'); % Path for Simscape Model
 | 
			
		||||
addpath('./subsystems/'); % Path for Subsystems Simulink files
 | 
			
		||||
 | 
			
		||||
%% Linearization options
 | 
			
		||||
opts = linearizeOptions;
 | 
			
		||||
opts.SampleTime = 0;
 | 
			
		||||
 | 
			
		||||
%% Open Simscape Model
 | 
			
		||||
mdl = 'detail_fem_nass'; % Name of the Simulink File
 | 
			
		||||
open(mdl); % Open Simscape Model
 | 
			
		||||
 | 
			
		||||
%% Colors for the figures
 | 
			
		||||
colors = colororder;
 | 
			
		||||
freqs = logspace(1,3,500); % Frequency vector [Hz]
 | 
			
		||||
 | 
			
		||||
%% Identify the dynamics for several considered bending stiffnesses
 | 
			
		||||
% Let's initialize all the stages with default parameters.
 | 
			
		||||
initializeGround('type', 'rigid');
 | 
			
		||||
initializeGranite('type', 'rigid');
 | 
			
		||||
initializeTy('type', 'rigid');
 | 
			
		||||
initializeRy('type', 'rigid');
 | 
			
		||||
initializeRz('type', 'rigid');
 | 
			
		||||
initializeMicroHexapod('type', 'rigid');
 | 
			
		||||
initializeSample('m', 50);
 | 
			
		||||
 | 
			
		||||
initializeSimscapeConfiguration();
 | 
			
		||||
initializeDisturbances('enable', false);
 | 
			
		||||
initializeLoggingConfiguration('log', 'none');
 | 
			
		||||
initializeController('type', 'open-loop');
 | 
			
		||||
initializeReferences();
 | 
			
		||||
 | 
			
		||||
% Input/Output definition
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Controller'],     1, 'openinput');              io_i = io_i + 1; % Actuator Inputs
 | 
			
		||||
io(io_i) = linio([mdl, '/Tracking Error'], 1, 'openoutput', [], 'EdL');  io_i = io_i + 1; % Errors in the frame of the struts
 | 
			
		||||
io(io_i) = linio([mdl, '/NASS'],       3, 'openoutput', [], 'fn');  io_i = io_i + 1; % Force Sensors
 | 
			
		||||
 | 
			
		||||
% Effect of bending stiffness
 | 
			
		||||
Kf = [0, 50, 100, 500]; % [Nm/rad]
 | 
			
		||||
G_Kf = {zeros(length(Kf), 1)};
 | 
			
		||||
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    % Limited joint axial compliance
 | 
			
		||||
    initializeSimplifiedNanoHexapod('actuator_type', '1dof', ...
 | 
			
		||||
                          'flex_type_F', '2dof', ...
 | 
			
		||||
                          'flex_type_M', '3dof', ...
 | 
			
		||||
                          'actuator_k', 1e6, ...
 | 
			
		||||
                          'actuator_c', 1e1, ...
 | 
			
		||||
                          'actuator_kp', 0, ...
 | 
			
		||||
                          'actuator_cp', 0, ...
 | 
			
		||||
                          'Fsm', 56e-3, ... % APA300ML weight 112g
 | 
			
		||||
                          'Msm', 56e-3, ...
 | 
			
		||||
                          'Kf_F', Kf(i), ...
 | 
			
		||||
                          'Kf_M', Kf(i));
 | 
			
		||||
 | 
			
		||||
    G_Kf(i) = {linearize(mdl, io)};
 | 
			
		||||
    G_Kf{i}.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
    G_Kf{i}.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
freqs = logspace(0, 3, 1000);
 | 
			
		||||
 | 
			
		||||
%% Effect of the flexible joint bending stiffness on the HAC-plant
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    for j = 1:5
 | 
			
		||||
        for k = j+1:6
 | 
			
		||||
            plot(freqs, abs(squeeze(freqresp(G_Kf{i}("l"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(i,:), 0.1], ...
 | 
			
		||||
                 'HandleVisibility', 'off');
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    plot(freqs, abs(squeeze(freqresp(G_Kf{i}("l1","f1"), freqs, 'Hz'))), 'color', colors(i,:), 'DisplayName', sprintf('$k_f = %.0f $ [Nm/rad]', Kf(i)));
 | 
			
		||||
    for j = 2:6
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_Kf{i}("l"+j,"f"+j), freqs, 'Hz'))), 'color', colors(i,:), 'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-10, 1e-4]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_Kf{i}(1, 1), freqs, 'Hz')))));
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-200, 20]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
 | 
			
		||||
%% Effect of the flexible joint bending stiffness on the IFF plant
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    for j = 1:5
 | 
			
		||||
        for k = j+1:6
 | 
			
		||||
            plot(freqs, abs(squeeze(freqresp(G_Kf{i}("fm"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(i,:), 0.1], ...
 | 
			
		||||
                 'HandleVisibility', 'off');
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    plot(freqs, abs(squeeze(freqresp(G_Kf{i}("fm1","f1"), freqs, 'Hz'))), 'color', colors(i,:), 'DisplayName', sprintf('$k_f = %.0f $ [Nm/rad]', Kf(i)));
 | 
			
		||||
    for j = 2:6
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_Kf{i}("fm"+j,"f"+j), freqs, 'Hz'))), 'color', colors(i,:), 'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-4, 1e2]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile();
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_Kf{i}("fm1", "f1"), freqs, 'Hz')))));
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
 | 
			
		||||
%% Decentalized IFF
 | 
			
		||||
Kiff = -200 * ...              % Gain
 | 
			
		||||
       1/s * ... % LPF: provides integral action
 | 
			
		||||
       eye(6);                 % Diagonal 6x6 controller (i.e. decentralized)
 | 
			
		||||
 | 
			
		||||
Kiff.InputName = {'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
Kiff.OutputName = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
 | 
			
		||||
%% Root Locus for decentralized IFF - 1dof actuator - Effect of joint bending stiffness
 | 
			
		||||
gains = logspace(-1, 2, 400);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(1, 1, 'TileSpacing', 'compact', 'Padding', 'None');
 | 
			
		||||
nexttile();
 | 
			
		||||
hold on;
 | 
			
		||||
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    plot(real(pole(G_Kf{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))),  imag(pole(G_Kf{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))),  'x', 'color', colors(i,:), ...
 | 
			
		||||
        'DisplayName', sprintf('$k_f = %.0f$ Nm/rad', Kf(i)));
 | 
			
		||||
    plot(real(tzero(G_Kf{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))), imag(tzero(G_Kf{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))), 'o', 'color', colors(i,:), ...
 | 
			
		||||
        'HandleVisibility', 'off');
 | 
			
		||||
 | 
			
		||||
    for g = gains
 | 
			
		||||
        clpoles = pole(feedback(G_Kf{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}), g*Kiff, +1));
 | 
			
		||||
        plot(real(clpoles), imag(clpoles), '.', 'color', colors(i,:), ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
xline(0, 'HandleVisibility', 'off'); yline(0, 'HandleVisibility', 'off');
 | 
			
		||||
hold off;
 | 
			
		||||
axis equal;
 | 
			
		||||
xlim(1.1*[-900, 100]); ylim(1.1*[-100, 900]);
 | 
			
		||||
xticks(1.1*[-900:100:0]);
 | 
			
		||||
yticks(1.1*[0:100:900]);
 | 
			
		||||
set(gca, 'XTickLabel',[]); set(gca, 'YTickLabel',[]);
 | 
			
		||||
xlabel('Real part'); ylabel('Imaginary part');
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
%% Identify the dynamics for several considered bending stiffnesses - APA300ML
 | 
			
		||||
G_Kf_apa300ml = {zeros(length(Kf), 1)};
 | 
			
		||||
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    % Limited joint axial compliance
 | 
			
		||||
    initializeSimplifiedNanoHexapod('actuator_type', 'apa300ml', ...
 | 
			
		||||
                          'flex_type_F', '2dof', ...
 | 
			
		||||
                          'flex_type_M', '3dof', ...
 | 
			
		||||
                          'Fsm', 56e-3, ... % APA300ML weight 112g
 | 
			
		||||
                          'Msm', 56e-3, ...
 | 
			
		||||
                          'Kf_F', Kf(i), ...
 | 
			
		||||
                          'Kf_M', Kf(i));
 | 
			
		||||
 | 
			
		||||
    G_Kf_apa300ml(i) = {linearize(mdl, io)};
 | 
			
		||||
    G_Kf_apa300ml{i}.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
    G_Kf_apa300ml{i}.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Kiff = -1000 * ...              % Gain
 | 
			
		||||
       1/(s) * ... % LPF: provides integral action
 | 
			
		||||
       eye(6);                 % Diagonal 6x6 controller (i.e. decentralized)
 | 
			
		||||
 | 
			
		||||
Kiff.InputName = {'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
Kiff.OutputName = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
 | 
			
		||||
%% Root Locus for decentralized IFF - APA300ML actuator - Effect of joint bending stiffness
 | 
			
		||||
gains = logspace(-1, 2, 300);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(1, 1, 'TileSpacing', 'compact', 'Padding', 'None');
 | 
			
		||||
nexttile();
 | 
			
		||||
hold on;
 | 
			
		||||
 | 
			
		||||
for i = 1:length(Kf)
 | 
			
		||||
    plot(real(pole(G_Kf_apa300ml{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))),  imag(pole(G_Kf_apa300ml{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))),  'x', 'color', colors(i,:), ...
 | 
			
		||||
        'DisplayName', sprintf('$k_f = %.0f$ [Nm/rad]', Kf(i)));
 | 
			
		||||
    plot(real(tzero(G_Kf_apa300ml{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))), imag(tzero(G_Kf_apa300ml{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))), 'o', 'color', colors(i,:), ...
 | 
			
		||||
        'HandleVisibility', 'off');
 | 
			
		||||
 | 
			
		||||
    for g = gains
 | 
			
		||||
        clpoles = pole(feedback(G_Kf_apa300ml{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}), g*Kiff, +1));
 | 
			
		||||
        plot(real(clpoles), imag(clpoles), '.', 'color', colors(i,:), ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
xline(0, 'HandleVisibility', 'off'); yline(0, 'HandleVisibility', 'off');
 | 
			
		||||
hold off;
 | 
			
		||||
axis equal;
 | 
			
		||||
xlim(1.4*[-900, 100]); ylim(1.4*[-100, 900]);
 | 
			
		||||
xticks(1.4*[-900:100:0]);
 | 
			
		||||
yticks(1.4*[0:100:900]);
 | 
			
		||||
set(gca, 'XTickLabel',[]); set(gca, 'YTickLabel',[]);
 | 
			
		||||
xlabel('Real part'); ylabel('Imaginary part');
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
%% Identify the dynamics for several considered axial stiffnesses
 | 
			
		||||
% Let's initialize all the stages with default parameters.
 | 
			
		||||
initializeGround('type', 'rigid');
 | 
			
		||||
initializeGranite('type', 'rigid');
 | 
			
		||||
initializeTy('type', 'rigid');
 | 
			
		||||
initializeRy('type', 'rigid');
 | 
			
		||||
initializeRz('type', 'rigid');
 | 
			
		||||
initializeMicroHexapod('type', 'rigid');
 | 
			
		||||
initializeSample('m', 50);
 | 
			
		||||
 | 
			
		||||
initializeSimscapeConfiguration();
 | 
			
		||||
initializeDisturbances('enable', false);
 | 
			
		||||
initializeLoggingConfiguration('log', 'none');
 | 
			
		||||
initializeController('type', 'open-loop');
 | 
			
		||||
initializeReferences();
 | 
			
		||||
 | 
			
		||||
% Input/Output definition
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Controller'],     1, 'openinput');              io_i = io_i + 1; % Actuator Inputs
 | 
			
		||||
io(io_i) = linio([mdl, '/Tracking Error'], 1, 'openoutput', [], 'EdL');  io_i = io_i + 1; % Errors in the frame of the struts
 | 
			
		||||
io(io_i) = linio([mdl, '/NASS'],       3, 'openoutput', [], 'fn');  io_i = io_i + 1; % Force Sensors
 | 
			
		||||
 | 
			
		||||
% Effect of bending stiffness
 | 
			
		||||
Ka = 1e6*[1000, 100, 10, 1]; % [Nm/rad]
 | 
			
		||||
G_Ka = {zeros(length(Ka), 1)};
 | 
			
		||||
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    % Limited joint axial compliance
 | 
			
		||||
    initializeSimplifiedNanoHexapod('actuator_type', '1dof', ...
 | 
			
		||||
                          'flex_type_F', '2dof_axial', ...
 | 
			
		||||
                          'flex_type_M', '4dof', ...
 | 
			
		||||
                          'actuator_k', 1e6, ...
 | 
			
		||||
                          'actuator_c', 1e1, ...
 | 
			
		||||
                          'actuator_kp', 0, ...
 | 
			
		||||
                          'actuator_cp', 0, ...
 | 
			
		||||
                          'Fsm', 56e-3, ... % APA300ML weight 112g
 | 
			
		||||
                          'Msm', 56e-3, ...
 | 
			
		||||
                          'Ca_F', 1, ...
 | 
			
		||||
                          'Ca_M', 1, ...
 | 
			
		||||
                          'Ka_F', Ka(i), ...
 | 
			
		||||
                          'Ka_M', Ka(i));
 | 
			
		||||
 | 
			
		||||
    G_Ka(i) = {linearize(mdl, io)};
 | 
			
		||||
    G_Ka{i}.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
    G_Ka{i}.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
freqs = logspace(1, 4, 1000);
 | 
			
		||||
 | 
			
		||||
%% Effect of the flexible joint axial stiffness on the HAC-plant
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    for j = 1:5
 | 
			
		||||
        for k = j+1:6
 | 
			
		||||
            plot(freqs, abs(squeeze(freqresp(G_Ka{i}("l"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(i,:), 0.1], ...
 | 
			
		||||
                 'HandleVisibility', 'off');
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    plot(freqs, abs(squeeze(freqresp(G_Ka{i}("l1","f1"), freqs, 'Hz'))), 'color', colors(i,:), 'DisplayName', sprintf('$k_a = %.0f$ [N/$\\mu$m]', 1e-6*Ka(i)));
 | 
			
		||||
    % for j = 2:6
 | 
			
		||||
    %     plot(freqs, abs(squeeze(freqresp(G_Ka{i}("l"+j,"f"+j), freqs, 'Hz'))), 'color', colors(i,:), 'HandleVisibility', 'off');
 | 
			
		||||
    % end
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-10, 1e-4]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_Ka{i}(1, 1), freqs, 'Hz')))));
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-200, 20]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
 | 
			
		||||
%% Effect of the flexible joint axial stiffness on the IFF plant
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    for j = 1:5
 | 
			
		||||
        for k = j+1:6
 | 
			
		||||
            plot(freqs, abs(squeeze(freqresp(G_Ka{i}("fm"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(i,:), 0.1], ...
 | 
			
		||||
                 'HandleVisibility', 'off');
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    plot(freqs, abs(squeeze(freqresp(G_Ka{i}("fm1","f1"), freqs, 'Hz'))), 'color', colors(i,:), 'DisplayName', sprintf('$k_a = %.0f$ [N/$\\mu$m]', 1e-6*Ka(i)));
 | 
			
		||||
    % for j = 2:6
 | 
			
		||||
    %     plot(freqs, abs(squeeze(freqresp(G_Ka{i}("fm"+j,"f"+j), freqs, 'Hz'))), 'color', colors(i,:), 'HandleVisibility', 'off');
 | 
			
		||||
    % end
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-4, 1e2]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile();
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    plot(freqs, 180/pi*unwrap(angle(squeeze(freqresp(G_Ka{i}("fm1", "f1"), freqs, 'Hz')))));
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
 | 
			
		||||
%% Decentalized IFF
 | 
			
		||||
Kiff = -200 * ...              % Gain
 | 
			
		||||
       1/s * ... % LPF: provides integral action
 | 
			
		||||
       eye(6);                 % Diagonal 6x6 controller (i.e. decentralized)
 | 
			
		||||
 | 
			
		||||
Kiff.InputName = {'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
Kiff.OutputName = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
 | 
			
		||||
%% Root Locus for decentralized IFF - 1dof actuator - Effect of joint bending stiffness
 | 
			
		||||
gains = logspace(-1, 2, 400);
 | 
			
		||||
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(1, 1, 'TileSpacing', 'compact', 'Padding', 'None');
 | 
			
		||||
nexttile();
 | 
			
		||||
hold on;
 | 
			
		||||
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    plot(real(pole(G_Ka{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))),  imag(pole(G_Ka{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))),  'x', 'color', colors(i,:), ...
 | 
			
		||||
        'DisplayName', sprintf('$k_a = %.0f$ N/$\\mu$m', 1e-6*Ka(i)));
 | 
			
		||||
    plot(real(tzero(G_Ka{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))), imag(tzero(G_Ka{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}))), 'o', 'color', colors(i,:), ...
 | 
			
		||||
        'HandleVisibility', 'off');
 | 
			
		||||
 | 
			
		||||
    for g = gains
 | 
			
		||||
        clpoles = pole(feedback(G_Ka{i}({"fm1", "fm2", "fm3", "fm4", "fm5", "fm6"}, {"f1", "f2", "f3", "f4", "f5", "f6"}), g*Kiff, +1));
 | 
			
		||||
        plot(real(clpoles), imag(clpoles), '.', 'color', colors(i,:), ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
xline(0, 'HandleVisibility', 'off'); yline(0, 'HandleVisibility', 'off');
 | 
			
		||||
hold off;
 | 
			
		||||
axis equal;
 | 
			
		||||
xlim(1.1*[-900, 100]); ylim(1.1*[-100, 900]);
 | 
			
		||||
xticks(1.1*[-900:100:0]);
 | 
			
		||||
yticks(1.1*[0:100:900]);
 | 
			
		||||
set(gca, 'XTickLabel',[]); set(gca, 'YTickLabel',[]);
 | 
			
		||||
xlabel('Real part'); ylabel('Imaginary part');
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
%% Compute the damped plants
 | 
			
		||||
Kiff = -500 * ...              % Gain
 | 
			
		||||
       1/(s + 2*pi*0.1) * ... % LPF: provides integral action
 | 
			
		||||
       eye(6);                 % Diagonal 6x6 controller (i.e. decentralized)
 | 
			
		||||
 | 
			
		||||
Kiff.InputName = {'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
Kiff.OutputName = {'u1iff', 'u2iff', 'u3iff', 'u4iff', 'u5iff', 'u6iff'};
 | 
			
		||||
 | 
			
		||||
% New damped plant input
 | 
			
		||||
S1 = sumblk("f1 = u1iff + u1");
 | 
			
		||||
S2 = sumblk("f2 = u2iff + u2");
 | 
			
		||||
S3 = sumblk("f3 = u3iff + u3");
 | 
			
		||||
S4 = sumblk("f4 = u4iff + u4");
 | 
			
		||||
S5 = sumblk("f5 = u5iff + u5");
 | 
			
		||||
S6 = sumblk("f6 = u6iff + u6");
 | 
			
		||||
 | 
			
		||||
G_Ka_iff = {zeros(1,length(Ka))};
 | 
			
		||||
for i=1:length(Ka)
 | 
			
		||||
    G_Ka_iff(i) = {connect(G_Ka{i}, Kiff, S1, S2, S3, S4, S5, S6, {'u1', 'u2', 'u3', 'u4', 'u5', 'u6'}, {'l1', 'l2', 'l3', 'l4', 'l5', 'l6'})};
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
%% Interaction Analysis - RGA Number
 | 
			
		||||
rga = zeros(length(Ka), length(freqs));
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    for j = 1:length(freqs)
 | 
			
		||||
        rga(i,j) = sum(sum(abs(inv(evalfr(G_Ka_iff{i}({"l1", "l2", "l3", "l4", "l5", "l6"}, {"u1", "u2", "u3", "u4", "u5", "u6"}), 1j*2*pi*freqs(j)).').*evalfr(G_Ka_iff{i}({"l1", "l2", "l3", "l4", "l5", "l6"}, {"u1", "u2", "u3", "u4", "u5", "u6"}), 1j*2*pi*freqs(j)) - eye(6))));
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
%% RGA number for the damped plants - Effect of the flexible joint axial stiffness
 | 
			
		||||
figure;
 | 
			
		||||
hold on;
 | 
			
		||||
for i = 1:length(Ka)
 | 
			
		||||
    plot(freqs, rga(i,:), 'DisplayName', sprintf('$k_a = %.0f$ N/$\\mu$m', 1e-6*Ka(i)))
 | 
			
		||||
end
 | 
			
		||||
hold off;
 | 
			
		||||
xlabel('Frequency [Hz]'); ylabel('RGA number');
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylim([0, 10]); xlim([10, 5e3]);
 | 
			
		||||
leg = legend('location', 'northwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
 | 
			
		||||
%% Extract stiffness of the joint from the reduced order model
 | 
			
		||||
% We first extract the stiffness and mass matrices.
 | 
			
		||||
K = readmatrix('flex025_mat_K.CSV');
 | 
			
		||||
M = readmatrix('flex025_mat_M.CSV');
 | 
			
		||||
% Then, we extract the coordinates of the interface nodes.
 | 
			
		||||
[int_xyz, int_i, n_xyz, n_i, nodes] = extractNodes('flex025_out_nodes_3D.txt');
 | 
			
		||||
 | 
			
		||||
m = 1;
 | 
			
		||||
 | 
			
		||||
%% Name of the Simulink File
 | 
			
		||||
mdl = 'detail_fem_joint';
 | 
			
		||||
 | 
			
		||||
%% Input/Output definition
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/T'], 1, 'openinput');  io_i = io_i + 1; % Forces and Torques
 | 
			
		||||
io(io_i) = linio([mdl, '/D'], 1, 'openoutput'); io_i = io_i + 1; % Translations and Rotations
 | 
			
		||||
 | 
			
		||||
G = linearize(mdl, io);
 | 
			
		||||
 | 
			
		||||
% Stiffness extracted from the Simscape model
 | 
			
		||||
k_a = 1/dcgain(G(3,3)); % Axial stiffness [N/m]
 | 
			
		||||
k_f = 1/dcgain(G(4,4)); % Bending stiffness [N/m]
 | 
			
		||||
k_t = 1/dcgain(G(6,6)); % Torsion stiffness [N/m]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
% Stiffness extracted from the Stiffness matrix
 | 
			
		||||
k_s = K(1,1); % shear [N/m]
 | 
			
		||||
% k_s = K(2,2); % shear [N/m]
 | 
			
		||||
k_a = K(3,3); % axial [N/m]
 | 
			
		||||
k_f = K(4,4); % bending [Nm/rad]
 | 
			
		||||
% k_f = K(5,5); % bending [Nm/rad]
 | 
			
		||||
k_t =  K(6,6); % torsion [Nm/rad]
 | 
			
		||||
 | 
			
		||||
%% Compare Dynamics between "Reduced Order" flexible joints and "2-dof and 3-dof" joints
 | 
			
		||||
% Let's initialize all the stages with default parameters.
 | 
			
		||||
initializeGround('type', 'rigid');
 | 
			
		||||
initializeGranite('type', 'rigid');
 | 
			
		||||
initializeTy('type', 'rigid');
 | 
			
		||||
initializeRy('type', 'rigid');
 | 
			
		||||
initializeRz('type', 'rigid');
 | 
			
		||||
initializeMicroHexapod('type', 'rigid');
 | 
			
		||||
initializeSample('m', 50);
 | 
			
		||||
 | 
			
		||||
initializeSimscapeConfiguration();
 | 
			
		||||
initializeDisturbances('enable', false);
 | 
			
		||||
initializeLoggingConfiguration('log', 'none');
 | 
			
		||||
initializeController('type', 'open-loop');
 | 
			
		||||
initializeReferences();
 | 
			
		||||
 | 
			
		||||
mdl = 'detail_fem_nass';
 | 
			
		||||
 | 
			
		||||
% Input/Output definition
 | 
			
		||||
clear io; io_i = 1;
 | 
			
		||||
io(io_i) = linio([mdl, '/Controller'],     1, 'openinput');              io_i = io_i + 1; % Actuator Inputs
 | 
			
		||||
io(io_i) = linio([mdl, '/Tracking Error'], 1, 'openoutput', [], 'EdL');  io_i = io_i + 1; % Errors in the frame of the struts
 | 
			
		||||
io(io_i) = linio([mdl, '/NASS'],       3, 'openoutput', [], 'fn');  io_i = io_i + 1; % Force Sensors
 | 
			
		||||
 | 
			
		||||
% Fully flexible joints
 | 
			
		||||
initializeSimplifiedNanoHexapod('actuator_type', 'apa300ml', ...
 | 
			
		||||
            'flex_type_F', 'flexible', ...
 | 
			
		||||
            'flex_type_M', 'flexible', ...
 | 
			
		||||
            'Fsm', 56e-3, ... % APA300ML weight 112g
 | 
			
		||||
            'Msm', 56e-3);
 | 
			
		||||
 | 
			
		||||
G_flex = linearize(mdl, io);
 | 
			
		||||
G_flex.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
G_flex.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
 | 
			
		||||
% Flexible joints modelled by 2DoF and 3DoF joints
 | 
			
		||||
initializeSimplifiedNanoHexapod('actuator_type', 'apa300ml', ...
 | 
			
		||||
            'flex_type_F', '2dof_axial', ...
 | 
			
		||||
            'flex_type_M', '4dof', ...
 | 
			
		||||
            'Kf_F', k_f, ...
 | 
			
		||||
            'Kt_F', k_t, ...
 | 
			
		||||
            'Ka_F', k_a, ...
 | 
			
		||||
            'Kf_M', k_f, ...
 | 
			
		||||
            'Kt_M', k_t, ...
 | 
			
		||||
            'Ka_M', k_a, ...
 | 
			
		||||
            'Cf_F', 1e-2, ...
 | 
			
		||||
            'Ct_F', 1e-2, ...
 | 
			
		||||
            'Ca_F', 1e-2, ...
 | 
			
		||||
            'Cf_M', 1e-2, ...
 | 
			
		||||
            'Ct_M', 1e-2, ...
 | 
			
		||||
            'Ca_M', 1e-2, ...
 | 
			
		||||
            'Fsm', 56e-3, ... % APA300ML weight 112g
 | 
			
		||||
            'Msm', 56e-3);
 | 
			
		||||
 | 
			
		||||
G_ideal = linearize(mdl, io);
 | 
			
		||||
G_ideal.InputName  = {'f1', 'f2', 'f3', 'f4', 'f5', 'f6'};
 | 
			
		||||
G_ideal.OutputName = {'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'fm1', 'fm2', 'fm3', 'fm4', 'fm5', 'fm6'};
 | 
			
		||||
 | 
			
		||||
%% Comparison of the dynamics with joints modelled with FEM and modelled with "ideal joints" - HAC plant
 | 
			
		||||
freqs = logspace(1, 4, 1000);
 | 
			
		||||
 | 
			
		||||
%% Effect of the flexible joint axial stiffness on the HAC-plant
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for j = 1:5
 | 
			
		||||
    for k = j+1:6
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_flex("l"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(1,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_ideal("l"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(2,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_flex("l1","f1"), freqs, 'Hz'))), 'color', colors(1,:), 'DisplayName', 'Reduced Order Flexible Joints');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_ideal("l1","f1"), freqs, 'Hz'))), 'color', colors(2,:), 'DisplayName', 'Bot: $k_f$, $k_a$, Top: $k_f$, $k_t$, $k_a$');
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'southwest', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-10, 1e-4]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_flex("l1","f1"), freqs, 'Hz'))));
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ideal("l1","f1"), freqs, 'Hz'))));
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
 | 
			
		||||
freqs = logspace(0, 3, 1000);
 | 
			
		||||
 | 
			
		||||
%% Effect of the flexible joint axial stiffness on the HAC-plant
 | 
			
		||||
figure;
 | 
			
		||||
tiledlayout(3, 1, 'TileSpacing', 'Compact', 'Padding', 'None');
 | 
			
		||||
 | 
			
		||||
ax1 = nexttile([2,1]);
 | 
			
		||||
hold on;
 | 
			
		||||
for j = 1:5
 | 
			
		||||
    for k = j+1:6
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_flex("fm"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(1,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
        plot(freqs, abs(squeeze(freqresp(G_ideal("fm"+k,"f"+j), freqs, 'Hz'))), 'color', [colors(2,:), 0.1], ...
 | 
			
		||||
            'HandleVisibility', 'off');
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_flex("fm1","f1"), freqs, 'Hz'))), 'color', colors(1,:), 'DisplayName', 'Reduced Order Flexible Joints');
 | 
			
		||||
plot(freqs, abs(squeeze(freqresp(G_ideal("fm1","f1"), freqs, 'Hz'))), 'color', colors(2,:), 'DisplayName', 'Bot: $k_f$, $k_a$, Top: $k_f$, $k_t$, $k_a$');
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
 | 
			
		||||
ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]);
 | 
			
		||||
leg = legend('location', 'southeast', 'FontSize', 8, 'NumColumns', 1);
 | 
			
		||||
leg.ItemTokenSize(1) = 15;
 | 
			
		||||
ylim([1e-5, 1e1]);
 | 
			
		||||
 | 
			
		||||
ax2 = nexttile;
 | 
			
		||||
hold on;
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_flex("fm1","f1"), freqs, 'Hz'))));
 | 
			
		||||
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ideal("fm1","f1"), freqs, 'Hz'))));
 | 
			
		||||
hold off;
 | 
			
		||||
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
 | 
			
		||||
ylabel('Phase [deg]'); xlabel('Frequency [Hz]');
 | 
			
		||||
ylim([-20, 200]);
 | 
			
		||||
yticks([-360:45:360]);
 | 
			
		||||
 | 
			
		||||
linkaxes([ax1,ax2],'x');
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								matlab/mat/detail_fem_apa95ml_open_circuit.mat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								matlab/mat/detail_fem_apa95ml_open_circuit.mat
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								matlab/mat/detail_fem_apa95ml_short_circuit.mat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								matlab/mat/detail_fem_apa95ml_short_circuit.mat
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										85
									
								
								nass-fem.bib
									
									
									
									
									
								
							
							
						
						
									
										85
									
								
								nass-fem.bib
									
									
									
									
									
								
							@@ -1,15 +1,15 @@
 | 
			
		||||
@article{souleille18_concep_activ_mount_space_applic,
 | 
			
		||||
  author          = {Souleille, Adrien and Lampert, Thibault and Lafarga, V and
 | 
			
		||||
                  Hellegouarch, Sylvain and Rondineau, Alan and Rodrigues,
 | 
			
		||||
                  Gon{\c{c}}alo and Collette, Christophe},
 | 
			
		||||
  title           = {A Concept of Active Mount for Space Applications},
 | 
			
		||||
  journal         = {CEAS Space Journal},
 | 
			
		||||
  volume          = 10,
 | 
			
		||||
  number          = 2,
 | 
			
		||||
  pages           = {157--165},
 | 
			
		||||
  year            = 2018,
 | 
			
		||||
  publisher       = {Springer},
 | 
			
		||||
  keywords        = {parallel robot, iff},
 | 
			
		||||
@article{mcinroy02_model_desig_flexur_joint_stewar,
 | 
			
		||||
  author          = {J.E. McInroy},
 | 
			
		||||
  title           = {Modeling and Design of Flexure Jointed Stewart Platforms
 | 
			
		||||
                  for Control Purposes},
 | 
			
		||||
  journal         = {IEEE/ASME Transactions on Mechatronics},
 | 
			
		||||
  volume          = 7,
 | 
			
		||||
  number          = 1,
 | 
			
		||||
  pages           = {95-99},
 | 
			
		||||
  year            = 2002,
 | 
			
		||||
  doi             = {10.1109/3516.990892},
 | 
			
		||||
  url             = {https://doi.org/10.1109/3516.990892},
 | 
			
		||||
  keywords        = {parallel robot, flexure},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -109,6 +109,19 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@book{pintelon12_system_ident,
 | 
			
		||||
  author          = {Rik Pintelon and Johan Schoukens},
 | 
			
		||||
  title           = {System Identification : a Frequency Domain Approach},
 | 
			
		||||
  year            = 2012,
 | 
			
		||||
  publisher       = {Wiley IEEE Press},
 | 
			
		||||
  url             = {https://doi.org/10.1002/9781118287422},
 | 
			
		||||
  address         = {Hoboken, N.J. Piscataway, NJ},
 | 
			
		||||
  doi             = {10.1002/9781118287422},
 | 
			
		||||
  isbn            = 9780470640371,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@phdthesis{hanieh03_activ_stewar,
 | 
			
		||||
  author          = {Hanieh, Ahmed Abu},
 | 
			
		||||
  keywords        = {parallel robot},
 | 
			
		||||
@@ -120,18 +133,29 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@article{mcinroy02_model_desig_flexur_joint_stewar,
 | 
			
		||||
  author          = {J.E. McInroy},
 | 
			
		||||
  title           = {Modeling and Design of Flexure Jointed Stewart Platforms
 | 
			
		||||
                  for Control Purposes},
 | 
			
		||||
  journal         = {IEEE/ASME Transactions on Mechatronics},
 | 
			
		||||
  volume          = 7,
 | 
			
		||||
  number          = 1,
 | 
			
		||||
  pages           = {95-99},
 | 
			
		||||
  year            = 2002,
 | 
			
		||||
  doi             = {10.1109/3516.990892},
 | 
			
		||||
  url             = {https://doi.org/10.1109/3516.990892},
 | 
			
		||||
  keywords        = {parallel robot, flexure},
 | 
			
		||||
@article{souleille18_concep_activ_mount_space_applic,
 | 
			
		||||
  author          = {Souleille, Adrien and Lampert, Thibault and Lafarga, V and
 | 
			
		||||
                  Hellegouarch, Sylvain and Rondineau, Alan and Rodrigues,
 | 
			
		||||
                  Gon{\c{c}}alo and Collette, Christophe},
 | 
			
		||||
  title           = {A Concept of Active Mount for Space Applications},
 | 
			
		||||
  journal         = {CEAS Space Journal},
 | 
			
		||||
  volume          = 10,
 | 
			
		||||
  number          = 2,
 | 
			
		||||
  pages           = {157--165},
 | 
			
		||||
  year            = 2018,
 | 
			
		||||
  publisher       = {Springer},
 | 
			
		||||
  keywords        = {parallel robot, iff},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@book{schmidt20_desig_high_perfor_mechat_third_revis_edition,
 | 
			
		||||
  author          = {Schmidt, R Munnig and Schitter, Georg and Rankers, Adrian},
 | 
			
		||||
  title           = {The Design of High Performance Mechatronics - Third Revised
 | 
			
		||||
                  Edition},
 | 
			
		||||
  year            = 2020,
 | 
			
		||||
  publisher       = {Ios Press},
 | 
			
		||||
  keywords        = {favorite},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -187,3 +211,16 @@
 | 
			
		||||
  keywords        = {parallel robot},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@book{preumont18_vibrat_contr_activ_struc_fourt_edition,
 | 
			
		||||
  author          = {Andre Preumont},
 | 
			
		||||
  title           = {Vibration Control of Active Structures - Fourth Edition},
 | 
			
		||||
  year            = 2018,
 | 
			
		||||
  publisher       = {Springer International Publishing},
 | 
			
		||||
  url             = {https://doi.org/10.1007/978-3-319-72296-2},
 | 
			
		||||
  doi             = {10.1007/978-3-319-72296-2},
 | 
			
		||||
  keywords        = {favorite, parallel robot},
 | 
			
		||||
  series          = {Solid Mechanics and Its Applications},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1023
									
								
								nass-fem.org
									
									
									
									
									
								
							
							
						
						
									
										1023
									
								
								nass-fem.org
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								nass-fem.pdf
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								nass-fem.pdf
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										29
									
								
								nass-fem.tex
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								nass-fem.tex
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
% Created 2025-02-27 Thu 01:24
 | 
			
		||||
% Created 2025-02-27 Thu 10:38
 | 
			
		||||
% Intended LaTeX compiler: pdflatex
 | 
			
		||||
\documentclass[a4paper, 10pt, DIV=12, parskip=full, bibliography=totoc]{scrreprt}
 | 
			
		||||
 | 
			
		||||
@@ -38,7 +38,6 @@ Section \ref{sec:detail_fem_joint} addresses the design of flexible joints, wher
 | 
			
		||||
In both cases, the hybrid modeling approach enables detailed component optimization while maintaining the ability to predict system-level dynamic behavior, particularly under closed-loop control conditions.
 | 
			
		||||
 | 
			
		||||
\chapter{Reduced order flexible bodies}
 | 
			
		||||
\label{sec:orgfd22661}
 | 
			
		||||
\label{sec:detail_fem_super_element}
 | 
			
		||||
Components exhibiting complex dynamical behavior are frequently found to be unsuitable for direct implementation within multi-body models.
 | 
			
		||||
These components are traditionally analyzed using Finite Element Analysis (FEA) software.
 | 
			
		||||
@@ -50,7 +49,6 @@ First, the fundamental principles and methodological approaches of this modeling
 | 
			
		||||
It is then illustrated through its practical application to the modelling of an Amplified Piezoelectric Actuator (APA) (Section \ref{ssec:detail_fem_super_element_example}).
 | 
			
		||||
Finally, the validity of this modeling approach is demonstrated through experimental validation, wherein the obtained dynamics from the hybrid modelling approach is compared with measurements (Section \ref{ssec:detail_fem_super_element_validation}).
 | 
			
		||||
\section{Procedure}
 | 
			
		||||
\label{sec:org93ab665}
 | 
			
		||||
\label{ssec:detail_fem_super_element_theory}
 | 
			
		||||
 | 
			
		||||
In this modeling approach, some components within the multi-body framework are represented as \emph{reduced-order flexible bodies}, wherein their modal behavior is characterized through reduced mass and stiffness matrices derived from finite element analysis (FEA) models.
 | 
			
		||||
@@ -74,7 +72,6 @@ m = 6 \times n + p
 | 
			
		||||
\end{equation}
 | 
			
		||||
 | 
			
		||||
\section{Example with an Amplified Piezoelectric Actuator}
 | 
			
		||||
\label{sec:org1e66a5f}
 | 
			
		||||
\label{ssec:detail_fem_super_element_example}
 | 
			
		||||
The presented modeling framework was first applied to an Amplified Piezoelectric Actuator (APA) for several reasons.
 | 
			
		||||
Primarily, this actuator represents an excellent candidate for implementation within the nano-hexapod, as will be elaborated in Section \ref{sec:detail_fem_actuator}.
 | 
			
		||||
@@ -105,7 +102,6 @@ Stiffness & \(21\,N/\mu m\)\\
 | 
			
		||||
\captionof{table}{\label{tab:detail_fem_apa95ml_specs}APA95ML specifications}
 | 
			
		||||
\end{minipage}
 | 
			
		||||
\paragraph{Finite Element Model}
 | 
			
		||||
\label{sec:orgce5afdb}
 | 
			
		||||
 | 
			
		||||
The development of the finite element model for the APA95ML necessitated the specification of appropriate material properties, as summarized in Table \ref{tab:detail_fem_material_properties}.
 | 
			
		||||
The finite element mesh, shown in Figure \ref{fig:detail_fem_apa95ml_mesh}, was then generated.
 | 
			
		||||
@@ -142,11 +138,10 @@ The modal reduction procedure was then executed, yielding the reduced mass and s
 | 
			
		||||
\end{center}
 | 
			
		||||
\subcaption{\label{fig:detail_fem_apa_model_schematic}Inclusion in multi-body model}
 | 
			
		||||
\end{subfigure}
 | 
			
		||||
\caption{\label{fig:detail_fem_apa95ml_model}Obtained mesh and defined interface frames (or ``remote points'') in the finite element model of the APA95ML (\subref{fig:detail_fem_apa95ml_mesh}). Interface with the multi-body model is shown in (\subref{fig:detail_fem_apa_modal_schematic}).}
 | 
			
		||||
\caption{\label{fig:detail_fem_apa95ml_model}Obtained mesh and defined interface frames (or ``remote points'') in the finite element model of the APA95ML (\subref{fig:detail_fem_apa95ml_mesh}). Interface with the multi-body model is shown in (\subref{fig:detail_fem_apa_model_schematic}).}
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\paragraph{Super Element in the Multi-Body Model}
 | 
			
		||||
\label{sec:org809b5e7}
 | 
			
		||||
 | 
			
		||||
Previously computed reduced order mass and stiffness matrices were imported in a multi-body model block called ``Reduced Order Flexible Solid''.
 | 
			
		||||
This block has several interface frames corresponding to the ones defined in the FEA software.
 | 
			
		||||
@@ -158,7 +153,6 @@ This is illustrated in Figure \ref{fig:detail_fem_apa_model_schematic}.
 | 
			
		||||
However, to have access to the physical voltage input of the actuators stacks \(V_a\) and to the generated voltage by the force sensor \(V_s\), conversion between the electrical and mechanical domains need to be determined.
 | 
			
		||||
 | 
			
		||||
\paragraph{Sensor and Actuator ``constants''}
 | 
			
		||||
\label{sec:orgb3a075f}
 | 
			
		||||
 | 
			
		||||
To link the electrical domain to the mechanical domain, an ``actuator constant'' \(g_a\) and a ``sensor constant'' \(g_s\) were introduced as shown in Figure \ref{fig:detail_fem_apa_model_schematic}.
 | 
			
		||||
 | 
			
		||||
@@ -217,7 +211,6 @@ From these parameters, \(g_s = 5.1\,V/\mu m\) and \(g_a = 26\,N/V\) were obtaine
 | 
			
		||||
\end{table}
 | 
			
		||||
 | 
			
		||||
\paragraph{Identification of the APA Characteristics}
 | 
			
		||||
\label{sec:orge041867}
 | 
			
		||||
 | 
			
		||||
Initial validation of the finite element model and its integration as a reduced-order flexible model within the multi-body model was accomplished through comparative analysis of key actuator characteristics against manufacturer specifications.
 | 
			
		||||
 | 
			
		||||
@@ -225,7 +218,7 @@ The stiffness of the APA95ML was estimated from the multi-body model by computin
 | 
			
		||||
The inverse of the DC gain this transfer function corresponds to the axial stiffness of the APA95ML.
 | 
			
		||||
A value of \(23\,N/\mu m\) was found which is close to the specified stiffness in the datasheet of \(k = 21\,N/\mu m\).
 | 
			
		||||
 | 
			
		||||
The multi-body model predicted a resonant frequency under block-free conditions of \(2024\,\text{Hz}\) (Figure \ref{fig:detail_fem_apa95ml_compliance}), which is in agreement with the nominal specification of \(2000\,\text{Hz}\).
 | 
			
		||||
The multi-body model predicted a resonant frequency under block-free conditions of \(\approx 2\,\text{kHz}\) (Figure \ref{fig:detail_fem_apa95ml_compliance}), which is in agreement with the nominal specification of \(2\,\text{kHz}\).
 | 
			
		||||
 | 
			
		||||
\begin{figure}[htbp]
 | 
			
		||||
\centering
 | 
			
		||||
@@ -243,7 +236,6 @@ Through the established amplification factor of 1.5, this translates to a predic
 | 
			
		||||
The high degree of concordance observed across multiple performance metrics provides a first validation of the ability to include FEM into multi-body model.
 | 
			
		||||
 | 
			
		||||
\section{Experimental Validation}
 | 
			
		||||
\label{sec:org354cea4}
 | 
			
		||||
\label{ssec:detail_fem_super_element_validation}
 | 
			
		||||
Further validation of the reduced-order flexible body methodology was undertaken through experimental investigation.
 | 
			
		||||
The goal is to measure the dynamics of the APA95ML and compared it with predictions derived from the multi-body model incorporating the actuator as a flexible element.
 | 
			
		||||
@@ -269,7 +261,6 @@ Measurement of the sensor stack voltage \(V_s\) was performed using an analog-to
 | 
			
		||||
\caption{\label{fig:detail_fem_apa95ml_bench}Test bench used to validate ``reduced order solid bodies'' using an APA95ML. Picture of the bench is shown in (\subref{fig:detail_fem_apa95ml_bench_picture}). Schematic is shown in (\subref{fig:detail_fem_apa95ml_bench_schematic}).}
 | 
			
		||||
\end{figure}
 | 
			
		||||
\paragraph{Comparison of the dynamics}
 | 
			
		||||
\label{sec:orgc0ac08b}
 | 
			
		||||
 | 
			
		||||
Frequency domain system identification techniques were used to characterize the dynamic behavior of the APA95ML.
 | 
			
		||||
The identification procedure necessitated careful choice of the excitation signal \cite[, chap. 5]{pintelon12_system_ident}.
 | 
			
		||||
@@ -304,7 +295,6 @@ Regarding the amplitude characteristics, the constants \(g_a\) and \(g_s\) could
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\paragraph{Integral Force Feedback with APA}
 | 
			
		||||
\label{sec:org4b65d74}
 | 
			
		||||
 | 
			
		||||
To further validate this modeling methodology, its ability to predict closed-loop behavior was verified experimentally.
 | 
			
		||||
Integral Force Feedback (IFF) was implemented using the force sensor stack, and the measured dynamics of the damped system were compared with model predictions across multiple feedback gains.
 | 
			
		||||
@@ -338,7 +328,6 @@ The close agreement between experimental measurements and theoretical prediction
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\section*{Conclusion}
 | 
			
		||||
\label{sec:org105aef7}
 | 
			
		||||
The modeling procedure presented in this section will demonstrate significant utility for the optimization of complex mechanical components within multi-body systems, particularly in the design of actuators (Section \ref{sec:detail_fem_actuator}) and flexible joints (Section \ref{sec:detail_fem_joint}).
 | 
			
		||||
 | 
			
		||||
Through experimental validation using an Amplified Piezoelectric Actuator, the methodology has been shown to accurately predict both open-loop and closed-loop dynamic behavior, thereby establishing its reliability for component design and system analysis.
 | 
			
		||||
@@ -348,7 +337,6 @@ This is exemplified by the nano-hexapod configuration, where the implementation
 | 
			
		||||
However, the methodology remains valuable for system analysis, as the extraction of frequency domain characteristics can be efficiently performed even with such high-order models.
 | 
			
		||||
 | 
			
		||||
\chapter{Actuator Selection}
 | 
			
		||||
\label{sec:org3ec4809}
 | 
			
		||||
\label{sec:detail_fem_actuator}
 | 
			
		||||
The selection and modeling of actuators constitutes a critical step in the development of the nano-hexapod.
 | 
			
		||||
This chapter presents the approach to actuator selection and modeling.
 | 
			
		||||
@@ -356,7 +344,6 @@ First, specifications for the nano-hexapod actuators are derived from previous a
 | 
			
		||||
Then, the chosen actuator is modeled using the reduced-order flexible body approach developed in the previous section, enabling validation of this selection through detailed dynamical analysis (Section \ref{ssec:detail_fem_actuator_apa300ml}).
 | 
			
		||||
Finally, a simplified two-degree-of-freedom model is developed to facilitate time-domain simulations while maintaining accurate representation of the actuator's essential characteristics (Section \ref{ssec:detail_fem_actuator_apa300ml_2dof}).
 | 
			
		||||
\section{Choice of the Actuator based on Specifications}
 | 
			
		||||
\label{sec:org929a34b}
 | 
			
		||||
\label{ssec:detail_fem_actuator_specifications}
 | 
			
		||||
 | 
			
		||||
The actuator selection process was driven by several critical requirements derived from previous dynamic analyses.
 | 
			
		||||
@@ -431,7 +418,6 @@ Height  \(< 50\, [mm]\) & 22 & 30 & 24 & 27 & 16\\
 | 
			
		||||
\end{table}
 | 
			
		||||
 | 
			
		||||
\section{APA300ML - Reduced Order Flexible Body}
 | 
			
		||||
\label{sec:orgeff9b1b}
 | 
			
		||||
\label{ssec:detail_fem_actuator_apa300ml}
 | 
			
		||||
 | 
			
		||||
The validation of the APA300ML started by incorporating a ``reduced order flexible body'' into the multi-body model as explained in Section \ref{sec:detail_fem_super_element}.
 | 
			
		||||
@@ -459,7 +445,6 @@ While this high order provides excellent accuracy for validation purposes, it pr
 | 
			
		||||
The sensor and actuator ``constants'' (\(g_s\) and \(g_a\)) derived in Section \ref{ssec:detail_fem_super_element_example} for the APA95ML were used for the APA300ML model, as both actuators employ identical piezoelectric stacks.
 | 
			
		||||
 | 
			
		||||
\section{Simpler 2DoF Model of the APA300ML}
 | 
			
		||||
\label{sec:org120c274}
 | 
			
		||||
\label{ssec:detail_fem_actuator_apa300ml_2dof}
 | 
			
		||||
 | 
			
		||||
To facilitate efficient time-domain simulations while maintaining essential dynamic characteristics, a simplified two-degree-of-freedom model was developed, adapted from \cite{souleille18_concep_activ_mount_space_applic}.
 | 
			
		||||
@@ -532,7 +517,6 @@ While higher-order modes and non-axial flexibility are not captured, the model a
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\section{Electrical characteristics of the APA}
 | 
			
		||||
\label{sec:orga7af5a1}
 | 
			
		||||
\label{ssec:detail_fem_actuator_apa300ml_electrical}
 | 
			
		||||
 | 
			
		||||
The behavior of piezoelectric actuators is characterized by coupled constitutive equations that establish relationships between electrical properties (charges, voltages) and mechanical properties (stress, strain) \cite[, chapter 5.5]{schmidt20_desig_high_perfor_mechat_third_revis_edition}.
 | 
			
		||||
@@ -553,7 +537,6 @@ Proper consideration must be given to voltage amplifier specifications and force
 | 
			
		||||
These aspects, being fundamental to system implementation, will be addressed in the instrumentation chapter.
 | 
			
		||||
 | 
			
		||||
\section{Validation with the Nano-Hexapod}
 | 
			
		||||
\label{sec:orgba951c9}
 | 
			
		||||
\label{ssec:detail_fem_actuator_apa300ml_validation}
 | 
			
		||||
 | 
			
		||||
The integration of the APA300ML model within the nano-hexapod simulation framework served two validation objectives: to validate the APA300ML choice through analysis of system dynamics with APA modelled as flexible bodies, and to validate the simplified 2DoF model through comparative analysis with the full FEM implementation.
 | 
			
		||||
@@ -586,7 +569,6 @@ These results validate both the selection of the APA300ML and the effectiveness
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\chapter{Flexible Joint Design}
 | 
			
		||||
\label{sec:org93c9b2c}
 | 
			
		||||
\label{sec:detail_fem_joint}
 | 
			
		||||
High-precision position control at the nanometer scale requires systems to be free from friction and backlash, as these nonlinear phenomena severely limit achievable positioning accuracy.
 | 
			
		||||
This fundamental requirement prevents the use of conventional joints, necessitating instead the implementation of flexible joints that achieve motion through elastic deformation.
 | 
			
		||||
@@ -622,7 +604,6 @@ The analysis of bending and axial stiffness effects enables the establishment of
 | 
			
		||||
These specifications guide the development and optimization of a flexible joint design through finite element analysis (Section \ref{ssec:detail_fem_joint_specs}).
 | 
			
		||||
The validation process, detailed in Section \ref{ssec:detail_fem_joint_validation}, begins with the integration of the joints as ``reduced order flexible bodies'' in the nano-hexapod model, followed by the development of computationally efficient lower-order models that preserve the essential dynamic characteristics.
 | 
			
		||||
\section{Bending and Torsional Stiffness}
 | 
			
		||||
\label{sec:org582c93a}
 | 
			
		||||
\label{ssec:detail_fem_joint_bending}
 | 
			
		||||
 | 
			
		||||
The presence of bending stiffness in flexible joints causes the forces applied by the struts to deviate from the strut direction.
 | 
			
		||||
@@ -679,7 +660,6 @@ A parallel analysis of torsional stiffness revealed similar dynamic effects, tho
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\section{Axial Stiffness}
 | 
			
		||||
\label{sec:org05206a1}
 | 
			
		||||
\label{ssec:detail_fem_joint_axial}
 | 
			
		||||
 | 
			
		||||
The limited axial stiffness (\(k_a\)) of flexible joints introduces an additional compliance between the actuation point and the measurement point.
 | 
			
		||||
@@ -735,7 +715,6 @@ Based on this analysis, an axial stiffness specification of \(100\,N/\mu m\) was
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\section{Specifications and Design flexible joints}
 | 
			
		||||
\label{sec:org2310ef0}
 | 
			
		||||
\label{ssec:detail_fem_joint_specs}
 | 
			
		||||
 | 
			
		||||
The design of flexible joints for precision applications requires careful consideration of multiple mechanical characteristics.
 | 
			
		||||
@@ -784,7 +763,6 @@ The final design, featuring a neck dimension of 0.25mm, achieves mechanical prop
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\section{Validation with the Nano-Hexapod}
 | 
			
		||||
\label{sec:org4e972fc}
 | 
			
		||||
\label{ssec:detail_fem_joint_validation}
 | 
			
		||||
 | 
			
		||||
The designed flexible joint was first validated through integration into the nano-hexapod model using reduced-order flexible bodies derived from finite element analysis.
 | 
			
		||||
@@ -822,7 +800,6 @@ While additional degrees of freedom could potentially capture more dynamic featu
 | 
			
		||||
\end{figure}
 | 
			
		||||
 | 
			
		||||
\chapter*{Conclusion}
 | 
			
		||||
\label{sec:org5382fe7}
 | 
			
		||||
\label{sec:detail_fem_conclusion}
 | 
			
		||||
 | 
			
		||||
In this chapter, the methodology of combining finite element analysis with multi-body modeling has been demonstrated and validated, proving particularly valuable for the detailed design phase of the nano-hexapod.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user