diff --git a/.SimulinkProject/Root.type.EnvironmentCustomizations/environment.loadSimulink.type.Command.xml b/.SimulinkProject/Root.type.EnvironmentCustomizations/environment.loadSimulink.type.Command.xml index 08fab53..6dbc40c 100644 --- a/.SimulinkProject/Root.type.EnvironmentCustomizations/environment.loadSimulink.type.Command.xml +++ b/.SimulinkProject/Root.type.EnvironmentCustomizations/environment.loadSimulink.type.Command.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/active-damping.org b/active-damping.org index b5bf2c2..24c18ac 100644 --- a/active-damping.org +++ b/active-damping.org @@ -45,7 +45,10 @@ stewart = generateCubicConfiguration(stewart, 'Hc', 40e-3, 'FOc', 45e-3, 'FHa', 5e-3, 'MHb', 5e-3); stewart = computeJointsPose(stewart); stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart); #+end_src ** Identification of the Dynamics diff --git a/control-study.org b/control-study.org index 22949aa..547cbdc 100644 --- a/control-study.org +++ b/control-study.org @@ -69,17 +69,14 @@ ** Initialize the Stewart platform #+begin_src matlab - stewart = initializeFramesPositions('H', 90e-3, 'MO_B', 45e-3); - % stewart = generateCubicConfiguration(stewart, 'Hc', 60e-3, 'FOc', 45e-3, 'FHa', 5e-3, 'MHb', 5e-3); + stewart = initializeFramesPositions(); stewart = generateGeneralConfiguration(stewart); stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeStrutDynamics(stewart); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); -#+end_src - -** Initialize the Simulation -#+begin_src matlab - load('mat/conf_simscape.mat'); + stewart = initializeStewartPose(stewart); #+end_src ** Identification of the plant diff --git a/cubic-configuration.org b/cubic-configuration.org index 8b07ad0..da10245 100644 --- a/cubic-configuration.org +++ b/cubic-configuration.org @@ -53,7 +53,7 @@ The goal is to study the benefits of using a cubic configuration: - No coupling between the actuators? - Is the center of the cube an important point? -* Configuration Analysis - Stiffness Matrix +* TODO Configuration Analysis - Stiffness Matrix ** Cubic Stewart platform centered with the cube center - Jacobian estimated at the cube center We create a cubic Stewart platform (figure [[fig:3d-cubic-stewart-aligned]]) in such a way that the center of the cube (black dot) is located at the center of the Stewart platform (blue dot). The Jacobian matrix is estimated at the location of the center of the cube. @@ -228,7 +228,7 @@ We obtain $k_x = k_y = k_z$ and $k_{\theta_x} = k_{\theta_y}$, but the Stiffness - The stiffness matrix $K$ is diagonal for the cubic configuration if the Stewart platform and the cube are centered *and* the Jacobian is estimated at the cube center #+end_important -* Cubic size analysis +* TODO Cubic size analysis We here study the effect of the size of the cube used for the Stewart configuration. We fix the height of the Stewart platform, the center of the cube is at the center of the Stewart platform. @@ -304,14 +304,14 @@ We observe that $k_{\theta_x} = k_{\theta_y}$ and $k_{\theta_z}$ increase linear In that case, the legs will the further separated. Size of the cube is then limited by allowed space. #+end_important -* initializeCubicConfiguration - :PROPERTIES: - :HEADER-ARGS:matlab+: :exports code - :HEADER-ARGS:matlab+: :comments no - :HEADER-ARGS:matlab+: :eval no - :HEADER-ARGS:matlab+: :tangle src/initializeCubicConfiguration.m - :END: - <> +* TODO initializeCubicConfiguration +:PROPERTIES: +:HEADER-ARGS:matlab+: :exports code +:HEADER-ARGS:matlab+: :comments no +:HEADER-ARGS:matlab+: :eval no +:HEADER-ARGS:matlab+: :tangle src/initializeCubicConfiguration.m +:END: +<> ** Function description #+begin_src matlab @@ -449,7 +449,7 @@ And the location of the joints on the mobile platform with respect to $\{B\}$. end #+end_src -* Tests +* TODO Tests ** First attempt to parametrisation #+name: fig:stewart_bottom_plate #+caption: Schematic of the bottom plates with all the parameters diff --git a/dynamics-study.org b/dynamics-study.org index fca28df..cde371d 100644 --- a/dynamics-study.org +++ b/dynamics-study.org @@ -41,11 +41,14 @@ ** test #+begin_src matlab - stewart = initializeFramesPositions('H', 90e-3, 'MO_B', 45e-3); - stewart = generateCubicConfiguration(stewart, 'Hc', 60e-3, 'FOc', 45e-3, 'FHa', 5e-3, 'MHb', 5e-3); + stewart = initializeFramesPositions(); + stewart = generateGeneralConfiguration(stewart); stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeStrutDynamics(stewart); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart); #+end_src Estimation of the transfer function from $\mathcal{\bm{F}}$ to $\mathcal{\bm{X}}$: @@ -126,11 +129,14 @@ Estimation of the transfer function from $\mathcal{\bm{F}}$ to $\mathcal{\bm{X}} ** Compare external forces and forces applied by the actuators Initialization of the Stewart platform. #+begin_src matlab - stewart = initializeFramesPositions('H', 90e-3, 'MO_B', 45e-3); - stewart = generateCubicConfiguration(stewart, 'Hc', 60e-3, 'FOc', 45e-3, 'FHa', 5e-3, 'MHb', 5e-3); + stewart = initializeFramesPositions(); + stewart = generateGeneralConfiguration(stewart); stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeStrutDynamics(stewart); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart); #+end_src Estimation of the transfer function from $\mathcal{\bm{F}}$ to $\mathcal{\bm{X}}$: @@ -188,11 +194,14 @@ Seems quite similar. ** Comparison of the static transfer function and the Compliance matrix Initialization of the Stewart platform. #+begin_src matlab - stewart = initializeFramesPositions('H', 90e-3, 'MO_B', 45e-3); - stewart = generateCubicConfiguration(stewart, 'Hc', 60e-3, 'FOc', 45e-3, 'FHa', 5e-3, 'MHb', 5e-3); + stewart = initializeFramesPositions(); + stewart = generateGeneralConfiguration(stewart); stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeStrutDynamics(stewart); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart); #+end_src Estimation of the transfer function from $\mathcal{\bm{F}}$ to $\mathcal{\bm{X}}$: @@ -248,11 +257,14 @@ The low frequency transfer function matrix from $\mathcal{\bm{F}}$ to $\mathcal{ ** Transfer function from forces applied in the legs to the displacement of the legs Initialization of the Stewart platform. #+begin_src matlab - stewart = initializeFramesPositions('H', 90e-3, 'MO_B', 45e-3); - stewart = generateCubicConfiguration(stewart, 'Hc', 60e-3, 'FOc', 45e-3, 'FHa', 5e-3, 'MHb', 5e-3); + stewart = initializeFramesPositions(); + stewart = generateGeneralConfiguration(stewart); stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeStrutDynamics(stewart); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart); #+end_src Estimation of the transfer function from $\bm{\tau}$ to $\bm{L}$: diff --git a/simscape-model.org b/simscape-model.org index 82c1031..30675e7 100644 --- a/simscape-model.org +++ b/simscape-model.org @@ -106,8 +106,11 @@ By following this procedure, we obtain a Matlab structure =stewart= that contain stewart = generateGeneralConfiguration(stewart); stewart = computeJointsPose(stewart); stewart = initializeStrutDynamics(stewart, 'Ki', 1e6*ones(6,1), 'Ci', 1e2*ones(6,1)); + stewart = initializeCylindricalPlatforms(stewart); stewart = initializeCylindricalStruts(stewart); stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart, 'AP', [0;0;0.01], 'ARB', eye(3)); + [Li, dLi] = inverseKinematics(stewart, 'AP', [0;0;0.00001], 'ARB', eye(3)); [P, R] = forwardKinematicsApprox(stewart, 'dL', dLi); #+end_src @@ -268,8 +271,6 @@ This Matlab function is accessible [[file:src/generateGeneralConfiguration.m][he % Syntax: [stewart] = generateGeneralConfiguration(stewart, args) % % Inputs: - % - stewart - A structure with the following fields - % - H [1x1] - Total height of the platform [m] % - args - Can have the following fields: % - FH [1x1] - Height of the position of the fixed joints with respect to the frame {F} [m] % - FR [1x1] - Radius of the position of the fixed joints in the X-Y [m] @@ -477,6 +478,81 @@ This Matlab function is accessible [[file:src/computeJacobian.m][here]]. #+end_src * Initialize the Geometry of the Mechanical Elements +** =initializeCylindricalPlatforms=: Initialize the geometry of the Fixed and Mobile Platforms +:PROPERTIES: +:header-args:matlab+: :tangle src/initializeCylindricalPlatforms.m +:header-args:matlab+: :comments none :mkdirp yes :eval no +:END: +<> + +This Matlab function is accessible [[file:src/initializeCylindricalPlatforms.m][here]]. + +*** Function description +#+begin_src matlab + function [stewart] = initializeCylindricalPlatforms(stewart, args) + % initializeCylindricalPlatforms - Initialize the geometry of the Fixed and Mobile Platforms + % + % Syntax: [stewart] = initializeCylindricalPlatforms(args) + % + % Inputs: + % - args - Structure with the following fields: + % - Fpm [1x1] - Fixed Platform Mass [kg] + % - Fph [1x1] - Fixed Platform Height [m] + % - Fpr [1x1] - Fixed Platform Radius [m] + % - Mpm [1x1] - Mobile Platform Mass [kg] + % - Mph [1x1] - Mobile Platform Height [m] + % - Mpr [1x1] - Mobile Platform Radius [m] + % + % Outputs: + % - stewart - updated Stewart structure with the added fields: + % - platforms [struct] - structure with the following fields: + % - Fpm [1x1] - Fixed Platform Mass [kg] + % - Msi [3x3] - Mobile Platform Inertia matrix [kg*m^2] + % - Fph [1x1] - Fixed Platform Height [m] + % - Fpr [1x1] - Fixed Platform Radius [m] + % - Mpm [1x1] - Mobile Platform Mass [kg] + % - Fsi [3x3] - Fixed Platform Inertia matrix [kg*m^2] + % - Mph [1x1] - Mobile Platform Height [m] + % - Mpr [1x1] - Mobile Platform Radius [m] +#+end_src + +*** Optional Parameters +#+begin_src matlab + arguments + stewart + args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1 + args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3 + args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 125e-3 + args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1 + args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3 + args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 100e-3 + end +#+end_src + +*** Create the =platforms= struct +#+begin_src matlab + platforms = struct(); + + platforms.Fpm = args.Fpm; + platforms.Fph = args.Fph; + platforms.Fpr = args.Fpr; + platforms.Fpi = diag([1/12 * platforms.Fpm * (3*platforms.Fpr^2 + platforms.Fph^2), ... + 1/12 * platforms.Fpm * (3*platforms.Fpr^2 + platforms.Fph^2), ... + 1/2 * platforms.Fpm * platforms.Fpr^2]); + + platforms.Mpm = args.Mpm; + platforms.Mph = args.Mph; + platforms.Mpr = args.Mpr; + platforms.Mpi = diag([1/12 * platforms.Mpm * (3*platforms.Mpr^2 + platforms.Mph^2), ... + 1/12 * platforms.Mpm * (3*platforms.Mpr^2 + platforms.Mph^2), ... + 1/2 * platforms.Mpm * platforms.Mpr^2]); +#+end_src + +*** Save the =platforms= struct +#+begin_src matlab + stewart.platforms = platforms; +#+end_src + ** =initializeCylindricalStruts=: Define the mass and moment of inertia of cylindrical struts :PROPERTIES: :header-args:matlab+: :tangle src/initializeCylindricalStruts.m @@ -556,79 +632,50 @@ This Matlab function is accessible [[file:src/initializeCylindricalStruts.m][her stewart.struts = struts; #+end_src -** =initializeCylindricalPlatforms=: Initialize the geometry of the Fixed and Mobile Platforms +* =initializeStewartPose=: Determine the initial stroke in each leg to have the wanted pose :PROPERTIES: -:header-args:matlab+: :tangle src/initializeCylindricalPlatforms.m +:header-args:matlab+: :tangle src/initializeStewartPose.m :header-args:matlab+: :comments none :mkdirp yes :eval no :END: -<> +<> -This Matlab function is accessible [[file:src/initializeCylindricalPlatforms.m][here]]. +This Matlab function is accessible [[file:src/initializeStewartPose.m][here]]. -*** Function description +** Function description #+begin_src matlab - function [stewart] = initializeCylindricalPlatforms(stewart, args) - % initializeCylindricalPlatforms - Initialize the geometry of the Fixed and Mobile Platforms + function [stewart] = initializeStewartPose(stewart, args) + % initializeStewartPose - Determine the initial stroke in each leg to have the wanted pose + % It uses the inverse kinematic % - % Syntax: [stewart] = initializeCylindricalPlatforms(args) + % Syntax: [stewart] = initializeStewartPose(stewart, args) % % Inputs: - % - args - Structure with the following fields: - % - Fpm [1x1] - Fixed Platform Mass [kg] - % - Fph [1x1] - Fixed Platform Height [m] - % - Fpr [1x1] - Fixed Platform Radius [m] - % - Mpm [1x1] - Mobile Platform Mass [kg] - % - Mph [1x1] - Mobile Platform Height [m] - % - Mpr [1x1] - Mobile Platform Radius [m] + % - stewart - A structure with the following fields + % - Aa [3x6] - The positions ai expressed in {A} + % - Bb [3x6] - The positions bi expressed in {B} + % - args - Can have the following fields: + % - 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} % % Outputs: % - stewart - updated Stewart structure with the added fields: - % - platforms [struct] - structure with the following fields: - % - Fpm [1x1] - Fixed Platform Mass [kg] - % - Msi [3x3] - Mobile Platform Inertia matrix [kg*m^2] - % - Fph [1x1] - Fixed Platform Height [m] - % - Fpr [1x1] - Fixed Platform Radius [m] - % - Mpm [1x1] - Mobile Platform Mass [kg] - % - Fsi [3x3] - Fixed Platform Inertia matrix [kg*m^2] - % - Mph [1x1] - Mobile Platform Height [m] - % - Mpr [1x1] - Mobile Platform Radius [m] + % - dLi[6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A} #+end_src -*** Optional Parameters +** Optional Parameters #+begin_src matlab arguments stewart - args.Fpm (1,1) double {mustBeNumeric, mustBePositive} = 1 - args.Fph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3 - args.Fpr (1,1) double {mustBeNumeric, mustBePositive} = 125e-3 - args.Mpm (1,1) double {mustBeNumeric, mustBePositive} = 1 - args.Mph (1,1) double {mustBeNumeric, mustBePositive} = 10e-3 - args.Mpr (1,1) double {mustBeNumeric, mustBePositive} = 100e-3 + args.AP (3,1) double {mustBeNumeric} = zeros(3,1) + args.ARB (3,3) double {mustBeNumeric} = eye(3) end #+end_src -*** Create the =platforms= struct +** Use the Inverse Kinematic function #+begin_src matlab - platforms = struct(); + [Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB); - platforms.Fpm = args.Fpm; - platforms.Fph = args.Fph; - platforms.Fpr = args.Fpr; - platforms.Fpi = diag([1/12 * platforms.Fpm * (3*platforms.Fpr^2 + platforms.Fph^2), ... - 1/12 * platforms.Fpm * (3*platforms.Fpr^2 + platforms.Fph^2), ... - 1/2 * platforms.Fpm * platforms.Fpr^2]); - - platforms.Mpm = args.Mpm; - platforms.Mph = args.Mph; - platforms.Mpr = args.Mpr; - platforms.Mpi = diag([1/12 * platforms.Mpm * (3*platforms.Mpr^2 + platforms.Mph^2), ... - 1/12 * platforms.Mpm * (3*platforms.Mpr^2 + platforms.Mph^2), ... - 1/2 * platforms.Mpm * platforms.Mpr^2]); -#+end_src - -*** Save the =platforms= struct -#+begin_src matlab - stewart.platforms = platforms; + stewart.dLi = dLi; #+end_src * Utility Functions diff --git a/simscape_subsystems/stewart_strut.slx b/simscape_subsystems/stewart_strut.slx index 8c3e84a..94091dd 100644 Binary files a/simscape_subsystems/stewart_strut.slx and b/simscape_subsystems/stewart_strut.slx differ diff --git a/simulink/stewart_platform_dynamics.slx b/simulink/stewart_platform_dynamics.slx index c2cdc88..9a81061 100644 Binary files a/simulink/stewart_platform_dynamics.slx and b/simulink/stewart_platform_dynamics.slx differ diff --git a/src/initializeStewartPose.m b/src/initializeStewartPose.m new file mode 100644 index 0000000..a32f8eb --- /dev/null +++ b/src/initializeStewartPose.m @@ -0,0 +1,27 @@ +function [stewart] = initializeStewartPose(stewart, args) +% initializeStewartPose - Determine the initial stroke in each leg to have the wanted pose +% It uses the inverse kinematic +% +% Syntax: [stewart] = initializeStewartPose(stewart, args) +% +% Inputs: +% - stewart - A structure with the following fields +% - Aa [3x6] - The positions ai expressed in {A} +% - Bb [3x6] - The positions bi expressed in {B} +% - args - Can have the following fields: +% - 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} +% +% Outputs: +% - stewart - updated Stewart structure with the added fields: +% - dLi[6x1] - The 6 needed displacement of the struts from the initial position in [m] to have the wanted pose of {B} w.r.t. {A} + +arguments + stewart + args.AP (3,1) double {mustBeNumeric} = zeros(3,1) + args.ARB (3,3) double {mustBeNumeric} = eye(3) +end + +[Li, dLi] = inverseKinematics(stewart, 'AP', args.AP, 'ARB', args.ARB); + +stewart.dLi = dLi; diff --git a/stiffness-study.html b/stiffness-study.html deleted file mode 100644 index 254d5fb..0000000 --- a/stiffness-study.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - -Stiffness of the Stewart Platform - - - - - - - - - - - - -
- UP - | - HOME -
-

Stiffness of the Stewart Platform

-
-

Table of Contents

- -
- -
-

1 Functions

-
-
-
-

1.1 getStiffnessMatrix

-
-
-
function [K] = getStiffnessMatrix(k, J)
-% k - leg stiffness
-% J - Jacobian matrix
-    K = k*(J'*J);
-end
-
-
-
-
-
-
-
-

Author: Thomas Dehaeze

-

Created: 2019-08-26 lun. 11:56

-

Validate

-
- - diff --git a/stiffness-study.org b/stiffness-study.org deleted file mode 100644 index 4c734f1..0000000 --- a/stiffness-study.org +++ /dev/null @@ -1,41 +0,0 @@ -#+TITLE: Stiffness of the Stewart Platform -:DRAWER: -#+HTML_LINK_HOME: ./index.html -#+HTML_LINK_UP: ./index.html - -#+HTML_HEAD: -#+HTML_HEAD: -#+HTML_HEAD: -#+HTML_HEAD: -#+HTML_HEAD: -#+HTML_HEAD: - -#+PROPERTY: header-args:matlab :session *MATLAB* -#+PROPERTY: header-args:matlab+ :tangle matlab/stiffness_study.m -#+PROPERTY: header-args:matlab+ :comments org -#+PROPERTY: header-args:matlab+ :exports both -#+PROPERTY: header-args:matlab+ :results none -#+PROPERTY: header-args:matlab+ :eval no-export -#+PROPERTY: header-args:matlab+ :noweb yes -#+PROPERTY: header-args:matlab+ :mkdirp yes -#+PROPERTY: header-args:matlab+ :output-dir figs -:END: - -* Functions - :PROPERTIES: - :HEADER-ARGS:matlab+: :exports code - :HEADER-ARGS:matlab+: :comments no - :HEADER-ARGS:matlab+: :mkdir yes - :HEADER-ARGS:matlab+: :eval no - :END: -** getStiffnessMatrix - :PROPERTIES: - :HEADER-ARGS:matlab+: :tangle src/getStiffnessMatrix.m - :END: -#+begin_src matlab - function [K] = getStiffnessMatrix(k, J) - % k - leg stiffness - % J - Jacobian matrix - K = k*(J'*J); - end -#+end_src