Remove unused scripts

This commit is contained in:
Thomas Dehaeze 2018-06-07 13:54:15 +02:00
parent 86069beda1
commit 31a59fcca3
5 changed files with 2 additions and 297 deletions

View File

@ -1,73 +0,0 @@
run study_architecture.m
format shortEnG
%% tx
tx=[leg_radius', max_disp(:, 1)]';
tx1=find(tx(2,:)==max(tx(2,:)));
tx2=max(tx(2,:));
ltx=[tx1,tx2]
%% ty
ty=[leg_radius', max_disp(:, 2)]';
ty1=find(ty(2,:)==max(ty(2,:)));
ty2=max(ty(2,:));
lty=[ty1,ty2]
%% tz
tz=[leg_radius', max_disp(:,3)]';
tz1=find(tz(2,:)==max(tz(2,:)));
tz2=max(tz(2,:));
ltz=[tz1,tz2]
%% rx
rx=[leg_radius', max_disp(:,4)]';
rx1=find(rx(2,:)==max(rx(2,:)));
rx2=max(rx(2,:));
lrx=[rx1,rx2]
%% rx
ry=[leg_radius', max_disp(:,5)]';
ry1=find(ry(2,:)==max(ry(2,:)));
ry2=max(ry(2,:));
lry=[ry1,ry2]
%% rx
rz=[leg_radius', max_disp(:,6)]';
rz1=find(rz(2,:)==max(rz(2,:)));
rz2=max(rz(2,:));
lrz=[rz1,rz2]
%% kx
kx=[leg_radius', stiffness(:, 1, 1)]';
kx1=find(kx(2,:)==max(kx(2,:)));
kx2=max(kx(2,:));
lkx=[kx1,kx2]
%% ky
ky=[leg_radius', stiffness(:, 2, 2)]';
ky1=find(ky(2,:)==max(ky(2,:)));
ky2=max(ky(2,:));
lky=[ky1,ky2]
%% kz
kz=[leg_radius', stiffness(:, 3, 3)]';
kz1=find(kz(2,:)==max(kz(2,:)));
kz2=max(kz(2,:));
lkz=[kz1,kz2]
%% mx
mx=[leg_radius', stiffness(:, 4, 4)]';
mx1=find(mx(2,:)==max(mx(2,:)));
mx2=max(mx(2,:));
lmx=[mx1,mx2]
%% my
my=[leg_radius', stiffness(:, 5, 5)]';
my1=find(my(2,:)==max(my(2,:)));
my2=max(my(2,:));
lmy=[my1,my2]
%% my
mz=[leg_radius', stiffness(:, 6, 6)]';
mz1=find(mz(2,:)==max(mz(2,:)));
mz2=max(mz(2,:));
lmz=[mz1,mz2]

59
Test.m
View File

@ -1,59 +0,0 @@
%% Variable parameters
BP_leg_radius = 100:10:150;
TP_leg_radius = 50:10:100;
BP_leg_ang = 0:1:30;
TP_leg_ang = 0:1:30;
%%
intervalle1=10e-6;
intervalle2=10e-3;
% variation=1e-3;
%% Study the effect of the radius of the top platform position of the legs
max_disp = zeros(length(BP_leg_radius),length(TP_leg_radius),length(BP_leg_ang),length(TP_leg_ang), 6);
stiffness = zeros(length(BP_leg_radius),length(TP_leg_radius),length(BP_leg_ang),length(TP_leg_ang), 6, 6);
for Blri = 1:length(BP_leg_radius)
for Tlri = 1:length(TP_leg_radius)
for Blai = 1:length(BP_leg_ang)
for Tlai = 1:length(TP_leg_ang)
BP.leg.rad = BP_leg_radius(Blri);
TP.leg.rad = TP_leg_radius(Tlri);
BP.leg.ang = BP_leg_ang(Blai);
TP.leg.ang = TP_leg_ang(Tlai);
run stewart_init.m;
max_disp(Blri,Tlri,Blai,Tlai, :) = getMaxPureDisplacement(Leg, J)';
stiffness(Blri,Tlri,Blai,Tlai, :, :) = getStiffnessMatrix(Leg, J);
end
end
end
end
%%
M = min(max_disp(:, : , :, :, 1), max_disp(:, : , :, :, 2));
[C,I] = max(M(:));
[I1,I2,I3,I4] = ind2sub(size(max_disp(:, : , :, :, 3)),I);
BP_leg_radius(I1)
TP_leg_radius(I2)
BP_leg_ang(I3)
TP_leg_ang(I4)
% %%
% for Blri = 1:length(BP_leg_radius)
% for Tlri = 1:length(TP_leg_radius)
% for Blai = 1:length(BP_leg_ang)
% for Tlai = 1:length(TP_leg_ang)
% if max_disp==intervalle1
% i=i+1;
% s1(1,i)=BP_leg_radius(Blri);
% s1(2,i)=TP_leg_radius(Tlri);
% s1(3,i)=BP_leg_ang(Blai);
% s1(4,i)=TP_leg_ang(Tlai);
% else
% end
% end
% end
% end
% end
%

View File

@ -1,91 +0,0 @@
%% Define some constant values
deg2rad = pi/180;
x_axis = [1 0 0];
y_axis = [0 1 0];
z_axis = [0 0 1];
%% Connection points on base and top plate w.r.t. World frame at the center of the base plate
pos_base = zeros(6, 3);
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_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; % TODO
radius_b = BP.leg.rad*0.001; % rayon emplacement support base
radius_t = TP.leg.rad*0.001; % top radius in meters
for i = 1:3
% base points
angle_m_b = (2*pi/3)* (i-1) - alpha_b;
angle_p_b = (2*pi/3)* (i-1) + alpha_b;
pos_base(2*i-1,:) = [radius_b*cos(angle_m_b), radius_b*sin(angle_m_b), 0.0];
pos_base(2*i,:) = [radius_b*cos(angle_p_b), radius_b*sin(angle_p_b), 0.0];
% top points
% Top points are 60 degrees offset
angle_m_t = (2*pi/3)* (i-1) - alpha_t + 2*pi/6;
angle_p_t = (2*pi/3)* (i-1) + alpha_t + 2*pi/6;
pos_top(2*i-1,:) = [radius_t*cos(angle_m_t), radius_t*sin(angle_m_t), height];
pos_top(2*i,:) = [radius_t*cos(angle_p_t), radius_t*sin(angle_p_t), height];
end
% permute pos_top points so that legs are end points of base and top points
pos_top = [pos_top(6,:); pos_top(1:5,:)]; %6th point on top connects to 1st on bottom
pos_top_tranform = pos_top - height*[zeros(6, 2),ones(6, 1)];
%% Compute points w.r.t. to the body frame in a 3x6 matrix
body_pts = pos_top' - height*[zeros(2,6);ones(1,6)];
%% leg vectors
legs = pos_top - pos_base;
leg_length = zeros(6, 1);
leg_vectors = zeros(6, 3);
for i = 1:6
leg_length(i) = norm(legs(i,:));
leg_vectors(i,:) = legs(i,:) / leg_length(i);
end
Leg.lenght = 1000*leg_length(1)/1.5;
Leg.shape.bot = [0 0; Leg.rad.bottom 0; Leg.rad.bottom Leg.lenght; Leg.rad.top Leg.lenght; Leg.rad.top 0.2*Leg.lenght; 0 0.2*Leg.lenght];
%% Calculate revolute and cylindrical axes
rev1 = zeros(6, 3);
rev2 = zeros(6, 3);
rev3 = zeros(6, 3);
rev4 = zeros(6, 3);
cyl1 = zeros(6, 3);
for i = 1:6
rev1(i,:) = cross(leg_vectors(i,:), z_axis);
rev1(i,:) = rev1(i,:) / norm(rev1(i,:));
rev3(i,:) = rev1(i,:);
rev2(i,:) = - cross(rev1(i,:), leg_vectors(i,:));
rev2(i,:) = rev2(i,:) / norm(rev2(i,:));
rev4(i,:) = rev2(i,:);
cyl1(i,:) = leg_vectors(i,:);
end
%% Coordinate systems
lower_leg = struct('origin', [0 0 0], 'rotation', eye(3), 'end_point', [0 0 0]);
upper_leg = struct('origin', [0 0 0], 'rotation', eye(3), 'end_point', [0 0 0]);
for i = 1:6
lower_leg(i).origin = pos_base(i,:) + (3/8)*legs(i,:);
lower_leg(i).end_point = pos_base(i,:) + (3/4)*legs(i,:);
lower_leg(i).rotation = [rev1(i,:)', rev2(i,:)', cyl1(i,:)'];
upper_leg(i).origin = pos_base(i,:) + (1-3/8)*legs(i,:);
upper_leg(i).end_point = pos_base(i,:) + (1/4)*legs(i,:);
upper_leg(i).rotation = [rev1(i,:)', rev2(i,:)', cyl1(i,:)'];
end
%% Position Matrix
M_pos_base = pos_base + (height+(TP.thickness+Leg.sphere.top+SP.thickness.top+stewart.jacobian)*1e-3)*[zeros(6, 2),ones(6, 1)];
%% Compute Jacobian Matrix
aa = pos_top_tranform + (stewart.jacobian - TP.thickness - SP.height.top)*1e-3*[zeros(6, 2),ones(6, 1)];
J = getJacobianMatrix(leg_vectors', aa');

View File

@ -1,74 +0,0 @@
%% Nass height
stewart = struct();
stewart.h = 350; % Total height of the platform [mm]
stewart.jacobian = 0; % Point where the Jacobian is computed => Center of rotation [mm]
%% Bottom Plate
BP = struct();
BP.rad.int = 110; % Internal Radius [mm]
BP.rad.ext = 207.5; % External Radius [mm]
BP.thickness = 26; % Thickness [mm]
BP.leg.rad = 175.5; % Radius where the legs articulations are positionned [mm]
BP.leg.ang = 9.5; % Angle Offset [deg]
BP.density = 8000; % Density of the material [kg/m^3]
BP.color = [0.5 0.5 0.5]; % Color [rgb]
%% Top Plate
TP = struct();
TP.rad.int = 82; % Internal Radius [mm]
TP.rad.ext = 150; % Internal Radius [mm]
TP.thickness = 26; % Thickness [mm]
TP.leg.rad = 118; % Radius where the legs articulations are positionned [mm]
TP.leg.ang = 12.1; % Angle Offset [deg]
TP.density = 8000; % Density of the material [kg/m^3]
TP.color = [0.5 0.5 0.5]; % Color [rgb]
%% Leg
Leg = struct();
Leg.stroke = 10e-3; % Maximum Stroke of each leg [m]
Leg.k.ax = 5e7; % Stiffness of each leg [N/m]
Leg.ksi.ax = 10; % Maximum amplification at resonance []
Leg.rad.bottom = 25; % Radius of the cylinder of the bottom part [mm]
Leg.rad.top = 17; % Radius of the cylinder of the top part [mm]
Leg.density = 8000; % Density of the material [kg/m^3]
Leg.color.bottom = [0.5 0.5 0.5]; % Color [rgb]
Leg.color.top = [0.5 0.5 0.5]; % Color [rgb]
Leg.sphere.bottom = Leg.rad.bottom; % Size of the sphere at the end of the leg [mm]
Leg.sphere.top = Leg.rad.top; % Size of the sphere at the end of the leg [mm]
Leg.m = TP.density*((pi*(TP.rad.ext/1000)^2)*(TP.thickness/1000)-(pi*(TP.rad.int/1000^2))*(TP.thickness/1000))/6; % TODO [kg]
Leg = updateDamping(Leg);
%% Sphere
SP = struct();
SP.height.bottom = 27; % [mm]
SP.height.top = 27; % [mm]
SP.density.bottom = 8000; % [kg/m^3]
SP.density.top = 8000; % [kg/m^3]
SP.color.bottom = [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.ksi.ax = 10;
SP.thickness.bottom = SP.height.bottom-Leg.sphere.bottom; % [mm]
SP.thickness.top = SP.height.top-Leg.sphere.top; % [mm]
SP.rad.bottom = Leg.sphere.bottom; % [mm]
SP.rad.top = Leg.sphere.top; % [mm]
SP.m = SP.density.bottom*2*pi*((SP.rad.bottom*1e-3)^2)*(SP.height.bottom*1e-3); % TODO [kg]
SP = updateDamping(SP);
%%
function element = updateDamping(element)
field = fieldnames(element.k);
for i = 1:length(field)
element.c.(field{i}) = 1/element.ksi.(field{i})*sqrt(element.k.(field{i})/element.m);
end
end

View File

@ -1,3 +1,5 @@
%% TODO - rewrite this script
%% %%
run stewart_parameters.m run stewart_parameters.m
format shortE format shortE