diff --git a/docs/identification.html b/docs/identification.html index c61662e..3e79141 100644 --- a/docs/identification.html +++ b/docs/identification.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Identification of the Stewart Platform using Simscape @@ -268,233 +268,65 @@ for the JavaScript code in this tag.

Table of Contents

-

-We would like to extract a state space model of the Stewart Platform from the Simscape model. -

- -

-The inputs are: -

- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolMeaning
\(\bm{\mathcal{F}}_{d}\)External forces applied in {B}
\(\bm{\tau}\)Joint forces
\(\bm{\mathcal{F}}\)Cartesian forces applied by the Joints
\(\bm{D}_{w}\)Fixed Based translation and rotations around {A}
- -

-The outputs are: -

- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolMeaning
\(\bm{\mathcal{X}}\)Relative Motion of {B} with respect to {A}
\(\bm{\mathcal{L}}\)Joint Displacement
\(\bm{F}_{m}\)Force Sensors in each strut
\(\bm{v}_{m}\)Inertial Sensors located at \(b_i\) measuring in the direction of the strut
- - -
-

-An important difference from basic Simulink models is that the states in a physical network are not independent in general, because some states have dependencies on other states through constraints. -

-
- - - -
-

1 Identification

+
+

1 Modal Analysis of the Stewart Platform

-
-

1.1 Simscape Model

+
+

1.1 Initialize the Stewart Platform

+
+
+
stewart = initializeStewartPlatform();
+stewart = initializeFramesPositions(stewart);
+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);
+
-
-

1.2 Initialize the Stewart Platform

+
+
ground = initializeGround('type', 'none');
+payload = initializePayload('type', 'none');
+
+
+
+
+ +
+

1.2 Identification

-
stewart = initializeStewartPlatform();
-stewart = initializeFramesPositions(stewart);
-stewart = generateGeneralConfiguration(stewart);
-stewart = computeJointsPose(stewart);
-stewart = initializeStrutDynamics(stewart);
-stewart = initializeCylindricalPlatforms(stewart);
-stewart = initializeCylindricalStruts(stewart);
-stewart = computeJacobian(stewart);
-stewart = initializeStewartPose(stewart);
-
-
-
-
- -
-

1.3 Identification

-
-
%% Options for Linearized
 options = linearizeOptions;
 options.SampleTime = 0;
 
 %% Name of the Simulink File
-mdl = 'stewart_platform_identification';
+mdl = 'stewart_platform_model';
 
 %% Input/Output definition
 clear io; io_i = 1;
-io(io_i) = linio([mdl, '/tau'],  1, 'openinput');  io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Fext'], 1, 'openinput');  io_i = io_i + 1;
-io(io_i) = linio([mdl, '/X'],    1, 'openoutput'); io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Vm'],   1, 'openoutput'); io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Taum'], 1, 'openoutput'); io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Lm'],   1, 'openoutput'); io_i = io_i + 1;
-
-%% Run the linearization
-G = linearize(mdl, io, options);
-G.InputName  = {'tau1', 'tau2', 'tau3', 'tau4', 'tau5', 'tau6', ...
-                'Fx', 'Fy', 'Fz', 'Mx', 'My', 'Mz'};
-
-G.OutputName = {'Xdx', 'Xdy', 'Xdz', 'Xrx', 'Xry', 'Xrz', ...
-                'Vm1', 'Vm2', 'Vm3', 'Vm4', 'Vm5', 'Vm6', ...
-                'taum1', 'taum2', 'taum3', 'taum4', 'taum5', 'taum6', ...
-                'Lm1', 'Lm2', 'Lm3', 'Lm4', 'Lm5', 'Lm6'};
-
-
-
-
-
- -
-

2 States as the motion of the mobile platform

-
-
-
-

2.1 Initialize the Stewart Platform

-
-
-
stewart = initializeStewartPlatform();
-stewart = initializeFramesPositions(stewart);
-stewart = generateGeneralConfiguration(stewart);
-stewart = computeJointsPose(stewart);
-stewart = initializeStrutDynamics(stewart);
-stewart = initializeCylindricalPlatforms(stewart);
-stewart = initializeCylindricalStruts(stewart);
-stewart = computeJacobian(stewart);
-stewart = initializeStewartPose(stewart);
-
-
-
-
- -
-

2.2 Identification

-
-
-
%% Options for Linearized
-options = linearizeOptions;
-options.SampleTime = 0;
-
-%% Name of the Simulink File
-mdl = 'stewart_platform_identification_simple';
-
-%% Input/Output definition
-clear io; io_i = 1;
-io(io_i) = linio([mdl, '/tau'],  1, 'openinput');  io_i = io_i + 1;
-io(io_i) = linio([mdl, '/X'],    1, 'openoutput'); io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Xdot'], 1, 'openoutput'); io_i = 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, '/Relative Motion Sensor'],  1, 'openoutput'); io_i = io_i + 1; % Position/Orientation of {B} w.r.t. {A}
+io(io_i) = linio([mdl, '/Relative Motion Sensor'],  2, 'openoutput'); io_i = io_i + 1; % Velocity of {B} w.r.t. {A}
 
 %% Run the linearization
 G = linearize(mdl, io);
@@ -541,8 +373,8 @@ And indeed, we obtain 12 states.
 
-

2.3 Coordinate transformation

-
+

1.3 Coordinate transformation

+

We can perform the following transformation using the ss2ss command.

@@ -577,8 +409,8 @@ Gt = ss(At, Bt, Ct, Dt);
-

2.4 Analysis

-
+

1.4 Analysis

+
[V,D] = eig(Gt.A);
 
@@ -604,38 +436,38 @@ Gt = ss(At, Bt, Ct, Dt); 1.0 -174.5 -0.9 +780.6 +0.4 2.0 -174.5 -0.7 +780.6 +0.3 3.0 -202.1 -0.7 +903.9 +0.3 4.0 -237.3 -0.6 +1061.4 +0.3 5.0 -237.3 -0.5 +1061.4 +0.2 6.0 -283.8 -0.5 +1269.6 +0.2 @@ -643,8 +475,8 @@ Gt = ss(At, Bt, Ct, Dt);
-

2.5 Visualizing the modes

-
+

1.5 Visualizing the modes

+

To visualize the i’th mode, we may excite the system using the inputs \(U_i\) such that \(B U_i\) is co-linear to \(\xi_i\) (the mode we want to excite).

@@ -744,359 +576,11 @@ Save the movie of the mode shape.
- -
-

2.6 Identification

-
-
-
%% Options for Linearized
-options = linearizeOptions;
-options.SampleTime = 0;
-
-%% Name of the Simulink File
-mdl = 'stewart_platform_identification';
-
-%% Input/Output definition
-clear io; io_i = 1;
-io(io_i) = linio([mdl, '/tau'],  1, 'openinput');  io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Lm'],    1, 'openoutput'); io_i = io_i + 1;
-
-%% Run the linearization
-G = linearize(mdl, io, options);
-% G.InputName  = {'tau1', 'tau2', 'tau3', 'tau4', 'tau5', 'tau6'};
-% G.OutputName = {'Xdx', 'Xdy', 'Xdz', 'Xrx', 'Xry', 'Xrz', 'Vdx', 'Vdy', 'Vdz', 'Vrx', 'Vry', 'Vrz'};
-
-
- -
-
size(G)
-
-
-
-
- -
-

2.7 Change of states

-
-
-
At = G.C*G.A*pinv(G.C);
-
-Bt = G.C*G.B;
-
-Ct = eye(12);
-Dt = zeros(12, 6);
-
-
- -
-
Gt = ss(At, Bt, Ct, Dt);
-
-
- -
-
size(Gt)
-
-
-
-
-
- -
-

3 Simple Model without any sensor

-
-
-
-

3.1 Simscape Model

-
-
-
open 'stewart_identification_simple.slx'
-
-
-
-
- - -
-

3.2 Initialize the Stewart Platform

-
-
-
stewart = initializeStewartPlatform();
-stewart = initializeFramesPositions(stewart);
-stewart = generateGeneralConfiguration(stewart);
-stewart = computeJointsPose(stewart);
-stewart = initializeStrutDynamics(stewart);
-stewart = initializeCylindricalPlatforms(stewart);
-stewart = initializeCylindricalStruts(stewart);
-stewart = computeJacobian(stewart);
-stewart = initializeStewartPose(stewart);
-
-
-
-
- -
-

3.3 Identification

-
-
-
stateorder = {...
-    'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_1_1_1',...
-    'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_2_1_1',...
-    'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_3_1_1',...
-    'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_4_1_1',...
-    'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_5_1_1',...
-    'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_6_1_1',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Rz.q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Rz.q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Rz.q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Rz.q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Rz.q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Rz.q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Pz.p',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Pz.p',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Pz.p',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Pz.p',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Pz.p',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Pz.p',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Rz.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Rz.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Rz.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Rz.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Rz.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Rz.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Pz.v',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Pz.v',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Pz.v',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Pz.v',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Pz.v',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Pz.v',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_F.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.spherical_joint_F.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.spherical_joint_F.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.spherical_joint_F.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.spherical_joint_F.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.spherical_joint_F.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.spherical_joint_F.S.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.spherical_joint_F.S.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.spherical_joint_F.S.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.spherical_joint_F.S.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.spherical_joint_F.S.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_F.S.w',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_M.S.Q',...
-    'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_M.S.w'};
-
-
- - -
-
%% Options for Linearized
-options = linearizeOptions;
-options.SampleTime = 0;
-
-%% Name of the Simulink File
-mdl = 'stewart_platform_identification_simple';
-
-%% Input/Output definition
-clear io; io_i = 1;
-io(io_i) = linio([mdl, '/tau'],  1, 'openinput');  io_i = io_i + 1;
-io(io_i) = linio([mdl, '/X'],     1, 'openoutput'); io_i = io_i + 1;
-io(io_i) = linio([mdl, '/Xdot'],  1, 'openoutput'); io_i = io_i + 1;
-
-%% Run the linearization
-G = linearize(mdl, io, options);
-G.InputName  = {'tau1', 'tau2', 'tau3', 'tau4', 'tau5', 'tau6'};
-
-G.OutputName = {'Xdx', 'Xdy', 'Xdz', 'Xrx', 'Xry', 'Xrz', 'Vdx', 'Vdy', 'Vdz', 'Vrx', 'Vry', 'Vrz'};
-
-
- -
-
size(G)
-
-
- -
-
G.StateName
-
-
-
-
-
- -
-

4 Cartesian Plot

-
-

-From a force applied in the Cartesian frame to a displacement in the Cartesian frame. -

-
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_cart(1, 1), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_cart(2, 1), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_cart(3, 1), freqs, 'Hz'))));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude');
-
-
- -
-
figure;
-bode(G.G_cart, freqs);
-
-
-
-
- -
-

5 From a force to force sensor

-
-
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_forc(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$F_{m_i}/F_{i}$');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [N/N]');
-legend('location', 'southeast');
-
-
- -
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_forc(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$F_{m_i}/F_{i}$');
-plot(freqs, abs(squeeze(freqresp(G.G_forc(2, 1), freqs, 'Hz'))), 'k--', 'DisplayName', '$F_{m_j}/F_{i}$');
-plot(freqs, abs(squeeze(freqresp(G.G_forc(3, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-plot(freqs, abs(squeeze(freqresp(G.G_forc(4, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-plot(freqs, abs(squeeze(freqresp(G.G_forc(5, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-plot(freqs, abs(squeeze(freqresp(G.G_forc(6, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [N/N]');
-legend('location', 'southeast');
-
-
-
-
- -
-

6 From a force applied in the leg to the displacement of the leg

-
-
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_legs(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$D_{i}/F_{i}$');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]');
-
-
- -
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_legs(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$D_{i}/F_{i}$');
-plot(freqs, abs(squeeze(freqresp(G.G_legs(2, 1), freqs, 'Hz'))), 'k--', 'DisplayName', '$D_{j}/F_{i}$');
-plot(freqs, abs(squeeze(freqresp(G.G_legs(3, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-plot(freqs, abs(squeeze(freqresp(G.G_legs(4, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-plot(freqs, abs(squeeze(freqresp(G.G_legs(5, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-plot(freqs, abs(squeeze(freqresp(G.G_legs(6, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off');
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]');
-legend('location', 'northeast');
-
-
-
-
- -
-

7 Transmissibility

-
-
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 1), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_tran(2, 2), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_tran(3, 3), freqs, 'Hz'))));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [m/m]');
-
-
- -
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_tran(4, 4), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_tran(5, 5), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_tran(6, 6), freqs, 'Hz'))));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [$\frac{rad/s}{rad/s}$]');
-
-
- -
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 1), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 2), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 3), freqs, 'Hz'))));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [m/m]');
-
-
-
-
- -
-

8 Compliance

-
-

-From a force applied in the Cartesian frame to a relative displacement of the mobile platform with respect to the base. -

- -
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_comp(1, 1), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_comp(2, 2), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_comp(3, 3), freqs, 'Hz'))));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]');
-
-
-
-
- -
-

9 Inertial

-
-

-From a force applied on the Cartesian frame to the absolute displacement of the mobile platform. -

- -
-
figure;
-hold on;
-plot(freqs, abs(squeeze(freqresp(G.G_iner(1, 1), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_iner(2, 2), freqs, 'Hz'))));
-plot(freqs, abs(squeeze(freqresp(G.G_iner(3, 3), freqs, 'Hz'))));
-hold off;
-set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
-xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]');
-
-
-

Author: Dehaeze Thomas

-

Created: 2020-02-11 mar. 17:51

+

Created: 2020-02-13 jeu. 15:44

diff --git a/org/identification.org b/org/identification.org index f0141c1..ebf172a 100644 --- a/org/identification.org +++ b/org/identification.org @@ -39,32 +39,9 @@ :END: * Introduction :ignore: -We would like to extract a state space model of the Stewart Platform from the Simscape model. -The inputs are: -| Symbol | Meaning | -|------------------------+--------------------------------------------------| -| $\bm{\mathcal{F}}_{d}$ | External forces applied in {B} | -| $\bm{\tau}$ | Joint forces | -| $\bm{\mathcal{F}}$ | Cartesian forces applied by the Joints | -| $\bm{D}_{w}$ | Fixed Based translation and rotations around {A} | - -The outputs are: -| Symbol | Meaning | -|--------------------+---------------------------------------------------------------------------| -| $\bm{\mathcal{X}}$ | Relative Motion of {B} with respect to {A} | -| $\bm{\mathcal{L}}$ | Joint Displacement | -| $\bm{F}_{m}$ | Force Sensors in each strut | -| $\bm{v}_{m}$ | Inertial Sensors located at $b_i$ measuring in the direction of the strut | - - -#+begin_quote -An important difference from basic Simulink models is that the states in a physical network are not independent in general, because some states have dependencies on other states through constraints. -#+end_quote - - - -* Identification +* Modal Analysis of the Stewart Platform +** Introduction :ignore: ** Matlab Init :noexport:ignore: #+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) <> @@ -78,62 +55,8 @@ An important difference from basic Simulink models is that the states in a physi simulinkproject('../'); #+end_src -** Simscape Model - -** Initialize the Stewart Platform #+begin_src matlab - stewart = initializeStewartPlatform(); - stewart = initializeFramesPositions(stewart); - stewart = generateGeneralConfiguration(stewart); - stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart); - stewart = initializeCylindricalPlatforms(stewart); - stewart = initializeCylindricalStruts(stewart); - stewart = computeJacobian(stewart); - stewart = initializeStewartPose(stewart); -#+end_src - -** Identification -#+begin_src matlab - %% Options for Linearized - options = linearizeOptions; - options.SampleTime = 0; - - %% Name of the Simulink File - mdl = 'stewart_platform_identification'; - - %% Input/Output definition - clear io; io_i = 1; - io(io_i) = linio([mdl, '/tau'], 1, 'openinput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Fext'], 1, 'openinput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/X'], 1, 'openoutput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Vm'], 1, 'openoutput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Taum'], 1, 'openoutput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Lm'], 1, 'openoutput'); io_i = io_i + 1; - - %% Run the linearization - G = linearize(mdl, io, options); - G.InputName = {'tau1', 'tau2', 'tau3', 'tau4', 'tau5', 'tau6', ... - 'Fx', 'Fy', 'Fz', 'Mx', 'My', 'Mz'}; - - G.OutputName = {'Xdx', 'Xdy', 'Xdz', 'Xrx', 'Xry', 'Xrz', ... - 'Vm1', 'Vm2', 'Vm3', 'Vm4', 'Vm5', 'Vm6', ... - 'taum1', 'taum2', 'taum3', 'taum4', 'taum5', 'taum6', ... - 'Lm1', 'Lm2', 'Lm3', 'Lm4', 'Lm5', 'Lm6'}; -#+end_src - -* States as the motion of the mobile platform -** Matlab Init :noexport:ignore: -#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) - <> -#+end_src - -#+begin_src matlab :exports none :results silent :noweb yes - <> -#+end_src - -#+begin_src matlab :results none :exports none - simulinkproject('../'); + open('stewart_platform_model.slx') #+end_src ** Initialize the Stewart Platform @@ -143,10 +66,17 @@ An important difference from basic Simulink models is that the states in a physi 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); +#+end_src + +#+begin_src matlab + ground = initializeGround('type', 'none'); + payload = initializePayload('type', 'none'); #+end_src ** Identification @@ -156,13 +86,13 @@ An important difference from basic Simulink models is that the states in a physi options.SampleTime = 0; %% Name of the Simulink File - mdl = 'stewart_platform_identification_simple'; + mdl = 'stewart_platform_model'; %% Input/Output definition clear io; io_i = 1; - io(io_i) = linio([mdl, '/tau'], 1, 'openinput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/X'], 1, 'openoutput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Xdot'], 1, 'openoutput'); io_i = 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, '/Relative Motion Sensor'], 1, 'openoutput'); io_i = io_i + 1; % Position/Orientation of {B} w.r.t. {A} + io(io_i) = linio([mdl, '/Relative Motion Sensor'], 2, 'openoutput'); io_i = io_i + 1; % Velocity of {B} w.r.t. {A} %% Run the linearization G = linearize(mdl, io); @@ -233,12 +163,12 @@ We could perform the transformation by hand: #+RESULTS: | Mode Number | Resonance Frequency [Hz] | Damping Ratio [%] | |-------------+--------------------------+-------------------| -| 1.0 | 174.5 | 0.9 | -| 2.0 | 174.5 | 0.7 | -| 3.0 | 202.1 | 0.7 | -| 4.0 | 237.3 | 0.6 | -| 5.0 | 237.3 | 0.5 | -| 6.0 | 283.8 | 0.5 | +| 1.0 | 780.6 | 0.4 | +| 2.0 | 780.6 | 0.3 | +| 3.0 | 903.9 | 0.3 | +| 4.0 | 1061.4 | 0.3 | +| 5.0 | 1061.4 | 0.2 | +| 6.0 | 1269.6 | 0.2 | ** Visualizing the modes To visualize the i'th mode, we may excite the system using the inputs $U_i$ such that $B U_i$ is co-linear to $\xi_i$ (the mode we want to excite). @@ -309,288 +239,3 @@ Save the movie of the mode shape. #+caption: Identified mode - 5 [[file:figs/mode5.gif]] -** Identification -#+begin_src matlab - %% Options for Linearized - options = linearizeOptions; - options.SampleTime = 0; - - %% Name of the Simulink File - mdl = 'stewart_platform_identification'; - - %% Input/Output definition - clear io; io_i = 1; - io(io_i) = linio([mdl, '/tau'], 1, 'openinput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Lm'], 1, 'openoutput'); io_i = io_i + 1; - - %% Run the linearization - G = linearize(mdl, io, options); - % G.InputName = {'tau1', 'tau2', 'tau3', 'tau4', 'tau5', 'tau6'}; - % G.OutputName = {'Xdx', 'Xdy', 'Xdz', 'Xrx', 'Xry', 'Xrz', 'Vdx', 'Vdy', 'Vdz', 'Vrx', 'Vry', 'Vrz'}; -#+end_src - -#+begin_src matlab - size(G) -#+end_src - -** Change of states -#+begin_src matlab - At = G.C*G.A*pinv(G.C); - - Bt = G.C*G.B; - - Ct = eye(12); - Dt = zeros(12, 6); -#+end_src - -#+begin_src matlab - Gt = ss(At, Bt, Ct, Dt); -#+end_src - -#+begin_src matlab - size(Gt) -#+end_src - -* Simple Model without any sensor -** Matlab Init :noexport:ignore: -#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) - <> -#+end_src - -#+begin_src matlab :exports none :results silent :noweb yes - <> -#+end_src - -#+begin_src matlab :results none :exports none - simulinkproject('../'); -#+end_src - -** Simscape Model -#+begin_src matlab - open 'stewart_identification_simple.slx' -#+end_src - - -** Initialize the Stewart Platform -#+begin_src matlab - stewart = initializeStewartPlatform(); - stewart = initializeFramesPositions(stewart); - stewart = generateGeneralConfiguration(stewart); - stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart); - stewart = initializeCylindricalPlatforms(stewart); - stewart = initializeCylindricalStruts(stewart); - stewart = computeJacobian(stewart); - stewart = initializeStewartPose(stewart); -#+end_src - -** Identification -#+begin_src matlab - stateorder = {... - 'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_1_1_1',... - 'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_2_1_1',... - 'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_3_1_1',... - 'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_4_1_1',... - 'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_5_1_1',... - 'stewart_platform_identification_simple/Solver Configuration/EVAL_KEY/INPUT_6_1_1',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Rz.q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Rz.q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Rz.q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Rz.q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Rz.q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Rz.q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Pz.p',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Pz.p',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Pz.p',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Pz.p',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Pz.p',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Pz.p',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Rz.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Rz.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Rz.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Rz.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Rz.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Rz.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.cylindrical_joint.Pz.v',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.cylindrical_joint.Pz.v',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.cylindrical_joint.Pz.v',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.cylindrical_joint.Pz.v',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.cylindrical_joint.Pz.v',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.cylindrical_joint.Pz.v',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_F.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.spherical_joint_F.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.spherical_joint_F.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.spherical_joint_F.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.spherical_joint_F.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.spherical_joint_F.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_2.Subsystem.spherical_joint_F.S.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_3.Subsystem.spherical_joint_F.S.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_4.Subsystem.spherical_joint_F.S.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_5.Subsystem.spherical_joint_F.S.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_6.Subsystem.spherical_joint_F.S.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_F.S.w',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_M.S.Q',... - 'stewart_platform_identification_simple.Stewart_Platform.Strut_1.Subsystem.spherical_joint_M.S.w'}; -#+end_src - - -#+begin_src matlab - %% Options for Linearized - options = linearizeOptions; - options.SampleTime = 0; - - %% Name of the Simulink File - mdl = 'stewart_platform_identification_simple'; - - %% Input/Output definition - clear io; io_i = 1; - io(io_i) = linio([mdl, '/tau'], 1, 'openinput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/X'], 1, 'openoutput'); io_i = io_i + 1; - io(io_i) = linio([mdl, '/Xdot'], 1, 'openoutput'); io_i = io_i + 1; - - %% Run the linearization - G = linearize(mdl, io, options); - G.InputName = {'tau1', 'tau2', 'tau3', 'tau4', 'tau5', 'tau6'}; - - G.OutputName = {'Xdx', 'Xdy', 'Xdz', 'Xrx', 'Xry', 'Xrz', 'Vdx', 'Vdy', 'Vdz', 'Vrx', 'Vry', 'Vrz'}; -#+end_src - -#+begin_src matlab - size(G) -#+end_src - -#+begin_src matlab - G.StateName -#+end_src - -* Cartesian Plot -From a force applied in the Cartesian frame to a displacement in the Cartesian frame. -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_cart(1, 1), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_cart(2, 1), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_cart(3, 1), freqs, 'Hz')))); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude'); -#+end_src - -#+begin_src matlab :results none - figure; - bode(G.G_cart, freqs); -#+end_src - -* From a force to force sensor -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_forc(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$F_{m_i}/F_{i}$'); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [N/N]'); - legend('location', 'southeast'); -#+end_src - -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_forc(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$F_{m_i}/F_{i}$'); - plot(freqs, abs(squeeze(freqresp(G.G_forc(2, 1), freqs, 'Hz'))), 'k--', 'DisplayName', '$F_{m_j}/F_{i}$'); - plot(freqs, abs(squeeze(freqresp(G.G_forc(3, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - plot(freqs, abs(squeeze(freqresp(G.G_forc(4, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - plot(freqs, abs(squeeze(freqresp(G.G_forc(5, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - plot(freqs, abs(squeeze(freqresp(G.G_forc(6, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [N/N]'); - legend('location', 'southeast'); -#+end_src - -* From a force applied in the leg to the displacement of the leg -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_legs(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$D_{i}/F_{i}$'); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]'); -#+end_src - -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_legs(1, 1), freqs, 'Hz'))), 'k-', 'DisplayName', '$D_{i}/F_{i}$'); - plot(freqs, abs(squeeze(freqresp(G.G_legs(2, 1), freqs, 'Hz'))), 'k--', 'DisplayName', '$D_{j}/F_{i}$'); - plot(freqs, abs(squeeze(freqresp(G.G_legs(3, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - plot(freqs, abs(squeeze(freqresp(G.G_legs(4, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - plot(freqs, abs(squeeze(freqresp(G.G_legs(5, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - plot(freqs, abs(squeeze(freqresp(G.G_legs(6, 1), freqs, 'Hz'))), 'k--', 'HandleVisibility', 'off'); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]'); - legend('location', 'northeast'); -#+end_src - -* Transmissibility -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 1), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_tran(2, 2), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_tran(3, 3), freqs, 'Hz')))); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [m/m]'); -#+end_src - -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_tran(4, 4), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_tran(5, 5), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_tran(6, 6), freqs, 'Hz')))); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [$\frac{rad/s}{rad/s}$]'); -#+end_src - -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 1), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 2), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_tran(1, 3), freqs, 'Hz')))); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [m/m]'); -#+end_src - -* Compliance -From a force applied in the Cartesian frame to a relative displacement of the mobile platform with respect to the base. - -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_comp(1, 1), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_comp(2, 2), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_comp(3, 3), freqs, 'Hz')))); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]'); -#+end_src - -* Inertial -From a force applied on the Cartesian frame to the absolute displacement of the mobile platform. - -#+begin_src matlab :results none - figure; - hold on; - plot(freqs, abs(squeeze(freqresp(G.G_iner(1, 1), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_iner(2, 2), freqs, 'Hz')))); - plot(freqs, abs(squeeze(freqresp(G.G_iner(3, 3), freqs, 'Hz')))); - hold off; - set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - xlabel('Frequency [Hz]'); ylabel('Amplitude [m/N]'); -#+end_src -