diff --git a/src/displayArchitecture.m b/src/displayArchitecture.m index 3aa2073..1d9054c 100644 --- a/src/displayArchitecture.m +++ b/src/displayArchitecture.m @@ -9,6 +9,9 @@ function [] = displayArchitecture(stewart, args) % - AP [3x1] - The wanted position of {B} with respect to {A} % - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A} % - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A} +% - F_color [color] - Color used for the Fixed elements +% - M_color [color] - Color used for the Mobile elements +% - L_color [color] - Color used for the Legs elements % - frames [true/false] - Display the Frames % - legs [true/false] - Display the Legs % - joints [true/false] - Display the Joints @@ -21,6 +24,9 @@ arguments stewart args.AP (3,1) double {mustBeNumeric} = zeros(3,1) args.ARB (3,3) double {mustBeNumeric} = eye(3) + args.F_color = [0 0.4470 0.7410] + args.M_color = [0.8500 0.3250 0.0980] + args.L_color = [0 0 0] args.frames logical {mustBeNumericOrLogical} = true args.legs logical {mustBeNumericOrLogical} = true args.joints logical {mustBeNumericOrLogical} = true @@ -47,12 +53,12 @@ d_label = stewart.H/20; Ff = [0, 0, 0]; if args.frames quiver3(Ff(1)*ones(1,3), Ff(2)*ones(1,3), Ff(3)*ones(1,3), ... - [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', [0 0.4470 0.7410]) + [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color) if args.labels text(Ff(1) + d_label, ... Ff(2) + d_label, ... - Ff(3) + d_label, '$\{F\}$', 'Color', [0 0.4470 0.7410]); + Ff(3) + d_label, '$\{F\}$', 'Color', args.F_color); end end @@ -60,12 +66,12 @@ Fa = stewart.FO_A; if args.frames quiver3(Fa(1)*ones(1,3), Fa(2)*ones(1,3), Fa(3)*ones(1,3), ... - [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', [0 0.4470 0.7410]) + [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color) if args.labels text(Fa(1) + d_label, ... Fa(2) + d_label, ... - Fa(3) + d_label, '$\{A\}$', 'Color', [0 0.4470 0.7410]); + Fa(3) + d_label, '$\{A\}$', 'Color', args.F_color); end end @@ -79,18 +85,18 @@ if args.platforms && isfield(stewart, 'platforms') && isfield(stewart.platforms, plot3(points(1,:), ... points(2,:), ... - points(3,:), '-', 'Color', [0 0.4470 0.7410]); + points(3,:), '-', 'Color', args.F_color); end if args.joints scatter3(stewart.Fa(1,:), ... stewart.Fa(2,:), ... - stewart.Fa(3,:), 'MarkerEdgeColor', [0 0.4470 0.7410]); + stewart.Fa(3,:), 'MarkerEdgeColor', args.F_color); if args.labels for i = 1:size(stewart.Fa,2) text(stewart.Fa(1,i) + d_label, ... stewart.Fa(2,i), ... - stewart.Fa(3,i), sprintf('$a_{%i}$', i), 'Color', [0 0.4470 0.7410]); + stewart.Fa(3,i), sprintf('$a_{%i}$', i), 'Color', args.F_color); end end end @@ -100,12 +106,12 @@ Fm = FTm*[0; 0; 0; 1]; % Get the position of frame {M} w.r.t. {F} if args.frames FM_uv = FTm*[d_unit_vector*eye(3); zeros(1,3)]; % Rotated Unit vectors quiver3(Fm(1)*ones(1,3), Fm(2)*ones(1,3), Fm(3)*ones(1,3), ... - FM_uv(1,1:3), FM_uv(2,1:3), FM_uv(3,1:3), '-', 'Color', [0.8500 0.3250 0.0980]) + FM_uv(1,1:3), FM_uv(2,1:3), FM_uv(3,1:3), '-', 'Color', args.M_color) if args.labels text(Fm(1) + d_label, ... Fm(2) + d_label, ... - Fm(3) + d_label, '$\{M\}$', 'Color', [0.8500 0.3250 0.0980]); + Fm(3) + d_label, '$\{M\}$', 'Color', args.M_color); end end @@ -114,12 +120,12 @@ FB = stewart.FO_A + args.AP; if args.frames FB_uv = FTm*[d_unit_vector*eye(3); zeros(1,3)]; % Rotated Unit vectors quiver3(FB(1)*ones(1,3), FB(2)*ones(1,3), FB(3)*ones(1,3), ... - FB_uv(1,1:3), FB_uv(2,1:3), FB_uv(3,1:3), '-', 'Color', [0.8500 0.3250 0.0980]) + FB_uv(1,1:3), FB_uv(2,1:3), FB_uv(3,1:3), '-', 'Color', args.M_color) if args.labels text(FB(1) - d_label, ... FB(2) + d_label, ... - FB(3) + d_label, '$\{B\}$', 'Color', [0.8500 0.3250 0.0980]); + FB(3) + d_label, '$\{B\}$', 'Color', args.M_color); end end @@ -133,7 +139,7 @@ if args.platforms && isfield(stewart, 'platforms') && isfield(stewart.platforms, plot3(points(1,:), ... points(2,:), ... - points(3,:), '-', 'Color', [0.8500 0.3250 0.0980]); + points(3,:), '-', 'Color', args.M_color); end if args.joints @@ -141,13 +147,13 @@ if args.joints scatter3(Fb(1,:), ... Fb(2,:), ... - Fb(3,:), 'MarkerEdgeColor', [0.8500 0.3250 0.0980]); + Fb(3,:), 'MarkerEdgeColor', args.M_color); if args.labels for i = 1:size(Fb,2) text(Fb(1,i) + d_label, ... Fb(2,i), ... - Fb(3,i), sprintf('$b_{%i}$', i), 'Color', [0.8500 0.3250 0.0980]); + Fb(3,i), sprintf('$b_{%i}$', i), 'Color', args.M_color); end end end @@ -156,12 +162,12 @@ if args.legs for i = 1:6 plot3([stewart.Fa(1,i), Fb(1,i)], ... [stewart.Fa(2,i), Fb(2,i)], ... - [stewart.Fa(3,i), Fb(3,i)], 'k-'); + [stewart.Fa(3,i), Fb(3,i)], '-', 'Color', args.L_color); if args.labels text((stewart.Fa(1,i)+Fb(1,i))/2 + d_label, ... (stewart.Fa(2,i)+Fb(2,i))/2, ... - (stewart.Fa(3,i)+Fb(3,i))/2, sprintf('$%i$', i), 'Color', 'k'); + (stewart.Fa(3,i)+Fb(3,i))/2, sprintf('$%i$', i), 'Color', args.L_color); end end end diff --git a/stewart-architecture.html b/stewart-architecture.html index 5bb168c..37943b7 100644 --- a/stewart-architecture.html +++ b/stewart-architecture.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +initializeFramesPositions
: Initialize the positions of frames {A}, {B}, {F} and {M}
+initializeFramesPositions
: Initialize the positions of frames {A}, {B}, {F} and {M}
generateGeneralConfiguration
: Generate a Very General Configuration
+generateGeneralConfiguration
: Generate a Very General Configuration
computeJointsPose
: Compute the Pose of the Joints
+computeJointsPose
: Compute the Pose of the Joints
initializeStewartPose
: Determine the initial stroke in each leg to have the wanted pose
+initializeStewartPose
: Determine the initial stroke in each leg to have the wanted pose
initializeCylindricalPlatforms
: Initialize the geometry of the Fixed and Mobile Platforms
+initializeCylindricalPlatforms
: Initialize the geometry of the Fixed and Mobile Platforms
initializeCylindricalStruts
: Define the inertia of cylindrical struts
+initializeCylindricalStruts
: Define the inertia of cylindrical struts
initializeStrutDynamics
: Add Stiffness and Damping properties of each strut
+initializeStrutDynamics
: Add Stiffness and Damping properties of each strut
initializeJointDynamics
: Add Stiffness and Damping properties for spherical joints
+initializeJointDynamics
: Add Stiffness and Damping properties for spherical joints
displayArchitecture
: 3D plot of the Stewart platform architecture
+displayArchitecture
: 3D plot of the Stewart platform architecture
stewart.FRa = zeros(3,3,6); stewart.MRb = zeros(3,3,6); @@ -1077,11 +1077,11 @@ stewart.MRb = zeros(3,3,6);
initializeStewartPose
: Determine the initial stroke in each leg to have the wanted poseinitializeStewartPose
: Determine the initial stroke in each leg to have the wanted pose@@ -1089,9 +1089,9 @@ This Matlab function is accessible here
function [stewart] = initializeStewartPose(stewart, args) % initializeStewartPose - Determine the initial stroke in each leg to have the wanted pose @@ -1115,9 +1115,9 @@ This Matlab function is accessible here
arguments stewart @@ -1129,9 +1129,9 @@ This Matlab function is accessible here
[Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB); @@ -1142,11 +1142,11 @@ stewart.dLi = dLi;
initializeCylindricalPlatforms
: Initialize the geometry of the Fixed and Mobile PlatformsinitializeCylindricalPlatforms
: Initialize the geometry of the Fixed and Mobile Platforms
@@ -1154,9 +1154,9 @@ This Matlab function is accessible
-
@@ -1253,9 +1253,9 @@ This Matlab function is accessible h
@@ -1352,9 +1352,9 @@ This Matlab function is accessible here<
@@ -1413,9 +1413,9 @@ This Matlab function is accessible here<
@@ -1501,9 +1501,9 @@ This Matlab function is accessible here.
The reference frame of the 3d plot corresponds to the frame \(\{F\}\).
Let’s first plot the frame \(\{F\}\).
Plot the frame \(\{M\}\).
Plot the legs connecting the joints of the fixed base to the joints of the mobile platform.
Created: 2020-02-07 ven. 17:11 Created: 2020-02-07 ven. 17:18Function description
-Function description
+function [stewart] = initializeCylindricalPlatforms(stewart, args)
% initializeCylindricalPlatforms - Initialize the geometry of the Fixed and Mobile Platforms
@@ -1188,9 +1188,9 @@ This Matlab function is accessible
-
Optional Parameters
-Optional Parameters
+arguments
stewart
@@ -1206,9 +1206,9 @@ This Matlab function is accessible
-
Create the
-platforms
structCreate the
+platforms
structplatforms = struct();
@@ -1230,9 +1230,9 @@ platforms.Mpi = diag([1/12
Save the
-platforms
structSave the
+platforms
structstewart.platforms = platforms;
@@ -1241,11 +1241,11 @@ platforms.Mpi = diag([1/12
5.6
+initializeCylindricalStruts
: Define the inertia of cylindrical struts5.6
initializeCylindricalStruts
: Define the inertia of cylindrical strutsFunction description
-Function description
+function [stewart] = initializeCylindricalStruts(stewart, args)
% initializeCylindricalStruts - Define the mass and moment of inertia of cylindrical struts
@@ -1287,9 +1287,9 @@ This Matlab function is accessible h
Optional Parameters
-Optional Parameters
+arguments
stewart
@@ -1305,9 +1305,9 @@ This Matlab function is accessible h
Create the
-struts
structureCreate the
+struts
structurestruts = struct();
@@ -1340,11 +1340,11 @@ struts.Msi = zeros(3, 3, 6);
5.7
+initializeStrutDynamics
: Add Stiffness and Damping properties of each strut5.7
initializeStrutDynamics
: Add Stiffness and Damping properties of each strutFunction description
-Function description
+function [stewart] = initializeStrutDynamics(stewart, args)
% initializeStrutDynamics - Add Stiffness and Damping properties of each strut
@@ -1375,9 +1375,9 @@ This Matlab function is accessible here<
Optional Parameters
-Optional Parameters
+arguments
stewart
@@ -1389,9 +1389,9 @@ This Matlab function is accessible here<
Add Stiffness and Damping properties of each strut
-Add Stiffness and Damping properties of each strut
+stewart.Ki = args.Ki;
stewart.Ci = args.Ci;
@@ -1401,11 +1401,11 @@ stewart.Ci = args.Ci;
5.8
+initializeJointDynamics
: Add Stiffness and Damping properties for spherical joints5.8
initializeJointDynamics
: Add Stiffness and Damping properties for spherical jointsFunction description
-Function description
+function [stewart] = initializeJointDynamics(stewart, args)
% initializeJointDynamics - Add Stiffness and Damping properties for the spherical joints
@@ -1445,9 +1445,9 @@ This Matlab function is accessible here<
Optional Parameters
-Optional Parameters
+arguments
stewart
@@ -1464,9 +1464,9 @@ This Matlab function is accessible here<
Add Stiffness and Damping properties of each strut
-Add Stiffness and Damping properties of each strut
+if args.disable
stewart.Ksbi = zeros(6,1);
@@ -1489,11 +1489,11 @@ This Matlab function is accessible here<
5.9
+displayArchitecture
: 3D plot of the Stewart platform architecture5.9
displayArchitecture
: 3D plot of the Stewart platform architectureFunction description
-Function description
+function [] = displayArchitecture(stewart, args)
% displayArchitecture - 3D plot of the Stewart platform architecture
@@ -1516,6 +1516,9 @@ This Matlab function is accessible here.
% - AP [3x1] - The wanted position of {B} with respect to {A}
% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}
% - ARB [3x3] - The rotation matrix that gives the wanted orientation of {B} with respect to {A}
+% - F_color [color] - Color used for the Fixed elements
+% - M_color [color] - Color used for the Mobile elements
+% - L_color [color] - Color used for the Legs elements
% - frames [true/false] - Display the Frames
% - legs [true/false] - Display the Legs
% - joints [true/false] - Display the Joints
@@ -1528,14 +1531,17 @@ This Matlab function is accessible here.
Optional Parameters
-Optional Parameters
+arguments
stewart
args.AP (3,1) double {mustBeNumeric} = zeros(3,1)
args.ARB (3,3) double {mustBeNumeric} = eye(3)
+ args.F_color = [0 0.4470 0.7410]
+ args.M_color = [0.8500 0.3250 0.0980]
+ args.L_color = [0 0 0]
args.frames logical {mustBeNumericOrLogical} = true
args.legs logical {mustBeNumericOrLogical} = true
args.joints logical {mustBeNumericOrLogical} = true
@@ -1547,9 +1553,9 @@ This Matlab function is accessible here.
Figure Creation, Frames and Homogeneous transformations
-Figure Creation, Frames and Homogeneous transformations
+Fixed Base elements
-Fixed Base elements
+Ff = [0, 0, 0];
if args.frames
quiver3(Ff(1)*ones(1,3), Ff(2)*ones(1,3), Ff(3)*ones(1,3), ...
- [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', [0 0.4470 0.7410])
+ [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color)
if args.labels
text(Ff(1) + d_label, ...
Ff(2) + d_label, ...
- Ff(3) + d_label, '$\{F\}$', 'Color', [0 0.4470 0.7410]);
+ Ff(3) + d_label, '$\{F\}$', 'Color', args.F_color);
end
end
@@ -1621,12 +1627,12 @@ Now plot the frame \(\{A\}\) fixed to the Base.
if args.frames
quiver3(Fa(1)*ones(1,3), Fa(2)*ones(1,3), Fa(3)*ones(1,3), ...
- [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', [0 0.4470 0.7410])
+ [d_unit_vector 0 0], [0 d_unit_vector 0], [0 0 d_unit_vector], '-', 'Color', args.F_color)
if args.labels
text(Fa(1) + d_label, ...
Fa(2) + d_label, ...
- Fa(3) + d_label, '$\{A\}$', 'Color', [0 0.4470 0.7410]);
+ Fa(3) + d_label, '$\{A\}$', 'Color', args.F_color);
end
end
@@ -1646,7 +1652,7 @@ Let’s then plot the circle corresponding to the shape of the Fixed base.
plot3(points(1,:), ...
points(2,:), ...
- points(3,:), '-', 'Color', [0 0.4470 0.7410]);
+ points(3,:), '-', 'Color', args.F_color);
end
if args.joints
scatter3(stewart.Fa(1,:), ...
stewart.Fa(2,:), ...
- stewart.Fa(3,:), 'MarkerEdgeColor', [0 0.4470 0.7410]);
+ stewart.Fa(3,:), 'MarkerEdgeColor', args.F_color);
if args.labels
for i = 1:size(stewart.Fa,2)
text(stewart.Fa(1,i) + d_label, ...
stewart.Fa(2,i), ...
- stewart.Fa(3,i), sprintf('$a_{%i}$', i), 'Color', [0 0.4470 0.7410]);
+ stewart.Fa(3,i), sprintf('$a_{%i}$', i), 'Color', args.F_color);
end
end
end
@@ -1672,9 +1678,9 @@ Let’s now plot the position and labels of the Fixed Joints
Mobile Platform elements
-Mobile Platform elements
+Legs
-Legs
+5.9.1 Figure parameters
+5.9.1 Figure parameters
view([1 -0.6 0.4]);
@@ -1806,7 +1812,7 @@ Plot the legs connecting the joints of the fixed base to the joints of the mobil