diff --git a/.SimulinkProject/Root.type.Files/simulink.type.File.xml b/.SimulinkProject/Root.type.Files/simulink.type.File.xml deleted file mode 100644 index 1c0844e..0000000 --- a/.SimulinkProject/Root.type.Files/simulink.type.File.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.SimulinkProject/Root.type.Files/simulink.type.File/1.type.DIR_SIGNIFIER.xml b/.SimulinkProject/Root.type.Files/simulink.type.File/1.type.DIR_SIGNIFIER.xml deleted file mode 100644 index 1c0844e..0000000 --- a/.SimulinkProject/Root.type.Files/simulink.type.File/1.type.DIR_SIGNIFIER.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.SimulinkProject/Root.type.Files/simulink.type.File/stewart_active_damping.slx.type.File.xml b/.SimulinkProject/Root.type.Files/simulink.type.File/stewart_active_damping.slx.type.File.xml deleted file mode 100644 index 80b5b16..0000000 --- a/.SimulinkProject/Root.type.Files/simulink.type.File/stewart_active_damping.slx.type.File.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.SimulinkProject/Root.type.ProjectPath/53f4d1e7-39c5-44e2-aa9c-d823d65585c7.type.Reference.xml b/.SimulinkProject/Root.type.ProjectPath/53f4d1e7-39c5-44e2-aa9c-d823d65585c7.type.Reference.xml deleted file mode 100644 index c33ac3b..0000000 --- a/.SimulinkProject/Root.type.ProjectPath/53f4d1e7-39c5-44e2-aa9c-d823d65585c7.type.Reference.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/docs/simscape-model.html b/docs/simscape-model.html index 6020487..c5feac1 100644 --- a/docs/simscape-model.html +++ b/docs/simscape-model.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Stewart Platform - Simscape Model @@ -279,16 +279,32 @@ for the JavaScript code in this tag.
  • 6. Other Elements @@ -509,13 +525,189 @@ Both inertial sensors are described bellow.

    6 Other Elements

    -
    -

    6.1 Z-Axis Geophone

    +
    +

    6.1 Payload

    +

    + +

    + +

    +This Matlab function is accessible here. +

    -
    -

    6.1.1 Working Principle

    -
    + +
    +

    Function description

    +
    +
    +
    function [payload] = initializePayload(args)
    +% initializePayload - Initialize the Payload that can then be used for simulations and analysis
    +%
    +% Syntax: [payload] = initializePayload(args)
    +%
    +% Inputs:
    +%    - args - Structure with the following fields:
    +%        - type - 'none', 'solid', 'flexible', 'cartesian'
    +%        - h [1x1] - Height of the CoM of the payload w.r.t {M} [m]
    +%                    This also the position where K and C are defined
    +%        - K [6x1] - Stiffness of the Payload [N/m, N/rad]
    +%        - C [6x1] - Damping of the Payload [N/(m/s), N/(rad/s)]
    +%        - m [1x1] - Mass of the Payload [kg]
    +%        - I [3x3] - Inertia matrix for the Payload [kg*m2]
    +%
    +% Outputs:
    +%    - payload - Struture with the following properties:
    +%        - type - 1 (none), 2 (solid), 3 (flexible)
    +%        - h [1x1] - Height of the CoM of the payload w.r.t {M} [m]
    +%        - K [6x1] - Stiffness of the Payload [N/m, N/rad]
    +%        - C [6x1] - Stiffness of the Payload [N/(m/s), N/(rad/s)]
    +%        - m [1x1] - Mass of the Payload [kg]
    +%        - I [3x3] - Inertia matrix for the Payload [kg*m2]
    +
    +
    +
    +
    + +
    +

    Optional Parameters

    +
    +
    +
    arguments
    +  args.type char {mustBeMember(args.type,{'none', 'solid', 'flexible', 'cartesian'})} = 'none'
    +  args.K (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e8*ones(6,1)
    +  args.C (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1)
    +  args.h (1,1) double {mustBeNumeric, mustBeNonnegative} = 100e-3
    +  args.m (1,1) double {mustBeNumeric, mustBeNonnegative} = 10
    +  args.I (3,3) double {mustBeNumeric, mustBeNonnegative} = 1*eye(3)
    +end
    +
    +
    +
    +
    + +
    +

    Add Payload Type

    +
    +
    +
    switch args.type
    +  case 'none'
    +    payload.type = 1;
    +  case 'solid'
    +    payload.type = 2;
    +  case 'flexible'
    +    payload.type = 3;
    +  case 'cartesian'
    +    payload.type = 4;
    +end
    +
    +
    +
    +
    + +
    +

    Add Stiffness, Damping and Mass properties of the Payload

    +
    +
    +
    payload.K = args.K;
    +payload.C = args.C;
    +payload.m = args.m;
    +payload.I = args.I;
    +
    +payload.h = args.h;
    +
    +
    +
    +
    +
    + +
    +

    6.2 Ground

    +
    +

    + +

    + +

    +This Matlab function is accessible here. +

    +
    + +
    +

    Function description

    +
    +
    +
    function [ground] = initializeGround(args)
    +% initializeGround - Initialize the Ground that can then be used for simulations and analysis
    +%
    +% Syntax: [ground] = initializeGround(args)
    +%
    +% Inputs:
    +%    - args - Structure with the following fields:
    +%        - type - 'none', 'solid', 'flexible'
    +%        - K [3x1] - Translation Stiffness of the Ground [N/m]
    +%        - C [3x1] - Translation Damping of the Ground [N/(m/s)]
    +%
    +% Outputs:
    +%    - ground - Struture with the following properties:
    +%        - type - 1 (none), 2 (solid), 3 (flexible)
    +%        - K [3x1] - Translation Stiffness of the Ground [N/m]
    +%        - C [3x1] - Translation Damping of the Ground [N/(m/s)]
    +
    +
    +
    +
    + +
    +

    Optional Parameters

    +
    +
    +
    arguments
    +  args.type char {mustBeMember(args.type,{'none', 'solid', 'flexible'})} = 'none'
    +  args.K (3,1) double {mustBeNumeric, mustBeNonnegative} = 1e8*ones(3,1)
    +  args.C (3,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(3,1)
    +end
    +
    +
    +
    +
    + +
    +

    Add Ground Type

    +
    +
    +
    switch args.type
    +  case 'none'
    +    ground.type = 1;
    +  case 'solid'
    +    ground.type = 2;
    +  case 'flexible'
    +    ground.type = 3;
    +end
    +
    +
    +
    +
    + +
    +

    Add Stiffness and Damping properties of the Ground

    +
    +
    +
    ground.K = args.K;
    +ground.C = args.C;
    +
    +
    +
    +
    +
    + +
    +

    6.3 Z-Axis Geophone

    +
    +
    +
    +

    6.3.1 Working Principle

    +

    From the schematic of the Z-axis geophone shown in Figure 5, we can write the transfer function from the support velocity \(\dot{w}\) to the relative velocity of the inertial mass \(\dot{d}\): \[ \frac{\dot{d}}{\dot{w}} = \frac{-\frac{s^2}{{\omega_0}^2}}{\frac{s^2}{{\omega_0}^2} + 2 \xi \frac{s}{\omega_0} + 1} \] @@ -548,9 +740,9 @@ We generally want to have the smallest resonant frequency \(\omega_0\) to measur

    -
    -

    6.1.2 Initialization function

    -
    +
    +

    6.3.2 Initialization function

    +

    @@ -585,12 +777,12 @@ This Matlab function is accessible he
    -

    6.2 Z-Axis Accelerometer

    -
    +

    6.4 Z-Axis Accelerometer

    +
    -
    -

    6.2.1 Working Principle

    -
    +
    +

    6.4.1 Working Principle

    +

    From the schematic of the Z-axis accelerometer shown in Figure 6, we can write the transfer function from the support acceleration \(\ddot{w}\) to the relative position of the inertial mass \(d\): \[ \frac{d}{\ddot{w}} = \frac{-\frac{1}{{\omega_0}^2}}{\frac{s^2}{{\omega_0}^2} + 2 \xi \frac{s}{\omega_0} + 1} \] @@ -627,9 +819,9 @@ Note that there is trade-off between:

    -
    -

    6.2.2 Initialization function

    -
    +
    +

    6.4.2 Initialization function

    + diff --git a/matlab/stewart_platform_model.slx b/matlab/stewart_platform_model.slx new file mode 100644 index 0000000..638fa7f Binary files /dev/null and b/matlab/stewart_platform_model.slx differ diff --git a/org/simscape-model.org b/org/simscape-model.org index c995e10..a41b2bd 100644 --- a/org/simscape-model.org +++ b/org/simscape-model.org @@ -149,6 +149,158 @@ There is two main types of inertial sensor that can be used to measure the absol Both inertial sensors are described bellow. * Other Elements +** Payload +:PROPERTIES: +:header-args:matlab+: :tangle ../src/initializePayload.m +:header-args:matlab+: :comments none :mkdirp yes :eval no +:END: +<> + +This Matlab function is accessible [[file:../src/initializePayload.m][here]]. + +*** Function description +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + function [payload] = initializePayload(args) + % initializePayload - Initialize the Payload that can then be used for simulations and analysis + % + % Syntax: [payload] = initializePayload(args) + % + % Inputs: + % - args - Structure with the following fields: + % - type - 'none', 'solid', 'flexible', 'cartesian' + % - h [1x1] - Height of the CoM of the payload w.r.t {M} [m] + % This also the position where K and C are defined + % - K [6x1] - Stiffness of the Payload [N/m, N/rad] + % - C [6x1] - Damping of the Payload [N/(m/s), N/(rad/s)] + % - m [1x1] - Mass of the Payload [kg] + % - I [3x3] - Inertia matrix for the Payload [kg*m2] + % + % Outputs: + % - payload - Struture with the following properties: + % - type - 1 (none), 2 (solid), 3 (flexible) + % - h [1x1] - Height of the CoM of the payload w.r.t {M} [m] + % - K [6x1] - Stiffness of the Payload [N/m, N/rad] + % - C [6x1] - Stiffness of the Payload [N/(m/s), N/(rad/s)] + % - m [1x1] - Mass of the Payload [kg] + % - I [3x3] - Inertia matrix for the Payload [kg*m2] +#+end_src + +*** Optional Parameters +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + arguments + args.type char {mustBeMember(args.type,{'none', 'solid', 'flexible', 'cartesian'})} = 'none' + args.K (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e8*ones(6,1) + args.C (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1) + args.h (1,1) double {mustBeNumeric, mustBeNonnegative} = 100e-3 + args.m (1,1) double {mustBeNumeric, mustBeNonnegative} = 10 + args.I (3,3) double {mustBeNumeric, mustBeNonnegative} = 1*eye(3) + end +#+end_src + +*** Add Payload Type +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + switch args.type + case 'none' + payload.type = 1; + case 'solid' + payload.type = 2; + case 'flexible' + payload.type = 3; + case 'cartesian' + payload.type = 4; + end +#+end_src + +*** Add Stiffness, Damping and Mass properties of the Payload +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + payload.K = args.K; + payload.C = args.C; + payload.m = args.m; + payload.I = args.I; + + payload.h = args.h; +#+end_src + +** Ground +:PROPERTIES: +:header-args:matlab+: :tangle ../src/initializeGround.m +:header-args:matlab+: :comments none :mkdirp yes :eval no +:END: +<> + +This Matlab function is accessible [[file:../src/initializeGround.m][here]]. + +*** Function description +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + function [ground] = initializeGround(args) + % initializeGround - Initialize the Ground that can then be used for simulations and analysis + % + % Syntax: [ground] = initializeGround(args) + % + % Inputs: + % - args - Structure with the following fields: + % - type - 'none', 'solid', 'flexible' + % - K [3x1] - Translation Stiffness of the Ground [N/m] + % - C [3x1] - Translation Damping of the Ground [N/(m/s)] + % + % Outputs: + % - ground - Struture with the following properties: + % - type - 1 (none), 2 (solid), 3 (flexible) + % - K [3x1] - Translation Stiffness of the Ground [N/m] + % - C [3x1] - Translation Damping of the Ground [N/(m/s)] +#+end_src + +*** Optional Parameters +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + arguments + args.type char {mustBeMember(args.type,{'none', 'solid', 'flexible'})} = 'none' + args.K (3,1) double {mustBeNumeric, mustBeNonnegative} = 1e8*ones(3,1) + args.C (3,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(3,1) + end +#+end_src + +*** Add Ground Type +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + switch args.type + case 'none' + ground.type = 1; + case 'solid' + ground.type = 2; + case 'flexible' + ground.type = 3; + end +#+end_src + +*** Add Stiffness and Damping properties of the Ground +:PROPERTIES: +:UNNUMBERED: t +:END: +#+begin_src matlab + ground.K = args.K; + ground.C = args.C; +#+end_src + ** Z-Axis Geophone *** Working Principle From the schematic of the Z-axis geophone shown in Figure [[fig:z_axis_geophone]], we can write the transfer function from the support velocity $\dot{w}$ to the relative velocity of the inertial mass $\dot{d}$: diff --git a/simscape_subsystems/Fixed_Based.slx b/simscape_subsystems/Fixed_Based.slx index 7efce89..d1bf72d 100644 Binary files a/simscape_subsystems/Fixed_Based.slx and b/simscape_subsystems/Fixed_Based.slx differ diff --git a/simscape_subsystems/Mobile_Platform.slx b/simscape_subsystems/Mobile_Platform.slx index 2e7ba00..54e2092 100644 Binary files a/simscape_subsystems/Mobile_Platform.slx and b/simscape_subsystems/Mobile_Platform.slx differ diff --git a/simscape_subsystems/Stewart_Platform.slx b/simscape_subsystems/Stewart_Platform.slx index eab4181..fdcb6d0 100644 Binary files a/simscape_subsystems/Stewart_Platform.slx and b/simscape_subsystems/Stewart_Platform.slx differ diff --git a/simulink/stewart_active_damping.slx b/simulink/stewart_active_damping.slx deleted file mode 100644 index e54ab4f..0000000 Binary files a/simulink/stewart_active_damping.slx and /dev/null differ diff --git a/src/initializeGround.m b/src/initializeGround.m new file mode 100644 index 0000000..decf394 --- /dev/null +++ b/src/initializeGround.m @@ -0,0 +1,34 @@ +function [ground] = initializeGround(args) +% initializeGround - Initialize the Ground that can then be used for simulations and analysis +% +% Syntax: [ground] = initializeGround(args) +% +% Inputs: +% - args - Structure with the following fields: +% - type - 'none', 'solid', 'flexible' +% - K [3x1] - Translation Stiffness of the Ground [N/m] +% - C [3x1] - Translation Damping of the Ground [N/(m/s)] +% +% Outputs: +% - ground - Struture with the following properties: +% - type - 1 (none), 2 (solid), 3 (flexible) +% - K [3x1] - Translation Stiffness of the Ground [N/m] +% - C [3x1] - Translation Damping of the Ground [N/(m/s)] + +arguments + args.type char {mustBeMember(args.type,{'none', 'solid', 'flexible'})} = 'none' + args.K (3,1) double {mustBeNumeric, mustBeNonnegative} = 1e8*ones(3,1) + args.C (3,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(3,1) +end + +switch args.type + case 'none' + ground.type = 1; + case 'solid' + ground.type = 2; + case 'flexible' + ground.type = 3; +end + +ground.K = args.K; +ground.C = args.C; diff --git a/src/initializePayload.m b/src/initializePayload.m new file mode 100644 index 0000000..171766c --- /dev/null +++ b/src/initializePayload.m @@ -0,0 +1,50 @@ +function [payload] = initializePayload(args) +% initializePayload - Initialize the Payload that can then be used for simulations and analysis +% +% Syntax: [payload] = initializePayload(args) +% +% Inputs: +% - args - Structure with the following fields: +% - type - 'none', 'solid', 'flexible', 'cartesian' +% - h [1x1] - Height of the CoM of the payload w.r.t {M} [m] +% This also the position where K and C are defined +% - K [6x1] - Stiffness of the Payload [N/m, N/rad] +% - C [6x1] - Damping of the Payload [N/(m/s), N/(rad/s)] +% - m [1x1] - Mass of the Payload [kg] +% - I [3x3] - Inertia matrix for the Payload [kg*m2] +% +% Outputs: +% - payload - Struture with the following properties: +% - type - 1 (none), 2 (solid), 3 (flexible) +% - h [1x1] - Height of the CoM of the payload w.r.t {M} [m] +% - K [6x1] - Stiffness of the Payload [N/m, N/rad] +% - C [6x1] - Stiffness of the Payload [N/(m/s), N/(rad/s)] +% - m [1x1] - Mass of the Payload [kg] +% - I [3x3] - Inertia matrix for the Payload [kg*m2] + +arguments + args.type char {mustBeMember(args.type,{'none', 'solid', 'flexible', 'cartesian'})} = 'none' + args.K (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e8*ones(6,1) + args.C (6,1) double {mustBeNumeric, mustBeNonnegative} = 1e1*ones(6,1) + args.h (1,1) double {mustBeNumeric, mustBeNonnegative} = 100e-3 + args.m (1,1) double {mustBeNumeric, mustBeNonnegative} = 10 + args.I (3,3) double {mustBeNumeric, mustBeNonnegative} = 1*eye(3) +end + +switch args.type + case 'none' + payload.type = 1; + case 'solid' + payload.type = 2; + case 'flexible' + payload.type = 3; + case 'cartesian' + payload.type = 4; +end + +payload.K = args.K; +payload.C = args.C; +payload.m = args.m; +payload.I = args.I; + +payload.h = args.h;