From aad36ca47f93186b31b331707e417b670283b094 Mon Sep 17 00:00:00 2001
From: Thomas Dehaeze
@@ -768,7 +769,7 @@ The obtained initializeStewartPlatform
: Initialize the Stewart Platform structure
initializeFramesPositions
: Initialize the positions of frames {A}, {B}, {F} and {M}
generateGeneralConfiguration
: Generate a Very General Configuration
computeJointsPose
: Compute the Pose of the Joints
-
stewart
structure elementsstewart
structure elementsstewart
structurestewart
structureinitializeStewartPose
: Determine the initial stroke in each leg to have the wanted pose
initializeCylindricalPlatforms
: Initialize the geometry of the Fixed and Mobile Platforms
initializeCylindricalStruts
: Define the inertia of cylindrical struts
initializeStrutDynamics
: Add Stiffness and Damping properties of each strut
initializeAmplifiedStrutDynamics
: Add Stiffness and Damping properties of each strut for an amplified piezoelectric actuator
initializeJointDynamics
: Add Stiffness and Damping properties for spherical joints
-
initializeInertialSensor
: Initialize the inertial sensor in each strut
displayArchitecture
: 3D plot of the Stewart platform architecture
-
stewart
structure elementsstewart
structure elementsstewart
Matlab structure contains all the information
The function displayArchitecture
can be used to display the current Stewart configuration:
displayArchitecture(stewart); +displayArchitecture(stewart, 'views', 'all');
function [stewart] = initializeStewartPlatform() % initializeStewartPlatform - Initialize the stewart structure @@ -915,11 +916,11 @@ This Matlab function is accessible
arguments stewart @@ -982,9 +983,9 @@ FO_A = MO_B + FO_M; % Po
stewart
structurestewart
structurestewart.geometry.H = H; stewart.geometry.FO_M = FO_M; @@ -1008,9 +1009,9 @@ This Matlab function is accessible -Documentation
-++-Documentation
+Joints are positions on a circle centered with the Z axis of {F} and {M} and at a chosen distance from {F} and {M}. The radius of the circles can be chosen as well as the angles where the joints are located (see Figure 9). @@ -1025,9 +1026,9 @@ The radius of the circles can be chosen as well as the angles where the joints a
-Function description
-++Function description
+-function [stewart] = generateGeneralConfiguration(stewart, args) % generateGeneralConfiguration - Generate a Very General Configuration @@ -1052,9 +1053,9 @@ The radius of the circles can be chosen as well as the angles where the joints a-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1089,9 +1090,9 @@ Mb = zeros(3,6);-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.platform_F.Fa = Fa; stewart.platform_M.Mb = Mb; @@ -1113,9 +1114,9 @@ This Matlab function is accessible here-Documentation
-++Documentation
+-@@ -1125,9 +1126,9 @@ This Matlab function is accessible here
-Function description
-++Function description
+-function [stewart] = computeJointsPose(stewart) % computeJointsPose - @@ -1160,9 +1161,9 @@ This Matlab function is accessible here-Check the
-stewart
structure elements++Check the
+stewart
structure elements-assert(isfield(stewart.platform_F, 'Fa'), 'stewart.platform_F should have attribute Fa') Fa = stewart.platform_F.Fa; @@ -1233,9 +1234,9 @@ MRb = zeros(3,3,6);-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.geometry.Aa = Aa; stewart.geometry.Ab = Ab; @@ -1268,9 +1269,9 @@ This Matlab function is accessible here-Function description
-++Function description
+-function [stewart] = initializeStewartPose(stewart, args) % initializeStewartPose - Determine the initial stroke in each leg to have the wanted pose @@ -1294,9 +1295,9 @@ This Matlab function is accessible here-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1318,9 +1319,9 @@ This Matlab function is accessible here-Populate the
-stewart
structure++Populate the
+stewart
structurestewart.actuators.Leq = dLi;@@ -1341,9 +1342,9 @@ This Matlab function is accessible -Function description
-++Function description
+function [stewart] = initializeCylindricalPlatforms(stewart, args) % initializeCylindricalPlatforms - Initialize the geometry of the Fixed and Mobile Platforms @@ -1377,9 +1378,9 @@ This Matlab function is accessible -Optional Parameters
-++Optional Parameters
+arguments stewart @@ -1414,9 +1415,9 @@ This Matlab function is accessible -Populate the
-stewart
structure++Populate the
+stewart
structurestewart.platform_F.type = 1; @@ -1452,9 +1453,9 @@ This Matlab function is accessible -Function description
-++Function description
+function [stewart] = initializeCylindricalStruts(stewart, args) % initializeCylindricalStruts - Define the mass and moment of inertia of cylindrical struts @@ -1487,9 +1488,9 @@ This Matlab function is accessible -Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1537,9 +1538,9 @@ I_M = zeros(3, 3, 6); % Inertia of the "mobile" part o
-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.struts_M.type = 1; @@ -1575,9 +1576,9 @@ This Matlab function is accessible he-Documentation
-++Documentation
+@@ -1606,9 +1607,9 @@ A simplistic model of such amplified actuator is shown in Figure -
Function description
-++Function description
+function [stewart] = initializeStrutDynamics(stewart, args) % initializeStrutDynamics - Add Stiffness and Damping properties of each strut @@ -1630,9 +1631,9 @@ A simplistic model of such amplified actuator is shown in Figure -Optional Parameters
-++Optional Parameters
+arguments stewart @@ -1670,9 +1671,9 @@ This Matlab function is accessible -Documentation
-++Documentation
+An amplified piezoelectric actuator is shown in Figure 13.
@@ -1705,9 +1706,9 @@ A simplistic model of such amplified actuator is shown in Figure -Function description
-++Function description
+function [stewart] = initializeAmplifiedStrutDynamics(stewart, args) % initializeAmplifiedStrutDynamics - Add Stiffness and Damping properties of each strut @@ -1735,9 +1736,9 @@ A simplistic model of such amplified actuator is shown in Figure -Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1762,9 +1763,9 @@ C = args.Ca + args.Cr;
-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.actuators.type = 2; @@ -1794,9 +1795,9 @@ This Matlab function is accessible he-Function description
-++Function description
+-function [stewart] = initializeJointDynamics(stewart, args) % initializeJointDynamics - Add Stiffness and Damping properties for the spherical joints @@ -1831,9 +1832,9 @@ This Matlab function is accessible he-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1959,9 +1960,9 @@ This Matlab function is accessible h-Function description
-++Function description
+-function [stewart] = initializeInertialSensor(stewart, args) % initializeInertialSensor - Initialize the inertial sensor in each strut @@ -1987,9 +1988,9 @@ This Matlab function is accessible h-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -2030,9 +2031,9 @@ This Matlab function is accessible h-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.sensors.inertial = sensor;@@ -2053,9 +2054,9 @@ This Matlab function is accessible here-Function description
-++Function description
+-function [] = displayArchitecture(stewart, args) % displayArchitecture - 3D plot of the Stewart platform architecture @@ -2076,6 +2077,7 @@ This Matlab function is accessible here % - joints [true/false] - Display the Joints % - labels [true/false] - Display the Labels % - platforms [true/false] - Display the Platforms +% - views ['all', 'xy', 'yz', 'xz', 'default'] - % % Outputs:@@ -2083,9 +2085,9 @@ This Matlab function is accessible here-Optional Parameters
-++-Optional Parameters
+arguments stewart @@ -2099,15 +2101,16 @@ This Matlab function is accessible here args.joints logical {mustBeNumericOrLogical} = true args.labels logical {mustBeNumericOrLogical} = true args.platforms logical {mustBeNumericOrLogical} = true + args.views char {mustBeMember(args.views,{'all', 'xy', 'xz', 'yz', 'default'})} = 'default' end-Check the
-stewart
structure elements+++Check the
+stewart
structure elements++ +assert(isfield(stewart.platform_F, 'FO_A'), 'stewart.platform_F should have attribute FO_A') FO_A = stewart.platform_F.FO_A; @@ -2136,7 +2139,12 @@ Mb = stewart.platform_M.Mb; The reference frame of the 3d plot corresponds to the frame \(\{F\}\).-@@ -2367,15 +2375,65 @@ Plot the legs connecting the joints of the fixed base to the joints of the mobilfigure; +if ~strcmp(args.views, 'all') + figure; +else + f = figure('visible', 'off'); +end + hold on;5.12.1 Figure parameters
-view([1 -0.6 0.4]); +switch args.views + case 'default' + view([1 -0.6 0.4]); + case 'xy' + view([0 0 1]); + case 'xz' + view([0 -1 0]); + case 'yz' + view([1 0 0]); +end axis equal; axis off;++5.12.2 Subplots
++++if strcmp(args.views, 'all') + hAx = findobj('type', 'axes'); + + figure; + s1 = subplot(2,2,1); + copyobj(get(hAx(1), 'Children'), s1); + view([0 0 1]); + axis equal; + axis off; + title('Top') + + s2 = subplot(2,2,2); + copyobj(get(hAx(1), 'Children'), s2); + view([1 -0.6 0.4]); + axis equal; + axis off; + + s3 = subplot(2,2,3); + copyobj(get(hAx(1), 'Children'), s3); + view([1 0 0]); + axis equal; + axis off; + title('Front') + + s4 = subplot(2,2,4); + copyobj(get(hAx(1), 'Children'), s4); + view([0 -1 0]); + axis equal; + axis off; + title('Side') +end +@@ -2386,7 +2444,7 @@ Plot the legs connecting the joints of the fixed base to the joints of the mobil
diff --git a/org/stewart-architecture.org b/org/stewart-architecture.org index 1b8ad59..ed0d538 100644 --- a/org/stewart-architecture.org +++ b/org/stewart-architecture.org @@ -241,7 +241,7 @@ The obtained =stewart= Matlab structure contains all the information for analysi The function =displayArchitecture= can be used to display the current Stewart configuration: #+begin_src matlab - displayArchitecture(stewart); + displayArchitecture(stewart, 'views', 'all'); #+end_src #+header: :tangle no :exports results :results none :noweb yes @@ -1450,6 +1450,7 @@ This Matlab function is accessible [[file:../src/displayArchitecture.m][here]]. % - joints [true/false] - Display the Joints % - labels [true/false] - Display the Labels % - platforms [true/false] - Display the Platforms + % - views ['all', 'xy', 'yz', 'xz', 'default'] - % % Outputs: #+end_src @@ -1471,6 +1472,7 @@ This Matlab function is accessible [[file:../src/displayArchitecture.m][here]]. args.joints logical {mustBeNumericOrLogical} = true args.labels logical {mustBeNumericOrLogical} = true args.platforms logical {mustBeNumericOrLogical} = true + args.views char {mustBeMember(args.views,{'all', 'xy', 'xz', 'yz', 'default'})} = 'default' end #+end_src @@ -1503,7 +1505,12 @@ This Matlab function is accessible [[file:../src/displayArchitecture.m][here]]. The reference frame of the 3d plot corresponds to the frame $\{F\}$. #+begin_src matlab - figure; + if ~strcmp(args.views, 'all') + figure; + else + f = figure('visible', 'off'); + end + hold on; #+end_src @@ -1691,11 +1698,56 @@ Plot the legs connecting the joints of the fixed base to the joints of the mobil *** Figure parameters #+begin_src matlab - view([1 -0.6 0.4]); + switch args.views + case 'default' + view([1 -0.6 0.4]); + case 'xy' + view([0 0 1]); + case 'xz' + view([0 -1 0]); + case 'yz' + view([1 0 0]); + end axis equal; axis off; #+end_src +*** Subplots +#+begin_src matlab + if strcmp(args.views, 'all') + hAx = findobj('type', 'axes'); + + figure; + s1 = subplot(2,2,1); + copyobj(get(hAx(1), 'Children'), s1); + view([0 0 1]); + axis equal; + axis off; + title('Top') + + s2 = subplot(2,2,2); + copyobj(get(hAx(1), 'Children'), s2); + view([1 -0.6 0.4]); + axis equal; + axis off; + + s3 = subplot(2,2,3); + copyobj(get(hAx(1), 'Children'), s3); + view([1 0 0]); + axis equal; + axis off; + title('Front') + + s4 = subplot(2,2,4); + copyobj(get(hAx(1), 'Children'), s4); + view([0 -1 0]); + axis equal; + axis off; + title('Side') + end +#+end_src + + * Bibliography :ignore: bibliographystyle:unsrt bibliography:ref.bib diff --git a/src/displayArchitecture.m b/src/displayArchitecture.m index 39de82d..2e0a6bc 100644 --- a/src/displayArchitecture.m +++ b/src/displayArchitecture.m @@ -17,6 +17,7 @@ function [] = displayArchitecture(stewart, args) % - joints [true/false] - Display the Joints % - labels [true/false] - Display the Labels % - platforms [true/false] - Display the Platforms +% - views ['all', 'xy', 'yz', 'xz', 'default'] - % % Outputs: @@ -32,6 +33,7 @@ arguments args.joints logical {mustBeNumericOrLogical} = true args.labels logical {mustBeNumericOrLogical} = true args.platforms logical {mustBeNumericOrLogical} = true + args.views char {mustBeMember(args.views,{'all', 'xy', 'xz', 'yz', 'default'})} = 'default' end assert(isfield(stewart.platform_F, 'FO_A'), 'stewart.platform_F should have attribute FO_A') @@ -49,7 +51,12 @@ Fa = stewart.platform_F.Fa; assert(isfield(stewart.platform_M, 'Mb'), 'stewart.platform_M should have attribute Mb') Mb = stewart.platform_M.Mb; -figure; +if ~strcmp(args.views, 'all') + figure; +else + f = figure('visible', 'off'); +end + hold on; FTa = [eye(3), FO_A; ... @@ -185,6 +192,47 @@ if args.legs end end -view([1 -0.6 0.4]); +switch args.views + case 'default' + view([1 -0.6 0.4]); + case 'xy' + view([0 0 1]); + case 'xz' + view([0 -1 0]); + case 'yz' + view([1 0 0]); +end axis equal; axis off; + +if strcmp(args.views, 'all') + hAx = findobj('type', 'axes'); + + figure; + s1 = subplot(2,2,1); + copyobj(get(hAx(1), 'Children'), s1); + view([0 0 1]); + axis equal; + axis off; + title('Top') + + s2 = subplot(2,2,2); + copyobj(get(hAx(1), 'Children'), s2); + view([1 -0.6 0.4]); + axis equal; + axis off; + + s3 = subplot(2,2,3); + copyobj(get(hAx(1), 'Children'), s3); + view([1 0 0]); + axis equal; + axis off; + title('Front') + + s4 = subplot(2,2,4); + copyobj(get(hAx(1), 'Children'), s4); + view([0 -1 0]); + axis equal; + axis off; + title('Side') +end -Created: 2020-02-11 mar. 17:52
+Created: 2020-02-12 mer. 14:16