From 1427883583bec390008768d3cc182adc568c8665 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 15:34:18 +0200 Subject: [PATCH] Add script to compute automatically the solution --- MaxLocalisation.asv | 67 --------------------------------------- MaxLocalisation.m | 2 +- Test.asv | 59 +++++++++++++++++++++++++++++++++++ Test.m | 59 +++++++++++++++++++++++++++++++++++ stewart_parameters.m | 4 +-- study_architecture.m | 74 ++++++++++++++++++++++---------------------- 6 files changed, 158 insertions(+), 107 deletions(-) delete mode 100644 MaxLocalisation.asv create mode 100644 Test.asv create mode 100644 Test.m diff --git a/MaxLocalisation.asv b/MaxLocalisation.asv deleted file mode 100644 index 6be4ddc..0000000 --- a/MaxLocalisation.asv +++ /dev/null @@ -1,67 +0,0 @@ -run study_architecture.m -format short -%% 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,:)); -lkm=[mx1,mx2] - -%% my -my=[leg_radius', stiffness(:, 5, 5)]'; -my1=find(my(2,:)==max(my(2,:))); -my2=max(my(2,:)); -lkm=[mx1,my2] \ No newline at end of file diff --git a/MaxLocalisation.m b/MaxLocalisation.m index c8e3e08..a3b7cd3 100644 --- a/MaxLocalisation.m +++ b/MaxLocalisation.m @@ -1,5 +1,5 @@ run study_architecture.m -format short +format shortEnG %% tx tx=[leg_radius', max_disp(:, 1)]'; tx1=find(tx(2,:)==max(tx(2,:))); diff --git a/Test.asv b/Test.asv new file mode 100644 index 0000000..0bc3753 --- /dev/null +++ b/Test.asv @@ -0,0 +1,59 @@ +%% paramétres variables +BP_leg_radius = 100:10:150; +TP_leg_radius = 50:10:100; +BP_leg_ang = 0:1:30; +TP_leg_ang = 0:1:30; + +%% intervalle +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(min(stiffness(:, : , :, :, 1, 1), stiffness(:, : , :, :, 2, 2)), stiffness(:, : , :, :, 3, 3)); +[C,I] = max(M(:)); + +[I1,I2,I3,I4] = ind2sub(size(stiffness(:, : , :, :, 3, 3)),I); +BP.leg.rad = BP_leg_radius(I1) +TP.leg.rad = TP_leg_radius(I2) +BP.leg.ang = 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 +% diff --git a/Test.m b/Test.m new file mode 100644 index 0000000..b3d6ee8 --- /dev/null +++ b/Test.m @@ -0,0 +1,59 @@ +%% paramétres variables +BP_leg_radius = 100:10:150; +TP_leg_radius = 50:10:100; +BP_leg_ang = 0:1:30; +TP_leg_ang = 0:1:30; + +%% intervalle +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(min(stiffness(:, : , :, :, 4, 4), stiffness(:, : , :, :, 5, 5)), stiffness(:, : , :, :, 6, 6)); +[C,I] = max(M(:)); + +[I1,I2,I3,I4] = ind2sub(size(stiffness(:, : , :, :, 3, 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 +% diff --git a/stewart_parameters.m b/stewart_parameters.m index f583ec2..7fb3769 100644 --- a/stewart_parameters.m +++ b/stewart_parameters.m @@ -18,7 +18,7 @@ TP = struct(); TP.rad.int = 0;%mm TP.rad.ext = 150; %mm TP.thickness = 10; % mm -TP.leg.rad = 120; %mm +TP.leg.rad = 100; %mm TP.leg.ang = 5; %deg TP.density = 8000; %kg/m^3 TP.color = [0.5 0.5 0.5]; %rgb @@ -54,7 +54,7 @@ SP.m = SP.density.bottom*2*pi*((SP.rad.bottom*1e-3)^2)*(SP.height.bottom*1e-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 = 1; +SP.ksi.ax = 10; SP = updateDamping(SP); %% diff --git a/study_architecture.m b/study_architecture.m index bc2e66d..1fe5007 100644 --- a/study_architecture.m +++ b/study_architecture.m @@ -1,9 +1,9 @@ %% run stewart_parameters.m -format short +format shortE %% Study the effect of the radius of the top platform position of the legs -leg_radius = 50:1:150; +leg_radius = 50:1:120; max_disp = zeros(length(leg_radius), 6); stiffness = zeros(length(leg_radius), 6, 6); @@ -15,39 +15,39 @@ for i_leg = 1:length(leg_radius) 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))'); +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))');