From 009481ff75312bd300f26c465866aba6f30204f0 Mon Sep 17 00:00:00 2001
From: Thomas Dehaeze
computeJacobian
: Compute the Jacobian Matrix
-
stewart
structure elementsstewart
structure elementsinverseKinematics
: Compute Inverse Kinematics
forwardKinematicsApprox
: Compute the Approximate Forward Kinematics
We first define some general Stewart architecture. @@ -552,8 +560,8 @@ This is what is analyzed in this section.
Let’s first define the Stewart platform architecture that we want to study. @@ -972,8 +980,8 @@ However, for small displacements, we can use the Jacobian as an approximate solu
Let’s first define the Stewart platform architecture that we want to study. @@ -1089,8 +1097,8 @@ We can also approximate the mobility by a sphere with a radius equal to the mini
Let’s first define the Stewart Platform Geometry. @@ -1099,34 +1107,59 @@ Let’s first define the Stewart Platform Geometry.
stewart = initializeStewartPlatform(); stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 150e-3); stewart = generateGeneralConfiguration(stewart); -stewart = computeJointsPose(stewart); +stewart = computeJointsPose(stewart, 'AP', [0; 0; 0]); As_init = stewart.geometry.As;
Tx_max = 50e-6; % Translation [m] -Ty_max = 50e-6; % Translation [m] -Tz_max = 50e-6; % Translation [m] +Tx_max = 60e-6; % Translation [m] +Ty_max = 60e-6; % Translation [m] +Tz_max = 60e-6; % Translation [m] +Rx_max = 30e-6; % Rotation [rad] +Ry_max = 30e-6; % Rotation [rad] +Rz_max = 0; % Rotation [rad]
Ps = [2*(dec2bin(0:3^2-2,3)-'0')-1].*[Tx_max Ty_max Tz_max]; +Ps = [2*(dec2bin(0:5^2-1,5)-'0')-1, zeros(5^2, 1)].*[Tx_max Ty_max Tz_max Rx_max Ry_max Rz_max];
flex_ang = zeros(size(Ps, 1), 6); +Rxs = zeros(size(Ps, 1), 6) +Rys = zeros(size(Ps, 1), 6) +Rzs = zeros(size(Ps, 1), 6) for Ps_i = 1:size(Ps, 1) - stewart.geometry.FO_M = [0; 0; 90e-3] + Ps(Ps_i, :)'; + Rx = [1 0 0; + 0 cos(Ps(Ps_i, 4)) -sin(Ps(Ps_i, 4)); + 0 sin(Ps(Ps_i, 4)) cos(Ps(Ps_i, 4))]; - stewart = generateGeneralConfiguration(stewart); - stewart = computeJointsPose(stewart); + Ry = [ cos(Ps(Ps_i, 5)) 0 sin(Ps(Ps_i, 5)); + 0 1 0; + -sin(Ps(Ps_i, 5)) 0 cos(Ps(Ps_i, 5))]; + + Rz = [cos(Ps(Ps_i, 6)) -sin(Ps(Ps_i, 6)) 0; + sin(Ps(Ps_i, 6)) cos(Ps(Ps_i, 6)) 0; + 0 0 1]; + + ARB = Rz*Ry*Rx; + + stewart = computeJointsPose(stewart, 'AP', Ps(Ps_i, 1:3)', 'ARB', ARB); flex_ang(Ps_i, :) = acos(sum(As_init.*stewart.geometry.As)); + + for l_i = 1:6 + MRf = stewart.platform_M.MRb(:,:,l_i)*(ARB')*(stewart.platform_F.FRa(:,:,l_i)'); + + Rys(Ps_i, l_i) = atan2(MRf(1,3), sqrt(MRf(1,1)^2 + MRf(2,2)^2)); + Rxs(Ps_i, l_i) = atan2(-MRf(2,3)/cos(Rys(Ps_i, l_i)), MRf(3,3)/cos(Rys(Ps_i, l_i))); + Rzs(Ps_i, l_i) = atan2(-MRf(1,2)/cos(Rys(Ps_i, l_i)), MRf(1,1)/cos(Rys(Ps_i, l_i))); + end end
-0.90937 +1.1704+ + +
1e3*max(max(sqrt(Rxs.^2 + Rys.^2))) ++
+0.075063 ++ + +
1e3*max(max(Rzs)) ++
+0.04666 ++
open('stewart_platform_model.slx') ++
stewart = initializeStewartPlatform(); +stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3); +stewart = generateGeneralConfiguration(stewart); +stewart = computeJointsPose(stewart); +stewart = initializeStrutDynamics(stewart); +stewart = initializeJointDynamics(stewart, 'type_F', 'universal_p', 'type_M', 'spherical_p'); +stewart = initializeCylindricalPlatforms(stewart); +stewart = initializeCylindricalStruts(stewart); +stewart = computeJacobian(stewart); +stewart = initializeStewartPose(stewart); +stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3); ++
ground = initializeGround('type', 'rigid'); +payload = initializePayload('type', 'none'); +controller = initializeController('type', 'open-loop'); +disturbances = initializeDisturbances(); +references = initializeReferences(stewart); ++
%% Name of the Simulink File +mdl = 'stewart_platform_model'; + +%% Input/Output definition +clear io; io_i = 1; +io(io_i) = linio([mdl, '/Controller'], 1, 'openinput'); io_i = io_i + 1; % Actuator Force Inputs [N] +io(io_i) = linio([mdl, '/Stewart Platform'], 1, 'openoutput', [], 'dLm'); io_i = io_i + 1; % Relative Displacement Outputs [m] + +%% Run the linearization +G = linearize(mdl, io); +G.InputName = {'F1', 'F2', 'F3', 'F4', 'F5', 'F6'}; +G.OutputName = {'L1', 'L2', 'L3', 'L4', 'L5', 'L6'}; ++
wc = 2*pi*30; +Kl = diag(1./diag(abs(freqresp(G, wc)))) * wc/s * 1/(1 + s/3/wc); ++
controller = initializeController('type', 'ref-track-L'); ++
Tx_max = 60e-6; % Translation [m] +Ty_max = 60e-6; % Translation [m] +Tz_max = 60e-6; % Translation [m] +Rx_max = 30e-6; % Rotation [rad] +Ry_max = 30e-6; % Rotation [rad] +Rz_max = 0; % Rotation [rad] ++
Ps = [2*(dec2bin(0:5^2-1,5)-'0')-1, zeros(5^2, 1)].*[Tx_max Ty_max Tz_max Rx_max Ry_max Rz_max]; ++
cl_perf = zeros(size(Ps, 1), 1); % Closed loop performance [percentage] +Rs = zeros(size(Ps, 1), 5); % Max Flexor angles for the 6 legs [mrad] + +for Ps_i = 1:size(Ps, 1) + fprintf('Experiment %i over %i', Ps_i, size(Ps, 1)); + + references = initializeReferences(stewart, 't', 0, 'r', Ps(Ps_i, :)'); + set_param('stewart_platform_model','StopTime','0.1'); + sim('stewart_platform_model'); + + cl_perf(Ps_i) = 100*max(abs((simout.y.dLm.Data(end, :) - references.rL.Data(:,1,1)')./simout.y.dLm.Data(end, :))); + Rs(Ps_i, :) = [max(abs(1e3*simout.y.Rf.Data(end, 1:2:end))), max(abs(1e3*simout.y.Rf.Data(end, 2:2:end))), max(abs(1e3*simout.y.Rm.Data(end, 1:3:end))), max(abs(1e3*simout.y.Rm.Data(end, 2:3:end))), max(abs(1e3*simout.y.Rm.Data(end, 3:3:end)))]'; +end ++
+Verify that the simulations are all correct: +
+max(cl_perf) ++
+8.1147 ++
+ | Stroke [mrad] | +
---|---|
Rx bot | +1.03 | +
Ry bot | +0.93 | +
Rx top | +1.06 | +
Ry top | +0.95 | +
Rz top | +0.03 | +
function [stewart] = computeJacobian(stewart) % computeJacobian - @@ -1190,9 +1410,9 @@ This Matlab function is accessible here.
stewart
structure elementsstewart
structure elementsassert(isfield(stewart.geometry, 'As'), 'stewart.geometry should have attribute As') As = stewart.geometry.As; @@ -1300,9 +1520,9 @@ Otherwise, when the limbs’ lengths derived yield complex numbers, then the
function [Li, dLi] = inverseKinematics(stewart, args) % inverseKinematics - Compute the needed length of each strut to have the wanted position and orientation of {B} with respect to {A} @@ -1326,9 +1546,9 @@ Otherwise, when the limbs’ lengths derived yield complex numbers, then the
arguments stewart @@ -1340,9 +1560,9 @@ end
stewart
structure elementsstewart
structure elementsassert(isfield(stewart.geometry, 'Aa'), 'stewart.geometry should have attribute Aa') Aa = stewart.geometry.Aa; @@ -1386,9 +1606,9 @@ This Matlab function is accessible he
function [P, R] = forwardKinematicsApprox(stewart, args) % forwardKinematicsApprox - Computed the approximate pose of {B} with respect to {A} from the length of each strut and using @@ -1410,9 +1630,9 @@ This Matlab function is accessible he
arguments stewart @@ -1423,9 +1643,9 @@ end
stewart
structure elementsstewart
structure elementsassert(isfield(stewart.kinematics, 'J'), 'stewart.kinematics should have attribute J') J = stewart.kinematics.J; @@ -1490,7 +1710,7 @@ We then compute the corresponding rotation matrix.
Created: 2020-08-05 mer. 13:27
+Created: 2020-08-05 mer. 16:23
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
initializeFlexibleStrutDynamics
: Model each strut with a flexible element
initializeJointDynamics
: Add Stiffness and Damping properties for spherical joints
displayArchitecture
: 3D plot of the Stewart platform architecture
describeStewartPlatform
: Display some text describing the current defined Stewart Platform
function [stewart] = initializeStewartPlatform() % initializeStewartPlatform - Initialize the stewart structure @@ -746,11 +747,11 @@ This Matlab function is accessible
arguments stewart @@ -813,9 +814,9 @@ FO_A = MO_B + FO_M; % Position of {A} with respect to {F} [m]
stewart
structurestewart
structurestewart.geometry.H = H; stewart.geometry.FO_M = FO_M; @@ -839,9 +840,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). @@ -856,9 +857,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 @@ -883,9 +884,9 @@ The radius of the circles can be chosen as well as the angles where the joints a-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -920,9 +921,9 @@ end-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.platform_F.Fa = Fa; stewart.platform_M.Mb = Mb; @@ -944,9 +945,9 @@ This Matlab function is accessible here-Documentation
-++Documentation
+-@@ -956,14 +957,14 @@ This Matlab function is accessible here
-Function description
-++Function description
+--function [stewart] = computeJointsPose(stewart) +function [stewart] = computeJointsPose(stewart, args) % computeJointsPose - % -% Syntax: [stewart] = computeJointsPose(stewart) +% Syntax: [stewart] = computeJointsPose(stewart, args) % % Inputs: % - stewart - A structure with the following fields @@ -972,6 +973,9 @@ This Matlab function is accessible here % - platform_F.FO_A [3x1] - Position of {A} with respect to {F} % - platform_M.MO_B [3x1] - Position of {B} with respect to {M} % - geometry.FO_M [3x1] - Position of {M} with respect to {F} +% - 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 - A structure with the following added fields @@ -991,9 +995,23 @@ This Matlab function is accessible here-Check the
-stewart
structure elements+-++ +Optional Parameters
+++++arguments + stewart + args.AP (3,1) double {mustBeNumeric} = zeros(3,1) + args.ARB (3,3) double {mustBeNumeric} = eye(3) +end +++Check the
+stewart
structure elements@@ -1064,9 +1097,9 @@ endassert(isfield(stewart.platform_F, 'Fa'), 'stewart.platform_F should have attribute Fa') Fa = stewart.platform_F.Fa; @@ -1020,11 +1038,26 @@ FO_M = stewart.geometry.FO_M;-Ab = Bb - repmat(-MO_B-FO_M+FO_A, [1, 6]); +Aa = Fa - repmat(FO_A, [1, 6]); Bb = Mb - repmat(MO_B, [1, 6]); +++Original: +
+++ +Ab = Bb - repmat(-MO_B-FO_M+FO_A, [1, 6]); Ba = Aa - repmat( MO_B+FO_M-FO_A, [1, 6]);+Translation & Rotation: (Rotation and then translation) +
++Ab = args.ARB *Bb - repmat(-args.AP, [1, 6]); +Ba = args.ARB'*Aa - repmat( args.AP, [1, 6]); ++-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.geometry.Aa = Aa; stewart.geometry.Ab = Ab; @@ -1099,9 +1132,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 @@ -1125,9 +1158,9 @@ This Matlab function is accessible here-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1149,9 +1182,9 @@ end-Populate the
-stewart
structure++Populate the
+stewart
structurestewart.actuators.Leq = dLi;@@ -1172,9 +1205,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 @@ -1208,9 +1241,9 @@ This Matlab function is accessible -Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1245,9 +1278,9 @@ end-Populate the
-stewart
structure++Populate the
+stewart
structurestewart.platform_F.type = 1; @@ -1283,9 +1316,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 @@ -1318,9 +1351,9 @@ This Matlab function is accessible -Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1370,9 +1403,9 @@ end-Populate the
-stewart
structure++Populate the
+stewart
structure-switch args.type_M case 'cylindrical' @@ -1418,9 +1451,9 @@ This Matlab function is accessible he-Documentation
-++Documentation
+@@ -1449,9 +1482,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 @@ -1473,9 +1506,9 @@ A simplistic model of such amplified actuator is shown in Figure -Optional Parameters
-++Optional Parameters
+arguments stewart @@ -1513,9 +1546,9 @@ This Matlab function is accessible -Documentation
-++Documentation
+An amplified piezoelectric actuator is shown in Figure 13.
@@ -1548,9 +1581,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 @@ -1578,9 +1611,9 @@ A simplistic model of such amplified actuator is shown in Figure -Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1605,9 +1638,9 @@ C = args.Ca + args.Cr;-Populate the
-stewart
structure++Populate the
+stewart
structurestewart.actuators.type = 2; @@ -1637,9 +1670,9 @@ This Matlab function is accessible -Function description
-++Function description
+function [stewart] = initializeFlexibleStrutDynamics(stewart, args) % initializeFlexibleStrutDynamics - Add Stiffness and Damping properties of each strut @@ -1660,9 +1693,9 @@ This Matlab function is accessible -Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1688,9 +1721,9 @@ end-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.actuators.type = 3; @@ -1721,9 +1754,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 @@ -1758,9 +1791,9 @@ This Matlab function is accessible he-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -1994,9 +2027,9 @@ Note that there is trade-off between:-Function description
-++Function description
+-function [stewart] = initializeInertialSensor(stewart, args) % initializeInertialSensor - Initialize the inertial sensor in each strut @@ -2022,9 +2055,9 @@ Note that there is trade-off between:-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -2065,9 +2098,9 @@ end-Populate the
-stewart
structure++Populate the
+stewart
structure-stewart.sensors.inertial = sensor;@@ -2088,9 +2121,9 @@ This Matlab function is accessible here-Function description
-++Function description
+-function [] = displayArchitecture(stewart, args) % displayArchitecture - 3D plot of the Stewart platform architecture @@ -2119,9 +2152,9 @@ This Matlab function is accessible here-Optional Parameters
-++Optional Parameters
+-arguments stewart @@ -2142,9 +2175,9 @@ 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; @@ -2482,9 +2515,9 @@ This Matlab function is accessible he-Function description
-++Function description
+-function [] = describeStewartPlatform(stewart) % describeStewartPlatform - Display some text describing the current defined Stewart Platform @@ -2500,9 +2533,9 @@ This Matlab function is accessible he-Optional Parameters
-++Optional Parameters
+arguments stewart @@ -2651,7 +2684,7 @@ end-Created: 2020-08-05 mer. 13:27
+Created: 2020-08-05 mer. 16:23