Add multiple scripts (compute/plot max pos, effect of param)
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
function [X, Y, Z] = getMaxPositions(lmax, J)
 | 
			
		||||
function [X, Y, Z] = getMaxPositions(Leg, J)
 | 
			
		||||
    theta = linspace(0, 2*pi, 100);
 | 
			
		||||
    phi = linspace(-pi/2 , pi/2, 100);
 | 
			
		||||
    dmax = zeros(length(theta), length(phi));
 | 
			
		||||
@@ -6,7 +6,7 @@ function [X, Y, Z] = getMaxPositions(lmax, J)
 | 
			
		||||
    for i = 1:length(theta)
 | 
			
		||||
        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]';
 | 
			
		||||
            dmax(i, j) = lmax/max(abs(L));
 | 
			
		||||
            dmax(i, j) = Leg.stroke/max(abs(L));
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								getMaxPureDisplacement.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								getMaxPureDisplacement.m
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										3
									
								
								getStiffnessMatrix.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
function [K] = getStiffnessMatrix(leg, J)
 | 
			
		||||
    K = leg.k.ax*(J'*J);
 | 
			
		||||
end
 | 
			
		||||
@@ -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;
 | 
			
		||||
hold on;
 | 
			
		||||
mesh(X, Y, Z);
 | 
			
		||||
colorbar;
 | 
			
		||||
hold off;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,3 @@
 | 
			
		||||
%%
 | 
			
		||||
clear;
 | 
			
		||||
close all;
 | 
			
		||||
clc;
 | 
			
		||||
 | 
			
		||||
%%
 | 
			
		||||
run stewart_parameters.m
 | 
			
		||||
 | 
			
		||||
%% Define some constant values
 | 
			
		||||
deg2rad = pi/180;
 | 
			
		||||
x_axis = [1 0 0];
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ TP.color = [0.5 0.5 0.5] ; %rgb
 | 
			
		||||
 | 
			
		||||
%% Leg
 | 
			
		||||
Leg = struct();
 | 
			
		||||
Leg.stroke = 80e-6; % m
 | 
			
		||||
Leg.rad.bottom = 8; %mm
 | 
			
		||||
Leg.rad.top = 5; %mm
 | 
			
		||||
Leg.sphere.bottom = 10; % mm
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										52
									
								
								study_architecture.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								study_architecture.m
									
									
									
									
									
										Normal 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))');
 | 
			
		||||
		Reference in New Issue
	
	Block a user