Add multiple scripts (compute/plot max pos, effect of param)

This commit is contained in:
Thomas Dehaeze 2018-05-03 18:52:46 +02:00
parent 0cca3b7b53
commit c886022a5f
8 changed files with 105 additions and 46 deletions

View File

@ -1,4 +1,4 @@
function [X, Y, Z] = getMaxPositions(lmax, J) function [X, Y, Z] = getMaxPositions(Leg, J)
theta = linspace(0, 2*pi, 100); theta = linspace(0, 2*pi, 100);
phi = linspace(-pi/2 , pi/2, 100); phi = linspace(-pi/2 , pi/2, 100);
dmax = zeros(length(theta), length(phi)); dmax = zeros(length(theta), length(phi));
@ -6,7 +6,7 @@ function [X, Y, Z] = getMaxPositions(lmax, J)
for i = 1:length(theta) for i = 1:length(theta)
for j = 1:length(phi) for j = 1:length(phi)
L = J*[cos(phi(j))*cos(theta(i)) cos(phi(j))*sin(theta(i)) sin(phi(j)) 0 0 0]'; L = J*[cos(phi(j))*cos(theta(i)) cos(phi(j))*sin(theta(i)) sin(phi(j)) 0 0 0]';
dmax(i, j) = lmax/max(abs(L)); dmax(i, j) = Leg.stroke/max(abs(L));
end end
end end

9
getMaxPureDisplacement.m Normal file
View File

@ -0,0 +1,9 @@
function [max_disp] = getMaxPureDisplacement(Leg, J)
max_disp = zeros(6, 1);
max_disp(1) = Leg.stroke/max(abs(J*[1 0 0 0 0 0]'));
max_disp(2) = Leg.stroke/max(abs(J*[0 1 0 0 0 0]'));
max_disp(3) = Leg.stroke/max(abs(J*[0 0 1 0 0 0]'));
max_disp(4) = Leg.stroke/max(abs(J*[0 0 0 1 0 0]'));
max_disp(5) = Leg.stroke/max(abs(J*[0 0 0 0 1 0]'));
max_disp(6) = Leg.stroke/max(abs(J*[0 0 0 0 0 1]'));
end

3
getStiffnessMatrix.m Normal file
View File

@ -0,0 +1,3 @@
function [K] = getStiffnessMatrix(leg, J)
K = leg.k.ax*(J'*J);
end

View File

@ -1,10 +1,12 @@
lmax = 80e-6; %%
run stewart_parameters.m
run stewart_init.m
[X, Y, Z] = getMaxPositions(lmax, J); %%
[X, Y, Z] = getMaxPositions(Leg, J);
figure; figure;
hold on; hold on;
mesh(X, Y, Z); mesh(X, Y, Z);
colorbar; colorbar;
hold off; hold off;

View File

@ -1,11 +1,3 @@
%%
clear;
close all;
clc;
%%
run stewart_parameters.m
%% Define some constant values %% Define some constant values
deg2rad = pi/180; deg2rad = pi/180;
x_axis = [1 0 0]; x_axis = [1 0 0];
@ -19,7 +11,7 @@ pos_top = zeros(6, 3);
alpha_b = BP.leg.ang*deg2rad; % angle de décalage par rapport à 120 deg (pour positionner les supports bases) alpha_b = BP.leg.ang*deg2rad; % angle de décalage par rapport à 120 deg (pour positionner les supports bases)
alpha_t = TP.leg.ang*deg2rad; % +- offset angle from 120 degree spacing on top alpha_t = TP.leg.ang*deg2rad; % +- offset angle from 120 degree spacing on top
height = (stewart.h-BP.thickness-TP.thickness-Leg.sphere.bottom-Leg.sphere.top-SP.thickness.bottom-SP.thickness.top)*0.001 ; % 2 meter height in home configuration height = (stewart.h-BP.thickness-TP.thickness-Leg.sphere.bottom-Leg.sphere.top-SP.thickness.bottom-SP.thickness.top)*0.001; % 2 meter height in home configuration
radius_b = BP.leg.rad*0.001; % rayon emplacement support base radius_b = BP.leg.rad*0.001; % rayon emplacement support base
radius_t = TP.leg.rad*0.001; % top radius in meters radius_t = TP.leg.rad*0.001; % top radius in meters

View File

@ -5,55 +5,56 @@ stewart.jacobian = 174.5; %mm
%% Bottom Plate %% Bottom Plate
BP = struct(); BP = struct();
BP.rad.int = 105 ; %mm BP.rad.int = 105; %mm
BP.rad.ext = 152.5 ; %mm BP.rad.ext = 152.5; %mm
BP.thickness = 8; % mm BP.thickness = 8; % mm
BP.leg.rad = 142 ; %mm BP.leg.rad = 142; %mm
BP.leg.ang = 5 ; %deg BP.leg.ang = 5; %deg
BP.density = 8000 ; %kg/m^3 BP.density = 8000; %kg/m^3
BP.color = [0.5 0.5 0.5] ; %rgb BP.color = [0.5 0.5 0.5]; %rgb
%% TOP Plate %% TOP Plate
TP = struct(); TP = struct();
TP.rad.int = 0 ;%mm TP.rad.int = 0;%mm
TP.rad.ext = 120 ; %mm TP.rad.ext = 120; %mm
TP.thickness = 8; % mm TP.thickness = 8; % mm
TP.leg.rad = 100 ; %mm TP.leg.rad = 100; %mm
TP.leg.ang = 5 ; %deg TP.leg.ang = 5; %deg
TP.density = 8000 ; %kg/m^3 TP.density = 8000; %kg/m^3
TP.color = [0.5 0.5 0.5] ; %rgb TP.color = [0.5 0.5 0.5]; %rgb
%% Leg %% Leg
Leg = struct(); Leg = struct();
Leg.rad.bottom = 8 ; %mm Leg.stroke = 80e-6; % m
Leg.rad.top = 5 ; %mm Leg.rad.bottom = 8; %mm
Leg.sphere.bottom = 10 ; % mm Leg.rad.top = 5; %mm
Leg.sphere.top = 8 ; % mm Leg.sphere.bottom = 10; % mm
Leg.density = 8000 ; %kg/m^3 Leg.sphere.top = 8; % mm
Leg.density = 8000; %kg/m^3
Leg.lenght = stewart.h; % mm (approximate) Leg.lenght = stewart.h; % mm (approximate)
Leg.m = Leg.density*2*pi*((Leg.rad.bottom*1e-3)^2)*(Leg.lenght*1e-3); %kg Leg.m = Leg.density*2*pi*((Leg.rad.bottom*1e-3)^2)*(Leg.lenght*1e-3); %kg
Leg.color.bottom = [0.5 0.5 0.5] ; %rgb Leg.color.bottom = [0.5 0.5 0.5]; %rgb
Leg.color.top = [0.5 0.5 0.5] ; %rgb Leg.color.top = [0.5 0.5 0.5]; %rgb
Leg.k.ax = 5e7; % N/m Leg.k.ax = 5e7; % N/m
Leg.ksi.ax = 10 ; Leg.ksi.ax = 10;
Leg = updateDamping(Leg); Leg = updateDamping(Leg);
%% Sphere %% Sphere
SP = struct(); SP = struct();
SP.thickness.bottom = 1 ; %mm SP.thickness.bottom = 1; %mm
SP.thickness.top = 1 ; %mm SP.thickness.top = 1; %mm
SP.rad.bottom = Leg.sphere.bottom ; %mm SP.rad.bottom = Leg.sphere.bottom; %mm
SP.rad.top = Leg.sphere.top ; %mm SP.rad.top = Leg.sphere.top; %mm
SP.height.bottom = 5 ; %mm SP.height.bottom = 5; %mm
SP.height.top = 5 ; %mm SP.height.top = 5; %mm
SP.density.bottom = 8000 ; %kg/m^3 SP.density.bottom = 8000; %kg/m^3
SP.density.top = 8000 ; %kg/m^3 SP.density.top = 8000; %kg/m^3
SP.m = SP.density.bottom*2*pi*((SP.rad.bottom*1e-3)^2)*(SP.height.bottom*1e-3); %kg SP.m = SP.density.bottom*2*pi*((SP.rad.bottom*1e-3)^2)*(SP.height.bottom*1e-3); %kg
SP.color.bottom = [0.5 0.5 0.5] ; %rgb SP.color.bottom = [0.5 0.5 0.5]; %rgb
SP.color.top = [0.5 0.5 0.5] ; %rgb SP.color.top = [0.5 0.5 0.5]; %rgb
SP.k.ax = 0 ; % N*m/deg SP.k.ax = 0; % N*m/deg
SP.ksi.ax = 1 ; SP.ksi.ax = 1;
SP = updateDamping(SP); SP = updateDamping(SP);
%% %%

Binary file not shown.

52
study_architecture.m Normal file
View File

@ -0,0 +1,52 @@
%%
run stewart_parameters.m
format shortE
%% Study the effect of the radius of the top platform position of the legs
leg_radius = 50:1:120;
max_disp = zeros(length(leg_radius), 6);
stiffness = zeros(length(leg_radius), 6, 6);
for i_leg = 1:length(leg_radius)
TP.leg.rad = leg_radius(i_leg);
run stewart_init.m;
max_disp(i_leg, :) = getMaxPureDisplacement(Leg, J)';
stiffness(i_leg, :, :) = getStiffnessMatrix(Leg, J);
end
%% Plot everything
figure;
hold on;
plot(leg_radius, max_disp(:, 1))
plot(leg_radius, max_disp(:, 2))
plot(leg_radius, max_disp(:, 3))
hold off;
legend({'tx', 'ty', 'tz'})
xlabel('Leg Radius at the platform'); ylabel('Maximum translation (m)');
figure;
hold on;
plot(leg_radius, max_disp(:, 4))
plot(leg_radius, max_disp(:, 5))
plot(leg_radius, max_disp(:, 6))
hold off;
legend({'rx', 'ry', 'rz'})
xlabel('Leg Radius at the platform'); ylabel('Maximum rotations (rad)');
figure;
hold on;
plot(leg_radius, stiffness(:, 1, 1))
plot(leg_radius, stiffness(:, 2, 2))
plot(leg_radius, stiffness(:, 3, 3))
hold off;
legend({'kx', 'ky', 'kz'})
xlabel('Leg Radius at the platform'); ylabel('Stiffness in translation (N/m)');
figure;
hold on;
plot(leg_radius, stiffness(:, 4, 4))
plot(leg_radius, stiffness(:, 5, 5))
plot(leg_radius, stiffness(:, 6, 6))
hold off;
legend({'mx', 'my', 'mz'})
xlabel('Leg Radius at the platform'); ylabel('Stiffness in rotations (N/(m/rad))');